Artificial Intelligence & Data Science is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Mobile TCP

Mobile TCP studies how TCP (the Internet's reliable transport) behaves over wireless mobile links and the protocol changes or proxies used to keep performance and correctness during errors and handoffs.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Two sentences: Engineers need to make reliable, high-throughput TCP work when a device moves between cells or uses wireless links with bit errors and variable delay. Mobile TCP techniques (proxies, local retransmit, sender or base-station modifications) are practical tools used in mobile networks, edge gateways and when integrating cellular or Wi‑Fi radios with the Internet.

Key ideas

Start with TCP basics from first principles.

  • TCP (Transmission Control Protocol) — a transport-layer protocol that provides a reliable, in-order byte stream between two end hosts. Assumptions: the network can lose, reorder and duplicate packets; the receiver acknowledges received bytes; the sender retransmits on timeout or duplicate ACKs.
  • Round-Trip Time (RTT) — time between sending a packet and receiving its acknowledgement (one-sample value). Measured in seconds.
  • Retransmission Timeout (RTO) — timeout used by TCP to decide a packet is lost and needs retransmission. RTO is computed from a smoothed RTT estimate and a measure of RTT variation.
  • Congestion window (cwnd) — sender-side variable limiting the number of unacknowledged bytes in flight; used by TCP’s congestion control. Units: bytes.
  • Packet loss probability (p) — long-run fraction of transmitted packets that are lost. Used in performance models.

Why mobile is hard for TCP (derivation from basics):

  1. TCP assumes loss implies congestion. That is, when a packet is lost TCP reduces cwnd to avoid congestion collapse. But over wireless links many losses are due to bit errors, not congestion. If wireless losses are frequent, cwnd remains small and throughput drops.
  2. Mobility causes handoff interruptions and sudden RTT changes. Handovers can cause packets to be delayed or dropped and RTO may expire. RTO expiry causes retransmit and congestion-window collapse, even though the network may not be congested.
  3. Asymmetric links and link-layer retransmissions: wireless link-layer may buffer and retransmit, causing reordering and variable delays which confuse TCP’s duplicate-ACK and fast-retransmit logic.

Main categories of solutions (clear definitions and assumptions):

  • Split-connection (Indirect TCP, I-TCP) — TCP connection is split at the base station or proxy into two separate TCP connections: one from the fixed host to the proxy, and another from proxy to mobile. Assumption: base station is trustworthy and always available. Effect: isolates wireless losses to the wireless-side connection and prevents sender congestion-control reactions, but breaks end-to-end TCP semantics (application-level ACKs are satisfied early at proxy unless app-layer end-to-end semantics are reimplemented).
  • Snoop protocol (Snoop TCP) — a snoop agent at the base station caches TCP segments headed for the mobile. On seeing duplicate ACKs coming from the mobile, the snoop agent retransmits locally and suppresses duplicate ACKs forwarded to the fixed host. Assumptions: base station sees both data and ACKs; TCP headers must be visible to the BS (e.g., no end-to-end IPsec ESP), because snoop inspects TCP sequence/ACK fields. Preserves end-to-end semantics at TCP endpoints while hiding wireless losses from fixed host.
  • Explicit Loss Notification (ELN) — base station marks ACKs (or uses a flag) to indicate when losses are due to wireless errors. The sender uses ELN to avoid treating such losses as congestion losses. Assumptions: sender and base station agree on ELN signaling.
  • Freeze-TCP (or sender freeze on link down) — when a mobile detects a short disconnection (e.g., during handoff) the mobile or base station sends a signal (e.g., a TCP option or ICMP message) to the sender instructing it to “freeze” timers and avoid reducing cwnd; often implemented using a Zero Window Advertisement (ZWA) from the MH before disconnection and a window update after reconnection. Assumption: sender supports Freeze-TCP.
  • M-TCP (Mobile TCP) — closely related to Freeze-TCP; the MH/BS advertises a zero window to explicitly pause the sender during disconnections and restores the window on reconnection to avoid cwnd collapse; preserves end-to-end semantics.
  • Local retransmit and link-layer ARQ — use link-level retransmissions to hide bit errors from TCP. Assumption: retransmit delay is small compared to RTO and does not induce heavy reordering.
  • TCP enhancements for lossy links (SACK, selective retransmit, TCP NewReno, Westwood, Vegas) — sender-side algorithms that make TCP respond better to non-congestion losses or variable RTT; use selective acknowledgements (SACK) to retransmit only missing segments.

Exact statement often required in exams (example theorem-style):

  • TCP “loss = congestion” principle (more precise Reno rules): Original TCP congestion control assumes that a loss event is a signal of network congestion and therefore reduces sending rate. On timeout: ssthresh ← cwnd/2; cwnd ← 1·MSS (enter slow start). On triple-duplicate ACK: ssthresh ← cwnd/2; cwnd ← ssthresh + 3·MSS during fast recovery, then cwnd ← ssthresh. Assumptions: losses are primarily due to congestion and RTT measurements are stable.

Diagrams to draw in exam answers (describe exactly):

  • Draw a three-box diagram left-to-right: Fixed Host (FH), Base Station / Proxy (BS), Mobile Host (MH). Mark two TCP connections (FH↔BS and BS↔MH) for Indirect TCP. Label caches at BS and show where ACKs are generated.
  • For Snoop: draw packets from FH to MH passing BS; mark that BS caches data packets and forwards to MH; when dup-ACKs from MH arrive, BS retransmits locally and suppresses dup-ACK to FH. Label sequence numbers and ACK flow arrows.

Formulas

SRTT <- (1 - α)·SRTT + α·RTT_sample — SRTT (seconds) is the smoothed RTT estimate; α is dimensionless (typically 1/8). Applies in RTT estimator given sampled RTTs.

RTTVAR <- (1 - β)·RTTVAR + β·|RTT_sample - SRTT| — RTTVAR (seconds) is the smoothed mean deviation; β is dimensionless (typically 1/4).

RTO = SRTT + K·RTTVAR — retransmission timeout RTO (seconds); K is dimensionless (typically 4). Applies to TCP RTO computation assuming Jacobson/Karels algorithm. RFC 6298 also specifies RTO = SRTT + max(G, K·RTTVAR) with a minimum RTO of 1 s, Karn’s algorithm (do not sample RTT for retransmitted segments), and exponential backoff on repeated timeouts.

Throughput ≈ (1.22 · MSS) / (RTT · sqrt(p)) — approximate steady-state TCP throughput in bytes/second for TCP Reno-like congestion avoidance, where MSS is maximum segment size (bytes), RTT is round-trip time (s), p is packet loss probability (loss ratio). Assumptions: long-lived flow, independent random losses, loss rate p small, and ACKs are not delayed (b ≈ 1).

Window (bytes) ≈ Throughput · RTT — definition of average window under stationary conditions.

Notes: MSS units bytes, RTT seconds, throughput bytes/second or bits/second (convert by ×8). Mark constants α, β, K as typical dimensionless weighting values used in practice.

Worked examples

  1. Numerical throughput example (use approximate formula): Given: MSS = 1460 bytes, RTT = 100 ms = 0.1 s, packet loss p = 1% = 0.01. Use Throughput ≈ (1.22·MSS)/(RTT·sqrt(p)). Steps:
  1. Compute sqrt(p) = sqrt(0.01) = 0.1.
  2. Numerator = 1.22 · 1460 = 1781.2 bytes.
  3. Denominator = RTT · sqrt(p) = 0.1 s · 0.1 = 0.01 s.
  4. Throughput = 1781.2 / 0.01 = 178,120 bytes/s.
  5. Convert to bits/s: 178,120 · 8 = 1,424,960 bps ≈ 1.425 Mbps. Answer: 1.425 Mbps.
  1. Protocol trace example showing how Snoop hides wireless loss (small packet trace): Scenario: FH sends segments Seq=1,2,3; BS forwards to MH. Segment 2 lost on wireless hop. Steps:
  1. FH → BS: segments 1,2,3 (BS caches them and forwards to MH).
  2. MH receives 1, sends ACK for 2 (cumulative ACK=2) to FH via BS.
  3. Since segment 2 lost, MH receives 3 and sends duplicate ACK for 2 (dup-ACK), duplicated to BS.
  4. Snoop agent at BS sees dup-ACK and locally retransmits segment 2 to MH immediately from cache. Snoop suppresses forwarding the dup-ACK to FH.
  5. MH gets retransmitted 2 and sends ACK for 4 (or cumulative ACK for 4 if more). BS forwards the ACK to FH. FH never observed a loss and does not reduce cwnd. Result: local recovery avoids sender cwnd reduction and maintains throughput.
  1. Short model-answer derivation asked in exams: "Explain why split-connection I-TCP can improve throughput but breaks end-to-end semantics." Model answer (short): I-TCP isolates the wireless link by making TCP FH↔BS operate over wired Internet with low loss while BS↔MH uses a TCP variant optimized for wireless errors. Because losses on the wireless segment cause retransmits only on BS↔MH, FH never reduces its cwnd and throughput seen by application can be higher. However, I-TCP breaks TCP end-to-end semantics because BS may acknowledge data to FH before MH actually received it; therefore applications relying on TCP ACK meaning may be mistaken. Discuss trade-offs and mention state transfer during BS handoff to avoid packet loss.

Common mistakes

  • Forgetting to state assumptions for throughput formula (independent losses, long-lived flow). Without assumptions the numeric formula is invalid.
  • Mixing units (bytes vs bits) when converting throughput — always multiply by 8 to get bits/s.
  • Thinking that link-layer ARQ always fixes TCP: ARQ can hide errors but may introduce variable delay and reorder packets which still can trigger TCP mechanisms.

For your exam

Typical question types: definitions (define SRTT, RTO, snoop, I-TCP), short notes (compare I-TCP and Snoop), derivations (show RTO calculation, derive throughput approximation), numericals (compute throughput for given MSS/RTT/p), diagrams (draw split-connection and show message flow), and protocol trace (step-by-step Snoop retransmit or I-TCP handoff sequence). What a full-marks answer includes:

  • Clear definitions of every term used (RTT, RTO, cwnd, MSS, p).
  • Precise description of mechanism (e.g., where state is kept in I-TCP; what snoop caches and how dup-ACKs are handled).
  • Assumptions stated (e.g., path symmetry, loss independence, availability of base-station agent, unencrypted TCP headers).
  • A short diagram labelled with hosts, arrows and sequence numbers where required.
  • For numerical answers: formulas used, unit conversions shown, numerical steps and final unit.

Quick check

  1. What is the primary difference between I-TCP and Snoop protocols?
  2. Write the Jacobson RTT update rule for SRTT when α = 1/8.
  3. Using the approximation throughput ≈ 1.22·MSS/(RTT·sqrt(p)), if MSS=1000 bytes, RTT=50 ms and p=0.04, what is throughput in Mbps? (show only final numeric answer) Answers: 1) I-TCP splits the end-to-end TCP connection at the base station (breaks end-to-end semantics); Snoop keeps end-to-end TCP but does local retransmissions at BS and suppresses dup-ACKs. 2) SRTT <- (7/8)·SRTT + (1/8)·RTT_sample. 3) sqrt(0.04)=0.2; numerator=1.22·1000=1220; denom=0.05·0.2=0.01; throughput=1220/0.01=122,000 B/s = 976,000 bps ≈ 0.976 Mbps.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?