Namal University Mianwali
Department of Computer Science
Lab Manual
Course CSC-251L- Computer Networks - Lab
Instructor Muzamil Ahmed Session / Semester 2022-2026 (5th)
Lecture # 06
Topic Introduction to IP Addresses and Subnetting
Objectives Understand the concept of IP addresses and their importance in
network communication.
Learn about different IP address classes (A, B, C, D, E).
Practice configuring IP addresses and subnetting on Cisco Packet
Tracer using a switch.
IP Address Overview
An Internet Protocol (IP) address is a numeric label consisting of a 32-bit number assigned to
a network capable device that uses IP for communication. The address fundamentally serves
two purposes: location addressing and computer host or network interface identification. The
address indicates where the connected device resides with most hosts/devices still using the
IPv4 (Internet Protocol Version 4) form of addressing. A significant limitation of the legacy
IPv4 addressing is that it supports less than 4.3 billion total addresses. An IP address is 32
bits long, divided into four octets, and is represented in decimal form (e.g., 192.168.1.1) IP
addresses are classified into five classes (A, B, C, D, E), each serving specific purposes.
IP Address Classes
Class A:
Range: 1.0.0.0 to 126.0.0.0
First octet is between 1 and 126.
Default Subnet Mask: 255.0.0.0
Supports 16 million hosts on each of the 128 networks.
Class B:
Range: 128.0.0.0 to 191.255.0.0
First octet is between 128 and 191.
Default Subnet Mask: 255.255.0.0
Supports 65,536 hosts on each of the 16,384 networks.
Class C:
CSC-251L- Computer Networks - Lab
Range: 192.0.0.0 to 223.255.255.0
First octet is between 192 and 223.
Default Subnet Mask: 255.255.255.0
Supports 254 hosts on each of the 2 million networks.
Class D (Multicast):
Range: 224.0.0.0 to 239.255.255.255
Used for multicast groups rather than individual hosts.
Class E (Experimental):
Range: 240.0.0.0 to 255.255.255.255
Reserved for experimental purposes and future use.
Subnetting
Subnetting divides an IP network into smaller sub-networks (subnets) to optimize IP address
allocation, improve security, and reduce broadcast traffic.
Subnet Mask: A subnet mask is a 32-bit number used in conjunction with an IP address to
distinguish the network portion of the address from the host portion. The subnet mask
contains binary digits, where a "1" indicates the network part and a "0" indicates the host
part.
Example: For an IP address of 192.168.1.10 with a subnet mask of 255.255.255.0:
Binary Representation:
o IP Address: 11000000.10101000.00000001.00001010
o Subnet Mask: 11111111.11111111.11111111.00000000
Network Address: 192.168.1.0
Host Part: .10
CIDR Notation: Classless Inter-Domain Routing (CIDR) notation is a compact way to
represent IP addresses and their associated routing prefix. Instead of using the traditional
subnet mask (like 255.255.255.0), CIDR notation specifies the number of bits allocated to the
network part of the address.
Examples:
/24 corresponds to a subnet mask of 255.255.255.0 (256 total addresses, 254 usable).
/16 corresponds to a subnet mask of 255.255.0.0 (65,536 total addresses, 65,534
usable).
Subnet Calculation:
CSC-251L- Computer Networks - Lab
1. Determine the Number of Bits for Hosts and Networks:
An IP address consists of 32 bits, divided into two parts: the network part and the host
part.
The number of bits allocated to the network portion determines how many subnets
can be created, while the bits allocated to the host portion determine how many hosts
can be accommodated in each subnet.
2. Formula
Subnets Calculation: Number of Subnets=2 Number of Bits Borrowed
Number of Subnets: Number of Hosts=2 Number of Host Bits−2
(The subtraction of 2 accounts for the network and broadcast addresses.)
3. Example Calculation: Consider a Class C network: 192.168.1.0/24
Original Subnet Mask: 255.255.255.0
Binary Subnet Mask: 11111111.11111111.11111111.00000000
Subnetting:
o If we want to create 4 subnets, we need to borrow 2 bits from the host part:
o New Subnet Mask: 255.255.255.192 (CIDR /26)
o Binary: 11111111.11111111.11111111.11000000
Subnet Calculation:
o Number of Subnets: 22=4 subnets
o Number of Hosts per Subnet: 26−2=64−2=62 usable hosts
4. Subnet Details:
192.168.1.0/26 (Subnet 1) - Range: 192.168.1.1 to 192.168.1.62 (Broadcast:
192.168.1.63)
192.168.1.64/26 (Subnet 2) - Range: 192.168.1.65 to 192.168.1.126 (Broadcast:
192.168.1.127)
192.168.1.128/26 (Subnet 3) - Range: 192.168.1.129 to 192.168.1.190 (Broadcast:
192.168.1.191)
192.168.1.192/26 (Subnet 4) - Range: 192.168.1.193 to 192.168.1.254 (Broadcast:
192.168.1.255)
Lab Task
Task 1: The Namal University, Mianwali has invested in creating a “Smart Campus”
environment, where each academic block has its own network and dedicated resources. The
university administrators have assigned you the role of a network engineer to configure and
segment the IP addressing to secure the various zones of the campus. You’ll be setting up
subnetting and networking for each block using Cisco Packet Tracer. Use 192.168.1.0 as
original IP.
1. IT Innovation Hub – A center for digital learning and projects with advanced
networking needs:
o Host Requirement: 136 hosts
o Function: Centralized for large team projects and server hosting
2. Science Research Lab – Focused on experimental data processing and analytics:
CSC-251L- Computer Networks - Lab
o Host Requirement: 95 hosts
o Function: Resource-intensive lab with high connectivity needs
3. Creative Arts Studio – Equipped for media production and design:
o Host Requirement: 51 hosts
o Function: Studio space requiring bandwidth for high-resolution content
4. Postgraduate Common Room – A collaborative area for postgraduate students:
o Host Requirement: 24 hosts
o Function: Smaller network dedicated to postgraduate students' resources
CSC-251L- Computer Networks - Lab
Task 2: The City Hospital has undertaken an initiative to establish a “Smart Healthcare”
infrastructure, where each department has its own network and dedicated resources to ensure
a secure and efficient environment for patient care and hospital operations. You have been
appointed as the network engineer responsible for designing and configuring the IP
addressing and subnetting for the hospital departments using Cisco Packet Tracer. The
hospital administrators have provided an IP range, 10.0.0.0, for this setup.
The hospital has four main departments, each with distinct networking requirements:
1. Emergency Department – Dedicated to handling urgent care cases and connected to
multiple monitoring devices:
o Host Requirement: 110 hosts
o Function: Continuous monitoring and data-intensive operations for
emergency cases
2. Radiology and Imaging Center – Supports high-resolution imaging and scanning
equipment:
o Host Requirement: 65 hosts
o Function: Processes high-bandwidth imaging files for MRIs, X-rays, and CT
scans
3. Outpatient Clinic – Provides consultations and treatments for non-admitted patients:
o Host Requirement: 42 hosts
o Function: Regular consultations with a need for efficient patient data access
4. Administration Office – Manages hospital records, billing, and administrative tasks:
o Host Requirement: 30 hosts
o Function: Handles office tasks and hospital data management in a secure
network
Using the provided IP range, design an IP subnetting scheme to meet the requirements of
each department, ensuring that you optimize IP usage and secure each department’s network
independently.
Submission Guidelines
1. Create a folder named with your name + registration number with two subdirectories
i.e., Simulation File and Report
2. The Report subdirectory should contain a detailed explanation of each task, logical
observations and screenshot with proper referencing and detail.
3. Academic Integrity: Any instances of plagiarism will result in a zero score for the
last two lab submissions.
4. Adhere to the submission deadlines. Late submissions will receive zero marks.
CSC-251L- Computer Networks - Lab