Transport Layer

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play

1/43

encourage image

There are no tags or description

Looks like no tags are added yet.

44 Terms

1
New cards

What is the purpose of the transport layer?

To provide logical communication between application processes on different hosts (not between hosts directly)

2
New cards

What is the role of the sender in transport protocols?

Breaks the application messages into segments and passes them to the network layer

3
New cards

What is the role of the receiver in transport protocols?

Reassembles the segments into messages and passes them to the application layer

4
New cards

What are the characteristics of TCP?

Reliable, in-order delivery

Congestion control

Flow control

Connection setup

5
New cards

What are the characteristics of UDP?

Unreliable, unordered delivery, and extension of “best-effort” IP

6
New cards

What services are not provided by the transport layer?

Delay guarantees and bandwidth guarantees

7
New cards

Describe multiplexing

The sender handles data from multiple sockets and adds the transport header to them before sending

8
New cards

Describe demultiplexing

The receiver uses header info to deliver received segments to the correct socket

9
New cards

How does connectionless demultiplexing work?

The sender needs to specify the destination IP address and port number before sending into UDP socket

When host receives the UDP segment they check the destination port number in segment and directs the UDP segment to the socket with that port number

Datagrams with the same destination port number but different source IP addresses and/or port numbers will be directed to the same socket at receiving host

10
New cards

How does connection-oriented demultiplexing work?

TCP socket is identified by a 4-tuple consisting of:

  • source IP address

  • source port number

  • destination IP address

  • destination port number

Receiver uses all 4 values to direct the segment to the appropriate socket, server may support many TCP sockets simultaneously this way


11
New cards

What is UDP?

User datagram protocol, a best effort service and segment may be lost or delivered out of order

Connectionless so no handshaking and each segment is handled independently of others

12
New cards

Why do we have UDP?

No connection establishment means no added RTT delay, it’s simple, has a small header size, and no congestion control (can be as fast as desired and function even with congestion)

13
New cards

Where is UDP used?

Streaming multimedia apps, DNS, SNMP, and HTTP/3

If reliability is needed, it’s usually added/implemented at the application layer

14
New cards

What is the sender’s role in UDP?

Once passed a message, determines the UDP segment header field values, creates the UDP segment, and passes the segment to IP

15
New cards

What is the receiver’s role in UDP?

Receives the segment from IP, checks the UDP checksum header value, extracts the application layer message, and demultiplexes message up to application via socket

16
New cards

What is the purpose of a checksum?

To detect errors in transmitted segments

17
New cards

How does checksum work?

The sender treats the contents of the segment as a sequence of 16-bit integers, so the checksum is the addition of segment content with the value put into the UDP checksum field

Then the receiver computes the checksum of the received segment and checks if the computed checksum equals the field value

18
New cards

What is an ACK?

Acknowledgements, how receiver explicitly tells the sender that the packet was received ok

19
New cards

What is a NAK?

Negative acknowledgments, how receiver explicitly tells sender that the packet had errors, so the sender retransmits the packet

20
New cards

How to handle duplicates from retransmission if ACK/NAK was corrupted?

Sender adds sequence number to each packet, so when it retransmits the current packet even if it was actually received ok, the receiver can discard any duplicate packet

21
New cards

How does a NAK free protocol work?

Instead of NAK, the receiver sends an ACK for the last packet received ok. When the sender receives a duplicate ACK, it retransmits the current packet

22
New cards

How to handle not receiving an ACK because of packet loss?

Sender waits a reasonable amount of time for ACK, and retransmits if no ACK was received in that time

If packet was just delayed and not lost, the sequence number already handles that at the receiver

Use a countdown timer to interrupt the sender after reasonable amount of time

23
New cards

What are pipelined protocols?

Allow multiple, “in-flight”, yet to be acknowledge packets, with buffering at sender and/or receiver

24
New cards

What is a cumulative ACK?

Acks all packets up to including sequence number n: ACK(n)

Means all packets before n were also received ok

