Chapter 3 : Transport Layer

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/62

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

63 Terms

1
New cards

Transport layer (what it does)

Extends host-to-host delivery (IP) to process-to-process delivery between application processes on end systems (logical communication).

2
New cards

Logical communication

Abstraction provided by transport protocols so apps can "talk" as if directly connected, independent of physical network.

3
New cards

Segment (transport)

Application message encapsulated by the transport layer; carried inside a network-layer datagram.

4
New cards

Where transport protocols run

End systems only (not inside routers); network layer handles routing.

5
New cards

Processes vs hosts

Transport layer: process-to-process; Network layer: host-to-host.

6
New cards

IP service model

Best-effort, unreliable (no guarantees on delivery, integrity, or order).

7
New cards

Transport multiplexing

Demux/mux that extends host-to-host delivery to process-to-process delivery using port numbers.

8
New cards

Demultiplexing

Deliver incoming segment to the correct socket using header fields (dest port, often IPs).

9
New cards

Multiplexing

Gather data from sockets, add headers (src/dst ports), create segments, pass to network layer.

10
New cards

Socket identifier (UDP)

Destination IP + destination port number uniquely identify a UDP socket.

11
New cards

Port number range

16-bit (0-65535); well-known ports 0-1023 reserved for standard services.

12
New cards

UDP service model

Connectionless, minimal: multiplex/demultiplex + checksum error detection; no reliability, ordering, or congestion control.

13
New cards

Why choose UDP

Fine-grained send timing, no handshake delay, no connection state, small 8-byte header.

14
New cards

UDP ports in practice

Clients often use ephemeral ports (1024-65535); servers bind well-known or fixed ports (bind()).

15
New cards

UDP source port purpose

Acts as a return address so receiver can reply to the sender.

16
New cards

UDP header fields

Source port, destination port, length (header+data), checksum (error detection).

17
New cards

UDP checksum (idea)

1's complement sum of 16-bit words; receiver sum (including checksum) equals all 1s if no error.

18
New cards

TCP socket identifier

Four-tuple: (src IP, src port, dst IP, dst port).

19
New cards

Persistent vs non-persistent HTTP

Persistent: reuse one TCP connection; Non-persistent: new TCP connection per request/response (higher overhead).

20
New cards

Web servers and sockets

Servers may use many connection sockets (threads/processes) simultaneously to serve clients.

21
New cards

TCP service model

Reliable, ordered, byte-stream, full-duplex; flow control and congestion control.

22
New cards

MSS (Maximum Segment Size)

Max app-data per TCP segment; chosen to fit within MTU (Ethernet MTU 1500 → typical MSS ~1460 with 40B headers).

23
New cards

TCP send/receive buffers

Data queued in send buffer before transmission; received data placed in receive buffer for app to read.

24
New cards

TCP segment key fields

Source/destination ports, seq #, ack #, header len, flags, recv window, checksum, options.

25
New cards

TCP sequence numbers

Byte-oriented; seq # labels first byte in the segment's data.

26
New cards

TCP acknowledgment number

Next expected byte (cumulative ACK of all prior bytes).

27
New cards

Stop-and-wait inefficiency

With large RTT and high rate, sender is idle most of the time → low utilization.

28
New cards

Pipelining (why)

Increases utilization by allowing multiple in-flight packets; requires larger seq space and buffering.

29
New cards

RDT 1.0

Bare send/receive over perfect channel; no errors, no feedback.

30
New cards

RDT 2.0

Adds ACK/NAK (ARQ) and stop-and-wait; handles bit errors via retransmission.

31
New cards

RDT 2.1

Adds sequence numbers to detect duplicates; discards wrong-seq frames.

32
New cards

RDT 3.0

Adds timeouts for loss; functionally correct but stop-and-wait limits throughput.

33
New cards

Go-Back-N (GBN)

Sliding window of size N; cumulative ACKs; on timeout, retransmit from earliest unACKed; receiver discards out-of-order.

34
New cards

GBN sender windows

[0..base-1]=ACKed, [base..nextseqnum-1]=unACKed, [nextseqnum..base+N-1]=sendable, ≥base+N=not yet sendable.

