- Identify the OSI operating layer and forwarding logic for all major network devices.
- Contrast collision domains (Layer 1/2) with broadcast domains (Layer 2/3).
- Understand transparent bridging algorithms (learning, filtering, forwarding, aging).
| Device | OSI Layer | Primary Forwarding Logic | Key Operational Characteristic |
|---|---|---|---|
| NIC (Network Interface Card) | Layer 1 & 2 | Hardware MAC address (48-bit hex) | Gives host physical connection to medium; contains burned-in MAC address (e.g. 00:1A:2B:3C:4D:5E). |
| Repeater | Layer 1 (Physical) | Electrical signal regeneration | Regenerates and amplifies weak electrical/optical signals to overcome cable attenuation; does NOT inspect bits. |
| Hub | Layer 1 (Physical) | Blind electrical broadcasting to all ports | Multiport repeater; any bit received on one port is blindly repeated to all other ports. Half-duplex only. |
| Bridge | Layer 2 (Data Link) | Destination MAC address table | Connects two LAN segments; filters and forwards frames using a dynamically learned MAC table to isolate traffic. |
| Switch | Layer 2 (Data Link) | Hardware-based MAC table (CAM table) | Multiport bridge; creates dedicated, micro-segmented full-duplex links per port. Eliminates collisions! |
| Router | Layer 3 (Network) | Destination IP address routing table | Connects different logical subnets and autonomous systems; finds optimal paths using routing protocols (RIP, OSPF, BGP). |
| Gateway | Layers 4 to 7 | Application payload & protocol translation | Translates between fundamentally incompatible architectures (e.g. IBM SNA to TCP/IP, or email to SMS). |
| Firewall | Layers 3, 4 & 7 | Security rules (IP, Port, Protocol, State) | Inspects incoming and outgoing traffic to permit or block packets based on organizational security policies. |
| Evaluation Parameter | Collision Domain | Broadcast Domain |
|---|---|---|
| Definition | A network segment where simultaneous transmissions cause data signals to collide and corrupt. | A network segment where a broadcast packet sent by one device is received by all other devices on the segment. |
| Operating Layer | Layer 1 (Physical) & Layer 2 (Data Link). | Layer 2 (Data Link) & Layer 3 (Network). |
| Behavior on a Hub | 1 Single Shared Collision Domain across all connected ports. | 1 Single Shared Broadcast Domain across all ports. |
| Behavior on a Switch | $N$ Separate Collision Domains ($1$ dedicated collision domain per port). | 1 Single Broadcast Domain; switches flood broadcast frames (MAC FF:FF:FF:FF:FF:FF) out all ports! |
| Device that Breaks It | Bridges and Switches break and isolate collision domains. | Routers break and isolate broadcast domains (preventing broadcast storms). |
The Physical layer transmits an unstructured raw stream of bits. The Data Link Layer must break this stream into discrete units called Frames so the receiver knows where each packet begins and ends.
| Framing Method | How It Operates | Fatal Weakness / Limitation |
|---|---|---|
| 1. Character Count | First field in frame header is an integer specifying the total number of characters in the frame. | Catastrophic Desynchronization: If a single transmission bit error corrupts the count field, the receiver cannot find the boundary of any subsequent frame! |
| 2. Byte Stuffing | Frames are framed by special flag bytes (e.g. DLE STX and DLE ETX). An escape byte (DLE) is inserted before any data byte that happens to match a flag byte. |
Tied strictly to 8-bit character encodings (ASCII); not bit-oriented. |
| 3. Bit Stuffing (HDLC) | Each frame starts and ends with the 8-bit flag 01111110. Whenever the sender's hardware detects five consecutive 1s in user payload, it automatically injects a 0. |
Universal & Bit-Oriented: Works with any arbitrary sequence of bits regardless of character encoding. |
• Transmitter Rule: Begin with flag
01111110. Scan the payload data stream. Whenever you see five consecutive 1s ($11111$), immediately insert a 0 after the fifth 1. End with flag 01111110.• Receiver Rule: When five consecutive 1s are encountered:
- If the 6th bit is 0 $\implies$ It is a stuffed bit! Discard the 0 and keep reading payload data.
- If the 6th bit is 1 and 7th bit is 0 ($01111110$) $\implies$ End of Frame flag detected!
- If the 6th bit is 1 and 7th bit is 1 ($01111111$) $\implies$ Transmission error / abort flag!
Bit-stuff the following binary payload bitstream:
011011111110111110010Step 1: Scan bitstream for groups of five consecutive 1s:
0 1 1 0 1 1 1 1 1 [stuff 0] 1 1 0 1 1 1 1 1 [stuff 0] 0 0 1 0Step 2: Stuffed payload:
01101111101101111100010Step 3: Final Transmitted Frame (enclosed between flags):
01111110 01101111101101111100010 01111110
Receiver receives the stuffed frame:
01111110 1111100111110101111100 01111110. Recover the original user data.Step 1: Strip the starting and ending flags
01111110.Step 2: Scan for five consecutive 1s followed by 0, and remove the zero:
•
11111[0]0 $\to$ remove 0 $\implies 111110$•
11111[0]1 $\to$ remove 0 $\implies 111111$•
011111[0]0 $\to$ remove 0 $\implies 0111110$Recovered Original Data:
111110 111111 0111110
An IPv4 address consists of 32 bits grouped into four 8-bit octets, represented in dotted-decimal format (e.g. 192.168.1.1).
| Class | Leading Bits | 1st Octet Range | Default Subnet Mask | Net ID / Host ID Split | Max Usable Hosts / Network |
|---|---|---|---|---|---|
| Class A | 0 |
$1 - 126$ ($127$ reserved for loopback) | $255.0.0.0$ (/8) | $8 \text{ bits Net} \mid 24 \text{ bits Host}$ | $2^{24} - 2 = \mathbf{16,777,214}$ |
| Class B | 10 |
$128 - 191$ | $255.255.0.0$ (/16) | $16 \text{ bits Net} \mid 16 \text{ bits Host}$ | $2^{16} - 2 = \mathbf{65,534}$ |
| Class C | 110 |
$192 - 223$ | $255.255.255.0$ (/24) | $24 \text{ bits Net} \mid 8 \text{ bits Host}$ | $2^8 - 2 = \mathbf{254}$ |
| Class D | 1110 |
$224 - 239$ | None | Multicast Groups | N/A |
| Class E | 1111 |
$240 - 255$ | None | Experimental / Research | N/A |
- Loopback Address (127.0.0.1 / 127.0.0.0/8): Used for testing the internal software network stack on the local host without sending packets to any network card.
- Private RFC 1918 Ranges:
- Class A Private:
10.0.0.0to10.255.255.255(1 single /8 network) - Class B Private:
172.16.0.0to172.31.255.255(16 contiguous /16 networks) - Class C Private:
192.168.0.0to192.168.255.255(256 contiguous /24 networks)
- Class A Private:
An organization is assigned the network block $192.168.10.0/26$. Determine:
- Subnet Mask in dotted decimal format
- Total number of subnets created
- Number of usable hosts per subnet
- The complete subnet breakdown (Network ID, Host Range, Broadcast Address)
$26$ consecutive binary 1s: $11111111.11111111.11111111.11000000_2$
Fourth octet: $128 + 64 = 192 \implies \mathbf{255.255.255.192}$.
Default Class C uses 24 network bits. Here 2 additional bits are borrowed ($26 - 24 = 2$ bits):
$$\text{Number of Subnets} = 2^2 = \mathbf{4 \text{ Subnets}}$$
Remaining host bits = $32 - 26 = 6$ bits.
Subtract 2 addresses (Network ID and Directed Broadcast ID):
$$\text{Usable Hosts} = 2^6 - 2 = 64 - 2 = \mathbf{62 \text{ Hosts / Subnet}}$$
| Subnet # | Network ID | First Usable Host | Last Usable Host | Broadcast Address |
|---|---|---|---|---|
| Subnet 0 | 192.168.10.0 |
192.168.10.1 |
192.168.10.62 |
192.168.10.63 |
| Subnet 1 | 192.168.10.64 |
192.168.10.65 |
192.168.10.126 |
192.168.10.127 |
| Subnet 2 | 192.168.10.128 |
192.168.10.129 |
192.168.10.190 |
192.168.10.191 |
| Subnet 3 | 192.168.10.192 |
192.168.10.193 |
192.168.10.254 |
192.168.10.255 |
A university campus is assigned $172.16.0.0/19$. Calculate:
- Subnet Mask: $/19$ prefix $\implies 11111111.11111111.11100000.00000000_2 = \mathbf{255.255.224.0}$.
- Subnet Bits borrowed from Class B default (/16): $19 - 16 = 3$ bits $\implies 2^3 = \mathbf{8 \text{ Subnets}}$.
- Usable hosts per subnet: $32 - 19 = 13$ host bits $\implies 2^{13} - 2 = 8192 - 2 = \mathbf{8,190 \text{ Usable Hosts}}$.
- Block size in 3rd octet = $256 - 224 = 32$. First subnet:
172.16.0.0to172.16.31.255.
Routing is the process by which routers dynamically discover paths across interconnected networks and construct optimal forwarding tables.
| Evaluation Parameter | Distance Vector Routing (Bellman-Ford) | Link State Routing (Dijkstra's SPF) |
|---|---|---|
| Information Exchanged | Sends its entire routing table (vector of distances to all known destinations). | Sends only the status of its directly connected links (Link State Packet / LSP). |
| Recipient of Updates | Sends updates strictly to immediate directly connected neighbors only. | Floods Link State Packets to every router in the entire network. |
| Network Knowledge | "Routing by rumor": Each node trusts its neighbors' reports without global topology knowledge. | Every router builds a complete, identical mathematical map of the entire network topology graph. |
| Shortest Path Calculation | Bellman-Ford equation: $D_x(y) = \min_v \{c(x,v) + D_v(y)\}$. | Dijkstra's Shortest Path First (SPF) algorithm executed locally. |
| Convergence Speed | Slow convergence; vulnerable to routing loops and Count-to-Infinity. | Fast convergence; zero routing loops. |
| Standard Protocols | Routing Information Protocol (RIP, max 15 hops), IGRP. | Open Shortest Path First (OSPF), IS-IS. |
When a link breaks in Distance Vector routing, two adjacent routers can update each other iteratively, incrementing hop count indefinitely ($2 \to 3 \to 4 \dots \to \infty$) until reaching infinity ($16$ in RIP).
• Split Horizon: A router never advertises a route back out the same interface through which it learned it.
• Poison Reverse: When advertising a route back to the neighbor it was learned from, mark its metric as $\infty$ (poisoned) to prevent loops!
Congestion occurs when the number of packets entering a network exceeds the handling capacity of intermediate links and buffers. Traffic Shaping regulates packet transmission rates to prevent router buffer overflow.
| Evaluation Parameter | Leaky Bucket Algorithm | Token Bucket Algorithm |
|---|---|---|
| Output Transmission Rate | Strictly constant, smooth rate regardless of how bursty the incoming traffic is. | Allows controlled bursts of high-speed traffic as long as tokens are available in the bucket. |
| Handling Bursty Traffic | Bursts are smoothed out; if the bucket fills, incoming excess packets are discarded immediately. | Bursts are transmitted instantly up to token capacity without packet loss. |
| Token Accumulation | No token concept; operates like a physical bucket with a constant hole at the bottom. | Tokens are deposited into the bucket at a constant rate $r$ up to capacity $C$. Each packet consumes 1 token. |
| Primary Application | ATM networks, traffic policing. | Modern IP QoS, DiffServ, video streaming over Internet. |
Let token generation rate be $r$ bytes/sec, bucket capacity be $C$ bytes, and maximum physical burst transmission rate be $M$ bytes/sec (where $M > r$). The maximum burst duration $S$ is: $$\mathbf{S = \frac{C}{M - r}} \quad \text{seconds}$$
IPv4 20-Byte Base Header Format:
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Header Field | Size | Technical Function |
|---|---|---|
| Version | 4 bits | Identifies IP version (0100 for IPv4, 0110 for IPv6). |
| IHL (Header Length) | 4 bits | Header length in 32-bit (4-byte) words. Minimum value is 5 ($5 \times 4 = 20$ bytes). |
| Total Length | 16 bits | Total size of packet (header + payload) in bytes. Maximum is $2^{16}-1 = 65,535$ bytes. |
| TTL (Time to Live) | 8 bits | Hop counter decremented by 1 at every router. When TTL reaches 0, router drops packet and sends ICMP Time Exceeded (prevents infinite packet loops!). |
| Protocol | 8 bits | Identifies higher transport protocol: 6 for TCP, 17 for UDP, 1 for ICMP. |
1. Dual Stack: Routers and hosts run both IPv4 and IPv6 protocol stacks concurrently.
2. Tunneling: IPv6 packets are encapsulated inside IPv4 packets to traverse legacy IPv4 networks (e.g. 6to4).
3. Network Address Translation - Protocol Translation (NAT-PT): Translates IPv6 packet headers directly into IPv4 headers.
- OSI Layer Mapping (2 Marks): State the exact OSI layer for each device (Repeater/Hub: Layer 1, Bridge/Switch: Layer 2, Router: Layer 3, Gateway: Layer 4-7).
- Domain Analysis (3 Marks): Clearly explain how Hubs share collision domains, Switches break collision domains, and Routers break broadcast domains.
- Working Mechanism (3 Marks): Mention that Switches forward frames using MAC addresses, while Routers forward packets using IP routing tables.
- Summary Table (2 Marks): Draw a clean comparison table summarizing all 5 devices.
• Forgetting to subtract 2 for usable hosts: Total hosts is $2^h$, but usable hosts is ALWAYS $2^h - 2$ because the all-zeros host address is the Network ID and the all-ones host address is the Directed Broadcast Address!
• Confusing Collision Domains and Broadcast Domains on a Switch: A switch creates separate collision domains for every port, but all ports still belong to a SINGLE broadcast domain!
Answer all 10 questions covering network hardware layers, collision domains, bit stuffing, and IPv4 subnetting.