IP Address
IP Address
1. IP Address Structure
• Format: IPv4 addresses are 32-bit numbers typically expressed in decimal notation as
four octets separated by periods (e.g., 192.168.1.1).
• Range: IPv4 addresses range from 0.0.0.0 to 255.255.255.255. This provides
approximately 4.3 billion unique addresses.
• Components:
o Network Portion: Identifies the specific network.
o Host Portion: Identifies the device within the network.
• Classes: Historically, IPv4 addresses were divided into classes (A, B, C, D, E),
though modern practice uses Classless Inter-Domain Routing (CIDR) to allocate IP
addresses more flexibly.
2. Types of IP Addresses
Public IP Addresses
• Definition: Addresses that are routable on the global internet and are assigned by
Internet Service Providers (ISPs).
• Purpose: Enable devices to communicate over the internet and are unique worldwide.
• Example: 203.0.113.76
Private IP Addresses
• Definition: Addresses used within private networks and not routable on the global
internet. They are reserved for use within local networks.
• Ranges:
o IPv4 Private Address Ranges:
▪ 10.0.0.0 to 10.255.255.255
▪ 172.16.0.0 to 172.31.255.255
▪ 192.168.0.0 to 192.168.255.255
• Purpose: Allow devices within the same local network to communicate without
consuming public IP address space.
• Example: 192.168.1.5
Loopback IP Addresses
• Definition: Special IP addresses used to test the network stack on a local machine.
• IPv4 Loopback Address: 127.0.0.1
• Purpose: Used for diagnostics and testing purposes to ensure that the network
interface and protocols are functioning correctly on the local device.
IP addresses are divided into five classes: A, B, C, D, and E. Each class has a different
network and host portion. Here's a summary of each class with examples to help you
understand:
1. Class A
• Network ID: 10
• Host ID: 0.0.1
2. Class B
3. Class C
• Range: 192.0.0.0 to 223.255.255.0
• Network ID: The first 24 bits (1st, 2nd, and 3rd octet)
• Host ID: The remaining 8 bits (4th octet)
• Default Subnet Mask: 255.255.255.0
• Number of Networks: ~2 million
• Number of Hosts per Network: 254
4. Class D (Multicast)
5. Class E (Experimental)
3. IP Address Allocation
Static IP Addresses
• Definition: IP addresses manually assigned to a device and do not change over time.
• Use Cases: Commonly used for servers, printers, and network devices where a
consistent address is required for proper operation.
Dynamic IP Addresses
1. What is Subnetting?
3. Subnet Mask:
A subnet mask is used to divide the IP address into two parts: the network part and the host
part.
Subnetting involves borrowing bits from the host portion to create more networks.
Suppose we want to create 4 subnets. We need to borrow 2 bits from the host portion:
• New subnet mask: 255.255.255.192 (/26 means 26 bits for the network).
Resulting Subnets:
1. 192.168.1.0 - 192.168.1.63
2. 192.168.1.64 - 192.168.1.127
3. 192.168.1.128 - 192.168.1.191
4. 192.168.1.192 - 192.168.1.255
Each subnet has 62 usable IP addresses, since the first and last addresses in each range are
reserved for network ID and broadcast.
Supernetting
Supernetting is the opposite of subnetting. While subnetting breaks down larger networks
into smaller sub-networks, Supernetting combines multiple smaller networks (subnets) into
one larger network. It is also referred to as route aggregation or CIDR (Classless Inter-
Domain Routing). Supernetting helps simplify routing tables by reducing the number of
routes a router must maintain, which improves the efficiency of routing and reduces memory
and processing power usage.
Supernetting involves combining multiple continuous IP address blocks into a larger block by
reducing the number of network bits and increasing the number of host bits.
Example of Supernetting:
• 192.168.1.0/24
• 192.168.2.0/24
• 192.168.3.0/24
• 192.168.4.0/24
Each network has its own entry in the routing table. However, if these networks are
contiguous (back-to-back), you can combine them into one larger supernet.
Steps:
By aggregating these networks into the supernet 192.168.0.0/22, the routing table now has
just one entry instead of four, covering all IP addresses from 192.168.0.0 to
192.168.3.255.
Benefits of Supernetting:
Real-Life Example:
Imagine an Internet Service Provider (ISP) that assigns multiple Class C networks to
different businesses in a city. Instead of having separate routing table entries for each
business, the ISP could use Supernetting to combine all these networks into a single route,
reducing the routing complexity.