1/43
Looks like no tags are added yet.
What is the purpose of the transport layer?
To provide logical communication between application processes on different hosts (not between hosts directly)
What is the role of the sender in transport protocols?
Breaks the application messages into segments and passes them to the network layer
What is the role of the receiver in transport protocols?
Reassembles the segments into messages and passes them to the application layer
What are the characteristics of TCP?
Reliable, in-order delivery
Congestion control
Flow control
Connection setup
What are the characteristics of UDP?
Unreliable, unordered delivery, and extension of “best-effort” IP
What services are not provided by the transport layer?
Delay guarantees and bandwidth guarantees
Describe multiplexing
The sender handles data from multiple sockets and adds the transport header to them before sending
Describe demultiplexing
The receiver uses header info to deliver received segments to the correct socket
How does connectionless demultiplexing work?
The sender needs to specify the destination IP address and port number before sending into UDP socket
When host receives the UDP segment they check the destination port number in segment and directs the UDP segment to the socket with that port number
Datagrams with the same destination port number but different source IP addresses and/or port numbers will be directed to the same socket at receiving host
How does connection-oriented demultiplexing work?
TCP socket is identified by a 4-tuple consisting of:
source IP address
source port number
destination IP address
destination port number
Receiver uses all 4 values to direct the segment to the appropriate socket, server may support many TCP sockets simultaneously this way
What is UDP?
User datagram protocol, a best effort service and segment may be lost or delivered out of order
Connectionless so no handshaking and each segment is handled independently of others
Why do we have UDP?
No connection establishment means no added RTT delay, it’s simple, has a small header size, and no congestion control (can be as fast as desired and function even with congestion)
Where is UDP used?
Streaming multimedia apps, DNS, SNMP, and HTTP/3
If reliability is needed, it’s usually added/implemented at the application layer
What is the sender’s role in UDP?
Once passed a message, determines the UDP segment header field values, creates the UDP segment, and passes the segment to IP
What is the receiver’s role in UDP?
Receives the segment from IP, checks the UDP checksum header value, extracts the application layer message, and demultiplexes message up to application via socket
What is the purpose of a checksum?
To detect errors in transmitted segments
How does checksum work?
The sender treats the contents of the segment as a sequence of 16-bit integers, so the checksum is the addition of segment content with the value put into the UDP checksum field
Then the receiver computes the checksum of the received segment and checks if the computed checksum equals the field value
What is an ACK?
Acknowledgements, how receiver explicitly tells the sender that the packet was received ok
What is a NAK?
Negative acknowledgments, how receiver explicitly tells sender that the packet had errors, so the sender retransmits the packet
How to handle duplicates from retransmission if ACK/NAK was corrupted?
Sender adds sequence number to each packet, so when it retransmits the current packet even if it was actually received ok, the receiver can discard any duplicate packet
How does a NAK free protocol work?
Instead of NAK, the receiver sends an ACK for the last packet received ok. When the sender receives a duplicate ACK, it retransmits the current packet
How to handle not receiving an ACK because of packet loss?
Sender waits a reasonable amount of time for ACK, and retransmits if no ACK was received in that time
If packet was just delayed and not lost, the sequence number already handles that at the receiver
Use a countdown timer to interrupt the sender after reasonable amount of time
What are pipelined protocols?
Allow multiple, “in-flight”, yet to be acknowledge packets, with buffering at sender and/or receiver
What is a cumulative ACK?
Acks all packets up to including sequence number n: ACK(n)
Means all packets before n were also received ok
How does the sender work in piplined protocol?
Has a window of up to N consecutive transmitted but unACKed packets, when it receives ACK(n) it moves the window forward to begin at n+1
Uses a timeout for oldest in flight packet, and retransmits packet n and all higher sequence number packets in the window
How does the receiver work in pipelined protocol?
Always sends ACK for correctly received packets so far with the highest in order sequence number
When it receives an out of order packet, it can discard or buffer it, and re-ACK packet with highest in order sequence number
What is selective repeat?
Uses pipelining, the receiver buffers packets as needed and individually ACKS all correctly received packets
The sender maintains a timer for each unACKed packet, on timeout retransmits the packet. Also maintains a window over N consecutive sequence numbers which limits pipelined packets to be in this window
What is TCP?
Point-to-Point, reliable in-order byte stream, full duplex data (bi-directional data flow, MSS: max segment size), uses cumulative ACKs, pipelining for congestion and flow control, connection oriented, and flow controlled (sender will not overwhelm receiver)
What are sequence numbers?
Byte stream number of the first byte in a segment’s data
What events does the sender have to handle in TCP?
Data received, timeout, and ACK received
What does the sender do when data is received in TCP?
Creates a segment with the sequence number, and starts the timer if it’s not already running
What does the sender do on timeout in TCP?
Retransmits the segment that caused the timeout and restarts the timer
What does the sender do when an ACK is received in TCP?
If the ACK acknowledges previously unACKed segments, it updates what is known to be ACKed and starts the timer if there are still unACKed segments
Describe fast retransmission
If sender receives 3 additional ACKs for the same data, it resends the unACKed segment with the smallest sequence number
Doesn’t wait for the timeout, making it faster if packet is actually lost
How does flow control work in TCP?
Receiver advertises free buffer space in the rwnd field in the TCP header, so the sender limits the amount of unACKed data to the received rwnd value to guarantee the receiver buffer will not overflow
How are connections managed in TCP?
Client and server use a 3 way handshake before exchanging data, agreeing to establish a connection and agreeing on connection parameters
To close the connection, both client and server close their side of the connection, sending a segment with FIN bit = 1, respond to the FIN with ACK
What are the costs of congestion?
More work (retransmission) for receiver throughput
Unneeded transmissions, carrying multiple copies of a packet decreases max achievable throughput
When a packet is dropped, any upstream transmission capacity and buffering used for that packet was wasted
What is end-to-end congestion control?
No explicit feedback from the network, congestion is inferred from observed loss and delay
What is network assisted congestion control?
Routers provide direct feedback to hosts with flows passing through congested router
May indicate congestion level or explicitly set sending rate
Describe TCP’s AIMD congestion control
Senders can increase sending rate until packet loss occurs, then decrease on loss event
Additive increase, and multiplicative decrease (cut in half on loss detected by triple duplicate ACK, cut to 1MSS when loss detected by timeout)
What is slow start?
When TCP connection begins, increase sending rate exponentially until the first loss event
Initially cwnd = 1MSS, so double cwnd every RTT
Initial rate is slow but ramps up exponentially fast
How does the sender know when to switch to additive increase from slow start’s exponential increase?
Use variable ssthresh, then on loss event ssthresh is set to half of cwnd just before the loss event
What is a bottleneck link?
A link that’s always busy, it’s queue is almost never empty, so optimizing congestion control is limited by this link
Goal is to keep the pipe just full enough, but not fuller to avoid high delays and buffering
What is an explicit congestion notification?
Used in network assisted congestion control, there are two bits in IP header that are marked by the network router to indicate congestion, which is carried to the destination, then the destination sets the ECE bit on ACK segment to notify the sender of congestion