35
New cards

Selective Repeat (SR)

Per-packet ACKs and timers; receiver buffers out-of-order; sender retransmits only missing packets.

36
New cards

TCP RTT measurement

SampleRTT measured for one in-flight segment at a time; varies with load/route.

37
New cards

EstimatedRTT formula

EstimatedRTT = (1 - α)·EstimatedRTT + α·SampleRTT (α ≈ 0.125).

38
New cards

RTT variation (DevRTT)

DevRTT = (1 - β)·DevRTT + β·|SampleRTT - EstimatedRTT| (β ≈ 0.25).

39
New cards

TCP timeout interval

TimeoutInterval = EstimatedRTT + 4·DevRTT; doubled after a timeout (backoff), then recomputed.

40
New cards

TCP reliable transfer (timers)

One retransmission timer (oldest unACKed seg); on timeout retransmit earliest unACKed and restart timer.

41
New cards

Duplicate ACK

ACK that repeats acknowledgment of already ACKed data (out-of-order arrival at receiver).

42
New cards

Fast retransmit

Trigger on 3 duplicate ACKs → retransmit missing segment before timeout.

43
New cards

TCP recovery style

Hybrid of GBN (cumulative ACKs) and SR (selective fast retransmit behavior).

44
New cards

Flow control vs congestion control

Flow: match sender to receiver's buffer speed; Congestion: match sender to network capacity.

45
New cards

Receive window (rwnd)

rwnd = RcvBuffer - (LastByteRcvd - LastByteRead); sender ensures in-flight ≤ rwnd.

46
New cards

Zero-window probing

If rwnd=0, sender must send 1-byte probes to learn when space frees.

47
New cards

TCP congestion window (cwnd)

Limits unACKed data: in-flight ≤ min(cwnd, rwnd); send rate ≈ cwnd/RTT.

48
New cards

Detecting congestion

Loss event via timeout or 3 dup ACKs; rising RTTs can also hint congestion (delay-based variants).

49
New cards

AIMD behavior

Additive increase (probe bandwidth), multiplicative decrease on loss → sawtooth cwnd over time.

50
New cards

Slow start

Start with small cwnd; cwnd doubles each RTT until ssthresh or loss; on timeout → cwnd=1 MSS, ssthresh=½ previous cwnd.

51
New cards

Congestion avoidance

Linear cwnd growth (~+1 MSS/RTT) until loss; on timeout → cwnd=1 MSS, ssthresh halved.

52
New cards

Fast recovery (Reno)

On 3 dup ACKs, inflate cwnd to keep pipe full, retransmit missing seg; then enter congestion avoidance.

53
New cards

End-to-end congestion control

No router help; sender infers congestion from loss/RTT and adapts cwnd (classic TCP).

54
New cards

Network-assisted congestion control

Routers provide explicit feedback (e.g., ECN bits or choke packets) about congestion state.

55
New cards

ECN (Explicit Congestion Notification)

IP/TCP marks indicate congestion without drops; sender halves cwnd on ECN, sets CWR; reduces loss-induced recovery.

56
New cards

Delay-based control (Vegas/BBR)

Use RTT/throughput to keep pipe "just full"; Vegas adjusts cwnd by measured vs expected rate; BBR models bottleneck bandwidth and RTT.

57
New cards

QUIC (why)

Application-layer transport over UDP to improve secure HTTP performance; faster handshakes, stream multiplexing, TCP-friendly CC.

58
New cards

QUIC streams

Multiple independent reliable, in-order streams within one QUIC connection → less HOL blocking.

59
New cards

QUIC security

All packets encrypted; combines connection + crypto handshake for faster setup.

60
New cards

QUIC congestion control

TCP-friendly algorithms (e.g., NewReno-like) while running over UDP user space.

61
New cards

Terminology: datagram vs segment

UDP unit often called "datagram"; TCP unit called "segment."

62
New cards

Connection-oriented vs connectionless

TCP is connection-oriented (setup/teardown, stateful); UDP is connectionless (no handshake, stateless).

63
New cards

TCP cumulative ACKs

ACK n means all bytes < n received; may buffer or discard out-of-order based on implementation.