Chapter 3: Transport layer Flashcards
What do transport services and protocols provide?
Logical communication between application processes running on different hosts
Logical communication
From an application’s perspective, it’s as if the hosts running the processes are directly connected
Where do transport protocols action?
In end systems
What does the sender in a transport protocol do?
- Creates transport layer segments; breaks application layer messages into chunks and adds a transport layer header to each chunk
- Passes them to a network layer
What does the receiver in a transport protocol do?
- Reassembles segments into messages
- Passes the messages to the application layer
What two transport protocols are available to Internet applications?
TCP & UDP
What is the role of the network layer in the relationship between a transport and network layer?
Logical communication between hosts
What is the role of the transport layer in the relationship between a network layer and a transport layer?
Logical communication between processes.
What does the transport layer rely on and possibly enhance?
The network layer
What does the sender in the transport layer do?
- Receives a application-layer message
- Determines segment header field values
- Creates a segment
- Passes the segment to IP
What does the receiver in a transport layer do?
- Receives a segment from IP
- Checks the header values
- Extracts the application-layer message
- Demuxes the message up to the application-layer via socket(s)
What are the two primary responsibilities of the TCP and UDP?
- Extend IP’s delivery service between processes
- Provide error checking
Describe the Transmission Control Protocol (TCP)
- Reliable, in-order delivert
- Connection-oriented service
- Congestion & flow control
- Connection set-up
Describe the User Datagram Protocol (UDP)
- Unreliable, unordered delivery
- Connectionless service
- No-frills extension of the “best-effort” IP
What services are not available with both TCP and UDP?
- Delay guarantees
- Bandwidth guarantees
What does multiplexing at the sender do?
- Handles data from socket(s)
- Adds a transport header
- Passes the segments to the network layer
What does demultiplexing at the receiver do?
- Uses header info to deliver received segments to correct socket
How does demultiplexing work?
- Host receives IP datagrams with a source IP address and a destination IP address
- Transport-layer examines the destination port number and directs the segment to the corresponding socket
- The segment’s data passes through the socket into the attached process
Describe connectionless multiplexing/demultiplexing
- Sender has to specify destination IP address and port number of datagram
- Receiving host receives UDP segment
- Receiving host directs UDP segment to socket with corresponding port number
Where will IP/UDP datagrams with the same destination port number and IP address, but different source IP addresses and/or source port numbers be directed at the receiving host?
To the same socket
Describe connection-oriented multiplexing and demultiplexing
Receiver uses all four values that identify the TCP socket to direct the segment to the appropriate socket
What are the 4 values that make up the 4-tuple that identifies a TCP socket?
Source IP address
Source port number
Destination IP address
Destination port number
What is multiplexing and demultiplexing based on?
Segments and datagram header field values
What is the only value that demultiplexing with UDP depends on?
Destination port number
What values does demultiplexing with TCP depend on?
Source and destination IP addresses and port numbers (4-tuple)
Which layers does multiplexing/demultiplexing happen at?
All layers
Describe User Datagram Protocol (UDP)
- “No frills” internet transport protocol
- “Best effort” service
- Connectionless
What does it mean that TDP is a best effort service?
That it may lose segments and that segments can be delivered out-of-order to the application
What does it mean that UDP is connectionless?
- No handshaking between UDP sender & receiver
- Each UDP segment is handled independently of others
Why is there a UDP?
- Finer application-level control over what data is sent, and when
- No connection establishment
- No connection state at sender and receiver
- Small packet header overhead/size
- No congestion control
What applications use UDP?
DNS, SNMP and HTTP/#
How can one implement reliable transfer over UDP?
- Add needed reliability at application layer
- Add congestion control at application layer
Describe the actions of a UDP sender
- Is passed an application-layer message
- Determines UDP segment header field values
- Creates UDP segment
- Passes segment to IP
Describe the actions of a UDP receiver
- Receives segment from IP
- Checks UDP checksum header value
- Extracts application-layer message
- Demultiplexes message up to application via socket
What is the UDP checksum used to determine?
Whether bits within the UDP segment have been altered as it moved from source to destination
Describe the sender in a internet checksum procedure
- Treat contents of UDP segment as sequence of 16-bit integers
- Checksum
- Checksum value put into UDP checksum field
Describe the receiver in a internet checksum procedure
- Compute checksum of received segment
- Checks if computed checksum equals checksum field value
What assumptions does the rdt1.0 protocol make?
- No bit errors
- No loss of packets
The underlying channel is perfectly reliable
Do we have one or separate FSMs for the sender and receiver in a rdt1.0 protocol?
Separate FSMs
What is the underlying assumption that rdt2.0 is based on?
Underlying channel may contain bit errors - flipped bits in packets
How does the rdt2.0 recover from errors?
Acknowledgements (ACKs)
Negative Acknowledgements (NAKs)
Retransmission based on NAKs
What do acknowledgements (ACKs) do?
Receiver explicitly tells the sender that packet received OK
What do negative acknowledgements (NAKs) do?
Receiver explicitly tells sender that the packet had errors
What is a stop and wait protocol?
A protocol where the sender sends one packet, then waits for a response from the receiver
What is the fatal flaw of the rdt2.0?
The ACK/NAK can be corrupted
How does rdt2.0 handle that ACK/NAKs can be corrupted?
- Sender retransmits current packet if ACK/NAK corrupted
- Sender adds a sequence number to each packet
- Receiver discards duplicate packets
Describe the sender in an rdt2.1 protocol
- The sequence number 0/1 added to each packet
- Checks if received ACK/NAK corrupted
- Twice as many states
Why does the sender in a rdt2.1 protocol have twice as many states?
State must “remember” whether expected packet should have the sequence number 1 or 0
Describe the receiver of a rdt2.1 protocol
- Checks if the received packet is a duplicate
What is the difference between rdt2.1 and rdt2.2?
rdt2.2 is a NAK-free protocol - instead of NAK, receiver sends ACK for last packet received OK
Why does TCP use the rdt2.2 protocol?
To be NAK-free
What assumptions does the rdt3.0 protocol rely on?
The underlying channel can have bit errors and lose packets
How does rdt3.0 handle the fact that the underlying channel can lose packets?
Uses a countdown timer to interrupt every transmission of ACK after the assumed amount of time needed for the packet to get to the receiver
Why is the rdt3.0 perfomance so bad?
The protocol and its use of the stop-and-wait operation limit the performance of the underlying infrastructure
Pipelining
Sender allows multiple, “in-flight”, yet-to-be-acknowledged packets
What do pipelined reliable data transfer protocols rely on to work?
Increased range of sequence numbers
Buffering at sender and/or receiver
New approaches for pipelined error recovery
N-packet pipelining increases utilization by a factor of…
N
Describe the Go-Back-N (GBN) protocol
The sender is allowed to retransmit multiple packets without waiting for an ACK, but is constrained to have no more than some maximum allowable number, N, of unACKed packets in the pipeline
Cumulative ACK
ACKing of all packets up to, and including sequence number n have been correctly received
What does the GBN protocol do when it times out?
Retransmits the packet and all higher sequence numbered packets in the window / all packets that have previously been sent but haven’t yet been ACKed
Describe the Selective Repeat protocol
Receiver individually ACKs all correctly received packets
What is the maximum window of Go-Back-N?
With a n-bit sequence number field, the size of the sequence number space = 2^n. Maximum window 2^n – 1
What is the maximum window of Selective Repeat?
With n-bit sequence number field, the size of the sequence number space = 2^n. Maximum window = 2^n-1
What does this description describe: one sender and one receiver
Point-to-point
What does this definition describe: the maximum amount of data that can be grabbed and placed in a segment.
Maximum Segment Size (MSS)
What sort of ACK only acknowledges bytes up to the first missing byte in the strem?
A cumulative ACK
Describe the sort of protocol that this is with one word: handshaking initializes sender and receiver before data exchange
Connection-oriented
What connection does this describe:
- Point-to-point
- Reliable, in-order, byte stream
- Full duplex service
- Cumulative ACKs
- Pipelining
- Connection-oriented
- Flow controlled
TCP connection
What does this enable: TCP congestion and flow control set window size
Pipelining
Which segment structure is described below:
- Sequence number field and acknowledgement number field
- Receive window
- Header length field
- Options field
- Flag field
TCP segment structure
What does the TCP and sender and receiver use to implement a reliable data transfer service in the TCP segment structure?
Sequence number and acknowledgement number fields
What is the receive window of the TCP segment structure used for?
Flow control
What specifies the length of the TCP header in 32-bit words within the TCP segment structure?
The header length field
What is used for when a sender and receiver negotiate the MSS / as a window scaling factor for use in high-speed networks in the TCP segment structure?
Options field
What bit in the flag field of the TCP segment structure is used to indicate that the value of the ACK field is valid?
ACK bit
What bits in the flag field of the TCP segment structure are used for connection setup and teardown?
RST, SYN and FIN bits
What bits in the flag field of the TCP segment structure are used in explicit congestion notification?
CWR and ECE bits
What bit in the flag field of the TCP segment structure indicated that the receiver should pass the data to the upper layer immediately?
PSH bit
What bit indicates that there is data in the segment that the sending-side upper-layer entity has marked as urgent in the TCP segment structure?
URG bit
What are the byte stream numbers of the first byte in a segment’s data in TCP called?
Sequence numbers
What are the sequence numbers of the next byte received from the other side in TCP?
ACKs
Does the TCP specification say how the receiver should handle out-of-order segments?
No
What is this the formula for:
(1- α)EstimatedRTT + αSampleRTT
EstimatedRTT
What is this the formula for:
EstimatedRTT + 4*DevRTT
TimeoutInterval
What is this the formula for:
(1-β)DevRTT + β|SampleRTT – EstimatedRTT|
DevRTT
What event does does this TCP Receiver Action correspond to:
Delayed ACK. Wait up to 500 ms for arrival of another in-order segment. If next in-order segment doesn’t arrive in this interval, send an ACK
Arrival of in-order segment with expected sequence number. All data up to expected sequence number already acknowledged.
What event does does this TCP Receiver Action correspond to:
Immediately send single cumulative ACK, ACKing both in-order segments
Arrival of in-order segment with expected sequence number. One other in-order segment waiting for ACK transmission.
What event does does this TCP Receiver Action correspond to:
Immediately send duplicate ACK, indicating sequence number of next expected byte (which is the lower end of the gap)
Arrival of out-of-order segment with higher-than-expected sequence number. Gap detected.
What event does does this TCP Receiver Action correspond to:
Immediately send ACK, provided that segment starts at the lower end of gap
Arrival of segment that partially or completely fills in gap in received data
What sort of transmission does this describe:
If sender receives 3 additional ACKs for same data, resend unACKed segment with smallest sequence number
TCP fast retransmit
What sort of control does this describe:
Receiver controls sender, so sender won’t overflow receiver’s buffer by transmitting too much, too fast
Flow control
What sort of connection has this connection management?
- Handshake between sender and receiver before exchanging data
- Agreeing to establish connection
- Agreeing on connection parameters
TCP connection
What sort of handshake is this:
- The client-side TCP first sends a special TCP segment to the server-side TCP
- Once the IP datagram containing the TCP SYN segment arrives at the server host, the server extracts the TCP SYN segment from the datagram, allocates the TCP buffers and variables to the connection, and sends a connection-granted segment to the client TCP
- Upon receiving SYNACK segment, the client also allocates buffers and variables to the connection. The client host then sends the server yet another segment; this last segment acknowledges the serv’s connection-granted segment
TCP 3-way handshake
What stage in a TCP connection does this describe:
- Client and server each close their side of the connection by:
- Sending a TCP segment with FIN bit = 1
- Responding to received FIN with ACK
- On receiving FIN, ACK is combined with FIN
- Simultaneous FIN exchanges are handled
- Connection closes at server when ACK sent from client is received
TCP connection closing
What does this describe:
Too many sources sending too much data too fast for network to handle
Congestion
What are the two approaches to congestion control?
End-end congestion control
Network-assisted congestion control
What sort of congestion control is described below?
- No explicit feedback from network
- Congestion inferred from observed loss and delay
- Approach taken by TCP
End-end congestion control
What sort of congestion control is described below?
- Routers provide direct feedback to sending/receiving hosts with flows passing through congested router
- May indicate congestion lever /explicitly set sending rate
- TCP ECN, ATM, DECbit protocols
Network-assisted congestion control
What are the three major components of the TCP Congestion-Control algorithm?
Slow start
Congestion avoidance
Fast recovery
What major component of the TCP Congestion-control algorithm uses the Additive Increase, Multiplicative Decrease (AIMD) technique?
Congestion avoidance
How does TCP Cubic work?
Increases sending rate, W, as a function of the cube of the distance between current time and point in time, K, when TCP window size will reach the sending rate at which congestion loss is detected
What is the TCP fairness goal?
If K TCP sessions share the same bottleneck link of bandwidth R, each should have an average rate of R/K
What does fairness in TCP mean?
Each connection gets and equal share of available bandwidth
What are the major features of QUIC?
Connection-oriented and secure, streams, reliable and TCP friendly congestion-controlled data transfer
What is QUIC?
Application-layer protocol on top of UDP that increases performance of HTTP
How many handshakes does QUIC use to establish a connection?
1
What does QUIC avoid by using streams and parallelism?
HOL blocking