1/62
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Transport layer (what it does)
Extends host-to-host delivery (IP) to process-to-process delivery between application processes on end systems (logical communication).
Logical communication
Abstraction provided by transport protocols so apps can "talk" as if directly connected, independent of physical network.
Segment (transport)
Application message encapsulated by the transport layer; carried inside a network-layer datagram.
Where transport protocols run
End systems only (not inside routers); network layer handles routing.
Processes vs hosts
Transport layer: process-to-process; Network layer: host-to-host.
IP service model
Best-effort, unreliable (no guarantees on delivery, integrity, or order).
Transport multiplexing
Demux/mux that extends host-to-host delivery to process-to-process delivery using port numbers.
Demultiplexing
Deliver incoming segment to the correct socket using header fields (dest port, often IPs).
Multiplexing
Gather data from sockets, add headers (src/dst ports), create segments, pass to network layer.
Socket identifier (UDP)
Destination IP + destination port number uniquely identify a UDP socket.
Port number range
16-bit (0-65535); well-known ports 0-1023 reserved for standard services.
UDP service model
Connectionless, minimal: multiplex/demultiplex + checksum error detection; no reliability, ordering, or congestion control.
Why choose UDP
Fine-grained send timing, no handshake delay, no connection state, small 8-byte header.
UDP ports in practice
Clients often use ephemeral ports (1024-65535); servers bind well-known or fixed ports (bind()).
UDP source port purpose
Acts as a return address so receiver can reply to the sender.
UDP header fields
Source port, destination port, length (header+data), checksum (error detection).
UDP checksum (idea)
1's complement sum of 16-bit words; receiver sum (including checksum) equals all 1s if no error.
TCP socket identifier
Four-tuple: (src IP, src port, dst IP, dst port).
Persistent vs non-persistent HTTP
Persistent: reuse one TCP connection; Non-persistent: new TCP connection per request/response (higher overhead).
Web servers and sockets
Servers may use many connection sockets (threads/processes) simultaneously to serve clients.
TCP service model
Reliable, ordered, byte-stream, full-duplex; flow control and congestion control.
MSS (Maximum Segment Size)
Max app-data per TCP segment; chosen to fit within MTU (Ethernet MTU 1500 → typical MSS ~1460 with 40B headers).
TCP send/receive buffers
Data queued in send buffer before transmission; received data placed in receive buffer for app to read.
TCP segment key fields
Source/destination ports, seq #, ack #, header len, flags, recv window, checksum, options.
TCP sequence numbers
Byte-oriented; seq # labels first byte in the segment's data.
TCP acknowledgment number
Next expected byte (cumulative ACK of all prior bytes).
Stop-and-wait inefficiency
With large RTT and high rate, sender is idle most of the time → low utilization.
Pipelining (why)
Increases utilization by allowing multiple in-flight packets; requires larger seq space and buffering.
RDT 1.0
Bare send/receive over perfect channel; no errors, no feedback.
RDT 2.0
Adds ACK/NAK (ARQ) and stop-and-wait; handles bit errors via retransmission.
RDT 2.1
Adds sequence numbers to detect duplicates; discards wrong-seq frames.
RDT 3.0
Adds timeouts for loss; functionally correct but stop-and-wait limits throughput.
Go-Back-N (GBN)
Sliding window of size N; cumulative ACKs; on timeout, retransmit from earliest unACKed; receiver discards out-of-order.
GBN sender windows
[0..base-1]=ACKed, [base..nextseqnum-1]=unACKed, [nextseqnum..base+N-1]=sendable, ≥base+N=not yet sendable.
Selective Repeat (SR)
Per-packet ACKs and timers; receiver buffers out-of-order; sender retransmits only missing packets.
TCP RTT measurement
SampleRTT measured for one in-flight segment at a time; varies with load/route.
EstimatedRTT formula
EstimatedRTT = (1 - α)·EstimatedRTT + α·SampleRTT (α ≈ 0.125).
RTT variation (DevRTT)
DevRTT = (1 - β)·DevRTT + β·|SampleRTT - EstimatedRTT| (β ≈ 0.25).
TCP timeout interval
TimeoutInterval = EstimatedRTT + 4·DevRTT; doubled after a timeout (backoff), then recomputed.
TCP reliable transfer (timers)
One retransmission timer (oldest unACKed seg); on timeout retransmit earliest unACKed and restart timer.
Duplicate ACK
ACK that repeats acknowledgment of already ACKed data (out-of-order arrival at receiver).
Fast retransmit
Trigger on 3 duplicate ACKs → retransmit missing segment before timeout.
TCP recovery style
Hybrid of GBN (cumulative ACKs) and SR (selective fast retransmit behavior).
Flow control vs congestion control
Flow: match sender to receiver's buffer speed; Congestion: match sender to network capacity.
Receive window (rwnd)
rwnd = RcvBuffer - (LastByteRcvd - LastByteRead); sender ensures in-flight ≤ rwnd.
Zero-window probing
If rwnd=0, sender must send 1-byte probes to learn when space frees.
TCP congestion window (cwnd)
Limits unACKed data: in-flight ≤ min(cwnd, rwnd); send rate ≈ cwnd/RTT.
Detecting congestion
Loss event via timeout or 3 dup ACKs; rising RTTs can also hint congestion (delay-based variants).
AIMD behavior
Additive increase (probe bandwidth), multiplicative decrease on loss → sawtooth cwnd over time.
Slow start
Start with small cwnd; cwnd doubles each RTT until ssthresh or loss; on timeout → cwnd=1 MSS, ssthresh=½ previous cwnd.
Congestion avoidance
Linear cwnd growth (~+1 MSS/RTT) until loss; on timeout → cwnd=1 MSS, ssthresh halved.
Fast recovery (Reno)
On 3 dup ACKs, inflate cwnd to keep pipe full, retransmit missing seg; then enter congestion avoidance.
End-to-end congestion control
No router help; sender infers congestion from loss/RTT and adapts cwnd (classic TCP).
Network-assisted congestion control
Routers provide explicit feedback (e.g., ECN bits or choke packets) about congestion state.
ECN (Explicit Congestion Notification)
IP/TCP marks indicate congestion without drops; sender halves cwnd on ECN, sets CWR; reduces loss-induced recovery.
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.
QUIC (why)
Application-layer transport over UDP to improve secure HTTP performance; faster handshakes, stream multiplexing, TCP-friendly CC.
QUIC streams
Multiple independent reliable, in-order streams within one QUIC connection → less HOL blocking.
QUIC security
All packets encrypted; combines connection + crypto handshake for faster setup.
QUIC congestion control
TCP-friendly algorithms (e.g., NewReno-like) while running over UDP user space.
Terminology: datagram vs segment
UDP unit often called "datagram"; TCP unit called "segment."
Connection-oriented vs connectionless
TCP is connection-oriented (setup/teardown, stateful); UDP is connectionless (no handshake, stateless).
TCP cumulative ACKs
ACK n means all bytes < n received; may buffer or discard out-of-order based on implementation.