
Basics of Internet Protocol (IP) AND IP Addressing
The Internet Protocol (IP) is a fundamental set of rules and conventions that govern how data is transmitted and routed over the Internet. It is a core component of the modern internet and is responsible for addressing and routing data packets to their destinations. Visit the detailed course on computer networks.

Basics of the Internet Protocol (IP)
Contents
Here are some basic terminologies of IP.
Addressing: IP assigns a numerical address to each device connected to the internet. These addresses are known as IP addresses. There are two main versions of IP addresses: IPv4 (Internet Protocol version 4) and IPv6 (Internet Protocol version 6). IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses. An example of an IPv4 address is “192.168.1.1,” and an IPv6 address looks like “2001:0db8:85a3:0000:0000:8a2e:0370:7334.”
Packet Structure: Data sent over the internet is broken down into small packets. Each packet contains a part of the data, along with source and destination IP addresses, so routers and switches can route the packets to their intended recipients.
Routing: IP is responsible for routing data packets from their source to their destination. Routers are devices that examine the destination IP address in each packet and decide where to forward it next. They use routing tables to make these decisions.
Version 4 (IPv4): IPv4 has been widely used since the early days of the Internet. However, its limited address space (4.3 billion unique addresses) has led to the exhaustion of available addresses, necessitating the adoption of IPv6. Network Address Translation (NAT) is often used to allow multiple devices within a private network to share a single public IPv4 address.
Version 6 (IPv6): IPv6 was introduced to overcome the address shortage of IPv4. It provides a vastly larger address space, allowing for trillions of unique IP addresses. It is designed to support the growing number of devices connected to the internet, including IoT devices.
End-to-end Connectivity: IP provides end-to-end connectivity, meaning that data packets can travel across multiple networks and devices to reach their destination. It does not guarantee the reliability or quality of the connection, but it ensures that data can traverse the internet.
Stateless Protocol: IP is a stateless protocol, which means that each packet is treated independently, and no previous connection information is stored. Higher-layer protocols, such as TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), provide additional features like error checking, reliability, and connection management on top of IP.
Internet Governance: IP address allocation and management are overseen by various organizations, including the Internet Assigned Numbers Authority (IANA), regional internet registries (RIRs), and local internet registries (LIRs).
Working of IP addressing

The working of IP (Internet Protocol) and IP addresses is fundamental to how data is transmitted and routed on the internet. Let’s explore how IP and IP addresses work:
IP Addresses
Unique Identifiers: IP addresses are numerical labels assigned to every device connected to a network, allowing them to be uniquely identified. Each device, whether it’s a computer, smartphone, server, or any networked device, has its own IP address.
IPv4 and IPv6: There are two main versions of IP addresses – IPv4 and IPv6. IPv4 uses 32-bit addresses, and IPv6 uses 128-bit addresses. IPv4 addresses are common but limited in number (4.3 billion unique addresses), while IPv6 provides a vast number of unique addresses (trillions).
Working of IP
Packetization: When data is sent over the internet, it is broken down into smaller packets. Each packet contains a portion of the data, along with the source and destination IP addresses. This packetization allows data to be transmitted efficiently and ensures that it can traverse different networks and devices.
Routing: IP is responsible for routing data packets from their source to their destination. Routers, which are network devices, play a key role in this process. They examine the destination IP address in each packet and decide where to forward it. This decision is based on routing tables, which contain information about network topology and routes.
Hop-by-Hop Routing: Data packets are often routed through multiple intermediary devices (routers) on their way to the destination. At each router, the device examines the destination IP address and determines the next hop on the path toward the final destination.
End-to-End Communication: IP provides end-to-end communication, meaning that data can traverse multiple networks and devices to reach its intended recipient. IP ensures that packets are delivered from the source to the destination but does not guarantee the reliability or quality of the connection.
Stateless Protocol: IP is stateless, meaning that each packet is treated independently. No information about previous packets or connections is stored. This is in contrast to higher-layer protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), which manage connection states and provide reliability features.
Classes of IP Networks

IP networks were traditionally divided into classes based on the range of IP addresses they could use. This classification was defined in the earlier IPv4 addressing system. There were five classes: A, B, C, D, and E. Here’s an overview of the classes of IP networks:
Class A (1.0.0.0 to 126.0.0.0)
- Default Subnet Mask: 255.0.0.0
- First Octet: The first octet (8 bits) is reserved for the network address, and the remaining three octets are available for hosts. Class A networks can support up to 16,777,214 hosts on a single network.
- Examples: 10.0.0.0, 100.0.0.0
Class B (128.0.0.0 to 191.255.0.0)
- Default Subnet Mask: 255.255.0.0
- First Two Octets: The first two octets (16 bits) are reserved for the network address, and the remaining two octets are available for hosts. Class B networks can support up to 65,534 hosts on a single network.
- Examples: 172.16.0.0, 172.31.0.0
Class C (192.0.0.0 to 223.255.255.0)
- Default Subnet Mask: 255.255.255.0
- First Three Octets: The first three octets (24 bits) are reserved for the network address, and only one octet is available for hosts. Class C networks can support up to 254 hosts on a single network.
- Examples: 192.168.0.0, 198.51.100.0
Class D (224.0.0.0 to 239.255.255.255)
- Reserved for Multicast: Class D addresses are reserved for multicast groups. Multicast allows data to be sent from one source and received by multiple hosts interested in that data simultaneously.
Class E (240.0.0.0 to 255.255.255.255)
- Reserved for Experimental Use: Class E addresses are reserved for experimental and research purposes and are not used in typical networking.
It’s important to note that while the concept of IP address classes still exists, modern networking often uses Classless Inter-Domain Routing (CIDR) notation to allocate IP addresses more flexibly. CIDR allows for variable-length subnet masks, providing finer control over address allocation and more efficient use of IP address space.
CIDR notation specifies IP addresses in the form of “IP_address/prefix_length,” where the prefix length indicates the number of network bits. For example, “192.168.0.0/24” represents a Class C network with a subnet mask of 255.255.255.0. This approach is widely used in contemporary IP address management.
IP Subnetting

