Computer Networks
Comprehensive exam revision notes for BCA-208N Unit 3 (Addressing, Internet Protocol & Routing Algorithms). Includes Section A (2M), Section B (5M), and Section C (15M) questions, answers, and diagrams.
Computer Networks
Addressing, Internet Protocol & Routing Algorithms
Core Definitions & Key Concepts
How many total addresses exist in IPv4 versus IPv6
- IPv4: 2^{32} ≈ 4.29 × 10^9 (4.29 billion addresses).
- IPv6: 2^{128} ≈ 3.4 × 10^{38} (340 undecillion addresses).
IPv4 Classful addressing ranges for Classes A, B, and C
- Class A:
1.0.0.0to126.255.255.255(Default mask:255.0.0.0or/8). - Class B:
128.0.0.0to191.255.255.255(Default mask:255.255.0.0or/16). - Class C:
192.0.0.0to223.255.255.255(Default mask:255.255.255.0or/24).
What is the purpose of CIDR (Classless Inter-Domain Routing)
CIDR eliminates rigid class boundaries, replacing them with arbitrary prefix lengths (/n). It halted IPv4 address exhaustion through efficient variable-length subnetting and supernetting.
What does the TTL (Time to Live) field in an IPv4 header do
TTL limits packet lifespan. Every router decrements TTL by 1. When TTL drops to 0, the packet is discarded and an ICMP Time Exceeded message is sent back, preventing infinite loops.
What are the DORA messages exchanged in DHCP
- Discover (Client broadcast)
- Offer (Server unicast/broadcast)
- Request (Client requests offered IP)
- Acknowledge (Server commits lease)
What does ARP (Address Resolution Protocol) do
ARP resolves a known logical IP address into a physical hardware (MAC) address on a local area network link via local broadcast.
The Count-to-Infinity problem in Distance Vector routing
When a network link fails, distance vector routers slowly propagate incrementing hop counts in a loop until the metric reaches infinity (16 in RIP), stalling network convergence.
What is the Split Horizon rule in Distance Vector routing
A router is prohibited from advertising a routing update back out of the same interface from which it originally learned that route.
Conceptual & Architectural Analysis
Compare IPv4 and IPv6 Protocols in a Detailed Comparative Table
| Dimension | IPv4 | IPv6 |
|---|---|---|
| Address Length | 32 bits (4 bytes) | 128 bits (16 bytes) |
| Notation | Dotted-decimal (192.168.1.1) | Hexadecimal colon (2001:0db8::1) |
| Total Address Space | ≈ 4.3 × 10^9 | ≈ 3.4 × 10^{38} |
| Header Size | Variable (20 to 60 bytes) | Fixed 40 bytes base header |
| Broadcast | Supported natively | Eliminated; replaced by Multicast/Anycast |
| Configuration | Manual or DHCP | Stateless Address Autoconfiguration (SLAAC) or DHCPv6 |
| IPSec Support | Optional add-on | Mandatory built-in architectural support |
| Checksum | Header checksum verified at every hop | Checksum removed from IP layer (handled by L2 & L4) |
Subnetting and Calculate Subnet Mask, Network ID, and Usable Hosts for 192.168.10.0/27
Step-by-Step Subnetting Calculation
- Given: Network
192.168.10.0/27
- Subnet Mask: Prefix
/27means 27 ones followed by 5 zeros:
11111111.11111111.11111111.11100000 = \mathbf{255.255.255.224}
- Host Bits ($h$): 32 - 27 = 5 bits.
- Total IP Addresses per Subnet: 2^5 = \mathbf{32}.
- Usable Host Addresses: 2^5 - 2 = \mathbf{30} hosts.
- Block Size (Magic Number): 256 - 224 = 32.
- First Subnet Range:
- Network Address:
192.168.10.0 - First Usable Host:
192.168.10.1 - Last Usable Host:
192.168.10.30 - Directed Broadcast Address:
192.168.10.31
IPv4 to IPv6 Transition Strategies (Dual Stack, Tunneling, NAT-PT)
- Dual Stack: Nodes run both IPv4 and IPv6 protocol stacks simultaneously on the same operating system interface, routing IPv4 over IPv4 and IPv6 over IPv6.
- Tunneling (e.g., 6to4, Teredo): Encapsulates native IPv6 packets inside standard IPv4 headers so they can traverse legacy IPv4 routing backbones.
- Header Translation (NAT-PT): A gateway translates IPv6 packet headers directly into IPv4 packet headers and vice versa, allowing direct communication between incompatible nodes.
Compare Distance Vector Routing (RIP) vs Link State Routing (OSPF)
| Dimension | Distance Vector (RIP) | Link State (OSPF) |
|---|---|---|
| Algorithm | Bellman-Ford algorithm | Dijkstra's Shortest Path First (SPF) |
| Routing View | Routing by rumor (knows only neighbors) | Full topological map of entire network area |
| Metric | Hop count (Max 15 hops; 16 = \infty) | Cost inversely proportional to bandwidth |
| Updates | Full table broadcast every 30 seconds | Triggered Link-State Advertisements (LSAs) on changes |
| Convergence | Slow; prone to routing loops | Fast; loop-free convergence |
In-Depth Analysis & Implementation
The Complete IPv4 Datagram Header Format and All Field Functions
IPv4 Datagram Header Structure (20–60 Bytes)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options (0 to 40 Bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Version (4b): Always
4(or6for IPv6). - IHL (4b): Internet Header Length in 32-bit words (minimum = 5, meaning 5 × 4 = 20 bytes).
- Total Length (16b): Total datagram size including header and payload (max 65,535 bytes).
- Identification (16b), Flags (3b - DF, MF), Fragment Offset (13b): Coordinate IP packet fragmentation across smaller MTU links.
- TTL (8b): Decremented at each hop to eliminate packet loops.
- Protocol (8b): Multiplexing identifier:
1= ICMP,6= TCP,17= UDP. - Header Checksum (16b): Recomputed at every router hop to detect transmission noise.
Solve Dijkstra's Shortest Path Algorithm for an OSPF Routing Topology Step-by-Step
Dijkstra's Shortest Path Algorithm Solution
Given Network Graph: Nodes A, B, C, D, E. Source Node = A.
- Edge Weights: A-B: 4, A-C: 2, B-C: 1, B-D: 5, C-D: 8, C-E: 10, D-E: 2.
Step-by-Step Iteration Table:
| Step | Visited Set (S) | Shortest Distance to A | Dist to B | Dist to C | Dist to D | Dist to E |
|---|---|---|---|---|---|---|
| 0 | {A} | 0 | 4 (via A) | 2 (via A) | \infty | \infty |
| 1 | {A, C} (Min is C=2) | 0 | 3 (via C) | 2 (via A) | 10 (via C) | 12 (via C) |
| 2 | {A, C, B} (Min is B=3) | 0 | 3 (via C) | 2 | 8 (via B) | 12 (via C) |
| 3 | {A, C, B, D} (Min is D=8) | 0 | 3 | 2 | 8 (via B) | 10 (via D) |
| 4 | {A, C, B, D, E} (Min is E=10) | 0 | 3 | 2 | 8 | 10 (via D) |
Final Shortest Paths from Source A:
- Path to B: A \to C \to B (Cost = 3)
- Path to C: A \to C (Cost = 2)
- Path to D: A \to C \to B \to D (Cost = 8)
- Path to E: A \to C \to B \to D \to E (Cost = 10)
NAT (Network Address Translation) and PAT (Port Address Translation) Architecture with Visual Flow
Network Address Translation Architecture
Private LAN (RFC 1918) Public Internet
192.168.1.10:5000 ---\ NAT Router /---> 142.250.190.46:80 (Google)
[NAT Table] Public IP:203.0.113.1
192.168.1.20:6000 ---/ \---> 157.240.22.35:443 (FB)NAT / PAT Translation Table:
| Private Socket (Internal) | Public Mapped Socket (External) | Remote Destination Socket |
|---|---|---|
192.168.1.10:5000 | 203.0.113.1:40001 | 142.250.190.46:80 |
192.168.1.20:6000 | 203.0.113.1:40002 | 157.240.22.35:443 |
Key Benefits:
- IPv4 Address Conservation: Hundreds of private hosts share a single public routable IP.
- Security & Obfuscation: Internal workstation IP addresses are hidden from external Internet scanners.
Important Exam Points & Quick Revision
Be ready to perform subnetting calculations, draw the IPv4 header, and solve Dijkstra's algorithm step-by-step.
100% left on this page — finishing it closes the gap for Addressing, Internet Protocol & Routing Algorithms.
Addressing, Internet Protocol & Routing Algorithms still counts as a weak topic until you finish this note and answer its questions.
Practise this unitTest Your Understanding
Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.