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.