25
New cards

How does the sender work in piplined protocol?

Has a window of up to N consecutive transmitted but unACKed packets, when it receives ACK(n) it moves the window forward to begin at n+1

Uses a timeout for oldest in flight packet, and retransmits packet n and all higher sequence number packets in the window

26
New cards

How does the receiver work in pipelined protocol?

Always sends ACK for correctly received packets so far with the highest in order sequence number

When it receives an out of order packet, it can discard or buffer it, and re-ACK packet with highest in order sequence number

27
New cards

What is selective repeat?

Uses pipelining, the receiver buffers packets as needed and individually ACKS all correctly received packets

The sender maintains a timer for each unACKed packet, on timeout retransmits the packet. Also maintains a window over N consecutive sequence numbers which limits pipelined packets to be in this window

28
New cards

What is TCP?

Point-to-Point, reliable in-order byte stream, full duplex data (bi-directional data flow, MSS: max segment size), uses cumulative ACKs, pipelining for congestion and flow control, connection oriented, and flow controlled (sender will not overwhelm receiver)

29
New cards

What are sequence numbers?

Byte stream number of the first byte in a segment’s data

30
New cards

What events does the sender have to handle in TCP?

Data received, timeout, and ACK received

31
New cards

What does the sender do when data is received in TCP?

Creates a segment with the sequence number, and starts the timer if it’s not already running

32
New cards

What does the sender do on timeout in TCP?

Retransmits the segment that caused the timeout and restarts the timer

33
New cards

What does the sender do when an ACK is received in TCP?

If the ACK acknowledges previously unACKed segments, it updates what is known to be ACKed and starts the timer if there are still unACKed segments

34
New cards

Describe fast retransmission

If sender receives 3 additional ACKs for the same data, it resends the unACKed segment with the smallest sequence number

Doesn’t wait for the timeout, making it faster if packet is actually lost

35
New cards

How does flow control work in TCP?

Receiver advertises free buffer space in the rwnd field in the TCP header, so the sender limits the amount of unACKed data to the received rwnd value to guarantee the receiver buffer will not overflow

36
New cards

How are connections managed in TCP?

Client and server use a 3 way handshake before exchanging data, agreeing to establish a connection and agreeing on connection parameters

To close the connection, both client and server close their side of the connection, sending a segment with FIN bit = 1, respond to the FIN with ACK

37
New cards

What are the costs of congestion?

More work (retransmission) for receiver throughput

Unneeded transmissions, carrying multiple copies of a packet decreases max achievable throughput

When a packet is dropped, any upstream transmission capacity and buffering used for that packet was wasted

38
New cards

What is end-to-end congestion control?

No explicit feedback from the network, congestion is inferred from observed loss and delay

39
New cards

What is network assisted congestion control?

Routers provide direct feedback to hosts with flows passing through congested router

May indicate congestion level or explicitly set sending rate

40
New cards

Describe TCP’s AIMD congestion control

Senders can increase sending rate until packet loss occurs, then decrease on loss event

Additive increase, and multiplicative decrease (cut in half on loss detected by triple duplicate ACK, cut to 1MSS when loss detected by timeout)

41
New cards

What is slow start?

When TCP connection begins, increase sending rate exponentially until the first loss event

Initially cwnd = 1MSS, so double cwnd every RTT

Initial rate is slow but ramps up exponentially fast

42
New cards

How does the sender know when to switch to additive increase from slow start’s exponential increase?

Use variable ssthresh, then on loss event ssthresh is set to half of cwnd just before the loss event

43
New cards

What is a bottleneck link?

A link that’s always busy, it’s queue is almost never empty, so optimizing congestion control is limited by this link

Goal is to keep the pipe just full enough, but not fuller to avoid high delays and buffering

44
New cards

What is an explicit congestion notification?

Used in network assisted congestion control, there are two bits in IP header that are marked by the network router to indicate congestion, which is carried to the destination, then the destination sets the ECE bit on ACK segment to notify the sender of congestion