Lesson 2 - Transport and Application Layers Flashcards

1
Q

What does the transport layer provide?

A

Logical end-to-end connection between processes running on different hosts. May provide services such as reliability, flow control, congestion control, and more.

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

What are the 2 main protocols within the transport layer

A

User datagram protocol (UDP) and the Transmission Control Protocol (TCP)

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

What is the need for multiplexing / demultiplexing?

A

It’s required in order for multiple applications to use the network simultaneously via ports. Each app binds itself to a unique port.

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

Describe the two types of multiplexing/demultiplexing.

A

Connectionless and connection oriented which depends on whether we have a connection established between sender and receiver. Demultiplexing is the job of delivering data included in a segment to the appropriate socket.

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

What is connection-oriented multiplexing/demultiplexing?

A

TCP socket = four-tuple of source IP, source port, destination IP, and destination port

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

What is connection-less multiplexing/demultiplexing?

A

UDP socket = two-tuple of destination IP and destination port

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

What is the relationship between the network and the transport layer

A

The transport layer is responsible for end-to-end communication between end hosts The network layer is responsible for moving datagrams from one internet host to another. Receives from transport layer and delivers the datagram to the host’s transport layer

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

What are the differences between UDP & TCP?

A

TCP provides strong primitives that make e2e communication reliable and cost effective while UDP has only basic functionality and relies on application-layer to implement the rest.

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

Explain TCP three-way handshake.

A
  1. Send segment with no data, SYN bit set to 1 and initial sequence number
  2. Server receives and allocates resources and sends back SYNACK with SYN bit set to 1 and randomly chosen initial sequence number
  3. Client receives SYNACK, also allocates buffer/resources, and sends back SYN bit set to 0.

SYN-SYNACK-SYN (110)

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

Explain TCP connection teardown

A
  1. Send FIN bit set to 1.
  2. Server acknowledges by sending ACK.
  3. Server sends FIN bit set to 1, indicating it is closed.
  4. Receiver sends ACK.

FIN-ACK-FIN-ACK

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

What is Automatic Repeat Request or ARQ?

A

Method for reliable transmission where the receiver acknowledges receiving specific segments. If the sender does not receive acknowledgement within a given period of time, it will assume the packet is lost and resend it.

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

What is Stop and Wait?

A

The most basic method for identifying a lost packet. In this case the sender sends a packet and waits for its acknowledgement from the receiver.

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

What is Go-back-N?

A

A way for the receiver to notify the sender of a missing segment by sending ACK for the most recently received in-order packet so the sender will send all packets from then on - even if there are duplicates. The receiver discards any out of order received packets.

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

What is selective ACKing?

A

Go-back-N can lead to many unnecessary retransmissions so selective ACKing solves this by having the sender retransmit only those that were received in error. The receiver buffers the out-of-order packets until the missing packets are received to fill in the blanks.

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

What is fast retransmit?

A

When the sender receives 3 duplicate ACKs for a packet, it considers the packet to be lost and will retransmit it instead of waiting for the timeout.

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

What is transmission control and why do we need to control it?

A

Sender doesn’t know link capacity or usage by others. Want to be fair to users in the network and avoid overflowing buffers or the network with congestion.

17
Q

What is flow control and why do we need to control it?

A

Controlling the transmission rate to protect the receiver’s buffer from overflow. Matching the sender’s rate against the receiver’s rate of reading the data.

18
Q

What is the receive window?

A

The receive window (rwnd) is the spare unused space in the receiver’s buffer. The receiver advertises this value of rwnd in every segment/ACK it sends back to the sender. It provides sender an idea of how much data the receiver can handle at the moment.

19
Q

What is congestion control?

A

Controlling the transmission rate to protect the network from congestion. Avoid congestion in the network by being dynamic and adapting to network conditions

20
Q

What are the goals of congestion control?

A

Efficiency (high use of the network)

Fairness (each user fair share of bandwidth - may depend on network policy)

Low delay

Fast convergence - converge to fair allocation quickly to not disadvantage short flows

21
Q

What is an E2E congestion control?

A

No explicit feedback - infer from network behavior and adapt rate. More aligned with e2e principle and adopted by TCP

22
Q

How does a host infer congestion?

A

Packet delay - increase in roundtrip time (RTT) as determined by ACKs = indication of congestion, tricky as packet delay can be variable.

Packet loss - when routers start dropping packets, we can infer congestion but it may be due to less common reasons as well

23
Q

What is network-assisted control?

A

The network layer to provides explicit feedback to the sender about congestion in the network.

24
Q

How does a TCP sender limit the sending rate?

A

Use ACKs as a pacing mechanism along with a congestion window (max number of packets that are sent but not yet acknowledged). Use probe-and-adapt approach by increasing until detecting congestion

25
Q

What is additive increase?

A

The idea behind additive increase is to increase the window by one packet every RTT (Round Trip Time). So, every time the sending host successfully sends a cwnd number of packets it adds 1 packet to cwnd.

26
Q

What is Multiplicative Decrease?

A

When the TCP detects congestion, it reduces the rate at which the sender transmits. So, when the TCP sender detects that a timeout occurred, then it sets the CongestionWindow (cwnd) to half of its previous value.

27
Q

What is a slow start in TCP?

A

AIMD = fast decrease, slow ramp up . Slow start = start with just 1, then increase exponentially instead of linearly (additive). Start with 1, then 2, 4, etc until a threshold = slow start threshold then uses AIMD

28
Q

Is TCP fair in case 2 connections have the same RTT? Explain why.

A

Yes. Both will increase/decrease their congestion window similarly and approach an equal bandwidth share.

29
Q

Is TCP fair in case 2 connections have different RTTs? Explain why.

A

Connections with smaller RTT values would increase their congestion window faster than the ones with longer RTT values. This leads to an unequal sharing of the bandwidth.

30
Q

What is network assisted congestion control?

A

Relying on the network layer to provide explicit feedback about congestion

31
Q

What is end-to-end congestion control?

A

No explicit feedback - infer from network behavior and adapt rate. More aligned with e2e principle and adopted by TCP

32
Q

What are the two types of packet loss detection?

A
  1. Triple ACK - mild congestion - reduce to half. 2. Timeout - more severe form - reset to initial window.
33
Q

How does a host infer congestion?

A
  1. Packet delay - increase in roundtrip time (RTT) as determined by ACKs = indication of congestion, tricky as packet delay can be variable. 2.Packet loss - when routers start dropping packets, we can infer congestion but it may be due to less common reasons as well
34
Q

How does a TCP sender limit the sending rate?

A

Use ACKs as a pacing mechanism along with a congestion window (max number of packets that are sent but not yet acknowledged). Use probe-and-adapt approach by increasing until detecting congestion

35
Q

Explain additive increase / multiplicative decrease (AIMD) in the context of TCP.

A

Start with a constant initial window, typically 2, and increase additively by one packet every RTT until congestion. Reduce by multiplicative decrease - set congestion window to half of previous value. 16 > 8 > 4 > 2 > 1

36
Q

Explain how TCP cubic works

A

Uses CUBIC polynomial as the growth function instead. More aggressive and slows towards the previous max (last packet loss). RTT-fair as it doesn’t use RTT time but just the time elapsed since the last loss event.

37
Q

When would an application layer protocol choose UDP over TCP?

A

Less delays and better control over sending data. Remote file server, DNS, RIP, SNMP, streaming

38
Q

Explain TCP throughput calculation

A

BW = data per cycle / time per cycle = (MSS/ RTT) * (C/Sqrt(p))