How unit 4 is examined
This unit covers host-to-host delivery: routing algorithms, IP addressing and subnetting, fragmentation, ICMP and IPv4 versus IPv6. The marks sit in IP addresses (subnetting numericals), ICMP, hierarchical routing, Bellman-Ford and IPv4 versus IPv6.
Network Layer: Need
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. The network layer moves packets from the source host to the destination host across many networks, which the data link layer (node to node) cannot do.
Key points.
- It gives every host a logical (IP) address that is independent of the hardware address.
- It packetizes data from the transport layer into datagrams and adds source and destination addresses.
- Routers use it to choose the path (routing) and to move each packet to the next hop (forwarding).
- <mark>The network layer provides host-to-host delivery, while the data link layer provides hop-to-hop delivery.</mark>
Services Provided
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. The network layer offers packetizing, addressing, routing, forwarding and (optionally) fragmentation to the transport layer, over a connectionless or connection-oriented service.
Key points.
- Circuit switching sets up a dedicated path before data flows, so delay is constant, but the line is idle when no data is sent.
- Message switching stores a whole message at each node and forwards it, so it needs big buffers and is slow.
- Datagram packet switching routes every packet independently, so packets can arrive out of order; no set-up is needed.
- Virtual-circuit packet switching sets up one path first and all packets follow it in order, using a circuit ID.
- <mark>Packet switching (datagram or virtual circuit) makes the best use of bandwidth, since links are shared.</mark>
Asked: [7 marks] (Jun 2026) Explain the functions of the Network Layer and discuss different switching techniques.
Design issues
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Design issues are the choices the network layer must make about the service it offers and how packets are moved.
Key points.
- Store-and-forward switching: a router receives a whole packet, checks it, then forwards it.
- Service type: connectionless (datagram) or connection-oriented (virtual circuit).
- Routing must be efficient, correct and robust, and must avoid congestion.
- <mark>Addressing, fragmentation to fit each link's MTU and congestion control are the other main issues.</mark>
Least Cost Routing
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. Least cost routing finds, for a source, the path to every destination whose total link cost (distance, delay or price) is the smallest.
Key points.
- Each link carries a cost, and the cost of a path is the sum of its link costs.
- The router keeps a cost table and picks the minimum-cost path to each destination.
- Dijkstra (link state) and Bellman-Ford (distance vector) are the two ways to compute it.
- Example from A: A-B 2, A-C 5, B-C 1, B-D 4, C-D 2 gives B=2, C=3 (via B), D=5 (via B, C).
Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u4-01" viewBox="0 0 338 252" width="338" height="252" role="img" aria-label="Least-cost path from A to D is A-B-C-D with cost 5"><style>#dsfig-u4-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u4-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u4-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u4-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u4-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u4-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u4-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u4-01 .t{fill:#16181D;font-weight:500}#dsfig-u4-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u4-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u4-01 .dot{fill:#16181D}#dsfig-u4-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u4-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u4-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u4-01 .ah{fill:#454C5A}#dsfig-u4-01 .ah.hi{fill:#2340B8}#dsfig-u4-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u4-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u4-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u4-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u4-01 .e{stroke:#B1B7C3}html.dark #dsfig-u4-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u4-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u4-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u4-01 .t{fill:#E6E8ED}html.dark #dsfig-u4-01 .t.inv{fill:#0F1115}html.dark #dsfig-u4-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u4-01 .dot{fill:#E6E8ED}html.dark #dsfig-u4-01 .ann{fill:#8FA3FF}html.dark #dsfig-u4-01 .lbl{fill:#858D9C}html.dark #dsfig-u4-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u4-01 .ah{fill:#B1B7C3}html.dark #dsfig-u4-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u4-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u4-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u4-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah10" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh10" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e hi" d="M55.8,115.5 L153.2,50.5"/><path class="e" d="M55.8,136.5 L153.2,201.5"/><path class="e hi" d="M169,59 L169,193"/><path class="e" d="M184.8,50.5 L282.2,115.5"/><path class="e hi" d="M184.8,201.5 L282.2,136.5"/><g class="wl hi"><rect x="94.9" y="74" width="19.2" height="18" rx="9"/><text class="t" x="104.5" y="83" dy=".35em" text-anchor="middle">2</text></g><g class="wl"><rect x="94.9" y="160" width="19.2" height="18" rx="9"/><text class="t" x="104.5" y="169" dy=".35em" text-anchor="middle">5</text></g><g class="wl hi"><rect x="159.4" y="117" width="19.2" height="18" rx="9"/><text class="t" x="169" y="126" dy=".35em" text-anchor="middle">1</text></g><g class="wl"><rect x="223.9" y="74" width="19.2" height="18" rx="9"/><text class="t" x="233.5" y="83" dy=".35em" text-anchor="middle">4</text></g><g class="wl hi"><rect x="223.9" y="160" width="19.2" height="18" rx="9"/><text class="t" x="233.5" y="169" dy=".35em" text-anchor="middle">2</text></g><circle class="n" cx="40" cy="126" r="18"/><text class="t" x="40" y="126" dy=".35em" text-anchor="middle">A</text><circle class="n" cx="169" cy="40" r="18"/><text class="t" x="169" y="40" dy=".35em" text-anchor="middle">B</text><circle class="n" cx="169" cy="212" r="18"/><text class="t" x="169" y="212" dy=".35em" text-anchor="middle">C</text><circle class="n" cx="298" cy="126" r="18"/><text class="t" x="298" y="126" dy=".35em" text-anchor="middle">D</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Least-cost path from A to D is A-B-C-D with cost 5</figcaption></figure>
Asked: [7 marks] (May 2023) Describe the working principle of Least Cost Routing using suitable example.
Dijkstra's algorithm
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Dijkstra's algorithm is a greedy, centralized algorithm that finds the shortest path from one source to all nodes when all costs are non-negative.
Key points.
- Step 1: set the source distance to 0 and all others to infinity.
- Step 2: pick the unvisited node with the least distance, mark it permanent and relax its neighbours ($d(v)=\min(d(v),d(u)+w)$).
- Step 3: repeat until all nodes are permanent.
- <mark>It runs in $O(V^2)$ and fails with negative edge weights.</mark>
Bellman-ford algorithm
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. Bellman-Ford finds the shortest path from a source by repeatedly relaxing every edge $V-1$ times. In networks it is Distance Vector routing: each router tells its neighbours its distance to every destination.
Key points.
- Start with distance 0 to itself and infinity to all others.
- Each round, every node applies $d_x(y)=\min_v\{c(x,v)+d_v(y)\}$ using vectors received from its neighbours.
- After at most $V-1$ rounds the distances settle, because a shortest path has at most $V-1$ edges.
- A further improvement in round $V$ reveals a negative cycle.
- Routers exchange vectors only with neighbours, so it is distributed; Dijkstra needs the full map.
- Bad news travels slowly, giving count-to-infinity; split horizon (do not advertise a route back to the neighbour it came from) reduces it.
Example. Same graph as above, source A (synchronous rounds):
| Round | B | C | D |
|---|---|---|---|
| 0 | inf | inf | inf |
| 1 | 2 | 5 | inf |
| 2 | 2 | 3 | 6 |
| 3 | 2 | 3 | 5 |
Round 4 brings no change, so the final distances are B=2, C=3, D=5.
| Basis | Bellman-Ford | Dijkstra |
|---|---|---|
| Approach | Relaxes all edges $V-1$ times | Greedy, picks nearest node |
| Negative weights | Handles them, detects negative cycles | Fails |
| Complexity | $O(VE)$ | $O(V^2)$ |
| Routing style | Distributed, neighbours only (RIP) | Centralized, full map (OSPF) |
| Weakness | Count-to-infinity | Needs the whole topology |
Answer frame. Open with the definition and the equation; draw the graph and the round table; develop points 1-4, then the comparison table; close with count-to-infinity and split horizon.
Asked: [7 marks] (Dec 2020) Describe the working of Bellman Ford Algorithm using suitable example. Asked: [7 marks] (May 2022, Dec 2024) Explain Distance Vector routing with example. / Describe the working principle of Bellman Ford algorithm using suitable example. Asked: [7 marks] (Jun 2026) Describe Bellman-Ford routing algorithm and compare it with Dijkstra's algorithm.
Hierarchical Routing
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. Routing is the process of choosing the path along which a packet travels from source to destination, using the routing table kept in each router. In hierarchical routing, routers are divided into regions and a router knows the details only of its own region.
Key points.
- In a large network, one table entry per router becomes too big, so the routers are grouped into regions (and regions into clusters and zones).
- A router keeps full entries for routers of its own region and a single entry for every other region.
- Traffic for another region is sent toward that region, and the routers inside it deliver the packet.
- This shrinks the tables, saves memory and CPU and cuts routing updates.
- The price is that paths may be longer than the true shortest path.
- Example: for 720 routers in 24 regions of 30, each table needs 30 + 23 = 53 entries instead of 720.
- The Internet does this with autonomous systems (AS): interior protocols (RIP, OSPF) inside, BGP between.
Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u4-02" viewBox="0 0 486 198" width="486" height="198" role="img" aria-label="Regions R1-R3 each contain routers; other regions appear as one entry"><style>#dsfig-u4-02 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u4-02 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u4-02 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u4-02 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u4-02 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u4-02 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u4-02 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u4-02 .t{fill:#16181D;font-weight:500}#dsfig-u4-02 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u4-02 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u4-02 .dot{fill:#16181D}#dsfig-u4-02 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u4-02 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u4-02 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u4-02 .ah{fill:#454C5A}#dsfig-u4-02 .ah.hi{fill:#2340B8}#dsfig-u4-02 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u4-02 .wl .t{font-size:12px;font-weight:700}#dsfig-u4-02 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u4-02 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u4-02 .e{stroke:#B1B7C3}html.dark #dsfig-u4-02 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u4-02 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u4-02 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u4-02 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u4-02 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u4-02 .t{fill:#E6E8ED}html.dark #dsfig-u4-02 .t.inv{fill:#0F1115}html.dark #dsfig-u4-02 .kd{stroke:#E6E8ED}html.dark #dsfig-u4-02 .dot{fill:#E6E8ED}html.dark #dsfig-u4-02 .ann{fill:#8FA3FF}html.dark #dsfig-u4-02 .lbl{fill:#858D9C}html.dark #dsfig-u4-02 .ptr{fill:#8FA3FF}html.dark #dsfig-u4-02 .ah{fill:#B1B7C3}html.dark #dsfig-u4-02 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u4-02 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u4-02 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u4-02 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah11" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh11" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><line class="e" x1="231" y1="39" x2="81" y2="103"/><line class="e" x1="231" y1="39" x2="231" y2="103"/><line class="e" x1="231" y1="39" x2="381" y2="103"/><line class="e" x1="81" y1="103" x2="31" y2="167"/><line class="e" x1="81" y1="103" x2="81" y2="167"/><line class="e" x1="81" y1="103" x2="131" y2="167"/><line class="e" x1="231" y1="103" x2="181" y2="167"/><line class="e" x1="231" y1="103" x2="231" y2="167"/><line class="e" x1="231" y1="103" x2="281" y2="167"/><line class="e" x1="381" y1="103" x2="331" y2="167"/><line class="e" x1="381" y1="103" x2="381" y2="167"/><line class="e" x1="381" y1="103" x2="431" y2="167"/><rect class="n" x="189.5" y="24" width="83" height="30" rx="8"/><text class="t" x="231" y="39" dy=".35em" text-anchor="middle">Internet</text><circle class="n" cx="81" cy="103" r="17"/><text class="t" x="81" y="103" dy=".35em" text-anchor="middle">R1</text><circle class="n" cx="31" cy="167" r="17"/><text class="t" x="31" y="167" dy=".35em" text-anchor="middle">a</text><circle class="n" cx="81" cy="167" r="17"/><text class="t" x="81" y="167" dy=".35em" text-anchor="middle">b</text><circle class="n" cx="131" cy="167" r="17"/><text class="t" x="131" y="167" dy=".35em" text-anchor="middle">c</text><circle class="n" cx="231" cy="103" r="17"/><text class="t" x="231" y="103" dy=".35em" text-anchor="middle">R2</text><circle class="n" cx="181" cy="167" r="17"/><text class="t" x="181" y="167" dy=".35em" text-anchor="middle">d</text><circle class="n" cx="231" cy="167" r="17"/><text class="t" x="231" y="167" dy=".35em" text-anchor="middle">e</text><circle class="n" cx="281" cy="167" r="17"/><text class="t" x="281" y="167" dy=".35em" text-anchor="middle">f</text><circle class="n" cx="381" cy="103" r="17"/><text class="t" x="381" y="103" dy=".35em" text-anchor="middle">R3</text><circle class="n" cx="331" cy="167" r="17"/><text class="t" x="331" y="167" dy=".35em" text-anchor="middle">g</text><circle class="n" cx="381" cy="167" r="17"/><text class="t" x="381" y="167" dy=".35em" text-anchor="middle">h</text><circle class="n" cx="431" cy="167" r="17"/><text class="t" x="431" y="167" dy=".35em" text-anchor="middle">i</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Regions R1-R3 each contain routers; other regions appear as one entry</figcaption></figure>
<mark>Hierarchical routing reduces routing-table size by grouping routers into regions, at the cost of slightly longer paths.</mark>
Answer frame. Open with the definition of routing and its table; draw the region tree; give points 1-7; then cover broadcast and multicast from their sections in two lines each; close with the table-size example.
Asked: [14 marks] (Dec 2020) What do you mean by Routing? Explain Hierarchical, Broadcast and multicast routing.
Broadcast Routing
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. Broadcast routing delivers a packet from one source to all hosts in the network.
Key points.
- Methods: flooding (send on every line except the arrival line), multidestination routing, and a spanning tree with reverse path forwarding.
- Flooding is simple but creates duplicates and wastes bandwidth.
- Multicast sends only to members of a group, so it uses bandwidth better; broadcast reaches everybody.
| Basis | Broadcast | Multicast |
|---|---|---|
| Receivers | All nodes | Only group members |
| Address | Broadcast address (all 1s) | Class D group address |
| Tree | One spanning tree of all nodes | Tree pruned to the group |
| Bandwidth | High, wasted on non-members | Low |
| Protocols | Flooding, RPF | DVMRP, MOSPF, PIM |
Asked: [7 marks] (Dec 2024) Give the basic difference between broad cast and multicast routing.
Multicast Routing
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Multicast routing sends one copy of a packet to every member of a group identified by a class D address, using a tree so that each link carries the packet once.
Key points.
- Hosts join a group through IGMP; routers build a multicast spanning tree per group.
- Branches with no members are pruned.
- Protocols: DVMRP, MOSPF and PIM.
- <mark>One packet is copied only where the tree branches, so it saves bandwidth.</mark>
IP Addresses
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. An IPv4 address is a unique 32-bit logical address of a host, written in dotted decimal as four bytes, split into a network ID and a host ID. A subnet mask is a 32-bit number with 1s over the network (and subnet) bits and 0s over the host bits. Subnetting divides one network into smaller subnets by borrowing host bits.
Key points.
- Class A starts with bit 0, so it ranges 1.0.0.0 to 126.255.255.255, with 8 network bits and 24 host bits.
- Class B starts with 10, ranging 128.0.0.0 to 191.255.255.255, with 16 network and 16 host bits.
- Class C starts with 110, ranging 192.0.0.0 to 223.255.255.255, with 24 network and 8 host bits.
- Class D starts with 1110 (224 to 239) and is used for multicast; Class E starts with 1111 (240 to 255) and is reserved.
- Hosts per network are $2^h-2$, since the all-0 network address and all-1 broadcast address are unusable.
- The default masks are 255.0.0.0, 255.255.0.0 and 255.255.255.0 for A, B and C.
- The network address is found by ANDing the IP address with the mask.
| Class | Networks | Hosts per network |
|---|---|---|
| A | $2^7-2=126$ | $2^{24}-2=16{,}777{,}214$ |
| B | $2^{14}=16{,}384$ | $2^{16}-2=65{,}534$ |
| C | $2^{21}=2{,}097{,}152$ | $2^8-2=254$ |
Example 1. Given 211.17.180.0/24 and 32 subnets.
| Step | Working |
|---|---|
| Bits borrowed | $2^5=32$, so 5 bits; new prefix $24+5=$ /29 |
| a) Mask | 255.255.255.248 |
| b) Addresses per subnet | $2^{32-29}=2^3=8$ (6 usable) |
| c) First subnet | 211.17.180.0/29: first 211.17.180.0, last 211.17.180.7 |
| d) Last subnet | 211.17.180.248/29: first 211.17.180.248, last 211.17.180.255 |
Mask 255.255.255.248, 8 addresses per subnet, first block .0-.7 and last block .248-.255.
Example 2. Host 25.34.12.56, mask 255.255.0.0 (Class A). AND byte by byte: 25 AND 255 = 25; 34 AND 255 = 34; 12 AND 0 = 0; 56 AND 0 = 0. Network address = 25.34.0.0.
==Network address = IP address AND subnet mask.==
Answer frame. For the theory question, open with the definitions, give the class table and one mask example per class, and close with the ANDing rule. For numericals, write Given, then the bits borrowed, the new prefix and mask, the block size, and the first and last addresses.
Asked: [14 marks] (Dec 2020) Define subnetting? What is the network address in a class A subnet with the IP address of one of the Hosts as 25.34.12.56 and mask 255.255.0.0? Asked: [14 marks] (May 2024, Jun 2025) An organization is granted the block 211.17.180.0/24. The administrator wants to create 32 subnets. Find (a) the subnet mask, (b) the number of addresses in each subnet, (c) the first and last address in the first subnet, (d) the first and last address in the last subnet. Asked: [7 marks] (May 2022, May 2024) What is subnet mask? Explain different classes of IP address (network-ID bits, host-ID bits, number of hosts, number of networks and range).
Header format
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. The IPv4 header is 20 to 60 bytes long and carries the control information for a datagram.
Key points.
- Version (4 bits), IHL (4), type of service (8) and total length (16) come first.
- Identification, flags (DF, MF) and fragment offset (13 bits) support fragmentation.
- TTL (8) limits hops, protocol (8) names the upper layer, and the header checksum (16) covers the header only.
- <mark>Source and destination addresses (32 bits each) follow, then options and padding.</mark>
Packet forwarding
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Forwarding is the router action of taking a packet from an input line and sending it out on the correct output line, using the forwarding table.
Key points.
- Next-hop forwarding: the table stores only the next router, not the full path.
- The destination address is matched against the mask of each entry; the longest matching prefix wins.
- If no entry matches, the packet goes to the default route.
- <mark>Routing builds the table; forwarding uses it.</mark>
Fragmentation and reassembly
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. Fragmentation splits a datagram into smaller pieces when it is larger than the MTU (maximum transfer unit) of the next link; reassembly joins them again at the destination only.
Key points.
- Each fragment copies the identification field, so the destination knows which fragments belong together.
- Fragment offset gives the position of the data in units of 8 bytes, and the MF (more fragments) flag is 1 for all fragments except the last.
- Example: 4000-byte datagram (20 header + 3980 data), MTU 1500, so data per fragment is 1480 (a multiple of 8).
| Fragment | Total length | Offset | MF |
|---|---|---|---|
| 1 | 1500 | 0 | 1 |
| 2 | 1500 | 185 | 1 |
| 3 | 1040 (1020 data) | 370 | 0 |
- The destination sorts by offset and stops when the MF=0 fragment arrives with no gap.
Asked: [7 marks] (Dec 2024) Explain the Fragmentation and reassembly using suitable example. Asked: [7 marks] (May 2023) Short note: Fragmentation and reassembly.
ICMP
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. ICMP (Internet Control Message Protocol) is a network-layer companion of IP that reports errors and gives diagnostic information; it does not correct errors and it does not carry user data.
Diagram. ICMP header (encapsulated in the data field of an IP datagram, protocol number 1):
| Type (8 bits) | Code (8 bits) | Checksum (16 bits) |
|---|---|---|
| Rest of header (32 bits): identifier and sequence number, or unused | ||
| Data: IP header plus first 8 bytes of the offending datagram (error messages) |
Key points.
- Error-reporting messages include destination unreachable, source quench, time exceeded (TTL reaches 0), parameter problem and redirect.
- Query messages include echo request and echo reply (used by ping) and timestamp request and reply.
- Type gives the message class, code gives the sub-reason (for example, network or host unreachable), and the checksum covers the ICMP message.
- ICMP travels inside an IP datagram, so it is an unreliable best-effort message like any other IP packet.
- Traceroute sends packets with increasing TTL and reads the time-exceeded replies.
- ICMP never reports errors about ICMP error messages, to avoid loops.
Checksum (Dec 2020). An error-detection method: the sender splits the data into 16-bit words, adds them with wraparound carry, complements the sum and sends it; the receiver adds everything including the checksum and accepts the data only if the result is all 1s.
FTP (Dec 2020). FTP (File Transfer Protocol) is an application-layer protocol on TCP, with a control connection (port 21) for commands and a data connection (port 20) for files. Modes are active and passive, and data transfer is in stream, block or compressed mode.
<mark>ICMP reports errors and queries about IP delivery; it has Type, Code and Checksum fields and rides inside IP.</mark>
Answer frame. For the note, open with the definition; draw the header table; list error and query messages with types; close with the IP encapsulation and ping. For the three-term question, give two or three lines for each of checksum, FTP and ICMP.
Asked: [14 marks] (Dec 2020) Explain the following terms: i) Check sum ii) FTP iii) ICMP. Asked: [7 marks] (May 2023) Write a brief note on ICMP (Internet Control Message Protocol) using its frame formats.
Comparative study of IPv4 & IPv6
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. IPv4 uses 32-bit addresses (about 4.3 billion) and IPv6 uses 128-bit addresses, designed to fix address exhaustion and to add security, simpler headers and auto-configuration.
Key points.
- IPv6 has a fixed 40-byte header, while IPv4 has a variable 20 to 60 byte header.
- IPv6 removes the header checksum, so routers work faster.
- IPv6 fragments only at the source; IPv4 routers can fragment too.
- IPv6 supports auto-configuration and has built-in IPSec; IPv4 needs DHCP and optional IPSec.
- IPv6 uses a flow label for QoS, while IPv4 uses the type of service field.
- IPv6 has no broadcast, only unicast, multicast and anycast; ARP is replaced by neighbour discovery.
| Basis | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Notation | Dotted decimal, 192.168.1.1 | Hexadecimal with colons, 2001:db8::1 |
| Header | 20-60 bytes, variable | 40 bytes, fixed |
| Checksum | Present | Absent |
| Fragmentation | Source and routers | Source only |
| Security | Optional IPSec | Built-in IPSec |
| QoS | Type of service | Flow label |
| Configuration | Manual or DHCP | Auto-configuration |
Advantages and limitations. IPv4 is universal and simple but has a small address space and no built-in security. IPv6 has a huge address space and a faster header but needs a costly transition and is not compatible with IPv4 without tunnelling.
Answer frame. Open with the two address sizes; draw the table; add the advantages and limitations of each; close with the transition methods (dual stack, tunnelling).
Asked: [7 marks] (May 2023, Jun 2026) Give the comparative study of IPv4 and IPv6. / Compare IPv4 and IPv6 protocols highlighting their advantages and limitations.
Last-minute revision
- Network layer gives host-to-host delivery; data link gives hop-to-hop.
- Dijkstra is greedy, centralized, $O(V^2)$, no negative weights; Bellman-Ford is $O(VE)$, distributed.
- Bellman-Ford runs $V-1$ rounds; a further change means a negative cycle.
- Split horizon fights count-to-infinity.
- Class ranges: A 1-126, B 128-191, C 192-223, D 224-239, E 240-255.
- Hosts = $2^h-2$; network address = IP AND mask.
- 211.17.180.0/24 with 32 subnets gives /29, mask 255.255.255.248, 8 addresses.
- 25.34.12.56 with 255.255.0.0 gives network 25.34.0.0.
- Fragment offset is in units of 8 bytes; MF=0 marks the last fragment.
- ICMP header: Type, Code, Checksum; it rides inside IP (protocol 1).
- IPv6: 128 bits, 40-byte header, no checksum, built-in IPSec.
Memory hooks
- Three networks in the network layer: "Route, Address, Packetize".
- Class prefix bits: 0, 10, 110, 1110, 1111 for A to E.
- Bellman-Ford = "Ask your neighbours"; Dijkstra = "See the whole map".
- Borrowed bits = $\log_2$(subnets); prefix goes up by that many.
- ICMP = Internet's complaint department: it reports, never repairs.
Coverage checklist
- Network Layer: Need: covered.
- Services Provided: Q14 (Jun 2026).
- Design issues: covered.
- Routing algorithms: Least Cost Routing algorithm: Q13 (May 2023).
- Dijkstra's algorithm: covered.
- Bellman-ford algorithm: Q5, Q6, Q7 (Dec 2020, May 2022, Dec 2024, Jun 2026).
- Hierarchical Routing: Q1 (Dec 2020).
- Broadcast Routing: Q8 (Dec 2024).
- Multicast Routing: covered.
- IP Addresses: Q3, Q4, Q12 (Dec 2020, May 2022, May 2024, Jun 2025).
- Header format: covered.
- Packet forwarding: covered.
- Fragmentation and reassembly: Q10 (Dec 2024), May 2023 note.
- ICMP: Q2 (Dec 2020), Q11 (May 2023).
- Comparative study of IPv4 & IPv6: Q9 (May 2023, Jun 2026).