Chapter 3: The Transport Layer Flashcards
In a postal exchange, what is analogous to:
a) the transport-layer protocol
b) the network-layer protocol
Which layer is communication between processes, and which is between hosts?
a) The person who picks up the mail from the letterbox.
b) The postal service.
Transport is between processes, and network is between hosts.
Why is IP said to be an unreliable service?
It does not guarantee that segments are delivered, segments are delivered in sequence or that the segments are unaffected.
What is multiplexing in the context of transport-layer applications?
When information from the application layer is received by the transport layer from different sockets, it is mixed together and passed to the network layer.
How is demultiplexing performed in UDP?
Concretely, if Host A sends a UDP message from port 19157 to Host B at port 46428, how is this achieved?
Host A creates a transport layer segment: (19157, 46428, _, _, data) and passes it to the network layer.
If the segment reaches Host B, the transport layer examines the destination port number in the segment, and delivers it to that socket.
How is demultiplexing performed in TCP?
A TCP socket has (sip, dip, sport, dport), and this uniquely determines where it is directed to.
Why is UDP described as connectionless?
There is no handshake.
Give an example of an application layer protocol that uses UDP.
DNS, HTTP/3
Give some benefits of UDP over TCP.
Finer application-level control.
No connection establishment.
No connection state, so more clients possible.
Small packet header overhead.
What is the packet structure of UDP?
16 bits for:
sport
dport
length
checksum
Application data
How is the UDP checksum implemented?
The 1s complement of the sum of the binary words is taken and stored.
At the recipient, the sum of all the words and the checksum should give all 1s.
In a completely reliable and integral transfer medium, what is the sending protocol and receiving protocol?
Sending: Receives data from the application is layer, and then encapsulates the packet before passing to the network layer.
Receiver: Takes a packet from the network layer, extracts the data and delivers it to the application layer.
In a completely reliable transfer medium with possible bit errors, what is the sending protocol and receiving protocol?
Sender: Receives data from application layer, encapsulates it and sends it to network, with a SEQUENCE NUMBER swapping between 0 and 1.
It then waits for a valid ACK packet with the sequence number positive acknowledgement. If it gets this, it reads the next data from the application layer. If it gets anything else, it resends.
Receiver: Receives packet from the network layer and extracts it. It sends an ACK with the sequence number of the last correctly received packet. If that was the packet just received, it extracts it and sends it to the application layer.
It returns to waiting for a packet.
A sender/receiver is set up to deal with a reliable transmission but with possible integrity issues.
What editing is needed to ensure it can deal with unreliable transmission?
When a sender sends a packet, it must start a timer. If the time runs out, it must resend the packet. If a correct acknowledgement is received or a retransmission is sent, it restarts the timer.
Explain why a stop-and-wait protocol, while functional, may not be ideal. What is the solution?
As each packet is sent and checked in turn, it takes substantially longer to transmit data across a network than it should.
Solved by pipelining.
Explain the Go-Back-N protocol.
The sequence number range is split into 4 sections:
- Packets sent and ack’d
- Packets sent and not ack’d
- Packets not sent but usable
- Packets not sent and not usable
The window constitutes the middle two sections.
If a packet is in the window, it can be sent. The window remains the same size at all times, so when a packet is ack’d, a new once can be added.
If an out-of-order packet is received, then the packet is dropped. The sender, on a timeout, will resend all the packets in the 2nd section.
Explain the Selective Repeat protocol.
The same window is set as GBN, but the window may contain ACK’d packets.
When the packet in the 1st position is ACK’d, the window is shifted along until a non-ack’d packet is in position 1.
When the receiver receives a packet in or before the window, it marks it as received and ACKs it.
When the 1st position is received, the window is slid over until a non-received packet into the 1st position.
Each packet must have it’s own timer.
What may occur if the window size is too large?
The last element of the sender may correspond to the sequence number of the start of the receiver, so new data may be received instead of the old data.
What precaution is taken for random reordering in a network?
Sequence numbers are not reused until it is sure no packet with that number may still be in the network.
What is the MSS and MTU in TCP?
MSS (Maximum Segment Size) is the amount of APPLICATION data that can be placed in a segment.
The MTU (Maximum Transmission Unit) is the length of the largest link layer frame that can be sent.
The MSS is normally calculated from determining the MTU.
What is in the TCP header?
16 bits for:
- source port
- destination port
32 bits for:
- sequence number
- ack number
4 bits for:
- header length
4 zero bits.
8 bits for:
- flags (ACK, RST, SYN, FIN, CWR, ECE, PSH, URG)
16 bits for:
- receive window
- checksum
- URG data pointer (if URG is set)
Options (variable length)
How is the segment sequence number decided in TCP?
By the first byte sequence number of that segment. The first byte of the whole sequence is given a random sequence number.
How is the segment acknowledgement number decided in TCP?
The sequence number of the next expected segment.
If the 1st and 3rd packets have been received, then the 2nd seq number will be sent as an ack to the most recent receival.
How is the estimated RTT computed in TCP?
At any point, one sample RTT is being calculated for a packet.
Then,
EstimatedRTT = (1-a) * EstimatedRTT + a * sampleRTT
a is recommended as 0.125
How is the RTT variability measured?
DevRTT = (1-b) * DevRTT + b * |SampleRTT - EstimatedRTT|
Recommended value: b = 0.25