Lecture Notes: IP Addressing
Course Title: Computer Networks / Data Communication
Topic: IP Addressing
Level: Diploma / ND I or ND II
Duration: 2 hours
1. Introduction to IP Addressing
IP (Internet Protocol) addressing is a fundamental concept in computer networking. It
provides unique identifiers for devices on a network, enabling them to communicate with
each other.
2. Types of IP Addresses
• IPv4 – 32-bit address
• IPv6 – 128-bit address
• Static IP – Manually assigned
• Dynamic IP – Assigned by DHCP
3. Structure of IPv4 Address
IPv4 addresses are 32 bits long, divided into 4 octets. Example: 192.168.1.1
4. Classes of IP Addresses (IPv4)
• Class A: 1.0.0.0 – 126.0.0.0 (/8)
• Class B: 128.0.0.0 – 191.255.0.0 (/16)
• Class C: 192.0.0.0 – 223.255.255.0 (/24)
5. Public vs Private IP Addresses
Private IPs:
• Class A: 10.0.0.0 – 10.255.255.255
• Class B: 172.16.0.0 – 172.31.255.255
• Class C: 192.168.0.0 – 192.168.255.255
6. Subnetting (with Calculation)
Subnetting divides a network into smaller segments called subnets to optimize IP address
usage.
6.1 Key Concepts
• Network bits
• Host bits
• Subnet mask
• CIDR notation
6.2 Subnetting Calculation
Example 1: Find Subnet Info for 192.168.10.0/26
Step 1: Subnet Mask: /26 → 255.255.255.192
Step 2: Number of Subnets: 2² = 4
Step 3: Hosts per Subnet: 2⁶ - 2 = 62
Step 4: Subnets:
1. 192.168.10.0 – 192.168.10.63
2. 192.168.10.64 – 192.168.10.127
3. 192.168.10.128 – 192.168.10.191
4. 192.168.10.192 – 192.168.10.255
Example 2: For 172.16.0.0/20 → Host bits = 12 → Hosts = 2^12 - 2 = 4094
Example 3: From /16 to /22 → Borrowed bits = 6 → Subnets = 2^6 = 64
7. IPv6 Addressing
IPv6 uses 128-bit addresses. Format: 8 groups of 4 hexadecimal digits (e.g.,
2001:0db8:85a3::8a2e:0370:7334)
8. Practical Examples
Assign IPs to 10 systems in the range 192.168.5.0/24. First usable: 192.168.5.1, Last usable:
192.168.5.254
9. Summary
• IP provides device identification and routing.
• IPv4 uses 32 bits; IPv6 uses 128.
• Subnetting optimizes address usage.
10. Assessment Questions (with subnetting)
1. Calculate subnets and hosts for 10.0.0.0/27
2. Identify range in subnet 192.168.5.0/28
3. Broadcast address of 172.16.4.0/23
4. Subnets possible from /24 to /29
5. Difference between IPv4 and IPv6