Midterm Exam

Table of contents

  1. Exam Details
  2. What We Are Judging — and What We Are Not
  3. Practice Exam — Questions
    1. Question 1: TCP Over Satellite (30 points)
      1. Background (provided)
      2. Scenario
    2. Question 2: IoT Warehouse — Medium Access Under Density (30 points)
      1. Background (provided)
      2. Scenario
    3. Question 3: Ride-Sharing Dispatch (25 points)
      1. Scenario (all information provided)
    4. Question 4: Quick Distinctions (15 points)
  4. Practice Exam — Model Answers
    1. Answer — Question 1
    2. Answer — Question 2
    3. Answer — Question 3
    4. Answer — Question 4

Exam Details

  
DateTuesday, May 6, 2026
TimeIn class (75 minutes)
FormatClosed notes, closed book, no calculators, no AI
CoverageLectures 1–8 (Chapters 1–4)
Total100 points across 4 questions

What We Are Judging — and What We Are Not

We ARE judging:

  • Your ability to apply the first-principles framework (four invariants, E-M-B decomposition, binding constraints) to scenarios you haven’t seen before.
  • Your reasoning process, not just the final answer. A wrong conclusion with correct intermediate reasoning earns more credit than a correct conclusion with no reasoning shown.
  • Correct use of framework vocabulary. When we ask for an invariant analysis, name the invariants. When we ask about E-M-B, label the layers.
  • Your ability to distinguish related concepts (overhead tax vs. contention ceiling, CSMA/CA vs. DCF, beliefs vs. measurements).

We are NOT judging:

  • Memorization of protocol constants. Every formula and constant you need is given in the question.
  • Arithmetic speed or precision. All arithmetic hints are provided.
  • Knowledge of systems not covered in class. Scenarios are described fully in the question.
  • Specific fix names. We care about which invariant or E-M-B layer your fix targets, not whether you name the exact RFC.
  • Historical dates or paper citations.

Practice Exam — Questions

The mock exam below has the same format, difficulty, and coverage as the real midterm. Try all questions first, then check the model answers below.

Time: 75 minutes (designed for ~50 minutes of work)Total: 100 points

Question 1: TCP Over Satellite (30 points)

Background (provided)

TCP uses loss as its congestion signal. When a sender transmits data and receives an acknowledgment (ACK), it infers that the network has capacity and grows its congestion window (cwnd). When a packet is lost (detected by duplicate ACKs or a timeout), TCP infers congestion and halves cwnd. This is Additive Increase, Multiplicative Decrease (AIMD).

TCP has two growth phases. In slow start (used when the connection begins or after a timeout), cwnd doubles every RTT. In congestion avoidance (used after slow start reaches a threshold), cwnd grows by one segment per RTT. In both phases, the maximum window size in classic TCP is 65,535 bytes (64 KB), set by the 16-bit window field in the TCP header.

Formulas (given):

  • Bandwidth-Delay Product: BDP = link capacity (bits/s) x RTT (seconds)
  • Utilization = (max window in bits) / BDP

Arithmetic hint: 65,535 x 8 = 524,280 bits (~524 Kbits).

Scenario

A research station in Antarctica connects to a university in California via a geostationary satellite link. The link has a capacity of 10 Mbps. The satellite is at 36,000 km altitude; the round-trip signal path is approximately 72,000 km. The speed of light is 3 x 10^8 m/s. Processing and queuing delays add approximately 20 ms.

Part A (5 pts): Compute the round-trip time (RTT). Show your work.

Part B (5 pts): Compute the BDP in bits. How does this compare to TCP’s maximum window of 524 Kbits?

Part C (5 pts): Compute TCP’s utilization of this link. Explain in one sentence why the utilization is so low.

Part D (8 pts): Use E-M-B to diagnose what went wrong: (1) What is the environment? (2) What is the measurement signal? (3) What is TCP’s belief, and why does it diverge?

Part E (7 pts): The satellite link exposes pressure on MORE THAN ONE invariant. Identify two distinct invariants under pressure, and for each, propose a specific fix targeting a different invariant.


Question 2: IoT Warehouse — Medium Access Under Density (30 points)

Background (provided)