IP subnetting is the process of dividing a single, larger IP network into smaller, more manageable subnetworks or subnets. This practice is essential for efficient IP address allocation and network organization. Subnetting helps reduce network congestion, improves security, and makes IP addresses more flexible to use. Here’s how IP subnetting works:
IP Addresses and Subnet Masks
- An IP address consists of two parts: the network address and the host address. The subnet mask is used to distinguish between these two parts.
- A subnet mask is a 32-bit number that is often expressed using dotted-decimal notation, just like IP addresses. It comprises two parts: the network bits (a consecutive sequence of ‘1’s) and the host bits (a consecutive sequence of ‘0’s).
Subnet Mask Length
- Subnet masks can have varying lengths, and this length is denoted by the number of ‘1’s in the mask.
- For example, a subnet mask of 255.255.255.0 is written in CIDR notation as “/24.” This means that the first 24 bits of the 32-bit address are allocated to the network, and the remaining 8 bits are available for hosts.
Dividing the Network
- Subnetting involves taking a network and dividing it into smaller, more manageable subnets. This is often done to accommodate different departments or segments within an organization, improve security, or optimize address usage.
- When you subnet, you borrow bits from the host portion of the IP address and allocate them to the network portion. The more bits you borrow, the more subnets you can create, but each subnet will have fewer available host addresses.
Calculating Subnets and Hosts
- To calculate the number of subnets and hosts per subnet, you can use the formula 2^n, where “n” is the number of bits borrowed.
- For example, if you borrow 3 bits for subnets, you can create 2^3 = 8 subnets. If you have 5 bits for hosts, you can have 2^5 – 2 = 30 hosts per subnet (minus 2 for the network address and broadcast address).
Subnetting Example
- Let’s say you have the IP address 192.168.1.0 with a subnet mask of 255.255.255.0 (/24).
- If you want to create multiple subnets, you can borrow additional bits. For instance, if you borrow 3 bits, your subnet mask becomes 255.255.255.224 (/27).
- With a /27 subnet mask, you have 3 bits for subnets and 5 bits for hosts. This allows you to create 2^3 = 8 subnets, each with 2^5 – 2 = 30 usable host addresses.
Efficient Use of IP Addresses
- Subnetting helps use IP addresses efficiently. Without it, you might allocate large IP address blocks for small subnetworks, resulting in a waste of addresses.
Routing and Routing Tables
- Routers play a crucial role in routing data between different subnets. They maintain routing tables that determine how to forward data between subnets based on destination IP addresses.
IP subnetting is a foundational skill for network administrators and engineers. It allows for the creation of logical subdivisions within networks, which can be essential for managing and securing large-scale network infrastructures.
IP Supernetting
IP supernetting, often referred to as route aggregation, is a network design technique in IPv4 (Internet Protocol version 4) used to combine multiple smaller, contiguous subnets into a single, larger supernet. This approach simplifies routing and reduces the size of routing tables in a network. Supernetting is particularly valuable for internet service providers (ISPs) and large organizations with complex networks. Here’s an overview of IP supernetting:
Key Concepts of IP Supernetting:
- Combining Subnets: Supernetting involves aggregating multiple smaller subnets with contiguous IP address ranges into a larger address block. These smaller subnets are usually represented by their respective subnet masks.
- Reducing Routing Table Size: The primary goal of supernetting is to reduce the number of entries in routing tables. Instead of listing individual, smaller subnets, the network design consolidates them into a single, aggregated supernet route. This simplifies routing and enhances the efficiency of routing tables.
- Supernet Mask: A supernet is defined by its associated supernet mask, which determines the network portion. The supernet mask has a larger subnet prefix than the individual subnet masks being aggregated.
- CIDR Notation: Supernetting is often associated with CIDR (Classless Inter-Domain Routing) notation, where the subnet mask is represented as a prefix length. For example, a supernet with CIDR notation “/20” indicates a supernet with a subnet mask of 255.255.240.0.
Benefits of IP Supernetting:
- Simplified Routing: Supernetting simplifies routing by aggregating multiple subnets into a single supernet entry in routing tables. This reduces the memory and processing requirements of routers.
- Efficient Routing: With fewer routing table entries, routing is more efficient. It optimizes the processing of packets as routers can quickly make routing decisions based on aggregated supernet information.
- Address Space Optimization: Supernetting is particularly useful when a network has many smaller subnets with contiguous address ranges. It helps optimize IP address allocation and utilization.
- Reduced Routing Table Size: By reducing the number of entries in routing tables, supernetting minimizes the overhead on routers and contributes to more efficient network operations.