What is ip address?
IP address is either a string of numbers (IPv4) or hexadecimal digits (IPv6) which ensure that data is accurately routed between the various devices.
IP addresses can be categorized based on the following perspectives:
IPv4 Address
Consists of four decimal numbers called octets, each ranging from 0 to 255, separated by dots, like 192.168.1.1
.
Each octet represents 8 bits, so with four octets the full address is 4 × 8 = 32 bits long.
For example, the decimal number 192 in binary is 11000000
, which is 8 bits.
Because IPv4 addresses are 32 bits in total, they can support roughly 4.3 billion unique addresses (2³²), which was sufficient for early internet needs but has become limited with the rapid growth of devices.
IPv6 Address
Consist of eight groups of four hexadecimal digits separated by colons, like 2001:0db8:85a3::8a2e:0370:7334
.
In this example, the double colon ::
is a shorthand notation that represents one or more consecutive groups of zeros, in this case, two groups of 0000
.
When fully expanded, the address becomes 2001:0db8:85a3:0000:0000:8a2e:0370:7334
.
Each group of four hexadecimal digits corresponds to 16 bits (since each hex digit equals 4 bits). With eight such groups, the complete IPv6 address totals 128 bits.
This significantly larger address size compared to IPv4’s 32-bit system allows IPv6 to accommodate approximately 3.4 × 1038 unique addresses, vastly expanding the available address space.
Public IP:
A public IP address is a globally unique identifier assigned by Internet Service Providers (ISPs) that allows devices to communicate over the internet.
Public IPs are used to identify your device or network on the broader internet, making it possible to send and receive data across different networks worldwide.
These addresses can be static, meaning they remain the same over time, or dynamic, where the ISP assigns a different address periodically.
Example: A public IP like 203.0.113.25
might be assigned to your home router, enabling you to access websites, send emails, or host servers accessible from anywhere on the internet.
Private IP:
Used within local networks such as home, office, or enterprise environments. These addresses typically fall within specific ranges, for example, 192.168.x.x
, 10.x.x.x
, or 172.16.x.x
to 172.31.x.x
.
Private IPs are not routable on the public internet, meaning devices with private IPs cannot be reached directly from outside the local network.
To communicate with the internet, private IP addresses require a process called Network Address Translation (NAT), which allows multiple devices on a local network to share a single public IP.
Example: Your laptop might have a private IP like 192.168.1.5
assigned by your home router. Although your laptop can access websites, external devices on the internet cannot directly access your laptop using this private IP.
Static IP Address
It is an IP address that is manually allocated to a networked device and stays the same throughout time. A static IP address is fixed and does not change unless manually reconfigured, in contrast to a dynamic IP address, which may change on a regular basis. For devices that require a constant and permanent address for access, this makes static IP addresses helpful.
In General, static IP address is:
- Manually Assigned: Network administrator manually configures the static IP, typically by navigating to the device's network settings.
- Permanent: Even if the device reboots or disconnects from the network, it remains unchanged unless the administrator makes changes.
- Used for Network Infrastructure: It is frequently utilized for routers, servers, printers, and other crucial network equipment where dependability is crucial.
For example, there are several devices connected to your local area network (LAN), including servers, printers, and PCs.
A web server that houses a business website, such as https://letuslearn.edu.et
, is one of your devices.
To ensure that clients can always reach the server at the same IP address, the server must have a constant IP address.
Dynamic IP Address
Dynamic Host Configuration Protocol servers automatically assign dynamic IP addresses, which are subject to change over time. Dynamic IP addresses are not fixed like static ones; they might vary every time a device connects to the network or after a predetermined lease period has passed.
Dynamic IP Addresses are:
- Assigned Automatically: By distributing IP addresses to networked devices automatically, a DHCP server removes the need for human setup.
- Has Temporary Nature: The "lease duration" is the amount of time that the IP address is leased. The device might be given a new IP address after the lease is over.
- Commonly Used: When regular external access to a device is not required, dynamic IP addresses are frequently utilized in home networks, smartphones, tablets, and personal computers.
Example, Consider a home network in which several nodes are connected to the internet. In this case, home routers usually employ dynamic IP addresses to give IP addresses to nodes like laptops, and smartphones.
Unicast IP Address
An IP address that is used to identify a single, distinct host (device) within a network. Data delivered to a unicast address is routed to a single, designated location. Since it is the technique used for the majority of client-server interactions, this is the most prevalent form of communication in typical networking scenarios.
Unicast IP Address is :
- One-to-One Communication: A single receiver is specified by a unicast IP address. Only the device linked to a unicast IP address receives data sent to that address.
- Most Common Communication: Web browsing, email, and file sharing are among the most common networking protocols and services that use it.
- Unique Addressing: Each network device that uses unicast communication is uniquely identified by its IP address.
For instance, in email communication, after composing the message, we click the send button. The email clients, like Outlook or Gmail, then send the email to the outgoing mail server using the SMTP (Simple Mail Transfer Protocol) and uses unicast to send the email. On the recipient's side, their mail server receives and stores the email until the recipient decides to access it.
Finally, when the recipient retrieves the email, it is also fetched through unicast communication directed to the unique IP address of their device.
Broadcast IP Address (IPv4 only)
In IPv4 networks, a broadcast IP address is a unique kind of address that is used to deliver data to every device connected to the network. Broadcast communication targets every device on the network, enabling one device to send data to every other device at the same time, in contrast to unicast, which sends data to a single device.
Broadcast IP Address is:
- One-to-All Communication: Broadcasts communicate with every device connected to a particular network or subnet.
- Network-Level Communication: Usually utilized within a local area network (LAN), broadcasting is not able to be routed across networks.
- Utilizes Special Address: The highest address in a network's IP range is its broadcast address (for example, 192.168.1.255 for a 192.168.1.0/24 network).
Example, The Address Resolution Protocol (ARP), which maps IP addresses to MAC addresses on a local network, is one of the most common uses of a broadcast IP address in IPv4.
On the same local network, Device A and Device B wish to communicate. Device A knows Device B’s IP address but does not have its corresponding MAC address. To discover the MAC address of Device B that matches the IP address 192.168.1.20, Device A sends out an ARP request as a broadcast to all devices on the network, asking, "Who has IP address 192.168.1.20? Please reply with your MAC address."
This broadcast message is sent to the broadcast address (192.168.1.255), meaning all devices in the 192.168.1.0/24 network will receive the request. Upon receiving the request, Device B, which has the IP address 192.168.1.20, recognizes that the request is for it and responds with its MAC address.
In this way, Device A learns the MAC address of Device B through broadcast communication.
Multicast IP Address
Unlike broadcast, which distributes data to every device on a network, multicast targets a specified group of devices that have expressed interest in receiving the data. Multicast IP addresses are used to send data to several targeted recipients at the same time. Applications like video streaming, web conferencing, and real-time data distribution that need to convey the same data to several receivers would find this effective technique especially helpful.
Multicast IP Address is
- One-to-Many Communication: Only devices that are a part of a multicast group can receive data from a single sender thanks to multicast. Compared to sending the same info to everyone, this is more efficient.
- Group Membership: In order for devices to receive multicast traffic, they must consciously join a multicast group. Multicast Listener Discovery (MLD) in IPv6 or the Internet Group Management Protocol (IGMP) in IPv4 are frequently used for this.
- Effective Use of Bandwidth: Compared to broadcasting the same data to every device on the network, data is transmitted just to those devices that require it (those in the multicast group), which uses less bandwidth.
For instance, during online conference, the presenter (multicast sender) transmits the presentation's audio and video to a multicast address, such as 233.1.2.3. Those who wish to watch and listen to the conference can do so by joining the multicast group 233.1.2.3.
In order to maximize bandwidth, routers make sure that multicast traffic only reaches networks where members have joined the multicast group.
By sending multiple copies of the same data, multicast enables the real-time distribution of conference content to numerous participants without taxing the servers or network.
How Do IP Addresses Work?
Roles of IP Address
- Identification: Each device on a network is assigned a unique IP address that distinguishes it from others.
- Communication: IP addresses enable devices to send and receive data packets across local and global networks.
- Routing: Routers use IP addresses to determine the best path for forwarding data to its intended destination.
- LAN and WAN: Local Area Networks use IP addresses for internal device communication, while Wide Area Networks, like the internet, handle global data exchange.
- NAT (Network Address Translation): Allows multiple devices on a private network to access the internet using a single public IP address, enhancing security and conserving address space.
Consider this example of email transmission from Ethiopia
to America
:
Solomon in Ethiopia wants to send an email to John in America. Both users are on private IP addresses within their respective home networks. Their routers, which are assigned public IPs by their ISPs, manage external communication. Solomon’s email is broken into data packets and routed through various global networks. Once it reaches John’s mail server in America, the packets are reassembled into the original message. John can then view the email on his device via his local IP, all made possible by IP addressing, NAT (Network Address Translation), and DNS (Domain Name System).
The most widely used IP address class is IPv4, which is separated into five classes to arrange the distribution of addresses:
Class A IP Address
The IP address range from 1.0.0.0 to 127.255.255.255, with the first octet ranging from 1 to 127. It uses a default subnet mask of 255.0.0.0, or /8, allowing approximately 16.7 million hosts per network (calculated as 2²⁴-2, with one address reserved for the network ID and one for broadcast). Although there are 128 possible networks, the entire 127.x.x.x range is reserved for loopback purposes and cannot be assigned to hosts.
Class A addresses are intended for very large networks or organizations requiring a substantial number of host addresses. Notably, the 127.0.0.0/8 block, especially 127.0.0.1, is exclusively used for localhost testing and is not valid for standard host communication.
Class B IP Address
The IP address range from 128.0.0.0 to 191.255.255.255, with the first octet ranging from 128 to 191. It uses a default subnet mask of 255.255.0.0, or /16, allowing for approximately 65,534 hosts per network (2¹⁶-2, with addresses reserved for network ID and broadcast).
There are a total of 16,384 networks within this class. Class B addresses are designed for medium sized networks, such as large corporations, universities, or other organizations that require more host capacity than Class C offers, but not as much as Class A provides.
Class C IP Address
The IP address range from 192.0.0.0 to 223.255.255.255, with the first octet ranging from 192 to 223. It uses a default subnet mask of 255.255.255.0, or /24, which supports 254 usable host addresses per network (2⁸-2, reserving one address each for network ID and broadcast).
Class C offers over two million networks in total, making it ideal for small organizations or businesses that require a modest number of devices fewer than 254 per subnet.
Class D IP Address
The IP address range from 224.0.0.0 to 239.255.255.255, with a first octet range of 224 to 239. This class is reserved for multicast communication, which is used for group data transmission rather than standard unicast traffic.
Class D addresses are commonly utilized in applications like video conferencing, media streaming, and routing protocols such as OSPF. Unlike other IP classes, Class D does not define traditional network and host structures, so the concept of hosts per network does not apply here.
Class E IP Address
The IP address range from 240.0.0.0 to 255.255.255.255, with the first octet spanning from 240 to 255. This class is designated for research and experimental purposes and is not intended for general public use.
It is reserved for future developments or testing scenarios. Within this range, the address 255.255.255.255 is specifically used for limited broadcast, allowing data to be sent to all hosts within a local network.
The following are considered special IP addresses
due
to their specific roles and reserved purposes in networking:
Loopback IP Address
The IP address 127.0.0.1
, part of the 127.0.0.0/8
range, is known as the loopback address. It is used to test and troubleshoot the network software stack on a local machine. When data is sent to this address, it is directed back to the device itself, also referred to as "localhost", without ever reaching the external network.
This looping mechanism allows developers and administrators to verify the functionality of network applications and the TCP/IP protocol stack without needing a physical network connection. It’s commonly used for testing server setups and ensuring local network configuration is working properly.
Broadcast IP Address
An example of a broadcast IP address is 192.168.1.255
, typically used within a subnet like 192.168.1.0/24
. Its main function is to deliver data to all devices within a specific local network at the same time. When a packet is sent to this address, every host on the 192.168.1.0/24
subnet receives it.
Broadcast addresses are essential for network-wide communication, especially for tasks like ARP requests, DHCP discovery, and announcing services across the local network.
Multicast IP Address
An example of a multicast IP address is 233.0.0.1
, which lies within the multicast range of 224.0.0.0
to 239.255.255.255
. Unlike broadcasting to all devices, multicast is designed to deliver data to a specific group of devices that have opted into receiving it.
Only the devices that join the designated multicast group will process the data, allowing for efficient one-to-many communication that conserves bandwidth compared to traditional broadcasting. This approach is widely used in applications like live video streaming.
To find the IP address of a Windows operating system, follow these simple steps:
- Open
Command Prompt
. - Type
ipconfig
and pressEnter
. - Look for the IPv4 Address under your active network connection.
Subnetting in Computer Networks
The process of splitting a single IP network into smaller, easier-to-manage sub-networks, known as subnets, is known as subnetting. It is a crucial component of network architecture and is frequently employed by administrators to maximize IP address utilization and enhance network functionality.
For example, instead of assigning the entire address block 37.1.1.0
to Office-1
and requiring the company to purchase more IP addresses,
subnetting allows us to split that large block into smaller subnets and assign one to each office.
This improves address efficiency and enhances control.
Subnetting a computer network is important for the following reasons:
- To divide large networks into smaller, more manageable subnets.
- To simplify network maintenance and troubleshooting.
- To enhance security by isolating segments within the network.
Drawback: To reach a specific application, the process must pass through multiple layers → network ID, subnet ID, host IP, and finally, the application port.
Let's assume 192.168.10.0
is a Class C network. In Class C, the default subnet mask is
255.255.255.0
, meaning the host ID starts with all 0s.
To divide this network into two subnets, we borrow 1 bit from the host ID 2¹ = 2 subnets
.
This leaves us with 7 bits for host addressing.
Subnet Ranges
- First Subnet:
192.168.10.0
to192.168.10.127
- Second Subnet:
192.168.10.128
to192.168.10.255
First Subnet
192.168.10.0
is used as the subnet ID and also as the network ID when viewed internally.192.168.10.127
is used as the directed broadcast address.
Second Subnet
192.168.10.128
is the subnet ID.192.168.10.255
serves as the directed broadcast address.
It's important to note that during subnetting, the number of usable host IP addresses is reduced. The first and last IP addresses in each subnet are reserved — one for the subnet ID and one for the broadcast address.
Context-based Interpretation:
How can we determine whether 192.168.10.0
is the network ID of the entire network or the
subnet ID of the first subnet?The answer will depends on the sender’s location:
- If the sender is outside the network, it treats
192.168.10.0
as the network ID for the whole block. - If the sender is inside the network, it treats
192.168.10.0
as the subnet ID of the first subnet.
Private Subnets:
Certain IP address ranges are reserved specifically for use in private networks. These addresses are not routable on the public internet and are commonly used in homes, labs, local area networks (LANs), and behind Network Address Translation (NAT) devices or routers.
Reserved Private IP Ranges
10.0.0.0/8
– Range:10.0.0.0
to 10.255.255.255 → from Class A172.16.0.0/12
– Range:172.16.0.0
to 172.31.255.255 → Class B192.168.0.0/16
– Range:192.168.0.0
to 192.168.255.255 →Class C
These private IP addresses can be used freely by anyone within internal networks without requiring coordination with any external organization or IP registry.
One key benefit is that internet routers are configured to never forward packets originating from these private ranges. This makes them safe for internal use, reducing the risk of IP conflicts or security breaches when connecting to the internet.
Supernetting in computer network
The practice of merging a collection of adjacent subnetted networks into a single, larger network is known as supernetting. Other names for this method are route aggregation and route summarization.
Optimizing routing tables is the main goal of supernetting. Supernetting reduces the size of a routing table, which lists all known networks, by combining several entries into a single entry.
A supernet mask is a 32-bit address composed of 1s and 0s that defines the network structure:
- The number of
1
s represents the fixed (network) portion. - The number of
0
s represents the variable (host) portion.
Here are the key rules for supernetting:
- All networks must be contiguous.
- All networks must be of the same size.
- The first network address must be evenly divisible by the total size of the supernet.
- 192.168.0.0
- 192.168.1.0
- 192.168.2.0
- 192.168.3.0
We have to check the Condition:
- All network addresses are contiguous.
- Each network is the same size (e.g., 2⁸ = 256 addresses).
- The first network (192.168.0.0) is divisible by the total supernet size (e.g., 2¹⁰ = 1024).
Since 2⁸ ÷ 2¹⁰ = 0 remainder, this condition is satisfied.
Now let’s determine the supernet mask using binary:
- 192.168.0.0 = 192.168.00000000.00000000
- 192.168.1.0 = 192.168.00000001.00000000
- 192.168.2.0 = 192.168.00000010.00000000
- 192.168.3.0 = 192.168.00000011.00000000
The fixed binary portion is 192.168.000000
; the rest is variable.
By converting the fixed part to 1s and variable part to 0s, we get:
255.255.252.0
as the supernet mask.
To determine the Network ID (NID) of each IP address, we apply the supernet mask using a bitwise AND operation:
IP Address + Supernet Mask = Network ID
After applying the supernet mask to all the listed addresses, we find that they all belong to the same supernet: 192.168.0.0. This becomes the supernet ID.
As a result, the routing table now contains a single summarized entry:
192.168.0.0
with the mask 255.255.252.0
.
Initially, there were four separate entries in the routing table one for each individual network. Through supernetting, these have been consolidated into one, simplifying the routing process and reducing overhead.