← CSC 216 Data Communication and Computer Networks
Network Layer and IPv4 Subnetting
Notes
Network Layer Responsibilities
The network layer is responsible for end-to-end packet delivery across heterogeneous, interconnected networks. Unlike the data link layer which handles local point-to-point delivery using MAC addresses, the network layer handles logical addressing and dynamic path determination through routing protocols such as OSPF and BGP.
IPv4 Addressing and Classless Inter-Domain Routing
An IPv4 address consists of 32 binary bits, conventionally represented as four decimal octets separated by periods. An IP address comprises two parts: the network prefix, identifying the network segment, and the host identifier, identifying the specific interface. Historically, addresses were divided into rigid classes (Class A, B, and C). Modern networking uses Classless Inter-Domain Routing (CIDR), which allows flexible boundary allocation using variable-length subnet masks denoted by prefix notation such as /24 or /28.
Subnetting Principles
Subnetting divides a single large network block into smaller, distinct broadcast domains. This reduces broadcast traffic, conserves public address space, and enhances perimeter security. To create subnets, host bits are borrowed to extend the network prefix. Each additional borrowed bit doubles the number of available subnets while halving the available host addresses per subnet. Two addresses in every subnet are strictly reserved: the network ID where host bits are all zeroes, and the directed broadcast address where host bits are all ones.
Practical example
Consider a regional campus of the Kenya Education Network (KENET) allocating IPv4 space to Murang'a University of Technology. KENET assigns the institution a contiguous block: 196.202.40.0/24. The university ICT director must create three separate, isolated subnets: one for the Administration staff (requiring up to 60 usable IP addresses), one for the Computer Science Student Lab (requiring up to 60 usable IP addresses), and one for Server Infrastructure (requiring up to 25 usable IP addresses).
To fulfill this using Variable Length Subnet Masking (VLSM):
For the Administration subnet, 60 hosts require 6 host bits (2^6 - 2 = 62 usable addresses). The subnet mask becomes /26 (255.255.255.192). This allocates 196.202.40.0/26 with usable host range 196.202.40.1 to 196.202.40.62, and broadcast 196.202.40.63.
For the Student Lab, borrowing 6 host bits again yields the next /26 block: 196.202.40.64/26, with usable range 196.202.40.65 to 196.202.40.126, and broadcast 196.202.40.127.
For the Server Infrastructure, 25 hosts require 5 host bits (2^5 - 2 = 30 usable addresses). The subnet mask becomes /27 (255.255.255.224). This yields 196.202.40.128/27, providing usable IP addresses from 196.202.40.129 to 196.202.40.158, with broadcast 196.202.40.159. Unused space remains available for future faculty expansion.
Quiz
1. What is the primary network performance benefit of dividing an enterprise network into smaller subnets?
2. How many total usable host addresses are provided by a standard /26 IPv4 subnet?
3. In the subnet 196.202.40.128/27, what is the directed broadcast address?
Sign in to submit and securely grade your quiz.