Skip to content
Unit 3 Syllabus Note· Computer Networks

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.0 to 126.255.255.255 (Default mask: 255.0.0.0 or /8).
  • Class B: 128.0.0.0 to 191.255.255.255 (Default mask: 255.255.0.0 or /16).
  • Class C: 192.0.0.0 to 223.255.255.255 (Default mask: 255.255.255.0 or /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

  1. Discover (Client broadcast)
  2. Offer (Server unicast/broadcast)
  3. Request (Client requests offered IP)
  4. 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

DimensionIPv4IPv6
Address Length32 bits (4 bytes)128 bits (16 bytes)
NotationDotted-decimal (192.168.1.1)Hexadecimal colon (2001:0db8::1)
Total Address Space≈ 4.3 × 10^9≈ 3.4 × 10^{38}
Header SizeVariable (20 to 60 bytes)Fixed 40 bytes base header
BroadcastSupported nativelyEliminated; replaced by Multicast/Anycast
ConfigurationManual or DHCPStateless Address Autoconfiguration (SLAAC) or DHCPv6
IPSec SupportOptional add-onMandatory built-in architectural support
ChecksumHeader checksum verified at every hopChecksum 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
  1. Subnet Mask: Prefix /27 means 27 ones followed by 5 zeros:

11111111.11111111.11111111.11100000 = \mathbf{255.255.255.224}

  1. Host Bits ($h$): 32 - 27 = 5 bits.
  2. Total IP Addresses per Subnet: 2^5 = \mathbf{32}.
  3. Usable Host Addresses: 2^5 - 2 = \mathbf{30} hosts.
  4. Block Size (Magic Number): 256 - 224 = 32.
  5. 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)

  1. 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.
  2. Tunneling (e.g., 6to4, Teredo): Encapsulates native IPv6 packets inside standard IPv4 headers so they can traverse legacy IPv4 routing backbones.
  3. Header Translation (NAT-PT): A gateway translates IPv6 packet headers directly into IPv4 packet headers and vice versa, allowing direct communication between incompatible nodes.
DimensionDistance Vector (RIP)Link State (OSPF)
AlgorithmBellman-Ford algorithmDijkstra's Shortest Path First (SPF)
Routing ViewRouting by rumor (knows only neighbors)Full topological map of entire network area
MetricHop count (Max 15 hops; 16 = \infty)Cost inversely proportional to bandwidth
UpdatesFull table broadcast every 30 secondsTriggered Link-State Advertisements (LSAs) on changes
ConvergenceSlow; prone to routing loopsFast; loop-free convergence

In-Depth Analysis & Implementation

The Complete IPv4 Datagram Header Format and All Field Functions

IPv4 Datagram Header Structure (20–60 Bytes)

System Architecture / Concept DiagramHorizontal Scroll Enabled
 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 (or 6 for 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:

StepVisited Set (S)Shortest Distance to ADist to BDist to CDist to DDist to E
0{A}04 (via A)2 (via A)\infty\infty
1{A, C} (Min is C=2)03 (via C)2 (via A)10 (via C)12 (via C)
2{A, C, B} (Min is B=3)03 (via C)28 (via B)12 (via C)
3{A, C, B, D} (Min is D=8)0328 (via B)10 (via D)
4{A, C, B, D, E} (Min is E=10)032810 (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

System Architecture / Concept DiagramHorizontal Scroll Enabled
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:5000203.0.113.1:40001142.250.190.46:80
192.168.1.20:6000203.0.113.1:40002157.240.22.35:443

Key Benefits:

  1. IPv4 Address Conservation: Hundreds of private hosts share a single public routable IP.
  2. 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.

Your reading progress
0%

100% left on this page — finishing it closes the gap for Addressing, Internet Protocol & Routing Algorithms.

Weak topic hint

Addressing, Internet Protocol & Routing Algorithms still counts as a weak topic until you finish this note and answer its questions.

Practise this unit
What Should You Do Next?

Test Your Understanding

Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.