TCP & UDP Flashcards
What is the purpose of L4
Provide transparent transfer of data between hosts
What does “transparent data transfer between hosts” mean?
Hosts involved are not aware of L1-3 details of the underlying network
What are the services offered (or not, depending on TCP vs UDP) by L4?
- Reliable data transfer
- Error recovery
- Data sequencing
- Flow control
What is the additional addressing system provided by L4?
Port numbers
What is an L4 session?
An exchange of data between two or more communicating devices
What does the L4 destination port identify?
The application layer (L5+) protocol
Is the L4 source port assigned or randomly selected?
Randomly selected
What does the L4 source port identify?
The L4 communication session
L4 addressing helps provide session _____
multiplexing
Port numbers 0 - 1023 are _____
Well-Known
Port numbers 1024 - 49151 are _____
Registered
Port numbers 49152 - 65535 are _____
Ephemeral / private / dynamic
Well known ports fall between ports ___ - ____
0 - 1023
Registered ports fall between ports ____ - ____
1024 - 49151
Ephemeral ports fall between ports ____ - ____
49152 - 65535
Before TCP can send data to a destination host, the two hosts must do what?
Establish a connection
Does TCP or UDP provide reliability?
TCP
Does TCP or UDP provide segment sequencing?
TCP
Does TCP or UDP provide flow control?
TCP
What is L4 flow control?
A destination being able to dictate the rate that data is sent
What flags in the TCP header are used to establish and terminate connections?
ACK
SYN
FIN
What function does the window size field in the TCP header serve?
Used for flow control, adjusting the rate at which data is sent
By which method does TCP establish connections between hosts?
TCP 3-way handshake
Explain the different parts of the TCP 3-way handshake
Client sends SYN
Server sends SYN ACK
client sends ACK
By which method does TCP terminate connections between hosts?
TCP 4-way handshake
Explain the different parts of the TCP 4-way handshake
Client sends FIN
Server sends ACK
Server sends FIN
Client sends ACK
Describe what TCP forward acknowledgement is
Indicates the sequence number of the next segment the host expects to receive
When a client sends the initial SYN message in the 3-way handshake, what is the initial sequence number?
Randomly chosen by the client
When a server sends the SYN-ACK message in the 3-way handshake, what are the sequence number and acknowledgement number set to?
The server picks its own random sequence number, and increments the sequence number sent by the client by 1, and uses that for the acknowledgement num
When a client sends the final ACK message in the TCP 3-way handshake, what are the sequence number and acknowledgement number set to?
Client flips what it received from the server. Sequence num will be the acknowledgement number the server sent on SYN-ACK, and the acknowledgement number is the sequence number the server sent on SYN-ACK plus one.
Explain what TCP sequencing allows
Allows the client/server to know what segment to expect next.
In layman’s terms, what is contained within a TCP header that allows for sequencing?
Here’s segment number X, I (client/server), expect segment number Y from you (server/client) next
The TCP header’s window size field allows for what?
More data to be sent before an acknowledgement is required
What is the TCP sliding window?
Used to dynamically adjust how large the TCP window size is depending on various factors
Describe the reliability of UDP
There is none. Segments are sent on a best-effort basis
Does UDP establish connections before data is sent?
No
How does UDP provide segment sequencing?
It doesn’t
How does UDP provide flow control?
It doesn’t
For downloading a file, what L4 protocol is best used?
TCP
For real time voice and video, what L4 protocol is best used?
UDP
Is it possible for some applications to use both TCP and UDP?
Yes. DNS is an example
Which of the following is a well known port number?
a) 1010
b) 2001
c) 4023
d) 65000
a) 1001
Well known are 0-1023
What range of port numbers should hosts select from when randomly selecting a source L4 port number?
a) Well known
b) Registered
c) Ephemeral
d) Reserved
c) Ephemeral
Ports 49152 - 65535
Which of the following are features of TCP but not UDP (pick 3)
a) L4 addressing
b) Error recovery
c) Session multiplexing
d) Flow control
e) Sequencing
b) Error recovery
d) Flow control
e) Sequencing
Which of the following application layer protocols use TCP to provide reliable communications? (pick 3)
a) SMTP
b) SNMP
c) HTTPS
d) DHCP
e) Syslog
f) SSH
a) SMTP
c) HTTPS
f) SSH
PC1 and SRV1 have an active TCP connection. SRV1 receives a TCP segment from PC1 with a sequence number of 27. When SRV1 acknowledges the segment, what will the value of the Acknowledgement field in the TCP header be? Assume a TCP window size of 1.
a) 26
b) 27
c) 28
c) 28
TCP acknowledges that it receives the segment by stating the next segment it expects to receive (forward acknowledgement)
Routers in which states send HSRP hello messages?
Active, standby, and speak states