IPv4 Addressing
IPv4 Addressing
Content
IPv4 Addressing
IPv6 Addressing
2 IP Addressing (4)
4 IP Address Class(6-7)
6 Subnetting (9-10)
3
• 1. ARPANET Beginnings (1960s-70s)
• ARPANET was created for military communication.
• Needed a way to connect different networks.
• 2. Idea of TCP/IP (1974)
• Vint Cerf and Bob Kahn introduced a method to link networks.
• Called it Transmission Control Protocol (TCP).
• 3. TCP and IP Split (1978)
• TCP split into two parts:
• -TCP: Ensured data delivery.
• -IP: Handled addresses and routing.
• 4. Official Standard (1983)
• ARPANET adopted TCP/IP as the internet’s main protocol.
• 5. IPv4 Launch (1981)
• First version of IP, called IPv4, allowed 4.3 billion addresses.
• Internet grew fast, and more addresses were needed.
4
• IPv4 addresses are allocated and managed by a hierarchical system:
• IANA (Internet Assigned Numbers Authority):
• Oversees the global pool of IPv4 addresses.
• Allocates large address blocks (typically /8) to Regional Internet Registries (RIRs).3. TCP and IP Split (1978).
• RIRs (Regional Internet Registries): Five RIRs distribute IP addresses to organizations within their geographic regions.
• ARIN: American Registry for Internet Numbers (North America).
• RIPE NCC: Réseaux IP Européens Network Coordination Centre (Europe, Middle East, Central Asia).
• APNIC: Asia-Pacific Network Information Centre (Asia-Pacific region).
• LACNIC: Latin America and Caribbean Network Information Centre (Latin America).
• AFRINIC: African Network Information Centre (Africa).
• LIRs (Local Internet Registries):
• Usually ISPs or large organizations that assign IP addresses to end-users or internal networks.
5
Core Function of IP: Logical Addressing
IP addresses provide a logical, hierarchical structure to uniquely identify hosts on a network.
Enables efficient routing and communication across networks.
IPv4 Address Structure
Format: Represented in decimal as four octets, separated by dots (e.g., 158.80.164.3).
Binary Representation: Each octet is an 8-bit binary number, forming a 32-bit address.
7
• IP addresses are divided into five classes (A, B, C, D, E).
• Helps in network organization and efficient allocation.
• Based on the first octet of the address (IPv4).
• IP address classes ensure efficient management of networks.
• Class A, B, C: Commonly used for host communication.
• Class D, E: Specialized or reserved purposes.
• Class A
• Range: 0.0.0.0 to 127.255.255.255
• Default Subnet Mask: 255.0.0.0
• Purpose: Large networks (e.g., multinational companies).
• Key Info:
• -Supports 16 million+ hosts per network.
• -First bit of the address is always 0.
8
• Class B
• Range: 128.0.0.0 to 191.255.255.255
• Default Subnet Mask: 255.255.0.0
• Purpose: Medium-sized networks (e.g., universities, organizations).
• Key Info:
• Class C
• Range: 192.0.0.0 to 223.255.255.255
• Default Subnet Mask: 255.255.255.0
• Purpose: Small networks (e.g., homes, small businesses).
• Key Info:
• Class D
• Range: 224.0.0.0 to 239.255.255.255
• Purpose: Multicasting (e.g., streaming, conferencing).
• Key Info:
9
• Class E
• Range: 240.0.0.0 to 255.255.255.255
• Purpose: Experimental and reserved for future use.
• Key Info:
• Not used publicly.
• First four bits of the address are always 1111.
10
• 1. Unicast:
• One-to-one communication.
• Example: 192.168.1.10.
• 2. Broadcast:
• One-to-all communication within a network.
• Broadcast address example: 192.168.1.255 (in a /24
subnet).
• 3. Multicast:
• One-to-many communication for a specific group.
• Multicast range: 224.0.0.0 – 239.255.255.255.
• 4. Anycast (Rarely used in IPv4):
• One-to-nearest communication (in terms of routing).
11
• Public IPv4 Address:
• Global Uniqueness: Must be unique across the entire internet.
• Routable: Can be accessed from anywhere on the internet.
• Assigned by IANA: Distributed by ISPs and regional registries.
• Cost: Limited availability, often costly to obtain.
• Public IP Ranges:
12
• There are certain ranges of IP addresses that are reserved for special purposes and are
not assigned to devices on the public internet.
• Reserved IPv4 Addresses (RFC 5735)
• Loopback Addresses (127.0.0.0/8):
• -Purpose: Used for self-testing within a device (local
communication).
• -Example: 127.0.0.1 (localhost)
• Link-Local Addresses (169.254.0.0/16):
• -Purpose: Used for communication between devices on the
same local network when no DHCP server is available.
• -Example: 169.254.0.1
• Multicast Addresses (224.0.0.0 to 233.255.255.255):
• -Purpose: Used for one-to-many communication, such as
streaming.
• -Example: 224.0.0.1 (All routers on the local network)
• Broadcast Addresses:
• -Purpose: Used to send data to all devices in a network.
• -Example: For a network 192.168.1.0/24, the broadcast
address is 192.168.1.255.
13
Consider the following subnetted Class A network: 10.0.0.0 255.255.248.0
255.0.0.0: 11111111.00000000.00000000.00000000
255.255.248.0: 11111111.11111111.11111000.00000000
Clearly, 13 bits have been stolen to create the new subnet mask. To
calculate the total number of new networks:
14
The first network will begin at 0,
again. However, the ranges are
spread across multiple octets. The
ranges of the first three networks
look as follows:
15
• A /27 subnet represents an IP address with 27 bits dedicated to the
network portion and the remaining 5 bits for the host portion. This
results in a subnet mask of 255.255.255.224.
• Breakdown of /27 Subnet
• Network Bits (27 bits): These bits identify the network address.
• Host Bits (5 bits): These bits identify individual devices (hosts)
within the subnet.
• Subnet Mask
• /27 in binary is:11111111.11111111.11111111.11100000
• This corresponds to the subnet mask 255.255.255.224.
• Let’s take the IP address 192.168.1.0/27 and break it down.
• Network Address: The network address is 192.168.1.0.
• Subnet Mask: The subnet mask for /27 is 255.255.255.224.
• Range of IP Addresses for the Subnet: The range of usable IP addresses
within the subnet can be calculated:
• Network Address: 192.168.1.0
• First Usable IP: 192.168.1.1
• Last Usable IP: 192.168.1.30
• Broadcast Address: 192.168.1.31
16
• Introduced in 1993 to replace class-based IP addressing for better
efficiency.
• Flexible Subnetting: Allocates variable-sized IP address blocks based
on need (e.g., /28 for 16 IPs).
• Efficient Address Utilization: Reduces wastage by avoiding rigid Class
A, B, or C boundaries.
• CIDR Notation: Uses / to specify network prefix length (e.g.,
192.168.1.0/24 means 24 bits for the network).
• Route Aggregation: Combines multiple networks into a single route
(e.g., 192.168.0.0/22 covers 4 /24 networks).
• Benefits:
• Reduces routing table size.
• Solves IP address exhaustion.
• Scales for networks of any size.
• Example:
• 192.168.1.0/27:
• 32 addresses, 30 usable hosts.
• Subnet Mask: 255.255.255.224.
17
• VLSM allows subnetting with different mask lengths, optimizing IP usage by
matching subnet sizes to specific needs.
• Key Features:
• Efficient address utilization.
• Supports flexible, hierarchical network designs.
• Works with CIDR for scalable subnetting.
• How It Works:
• A large network (e.g., 192.168.1.0/24) is divided into subnets with varying
sizes:
• - /28 for 16 IPs (small branches).
• - /26 for 64 IPs (larger offices).
• Benefits:
• Minimizes IP wastage.
• Simplifies routing with aggregated entries.
• Adapts to networks of any scale.
• Example: 192.168.1.0/24 → Multiple subnets: /28, /26, etc.
18
• Header Fields:
• Version: IPv4 = 4.
• IP Header Length: Length of the header in 32-bit words.
• TTL (Time to Live): Prevents infinite routing loops.
• Protocol: Specifies the upper-layer protocol (e.g., TCP = 6, UDP = 17).
• Source and Destination IP: Identifies the sender and receiver.
19
• Network address translation (NAT) is a method of mapping an
IP address space into another by modifying network address
information in the IP header of packets.
• Types of NAT:
• Static NAT: One-to-one mapping of private to public IP.
• Dynamic NAT: Maps private IPs to a pool of public IPs.
• PAT (Port Address Translation): Multiple private IPs
share one public IP using ports.
• Benefits:
• Conserves IPv4 addresses.
• Hides internal network details for added security.
• Facilitates internet connectivity for private networks.
• Example:
• Private IPs (e.g., 192.168.1.5) are translated to public
IPs (e.g., 203.0.113.10) at the NAT-enabled router.
20
• 1. Address Exhaustion
• Limited to ~4.3 billion addresses; not enough for the growing number of
devices.
• Widespread adoption of NAT and private IPs to conserve public addresses.
• 2. Lack of Security Features
• No inherent encryption or authentication.
• Relies on external protocols like IPsec for security.
• 3. Scalability Issues
• IPv4 routing tables grow with internet expansion, increasing router processing
and memory demands.
• 4. Inefficient Address Allocation
• Early class-based system (Class A, B, C) led to significant IP wastage.
• CIDR introduced to improve efficiency but still not optimal.
• 5. Poor Support for Modern Technologies
• Limited support for mobile networks and IoT due to constraints in address
availability.
• 6. Dependence on NAT
• NAT conserves IPs but adds latency, complicates protocols, and impacts end-
to-end connectivity.
• 7. No Native Multicast Support
• Multicast implementation is limited and requires additional configurations.
• 8. Geographic Imbalance
• Uneven distribution of IPv4 addresses across regions, causing shortages in
certain areas.
21
22