Computer Communication Networks Rithul Kamesh
1 Unit 1: Internet Architecture and Applications
1.1 Internet Introduction & Terminology
Key Concept
Computer Network: A distributed system consisting of interconnected computing devices
(end-systems) connected via communication links and packet switches, enabling resource shar-
ing and communication.
Core Components:
• End-systems/Hosts: Execute applications and generate/receive data packets
• Communication Links: Physical media connecting network devices
• Packet Switches: Forward packets between networks (routers, switches)
• Protocols: Define format and order of messages exchanged
1.1.1 Internet Service Provider (ISP) Architecture
Hierarchical Structure:
1. Tier-1 ISPs: Global backbone providers (AT&T, Level 3, Sprint)
2. Regional ISPs: National/regional coverage (BSNL, Airtel, Vodafone)
3. Access ISPs: Local internet access providers
Interconnection Mechanisms:
• Peering: Direct connection between ISPs of similar tier
• Transit: Higher-tier ISP provides connectivity to lower-tier ISP
• Internet Exchange Points (IXPs): Neutral locations for ISP peering
Practice Question
Calculate the total number of ISPs required if we have a fully connected network topology with
N access ISPs, where each access ISP connects to every other access ISP directly.
Solution
For N access ISPs in a fully connected topology:
• Each ISP connects to (N-1) other ISPs
N (N −1)
• Total connections = 2 (avoiding double counting)
10×9
• For N = 10 ISPs: 2 = 45 connections required
• This demonstrates why hierarchical ISP structure is more scalable
1
Computer Communication Networks Rithul Kamesh
1.2 Network Core and Switching
1.2.1 Circuit vs. Packet Switching
Circuit Switching:
• Resources reserved for entire communication session
• Guaranteed performance but potential resource underutilization
• Used in traditional telephone networks (PSTN)
Packet Switching:
• Data divided into packets, each forwarded independently
• Statistical multiplexing enables better resource utilization
• Suitable for bursty data traffic patterns
Important Formula
Circuit Switching Capacity: For a link with capacity C and circuit rate R:
• Maximum simultaneous circuits = ⌊C/R⌋
• If each user is active with probability p, then for N users:
• Probability all users active = pN
1.3 Delay, Loss, and Throughput Analysis
Important Formula
Total Nodal Delay Components:
dnodal = dproc + dqueue + dtrans + dprop
• dproc : Processing delay (typically < 1 ms)
• dqueue : Queuing delay (variable, depends on congestion)
• dtrans = L/R: Transmission delay (packet length/link rate)
• dprop = d/s: Propagation delay (distance/signal speed)
Important Formula
Traffic Intensity and Queuing:
λ·L
ρ=
R
where λ = arrival rate, L = packet size, R = transmission rate
• ρ < 1: System stable
• ρ ≥ 1: Queue builds indefinitely
ρ
• Average queuing delay ≈ 1−ρ · L
R (for M/M/1 queue)
2
Computer Communication Networks Rithul Kamesh
Practice Question
A router has a 10 Mbps outgoing link. Packets arrive at an average rate of 800 packets/sec,
with each packet being 1000 bits on average. Calculate:
1. Traffic intensity
2. Average transmission delay per packet
3. Is the system stable?
Solution
Given: R = 10 Mbps, λ = 800 packets/sec, L = 1000 bits
800×1000
1. Traffic intensity: ρ = 10×106
= 0.08
1000
2. Transmission delay: dtrans = 10×106
= 0.1 ms
3. Since ρ = 0.08 < 1, the system is stable
1.4 Protocol Layers and Service Models
1.4.1 TCP/IP Five-Layer Model
1. Application Layer: User applications and protocols (HTTP, FTP, SMTP, DNS)
2. Transport Layer: End-to-end message delivery (TCP, UDP)
3. Network Layer: Routing packets across networks (IP, ICMP)
4. Link Layer: Communication over single link (Ethernet, WiFi)
5. Physical Layer: Transmission of raw bits (cables, wireless)
Encapsulation Process:
• Application: Message → Transport: Segment → Network: Datagram → Link: Frame → Physical:
Bits
1.5 Web and HTTP
1.5.1 HTTP Connection Types
Important Formula
HTTP Response Time Analysis:
• Non-persistent HTTP: 2 × RT T + L
R per object
L
• Persistent HTTP: RT T + R per object (after first)
• Pipelined HTTP: RT T + N × L
R for N objects
where RTT = Round Trip Time, L = object size, R = transmission rate
3
Computer Communication Networks Rithul Kamesh
Practice Question
A web page contains 1 base HTML file (8 KB) and 5 images (each 12 KB). The RTT is 100
ms and transmission rate is 1 Mbps. Calculate total response time for:
1. Non-persistent HTTP
2. Persistent HTTP
Solution
Given: Base file = 8 KB, 5 images = 12 KB each, RTT = 100 ms, R = 1 Mbps
Transmission delays:
8×8192
• Base file: 106
= 65.5 ms
12×8192
• Each image: 106
= 98.3 ms
1. Non-persistent: 6 objects × (200 + transmission delay)
• Base: 200 + 65.5 = 265.5 ms
• Each image: 200 + 98.3 = 298.3 ms
• Total: 265.5 + 5 × 298.3 = 1757 ms
2. Persistent: First object + subsequent objects
• First: 200 + 65.5 = 265.5 ms
• Remaining: 5 × (100 + 98.3) = 992 ms
• Total: 265.5 + 992 = 1257.5 ms
1.6 Domain Name System (DNS)
1.6.1 DNS Resolution Process
Iterative Query Process:
1. Host queries local DNS server
2. Local DNS queries root DNS server
3. Root returns TLD server address
4. Local DNS queries TLD server
5. TLD returns authoritative server address
6. Local DNS queries authoritative server
7. Authoritative server returns IP address
Important Formula
DNS Query Analysis: For iterative queries with n levels in hierarchy:
• Total queries = n (from local DNS server)
• Total delay ≈ n × RT Tavg (ignoring processing)
• Caching reduces subsequent query delays
4
Computer Communication Networks Rithul Kamesh
2 Unit 2: Transport Layer and Network Layer
2.1 Reliable Data Transfer Protocols
2.1.1 Stop-and-Wait Protocols
Protocol Evolution:
• RDT 1.0: Reliable channel (no errors, no loss)
• RDT 2.0: Channel with bit errors (ACK/NAK)
• RDT 2.1: Handles corrupted ACK/NAK (sequence numbers)
• RDT 2.2: Eliminates NAK (duplicate ACKs)
• RDT 3.0: Handles packet loss (timeout mechanism)
Important Formula
Stop-and-Wait Performance:
L/R
Usender =
RT T + L/R
where L = packet size, R = transmission rate, RTT = round trip time
For 100% utilization in pipelining: N ≥ RT TL/R
+L/R
Practice Question
Consider a 1 Gbps satellite link with RTT of 500 ms. If packet size is 1000 bytes, what is
the utilization of stop-and-wait protocol? How many packets should be ”in flight” for 100%
utilization?
Solution
Given: R = 1 Gbps, RTT = 500 ms, L = 1000 bytes = 8000 bits
1. Transmission delay: L
R = 8000
109
= 8 × 10−6 seconds = 0.008 ms
2. Utilization: U = 0.008
500+0.008 = 0.008
500.008 ≈ 0.000016 = 0.0016%
3. For 100% utilization: N = 500+0.008
0.008 ≈ 62, 501 packets
The extremely low utilization demonstrates why pipelining is essential for high-delay links.
2.1.2 Pipelined Protocols
Go-Back-N (GBN):
• Window size N, sequence numbers 0 to 2k − 1
• Cumulative acknowledgments only
• Receiver discards out-of-order packets
• Sender retransmits all unacked packets on timeout
Selective Repeat (SR):
• Individual acknowledgments for each packet
5
Computer Communication Networks Rithul Kamesh
• Receiver buffers out-of-order packets
• Sender retransmits only suspected lost packets
• Window size ≤ 2k−1 to avoid sequence number confusion
2.2 TCP Protocol
2.2.1 TCP Connection Management
Key Concept
TCP Three-Way Handshake:
1. Client → Server: SYN=1, seq=client_isn
2. Server → Client: SYN=1, ACK=1, seq=server_isn, ack=client_isn+1
3. Client → Server: ACK=1, seq=client_isn+1, ack=server_isn+1
Connection established after step 3 completes.
2.2.2 TCP Round Trip Time Estimation
Important Formula
TCP Timer Management:
EstimatedRT T = (1 − α) × EstimatedRT T + α × SampleRT T (1)
DevRT T = (1 − β) × DevRT T + β × |SampleRT T − EstimatedRT T | (2)
T imeoutInterval = EstimatedRT T + 4 × DevRT T (3)
Recommended values: α = 0.125, β = 0.25
Practice Question
A TCP connection has the following RTT samples (in ms): 100, 120, 140, 110, 130. Calculate
the timeout interval after all samples, starting with EstimatedRTT = 100 ms and DevRTT =
0.
Solution
Using α = 0.125, β = 0.25:
Initial: EstimatedRTT = 100, DevRTT = 0
After sample 120 ms:
• EstimatedRTT = 0.875 × 100 + 0.125 × 120 = 102.5 ms
• DevRTT = 0.75 × 0 + 0.25 × |120-102.5| = 4.375 ms
After sample 140 ms:
• EstimatedRTT = 0.875 × 102.5 + 0.125 × 140 = 107.19 ms
• DevRTT = 0.75 × 4.375 + 0.25 × |140-107.19| = 11.48 ms
Continuing this process through all samples... Final TimeoutInterval = EstimatedRTT + 4 ×
DevRTT
6
Computer Communication Networks Rithul Kamesh
2.3 TCP Congestion Control
2.3.1 AIMD Algorithm
Key Concept
TCP Congestion Control Phases:
1. Slow Start: cwnd doubles every RTT until ssthresh
2. Congestion Avoidance: cwnd increases by 1 MSS per RTT
3. Fast Recovery: Triggered by 3 duplicate ACKs (TCP Reno)
Important Formula
Congestion Window Dynamics:
• Slow Start: cwndnew = cwndold + M SS (per ACK)
M SS 2
• Congestion Avoidance: cwndnew = cwndold + cwndold (per ACK)
• On timeout: ssthresh = cwnd/2, cwnd = 1 MSS
• On 3 dup ACKs: ssthresh = cwnd/2, cwnd = ssthresh + 3 × M SS
Practice Question
A TCP connection starts with cwnd = 1 MSS and ssthresh = 16 MSS. Trace the congestion
window evolution for the first 10 RTTs assuming no packet loss. What is the cwnd value after
10 RTTs?
Solution
Starting: cwnd = 1 MSS, ssthresh = 16 MSS
Slow Start phase (cwnd doubles each RTT until ssthresh):
• RTT 1: cwnd = 1 MSS
• RTT 2: cwnd = 2 MSS
• RTT 3: cwnd = 4 MSS
• RTT 4: cwnd = 8 MSS
• RTT 5: cwnd = 16 MSS (reaches ssthresh)
Congestion Avoidance phase (cwnd increases by 1 MSS per RTT):
• RTT 6: cwnd = 17 MSS
• RTT 7: cwnd = 18 MSS
• RTT 8: cwnd = 19 MSS
• RTT 9: cwnd = 20 MSS
• RTT 10: cwnd = 21 MSS
After 10 RTTs: cwnd = 21 MSS
7
Computer Communication Networks Rithul Kamesh
2.4 Network Layer: IPv4
2.4.1 IPv4 Addressing and Subnetting
Important Formula
CIDR Address Calculations: For network address a.b.c.d/n:
• Network bits: n
• Host bits: 32 - n
• Total addresses: 232−n
• Usable host addresses: 232−n − 2
• Subnet mask: n consecutive 1s followed by (32-n) 0s
Practice Question
You are given the network 192.168.1.0/24 and need to create 6 subnets. Design the subnetting
scheme and list the first three subnet addresses with their ranges.
Solution
Original network: 192.168.1.0/24 (256 addresses)
For 6 subnets, need at least 3 additional bits: 23 = 8 ≥ 6 New subnet mask: /27 (provides 8
subnets of 32 addresses each)
Subnet addresses:
1. 192.168.1.0/27 (192.168.1.0 - 192.168.1.31)
2. 192.168.1.32/27 (192.168.1.32 - 192.168.1.63)
3. 192.168.1.64/27 (192.168.1.64 - 192.168.1.95)
Each subnet provides 30 usable host addresses (32 - 2 for network and broadcast).
2.4.2 DHCP Protocol
Key Concept
DHCP Four-Step Process:
1. DHCP Discover: Client broadcasts request for IP configuration
2. DHCP Offer: Server responds with available IP and parameters
3. DHCP Request: Client formally requests the offered configuration
4. DHCP ACK: Server confirms and grants the IP lease
2.5 IPv6 Transition
2.5.1 IPv6 Features and Tunneling
IPv6 Improvements:
• Address Space: 128-bit addresses (3.4 × 1038 addresses)
8
Computer Communication Networks Rithul Kamesh
• Simplified Header: Fixed 40-byte header, no fragmentation
• Flow Labeling: Built-in QoS support
• Auto-configuration: Stateless address configuration
Tunneling Mechanism: IPv6 datagrams encapsulated within IPv4 datagrams for transmission
across IPv4 infrastructure.
3 Practice Questions and Solutions
Practice Question
Comprehensive Network Analysis: A company has a T1 line (1.544 Mbps) connecting to
the Internet. The line experiences 20% utilization during peak hours with an average packet
size of 800 bytes. Calculate:
1. Average packet arrival rate during peak hours
2. If the company upgrades to T3 (45 Mbps), what would be the new utilization for the
same traffic?
3. What is the maximum number of simultaneous 64 kbps voice circuits the T3 line can
support?
Solution
Given: T1 = 1.544 Mbps, utilization = 20%, packet size = 800 bytes = 6400 bits
1. Peak traffic = 0.20 × 1.544 Mbps = 0.3088 Mbps
6
Average arrival rate = 0.3088×10
6400 = 48.25 packets/sec
0.3088
2. T3 utilization = 45 = 0.0069 = 0.69%
6
3. Voice circuits on T3 = ⌊ 45×10
64×103
⌋ = ⌊703.125⌋ = 703 circuits
Practice Question
TCP Performance Analysis: A TCP connection has a bandwidth of 10 Mbps and RTT of
40 ms. The receiver buffer size is 64 KB. Calculate:
1. Bandwidth-delay product
2. Optimal TCP window size for maximum throughput
3. If MSS = 1 KB, how many segments can be unacknowledged?
Solution
Given: Bandwidth = 10 Mbps, RTT = 40 ms, Buffer = 64 KB, MSS = 1 KB
1. Bandwidth-delay product = 10 × 106 × 0.04 = 400, 000 bits = 50 KB
2. Optimal window = min(BDP, Receiver Buffer) = min(50 KB, 64 KB) = 50 KB
50 KB
3. Segments in flight = 1 KB = 50 segments
9
Computer Communication Networks Rithul Kamesh
4 Key Formulas Reference
Important Formula
Essential Performance Metrics:
L/R
Utilization = (Stop-and-wait) (4)
RT T + L/R
Throughput = min(bottleneck link capacities) (5)
ρ L
Queuing Delay ≈ × (M/M/1) (6)
1−ρ R
∑
End-to-end Delay = (dproc + dqueue + dtrans + dprop ) (7)
hops
Important Formula
Network Addressing:
Subnet Addresses = 2subnet bits (8)
host bits
Host Addresses per Subnet = 2 −2 (9)
32−prefix length
CIDR Block Size = 2 (10)
5 Exam Strategy
Key Concept
High-Priority Topics:
• Protocol layer encapsulation/decapsulation processes
• HTTP response time calculations (persistent vs. non-persistent)
• TCP congestion control algorithm state transitions
• Subnet design and CIDR address calculations
• Queuing delay analysis and traffic intensity
• DNS resolution process and record types
• Reliable data transfer protocol mechanisms
Key Concept
Problem-Solving Approach:
1. Read Carefully: Identify all given parameters and required outputs
2. Draw Diagrams: Network topologies, protocol interactions, timing diagrams
3. Apply Formulas: Use appropriate formulas and verify units
4. Check Reasonableness: Ensure answers make practical sense
5. Show Work: Partial credit often available for methodology
10