Chapter 3: The Transport Layer Flashcards

1
Q

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

a) The person who picks up the mail from the letterbox.
b) The postal service.

Transport is between processes, and network is between hosts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is IP said to be an unreliable service?

A

It does not guarantee that segments are delivered, segments are delivered in sequence or that the segments are unaffected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is multiplexing in the context of transport-layer applications?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is demultiplexing performed in TCP?

A

A TCP socket has (sip, dip, sport, dport), and this uniquely determines where it is directed to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why is UDP described as connectionless?

A

There is no handshake.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give an example of an application layer protocol that uses UDP.

A

DNS, HTTP/3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give some benefits of UDP over TCP.

A

Finer application-level control.
No connection establishment.
No connection state, so more clients possible.
Small packet header overhead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the packet structure of UDP?

A

16 bits for:
sport
dport
length
checksum

Application data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is the UDP checksum implemented?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In a completely reliable and integral transfer medium, what is the sending protocol and receiving protocol?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In a completely reliable transfer medium with possible bit errors, what is the sending protocol and receiving protocol?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain why a stop-and-wait protocol, while functional, may not be ideal. What is the solution?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Explain the Go-Back-N protocol.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain the Selective Repeat protocol.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What may occur if the window size is too large?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What precaution is taken for random reordering in a network?

A

Sequence numbers are not reused until it is sure no packet with that number may still be in the network.

19
Q

What is the MSS and MTU in TCP?

A

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.

20
Q

What is in the TCP header?

A

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)

21
Q

How is the segment sequence number decided in TCP?

A

By the first byte sequence number of that segment. The first byte of the whole sequence is given a random sequence number.

22
Q

How is the segment acknowledgement number decided in TCP?

A

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.

23
Q

How is the estimated RTT computed in TCP?

A

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

24
Q

How is the RTT variability measured?

A

DevRTT = (1-b) * DevRTT + b * |SampleRTT - EstimatedRTT|

Recommended value: b = 0.25

25
Q

What is the retransmission timeout interval for TCP?

A

TimeoutInterval = EstimatedRTT + 4 * DevRTT, with initial value of 1 sec.

When a timeout occurs, the timeout interval is doubled until a segment is received.

26
Q

What is a TCP fast transmit?

A

If there is 3 duplicate ACKs received, it is highly likely of a missing segment, so send that sequence number again immediately.

27
Q

What is flow control in TCP?

A

The reduction of data influx rate to combat overflowing receiving buffers.

28
Q

How is flow controlled in TCP?

A

Let A send B a large file.
The receive window is defined as:
rwnd = rcv_buffer - [last_byte_rcvd - last_byte_read]
(basically, the spare room in the receive buffer).

B will add the value of rwnd to every acknowledgement it sends to A.

Host A then keeps track of last_byte_sent and last_byte_acked to ensure it isn’t overflowing the buffer.

When B’s recv window is 0, A must send 1 data byte until the buffer is more than zero.

29
Q

What is the TCP handshake protocol?

A
  1. Client sends a SYN packet with a random sequence number to the server.
  2. The server sends a SYN-ACK packet with a random sequence number and the client’s seq number + 1 as its acknowledgement.
  3. The client sends an ACK packet with sequence number being the client_seq + 1 and acknowledgement of server+1
30
Q

What is the TCP teardown protocol?

A
  1. Client sends a FIN packet to the server
  2. Server sends an ACK packet to the client, waits for a bit, and sends a FIN packet.
  3. Client sends an ACK packet. There is a timed wait, and the connection is terminated.
31
Q

If a client sends a TCP packet to a server on an invalid port, what happens?

A

The server sends a packet back with a RST flag of 1.

32
Q

What are the costs of congestion?

A
  • Large queuing delays are experienced.
  • A sender must send retransmissions in order to compensate for dropped packets.
  • When a packet is dropped, the transmission capacity that was used at each of the upstream links is wasted.
33
Q

In network assisted congestion control, how might feedback be sent from the network to a sender?

A

The router can mark a packet as it goes to the receiver, which marks this in the acknowledgement.

34
Q

How does a TCP sender limit the rate at which it sends traffic into its connection?

A

The sender keeps track of a congestion window, cwnd.

Then, last_byte_sent - last_byte_acked <= min(cwnd, rwnd)

And thus, the send rate is roughly cwnd/RTT bytes/sec.

35
Q

How does a TCP sender perceive that there is congestion on the network?

A

The presence of a dropped TCP segment, which is detected by a timeout or triplicate ACK, gives high congestion.

36
Q

What is the TCP congestion-control slow start algorithm?

A

When a TCP connection begins, the cwnd is initialised to 1 MSS, so sending rate is approx MSS/RTT (small value).

It is doubled each time a transmitted segment is first acknowledged.

If there is a loss event indicated by a timeout, the algorithm resets. The slow_start_threshold is set to cwnd/2.

When ssthresh is reached, slow start algorithm ends.

If at any point a triplicate is detected, a fast retransmit is performed and the fast recovery algorithm is started.

37
Q

What is the TCP congestion-control congestion avoidance algorithm?

A

Each RTT, the cwnd is increased by 1 MSS. This is done by each ACK increasing the cwnd by MSS/cwnd.

When a timeout occurs, cwnd is set to 1 MSS and ssthresh is set to half of cwnd when the loss occurred.

When a triplicate ACK is received, cwnd is halved and increased by 3, and ssthresh is set to half of cwn when it was received. Fast recovery is then entered.

38
Q

What is the TCP congestion-control fast recovery algorithm?

A

The value of cwnd is increased by 1 MSS for every duplicate ACK received missing segment that caused TCP to enter fast-recovery.

When ACK arrives for the missing segment, it returns to the congestion-avoidance state.

If a timeout event occurs, it transitions to the slow start state after performing the standard set cwnd to 1 MSS and ssthresh is set to half of cwnd when it occurred.

39
Q

What is the average throughput of a TCP Reno connection?

A

0.75 * W/RTT where W is the window size in bytes when a loss event occurs.

40
Q

How does Explicit Congestion Notification work?

A

A router sets one of the ECN bits in the IP header as it passed to the recipient. The recipient then sets the ECHO bit in the ACK packet.

The sender then sends a CWR bit (Congestion Window Reduced) in the header of the next transmitted TCP sender-to-receiver segment.

41
Q

How does Delay-based Congestion Control work?

A

The uncongested throughput rate is cwnd/RTT_min.

If the actual rate is substantially less than this, the TCP sender decreases its sending rate.

42
Q

Is TCP fair? Is UDP fair? What occurs when UDP and TCP packets are sent at the same time, and how is this solved?

A

TCP is fair.
UDP is not.
UDP will crowd out the TCP traffic, and a congestion manager is needed.

43
Q

If TCP is fair, how is it possible a TCP application is unfair?

A

It uses multiple parallel connections.

44
Q

Give some benefits of QUIC.

A
  • Connection-oriented and secure
  • Encryption and handshake in one, so half the RTTs needed for this.
  • Parallel streams for each object in a website, so no HOL-blocking.
  • Reliable and congestion-controlled transfer.

NOTE: QUIC is an APPLICATION LAYER protocol, so it can be modified much faster.