In 802.11 WiFi, each station uses a random backoff to avoid collisions.

Formulas (given):

  • Per-slot transmission probability: tau = 2 / (CW_min + 1)
  • P(success) = n x tau x (1 - tau)^(n-1)
  • For 802.11a/g: CW_min = 15, slot = 9 us

Protocol overhead per frame (fixed): DIFS (34 us) + avg backoff (67.5 us) + preamble (20 us) + SIFS (16 us) + ACK (24 us) = ~160 us total.

Arithmetic hints: ln(0.875) = -0.1335; 0.875^9 = 0.316; 0.875^99 = 1.8 x 10^(-6); 0.875^999 ~ 0.

Scenario

A warehouse deploys battery-powered IoT temperature sensors sharing a single wireless channel with a central base station. Channel: 54 Mbps. Each sensor sends a 50-byte report every 10 seconds. Three scales: 10 sensors, 100 sensors, 1,000 sensors.

The operator must choose: distributed contention (CSMA/CA) or centralized scheduling (OFDMA / 5G). The operator can deploy on unlicensed spectrum or CBRS (priority licensed spectrum).

Part A (6 pts): Compute P(success) for n = 10, n = 100, and n = 1000.

Part B (8 pts): Compute data TX time for a 50-byte frame at 54 Mbps and the data fraction. Is throughput the right metric? What metric actually matters, and why?

Part C (8 pts): Evaluate two proposed fixes:

  • Fix 1: Batch 10 readings into one 500-byte frame every 100 seconds. Compute the new data fraction. Does it help with the overhead tax? The metric from Part B? What does it cost?
  • Fix 2: Use A-MPDU aggregation. Could it help the sensors? Why or why not?

Part D (8 pts): (i) Use E-M-B to explain why CSMA/CA is a poor fit considering contention, data freshness, AND power. (ii) At what point does distributed contention stop making sense? Gradual or sharp transition? (iii) How does CBRS change the answer?


Question 3: Ride-Sharing Dispatch (25 points)

Scenario (all information provided)

A ride-sharing company’s central server assigns drivers to passengers. The server knows each driver’s GPS location (updated every 5 seconds) and assigns the nearest driver by straight-line distance.

Problem: GPS straight-line distance is not road distance. A driver 500m away by GPS may be 2 km by road.

Facts: 200 active drivers, GPS updates every 5 seconds, 0.5 second computation time, 50 requests/minute at peak.

Part A (10 pts): Apply the four invariants (one sentence each): State, Time, Coordination, Interface.

Part B (8 pts): Identify the E-M-B gap. What is the Environment, Measurement, Belief? Which layer is the source of failure?

Part C (7 pts): Propose one fix. Which E-M-B layer does it target? Does it change any invariant answer from Part A?


Question 4: Quick Distinctions (15 points)

Answer each in 2–3 sentences. Use framework vocabulary.

Part A (5 pts): What is the difference between the overhead tax and the contention ceiling in WiFi? Which one gets WORSE as the PHY rate increases, and why?

Part B (5 pts): What is the structural difference between CSMA/CA (the principle) and DCF (the 802.11 standard)? Name one specific mechanism that belongs to DCF but is NOT part of CSMA/CA.

Part C (5 pts): Distance-vector routing (RIP) and link-state routing (OSPF) both distribute routing information. What is the fundamental difference in WHAT they share? Why does this difference eliminate count-to-infinity in link-state?


Practice Exam — Model Answers

Answer — Question 1

Part A: RTT = 72,000 km / (3 x 10^5 km/s) + 20 ms = 240 ms + 20 ms = 260 ms.

Part B: BDP = 10 Mbps x 0.26 s = 2.6 Mbits. TCP max window = 524 Kbits. BDP is ~5x larger than the max window.

Part C: Utilization = 524,280 / 2,600,000 = ~20%. TCP can use only 20% because its maximum window is too small to keep the long, fat pipe full.

Part D:

  1. Environment: 10 Mbps available capacity, no congestion, link is underutilized.
  2. Measurement: TCP measures ACK arrivals and loss events. On this link, ACKs arrive every 260 ms. RF interference losses are misinterpreted as congestion.
  3. Belief: Diverges in two ways. First, cwnd capped at 64 KB by the 16-bit window field — pipe is ~80% empty. Second, TCP interprets any loss as congestion — on a satellite link with RF noise, it repeatedly halves cwnd on an uncongested link.

