1. Transmission & Propagation Delay
When you send a file across a network, two independent delays add up before the last bit reaches the destination.
Transmission Delay
Time to push all bits of the packet onto the wire.
Transmission Delay (Tt) = L / BL = packet size in bits | B = link bandwidth in bps
Example: A 1 MB file (8 × 106 bits) on a 100 Mbps link:
Tt = 8,000,000 / 100,000,000 = 0.08 s = 80 ms
Propagation Delay
Time for one bit to travel from sender to receiver through the medium.
Propagation Delay (Tp) = D / VD = distance in metres | V = propagation speed (~2 × 108 m/s in copper, ~3 × 108 m/s in fibre/air)
Example: 3000 km fibre link: Tp = 3,000,000 / 3×108 = 10 ms
Total End-to-End Delay (store-and-forward)
Total Delay = n × Tt + Tpn = number of links (each router stores the full packet before forwarding)
Bandwidth-Delay Product (BDP)
BDP tells you how many bits are “in flight” in the network at any moment — useful for sizing TCP buffers.
BDP = Bandwidth × Round-Trip TimeExample: 100 Mbps link, RTT = 100 ms: BDP = 108 × 0.1 = 107 bits = 10 Mb
2. Throughput & Efficiency
Efficiency
Efficiency = Throughput / BandwidthEfficiency = Tt / (Tt + 2Tp) (for stop-and-wait)Stop-and-Wait Efficiency
With stop-and-wait, the sender waits for an ACK before sending the next packet. Let a = Tp / Tt:
EfficiencySW = 1 / (1 + 2a)When propagation delay is large relative to transmission delay (a >> 1), efficiency collapses — this is why sliding window protocols exist.
3. Channel Capacity — Shannon & Nyquist
Shannon’s Theorem (noisy channel)
The theoretical maximum data rate for a channel with noise:
C = B × log2(1 + SNR)C = capacity in bps | B = bandwidth in Hz | SNR = signal-to-noise ratio (linear, not dB)
SNR conversion: SNRdB = 10 × log10(SNRlinear)
Example: 3 kHz telephone channel, SNR = 1000:
C = 3000 × log2(1001) ≈ 3000 × 10 = 30 kbps
Nyquist’s Theorem (noiseless channel)
C = 2B × log2(M)M = number of signal levels
Example: 3 kHz channel, 8 signal levels: C = 2 × 3000 × log2(8) = 6000 × 3 = 18 kbps
4. Error Detection — Hamming Distance
Hamming Distance
The number of bit positions where two codewords differ.
d(x, y) = number of bit positions where x and y differError Detection vs Correction
To detect up to e errors: dmin ≥ e + 1To correct up to e errors: dmin ≥ 2e + 1Hamming Code — Number of Parity Bits
For a message of m data bits, the number of parity bits r must satisfy:
2r ≥ m + r + 1Example: m = 4 data bits: try r = 3 → 23 = 8 ≥ 4 + 3 + 1 = 8. So r = 3 parity bits, total codeword = 7 bits.
CRC — Key Relationship
Remainder = (Message × xr) mod Generatorr = degree of generator polynomial (number of parity bits appended)
5. Sliding Window Protocols
Sliding window allows the sender to have multiple unacknowledged frames in transit at once.
Window Size for 100% Efficiency
Window Size W ≥ 1 + 2a where a = Tp/TtEfficiency with Window Size W
If W ≥ 1 + 2a: Efficiency = 1 (100%)If W < 1 + 2a: Efficiency = W / (1 + 2a)Sequence Number Bits
| Protocol | Window Size | Sequence Numbers Needed | Bits Required |
|---|---|---|---|
| Stop-and-Wait | 1 | 2 | 1 |
| Go-Back-N | Ws | Ws + 1 (at minimum) | n bits → Ws = 2n − 1 |
| Selective Repeat | Ws | 2 × Ws | n bits → Ws = 2n−1 |
Throughput
Throughput = Efficiency × Bandwidth6. ALOHA Throughput
Pure ALOHA
S = G × e−2GS = throughput (fraction of capacity) | G = offered load
Maximum throughput = 1/(2e) ≈ 18.4% at G = 0.5
Slotted ALOHA
S = G × e−GMaximum throughput = 1/e ≈ 36.8% at G = 1
7. IP Subnetting & CIDR
Subnet Mask Basics
Number of hosts per subnet = 2h − 2h = number of host bits | subtract 2 for network address and broadcast address
CIDR Notation
192.168.1.0/24 means 24 network bits, 8 host bitsHosts = 232−24 − 2 = 28 − 2 = 254 usable hostsNumber of Subnets
Subnets = 2s where s = subnet bits borrowed from host portionCommon Subnet Quick Reference
| CIDR | Subnet Mask | Hosts | Block Size |
|---|---|---|---|
| /30 | 255.255.255.252 | 2 | 4 |
| /29 | 255.255.255.248 | 6 | 8 |
| /28 | 255.255.255.240 | 14 | 16 |
| /27 | 255.255.255.224 | 30 | 32 |
| /26 | 255.255.255.192 | 62 | 64 |
| /25 | 255.255.255.128 | 126 | 128 |
| /24 | 255.255.255.0 | 254 | 256 |
| /16 | 255.255.0.0 | 65,534 | 65,536 |
Routing — Longest Prefix Match
When a router has multiple matching routes, it always picks the one with the longest (most specific) prefix.
8. TCP — Window, RTT & Throughput
TCP Throughput
TCP Throughput = Window Size / RTTWindow Size in bytes, RTT in seconds → throughput in bytes/sec
RTT Estimation (Jacobson’s Algorithm)
SRTT = (1 − α) × SRTT + α × RTTsampleDevRTT = (1 − β) × DevRTT + β × |RTTsample − SRTT|TimeoutInterval = SRTT + 4 × DevRTTTypical: α = 0.125, β = 0.25
TCP Slow Start & Congestion Avoidance
| Phase | cwnd Growth | Trigger |
|---|---|---|
| Slow Start | Doubles each RTT (exponential) | Start / after timeout |
| Congestion Avoidance | +1 MSS per RTT (linear) | cwnd ≥ ssthresh |
| Fast Recovery | Linear after triple duplicate ACK | 3 duplicate ACKs |
TCP Maximum Segment Size (MSS)
MSS = MTU − IP header − TCP header = 1500 − 20 − 20 = 1460 bytes(for standard Ethernet MTU of 1500 bytes)
TCP Sequence Number Space
Sequence numbers: 0 to 232 − 1 (32-bit field)ACK number = next expected byte9. Application Layer — Key Numbers
| Protocol | Port | Transport | Key Detail |
|---|---|---|---|
| HTTP | 80 | TCP | Stateless; persistent vs non-persistent connections |
| HTTPS | 443 | TCP | HTTP over TLS/SSL |
| DNS | 53 | UDP (queries) / TCP (zone transfers) | Hierarchical; TTL controls caching |
| FTP | 21 (control), 20 (data) | TCP | Two separate connections |
| SMTP | 25 | TCP | Sending mail; push protocol |
| POP3 | 110 | TCP | Download and delete from server |
| IMAP | 143 | TCP | Sync, keep on server |
| DHCP | 67 (server), 68 (client) | UDP | DORA process |
| Telnet | 23 | TCP | Unencrypted remote login |
| SSH | 22 | TCP | Encrypted remote login |
| SNMP | 161 | UDP | Network management |
HTTP RTT Formula (Non-Persistent)
Total time = 2 RTT + Tt(file) per object1 RTT for TCP handshake + 1 RTT for HTTP request/response + file transmission time
HTTP RTT Formula (Persistent with Pipelining)
Total time = 2 RTT + Tt(all objects) (one handshake, then pipeline)10. Quick Reference Table
| Formula | Expression | Unit |
|---|---|---|
| Transmission delay | L / B | seconds |
| Propagation delay | D / V | seconds |
| Total delay (n links) | n × Tt + Tp | seconds |
| BDP | BW × RTT | bits |
| Stop-and-Wait efficiency | 1 / (1 + 2a) | — |
| Sliding window efficiency (W < 1+2a) | W / (1 + 2a) | — |
| Go-Back-N window (n bits) | 2n − 1 | frames |
| Selective Repeat window (n bits) | 2n−1 | frames |
| Pure ALOHA max throughput | 1 / 2e ≈ 18.4% | — |
| Slotted ALOHA max throughput | 1 / e ≈ 36.8% | — |
| Shannon capacity | B log2(1 + SNR) | bps |
| Nyquist capacity | 2B log2(M) | bps |
| Hamming parity bits | 2r ≥ m + r + 1 | bits |
| Hosts per subnet | 2h − 2 | hosts |
| TCP throughput | W / RTT | bytes/sec |
| MSS (Ethernet) | 1460 bytes | bytes |
11. Frequently Asked Questions
What is the difference between transmission delay and propagation delay?
Transmission delay is the time to push all bits of a packet onto the wire — it depends on packet size and link bandwidth. Propagation delay is the time for a single bit to physically travel from sender to receiver — it depends on distance and the speed of the medium. A large file on a slow link has high transmission delay; a short packet across a continent has high propagation delay.
Why does Go-Back-N use 2^n − 1 as window size but Selective Repeat uses 2^(n-1)?
In Selective Repeat, the receiver also maintains a window. If the window size were 2n−1, new and old sequence numbers would overlap in the receiver’s buffer, causing ambiguity — the receiver cannot tell if an arriving frame is a retransmission of an old frame or a new one. Halving the window to 2n-1 ensures the sender’s and receiver’s windows never overlap.
How do I convert SNR from dB to linear for Shannon’s formula?
Shannon’s formula needs linear SNR (not dB). Convert using: SNRlinear = 10(SNRdB / 10). For example, 30 dB SNR = 103 = 1000 linear. Then plug 1000 into log2(1 + 1000) ≈ 10.
Why do we subtract 2 when calculating the number of usable hosts in a subnet?
Every subnet reserves two addresses: the network address (all host bits = 0) and the broadcast address (all host bits = 1). These cannot be assigned to devices. So for a /24 subnet with 256 total addresses, only 254 are usable for hosts.
What does bandwidth-delay product tell you in practice?
BDP tells you how much data can be “in flight” in the network at once. If your TCP receive window is smaller than the BDP, the sender will have to stop and wait for ACKs, wasting link capacity. To fully utilise a high-speed long-distance link, you need a large TCP window — at least equal to the BDP.
What is the efficiency of stop-and-wait at a = 10?
Efficiency = 1 / (1 + 2 × 10) = 1/21 ≈ 4.76%. This shows how poor stop-and-wait is on high-latency links — the sender is idle for 95% of the time waiting for ACKs. Sliding window protocols fix this by allowing multiple frames in flight.