Network Layer MCQs for NSCT
The network layer moves packets from a source host to a destination host across many networks, using logical (IP) addresses and routers. It is topic 4 of the Computer Networks and Cloud Computing area, which carries 10% of the NSCT according to HEC's Areas of Competencies. Networks was one of the weakest areas in 2026, at 39.6% accuracy, per the HEC NSCT report and APP, and subnetting arithmetic is a big reason to practise this topic.
The layer sits above the data link layer, which only delivers frames across one link, and below the transport layer, which delivers data to processes.
IPv4
IPv4 (Internet Protocol version 4) is the connectionless, best-effort protocol that carries most Internet traffic. An address is 32 bits, written as four decimal octets such as 192.168.10.77. The header is 20 to 60 bytes and includes TTL (time to live), protocol, checksum, and the fields used for fragmentation.
| Field | What it does |
|---|---|
| TTL | Decremented by 1 at each router; the packet is dropped at 0 |
| Header checksum | Covers the header only, so routers recompute it after changing TTL |
| Identification, flags, fragment offset | Let the destination reassemble fragments |
Private ranges (RFC 1918) are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Exam angle: fragment offsets count 8-byte units, not bytes.
Subnetting
Subnetting splits one network into smaller ones by borrowing host bits for the network part. With h host bits, a subnet has 2^h addresses and 2^h − 2 usable hosts, because the all-zeros (network) and all-ones (broadcast) addresses are reserved.
Example: 192.168.1.0/26 has 6 host bits, so 64 addresses and 62 usable hosts. Its mask is 255.255.255.192 and its broadcast address is 192.168.1.63.
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
Exam angle: find the block size (256 minus the interesting mask octet), then the multiple of it that contains the host. For full drills, see subnetting practice.
CIDR
CIDR (Classless Inter-Domain Routing) replaced the old Class A, B and C system with a prefix length written after a slash, such as /22. It allows blocks of any size and lets routers advertise one summary instead of many routes.
Example: 200.10.0.0/24, 200.10.1.0/24, 200.10.2.0/24 and 200.10.3.0/24 aggregate exactly to 200.10.0.0/22. Routers forward with longest-prefix match: when several routes contain the destination, the most specific one wins. Exam angle: a summary must not cover blocks you do not own, or it attracts traffic you cannot deliver.
Routing
Routing builds the tables that forwarding uses. Forwarding is the local, per-packet step of choosing an output port; routing is the network-wide process that fills the table.
| Distance vector | Link state | |
|---|---|---|
| Knowledge | Neighbours' distance estimates | Full map of the area |
| Algorithm | Bellman-Ford | Dijkstra |
| Example | RIP (16 hops = infinity) | OSPF |
| Known weakness | Count-to-infinity | Flooding overhead |
BGP is a path-vector protocol used between autonomous systems. Example: if A reaches B at cost 2 and B is 5 from D, while A reaches C at cost 4 and C is 1 from D, then A's cost to D is min(2 + 5, 4 + 1) = 5, via C. Exam angle: add your own link cost before comparing neighbours' distances. The routing algorithms page goes deeper.
IPv6
IPv6 uses 128-bit addresses written as eight hexadecimal groups. You may drop leading zeros in each group and replace one run of zero groups with ::. For example, fe80:0000:0000:0000:0202:b3ff:fe1e:8329 becomes fe80::202:b3ff:fe1e:8329.
The base header is a fixed 40 bytes with no checksum. Routers never fragment; only the source does. There is no broadcast, so multicast takes its place. Exam angle: :: may appear only once in an address.
Common traps
- Forgetting the "− 2" for usable hosts, or applying it when the question asks for total addresses.
- Picking the longest prefix in the table even when it does not contain the destination.
- Writing fragment offsets in bytes instead of 8-byte units.
- Assuming two hosts are on the same subnet because they share the first three octets, without checking the mask.
- Confusing RIP's maximum of 15 hops with its "infinity" value of 16.
- Using
::twice when compressing an IPv6 address.
Worked examples
Understanding. Which IPv4 header field stops a packet from circling a routing loop forever? Answer: TTL. Each router decrements it and discards the packet at 0, sending an ICMP Time Exceeded message back to the source.
Application. A host is 172.16.45.200/21. What are its network and broadcast addresses, and how many usable hosts does the subnet have? Answer: 172.16.40.0, 172.16.47.255 and 2,046 hosts. A /21 keeps 5 bits of the third octet, so blocks step by 8; 40 to 47 contains 45. There are 11 host bits: 2^11 − 2 = 2,046.
Analysis. A router holds 192.168.0.0/16, 192.168.32.0/19 and 192.168.40.0/21. Which routes do packets to 192.168.47.10 and 192.168.50.1 use? Answer: the /21 and the /19. 192.168.40.0/21 spans 40.0 to 47.255, so it matches 47.10 and is the longest match. 50.1 falls outside the /21 but inside 192.168.32.0/19 (32.0 to 63.255), which beats the /16.
Practise
The quiz below has 99 Network Layer questions, which you can filter by tier and difficulty.
Practise: 99 questions
FAQs
How do I find the network address quickly?
Work out the block size in the octet where the mask is not 255 or 0: 256 minus that mask value. The network address is the largest multiple of the block size that does not exceed the host's value in that octet. The broadcast address is the next multiple minus 1. For 10.1.1.77/27, the block is 32, so the network is 10.1.1.64 and the broadcast is 10.1.1.95.
Is ARP part of the network layer?
Textbooks disagree. Forouzan treats ARP as a network-layer helper protocol, while Tanenbaum and others describe it as working between the data link and network layers, because it maps IP addresses to MAC addresses on one link. For an exam, remember what it does: it finds the MAC address for a known IPv4 address on the local network.
Do I still need to learn IP address classes?
Yes, at least briefly. Classful addressing is obsolete and CIDR replaced it, but questions still ask which class an address belongs to. Class A first octets run from 0 to 127, Class B from 128 to 191, Class C from 192 to 223, Class D (multicast) from 224 to 239 and Class E from 240 to 255.
Why can't IPv6 routers fragment packets?
IPv6 moved fragmentation to the source to make routers simpler and faster. If a packet is too big for the next link, the router drops it and returns an ICMPv6 Packet Too Big message. The source then sends smaller packets, using path MTU discovery and, if needed, a Fragment extension header.
Next step
Continue with Transport Layer MCQs, go back to the Networks & Cloud hub, or test yourself under time pressure in an NSCT mock test.