Part E:

  • Interface: 16-bit window field caps cwnd at 64 KB. Fix: TCP Window Scale (RFC 1323) — extends effective window beyond 64 KB.
  • Time: 260 ms RTT means each feedback cycle is 13x slower. Recovery from loss takes minutes. Fix: Larger initial window (IW10) or SACK for richer per-RTT feedback.

Answer — Question 2

Part A: tau = 2/16 = 0.125.

  • n = 10: P = 10 x 0.125 x 0.316 = ~0.40 (workable).
  • n = 100: P = 12.5 x 1.8e-6 = ~0.00002 (~0%).
  • n = 1000: P ~ 0 (complete collapse).

Part B: Data TX = (50 x 8) / 54e6 = 7.4 us. Data fraction = 7.4 / (7.4 + 160) = 4.4%. Over 95% is overhead. Throughput is the wrong metric — what matters is access latency (data freshness): how quickly the AP gets each reading.

Part C:

  • Fix 1 (batching): 500-byte fraction = 74 / (74+160) = 31.6%. Overhead tax improves, but data freshness degrades from 10s to 100s — wrong tradeoff for monitoring.
  • Fix 2 (A-MPDU): Does NOT help. Each sensor has only one frame — nothing to aggregate. A-MPDU helps the AP (downlink), not single-frame uplink senders.

Part D:

  • (i) E-M-B: Environment = 100 sensors, tiny packets, low aggregate traffic. Measurement = carrier sense (binary). Belief = “channel free.” At n=100, collision probability ~1 even though traffic is low. Power compounds it: CSMA/CA forces radio on for sensing, burning battery on failed attempts.
  • (ii) Transition is sharp: P(success) drops from 40% at n=10 to ~0% at n=100. Coordination must change from distributed to centralized (OFDMA or Target Wake Time). Sensors sleep between assigned slots — zero power, zero contention, bounded latency.
  • (iii) CBRS eliminates contention at every level (sole scheduler on priority spectrum). On unlicensed WiFi, even 802.11ax still contends with neighboring networks.

Answer — Question 3

Part A:

  1. State: Server has GPS coordinates (5s updates) and availability. Belief diverges because GPS measures position, not road-network reachability.
  2. Time: Mix of prescribed (5s polling) and event-driven (ride requests). The 5s interval is the dominant constraint.
  3. Coordination: Fully centralized — server is sole decision-maker.
  4. Interface: To passengers: ETA + driver identity. To drivers: assignment + passenger location. Hides internal ranking.

Part B: Environment = actual road-network travel time. Measurement = GPS coordinates (position proxy, not travel-time). Belief = “nearest by GPS = fastest arrival.” Source: Measurement layer — an honest but bad proxy, like distance-vector using queue length for link quality.

Part C: Replace straight-line distance with a road-network routing API. Targets Measurement layer. Changes State (belief model shifts to road-network travel time). Time cost: API query takes ~2s vs. 0.5s — drivers move during computation, introducing a new staleness gap.


Answer — Question 4

Part A: Overhead tax = fixed protocol time (~160 us) that doesn’t shrink with faster PHY. Contention ceiling = collision probability growing with station count (Bianchi). Overhead tax gets worse as PHY rate increases: data TX time shrinks toward microseconds, fixed 160 us dominates, data fraction drops below 2% at gigabit rates.

Part B: CSMA/CA = the principle (sense, transmit full frame, wait for ACK, retry). DCF = 802.11-1997 standard packaging optimizations on top. DCF-only mechanisms: SIFS/DIFS priority, Binary Exponential Backoff, or NAV (virtual carrier sense via Duration field).

Part C: Distance-vector shares computed distances (beliefs). Link-state shares raw link measurements (observations). Count-to-infinity occurs because stale beliefs echo back through neighbors. Link-state eliminates this because advertisements are direct environment observations, not processed beliefs. In E-M-B: distance-vector’s measurement comes from another node’s belief layer; link-state’s comes from the environment layer.