Comprehensive Notes: IP Addressing, Classes, and Subnetting
1. Introduction to IP Addressing
An IP address is a numerical label assigned to each device connected to a network. It identifies the host and
its location on the network.
2. IPv4 (Internet Protocol Version 4)
IPv4 uses 32-bit addresses in dotted decimal format (e.g., 192.168.1.1). Total = 2^32 = 4,294,967,296
addresses.
Classes:
Class A: 1.0.0.0 to 126.255.255.255 (2^7 networks, ~2^24 hosts)
Class B: 128.0.0.0 to 191.255.255.255 (2^14 networks, ~2^16 hosts)
Class C: 192.0.0.0 to 223.255.255.255 (2^21 networks, ~2^8 hosts)
Class D: 224.0.0.0 to 239.255.255.255 (Multicast)
Class E: 240.0.0.0 to 255.255.255.255 (Experimental)
3. IPv6 (Internet Protocol Version 6)
IPv6 uses 128-bit addresses in hexadecimal (e.g., 2001:0db8:85a3::8a2e:0370:7334). Total = 2^128
addresses.
No concept of classes; hierarchical; supports IPsec, auto-configuration.
4. Subnet Mask in IPv4
A subnet mask separates the network and host portions of an IP address.
Examples:
Comprehensive Notes: IP Addressing, Classes, and Subnetting
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
Used to define subnet boundaries, improve IP management and security.
5. Subnetting (IPv4)
Subnetting divides a large network into smaller subnets. Helps manage IPs, reduce broadcast domains.
6. Calculating Subnets and Hosts
Given: IP 192.168.1.0, Subnet Mask: 255.255.255.192 (/26)
Subnet Mask in binary: 11111111.11111111.11111111.11000000
Subnets: 2^2 = 4
Hosts per Subnet: 2^6 - 2 = 62
Subnet Ranges:
192.168.1.0/26 to 192.168.1.63
192.168.1.64/26 to 192.168.1.127, etc.
7. How Subnet Masks Work
Routers use a bitwise AND between the IP and subnet mask to find the network address.
Example:
IP: 192.168.1.130 = 11000000.10101000.00000001.10000010
Mask: 255.255.255.192 = 11111111.11111111.11111111.11000000
AND: 192.168.1.128 (Network Address)
Comprehensive Notes: IP Addressing, Classes, and Subnetting
8. CIDR Notation
CIDR uses slash notation to indicate network bits: /24, /26, etc.
/24 = 255.255.255.0 (254 hosts), /30 = 255.255.255.252 (2 hosts).
9. Summary Table
IPv4: 32-bit, decimal, class-based, 2^32 addresses
IPv6: 128-bit, hexadecimal, classless, 2^128 addresses
Subnetting enables efficient IP use, routing, and security.