The network layer is responsible for host-to-host delivery across multiple networks. For PSC Computer Engineer, this chapter needs routing logic, IP addressing, subnetting idea, ICMP, fragmentation and protocol comparison.
Engineering Definitions
IP datagram
Standard definition: A network-layer packet used by IP to carry data from source host to destination host.
Exam meaning: Source IP बाट destination IP सम्म जाने packet।
Routing
Standard definition: The process of selecting a path for packets from source network to destination network.
Exam meaning: Router ले कुन next hop बाट packet पठाउने निर्णय गर्ने प्रक्रिया।
ICMP
Standard definition: Internet Control Message Protocol carries error and diagnostic messages for IP.
Exam meaning: IP मा error/diagnostic message पठाउने protocol, जस्तै ping मा echo।
Concept Teaching
Router does not care about application data. It reads destination IP, checks routing table, decrements TTL, may fragment if MTU requires, and sends packet to next hop. Routing protocols build routing information; forwarding uses the already-built table.
Engineering Mechanism
- Host creates IP datagram with source/destination IP.
- Router receives frame, extracts IP packet, checks destination IP.
- Router performs longest-prefix match in routing table.
- TTL is decremented; checksum/header updated in IPv4.
- Packet is forwarded to next hop, possibly fragmented if needed.
Diagrams / Models To Draw
- Draw IPv4 header fields: source, destination, TTL, protocol, fragment fields.
- Draw subnet with host bits/network bits.
- Draw routing table and longest-prefix match example.
- Draw RIP distance-vector and OSPF link-state view.
Formulas, Fields and Algorithms
- IPv4 address length = 32 bits; IPv6 address length = 128 bits.
- Usable hosts in ordinary IPv4 subnet = 2^h – 2.
- CIDR /n means n network prefix bits and 32-n host bits for IPv4.
- RIP metric: hop count; OSPF metric commonly cost based on bandwidth.
| Protocol/Concept | Engineering role | Exam distinction |
|---|---|---|
| RIP | Distance-vector routing | Hop count, slower convergence |
| OSPF | Link-state routing | LSA, topology database, Dijkstra |
| ICMP | Error/control messages | Ping/traceroute related |
| IPv6 | Larger addressing and simplified header | 128-bit address |
Exam Point
- Differentiate routing and forwarding clearly.
- RIP vs OSPF is a high-yield comparison.
- IPv6 is not just “more addresses”; mention simplified header, extension headers, autoconfiguration.
Worked Example
For 192.168.10.0/24, host bits = 8, usable hosts = 2^8 – 2 = 254. A router receiving packet for 192.168.10.55 chooses route with longest matching prefix.
Subjective Answer Pattern
- Define network layer service.
- Explain IP datagram delivery and router operation.
- Add addressing/subnetting logic.
- Compare RIP and OSPF.
- Conclude with IPv6 improvements.
Common Engineering Mistakes
- Writing routing protocol and routed protocol as same.
- Forgetting longest-prefix match.
- Saying ICMP corrects errors; it reports errors.
MCQ Revision
- IPv4 length?
- IPv6 length?
- RIP metric?
- OSPF algorithm?
- ICMP used by ping?
Final Summary
- Network layer gives inter-network delivery.
- Routers forward using destination IP and routing table.
- RIP and OSPF differ in algorithm, metric and convergence.