How Does IP Addressing Work?

Your computer, smartphone, tablet that connect to a network all need a unique identifier (ID). This unique ID allows other devices to access the network, and it is known as the Internet Protocol (IP) address.

You will most likely have seen IP addresses if you have been around computers for a fair amount of time. They are those dotted numbers that look something like 192.168.123.132. Most of the time, they are on the backend of our internet activities, and we don’t necessarily interface with them directly. However, they are crucial in today’s IP networking.

Knowing how IP addressing works is important for distinct reasons. Perhaps your network is not working, or a specific device is not connecting, and you need to do some troubleshooting.

You may also need to know it works for a more advanced reason, like hosting a game server to connect with other players or friends.

In this article, we will be looking at everything you need to know about IP addressing. We’re going to cover the fundamentals of IP addressing, how it works, network classes, subnetting and other questions you may have. First, let us properly define an IP address.


What’s an IP Address?

An IP address is a dotted-decimal number that uniquely identifies a device such as a computer, router, or printer on an IP network.

The address usually looks something like this: 192.168.123.132. Each set of the four numbers separated by a dot can range from 0 to 255. This means the full range of IP addressing is from 0.0.0.0 to 255.255.255.255.

The numbers have a 255 limit because they are octets (eight-digit binary numbers). In an octet, zero is 00000000, while the maximum it can reach, 255 is 11111111.

The example IP address aforementioned, 192.168.123.132, actually looks like this in binary form: 110000000101000111101110000100.

For an IP network to work effectively, the routers use the information about the host’s network to pass packets of data to the destination’s network. After delivery, the packet is then delivered to the appropriate host. For this to work, an IP address has two parts.


What are the Two Parts of An IP Address?

An IP address comprises two distinct parts. They are the network ID and the host ID.

Network ID

The network ID is the first three sets of numbers on the IP address beginning from the left. It specifies the network on which a device is connected. For example, an IP address of 192.168.1.34 means the network ID is 192.168.1.

Host ID

The host ID is the remaining or last part of the IP address after the network ID. It specifies the device (host) on a network. For the same IP address of 192.168.1.34, the host ID would be 34.

Suppose you have several devices on your home or office network, like 192.168.1.34, 192.168.1 30, and 192.168.1.2. This means you have different devices with host IDs: 34, 30, and 2, respectively, and they are all on the same network (with network ID 192.168.1 or 192.168.1.0).


How Do IP Addresses Work?

IP addresses are divided into two parts: a network address and a host address, and they work just like street addresses. For instance, take a street address like 123 Mikaelson Street. The street name (Mikaelson) is the network ID, and the house number (123) is the host ID.

Just as no two streets are named the same, no two network IDs on the same network have the same IDs. Also, on a particular street, every house number is unique. In the same vein, all host IDs within a network ID are distinct.

Next time you are browsing the Internet on your computer, using your local internet service provider (ISP) or an office network, remember you can do so successfully because your computer uses internet protocol. Your IP address is used as a virtual return address to establish a connection.

See also  Can Parrot OS Be Hacked?

Once again, the first few octets in an IP address identify the network while the rest is for the hosts and subnets. Now, let us look into how your device determines which part of the IP address is the network ID and the host ID.


The Subnet Mask

Your device can determine which part of the IP address is the network ID and host through a second number known as the subnet mask. The subnet mask is used to ascertain whether a host is on the local subnet or a remote network for the IP to work.

In IP, the parts of the IP address used as the network and host addresses are not usually fixed, so they are difficult to determine unless you have more information. The subnet mask supplies this information.

On most networks, the subnet mask looks something like 255.255.255.0. The position of the 255s or 0 indicates whether that part is the network and host ID. The 255s represent the network.

Using the subnet mask 255.255.255.0 for the example IP address: 192.168.123.132. We have established earlier that 255 means 11111111 whole 0 means 0000000. The lineup will look something like this:

  • 11000000.10101000.01111011.10000100 – IP address (192.168.123.132)
  • 11111111.11111111.11111111.00000000 – Subnet mask (255.255.255.0)

The first 24 bits (the numbers that align with the 1s in the subnet mask) are identified as the network address, while the last 8 bits (that sign with the 0s) are identified as the host address.

Further breaking it down, the addresses look like this:

  • 11000000.10101000.01111011.00000000 – Network address (192.168.123.0)
  • 00000000.00000000.00000000.10000100 – Host address (000.000.000.132)

So for this example of a 255.255.255.0 subnet mask, the network ID is 192.168.123.0, and the host ID is 0.0.0.132.


Network Classes

IP addresses are divided into these three most common network classes: Classes A, B, and C – each of which has its unique subnet mask. An IP address class can be identified by looking at its first octet.

Class A

Class A networks have the first octet between 0 – 127 and use a default subnet mask of 255.0.0.0. For example, an IP address 42.57.34.10 is a class A address. Its first octet is 42, between 1 and 126.

Class B

Class B networks have a first octet between 128 – 191 and use a default subnet mask of 255.255.0.0. For example, an IP address 162.17.54.73 is a class B address. Its first octet is 162, which is between 128 and 191, inclusive.

Class C

Class C networks have a first octet between 192 – 223 and use a default subnet mask of 255.255.255.0. For example, the IP address 201.158.121.158 is a class C address. Its first octet is 201, between 192 and 223.

In some cases, Classes D and E exist but aren’t used by end-users. Next, we will look into how networks can be divided using subnet masks.


Subnetting

Network classes A, B, or C, can be further divided into subnets by a system administrator through a process known as Subnetting. Subnetting works as seen in the example below:

Assume you have a wide area network (WAN) with 150 hosts on three physical networks connected by an IP router. Each of these three networks has 50 hosts. You are allocated the class C network 192.168.123.0.

Two addresses that you can’t use in this IP address are 192.168.123.0 and 192.168.123.255 because binary addresses with a host portion of all ones and all zeros are invalid. This means that you can only use the addresses 192.168.123.1 to 192.168.123.254 for your 150 hosts.

This will work perfectly if all 150 computers are on a single network, but you are on three separate networks. At this point, you can divide your network into subnets that allow you to use one block of addresses on multiple physical networks.

See also  Why Is The Dark Web Not Shut Down?

Using the subnet mask 255.255.255.192 gives you four networks of 62 hosts each. The four networks will be 192.168.123.0, 192.168.123.64, 192.168.123.128, and 192.168.123.192.

These four networks would have as valid host IDs:

192.168.123.1-62 192.168.123.65-126 192.168.123.129-190 192.168.123.193-254

Remember that binary addresses with a host portion of all ones and all zeros are invalid, so you can’t use addresses with the last octet of 0, 63, 64, 127, 128, 191, 192, or 255.


The Default Gateways

Besides the IP address and subnet mask, another address in IP addressing is called the “gateway” or “router,” depending on the platform, you are using. This gateway is the default address to which a device sends network data when that data is supposed to go to a network with a different network ID.

For instance, when you want to visit a website, your device first sends a request to the site’s IP address. This is sent from your device to your gateway(router), and your gateway forwards the request to the site’s server.

The server then sends the right information back to your gateway, which routes the information back to your device, and you then see and interact with the website in your browser.

Now that you understand how IP addresses work let us look into how devices get their IP addresses.

How Does a Device Get Its IP Address?

There are two ways a device can get its IP address:

Dynamic IP:

A dynamic IP address is assigned automatically when a device connects to a network. This is done by the Dynamic Host Configuration Protocol (DHCP). When a device connects to a network, it sends out a message requesting an IP address. DHCP intercepts this and assigns an IP address to that device from a resource of private IP addresses.

There are about 17.9 million private addresses, and they are used as the default router IP address for certain routers. The private IP addresses have ranges, and they include:

  • 10.0.0.0 – 10.255.255.255: Some ISPs use these addresses on their routers. If you use Xfinity, your router uses IP addresses in this range.
  • 192.168.0.0 – 192.168.255.255: Most commercial routers are in this range—for example, NETGEAR and D-Link.
  • 172.16.0.0 – 172.16.255.255: This is rarely used by commercial routers
  • 169.254.0.0 – 169.254.255.255: This is for when your PC cannot find a DHCP server; it assigns itself an address in this range. This could mean you have some trouble with your router or a network issue.

Static IP

Dynamic addresses can sometimes change, and you may want to give a device a permanent IP address. Perhaps you need to manually access it or have apps that only connect to devices with a certain IP address. This is where you need a static IP.

You can manually configure the device with a static IP address yourself or configure your router to assign static IP addresses to the devices instead of the default DHCP dynamic assignment. This way, the IP address never changes. However, be careful not to assign the same IP address to two devices. Next, we will look at how two devices can end up having the same IP address.

Can two devices have the same IP address?

When two devices have the same IP address, it is known as an IP conflict. A duplicate IP error can occur in three ways:

  1. Mistakenly assigning the same static IP address to two devices.
  2. Having two DHCP servers on your network. For example, if your wireless router and modem are both trying to act as a router.
  3. When a device comes back online after being in hibernation for long. For example, if you leave your laptop hibernated for a week. In that period, your router may have assigned the address to another device, and when you turn the PC back on, it may think it still owns that IP address, which causes an IP duplicate error.


See also  What Are the Risks of Online Gaming?

How to Fix IP Address Conflicts

Like any other issue with networks, the first thing to do is restarting the router or modem in question. The duplicate IP address error could be a temporary malfunction which a reboot will resolve. Also, rebooting your devices will change all IP addresses via DHCP.

Other methods to fix IP address conflicts include:

  1. Troubleshoot static IP addresses
  2. Check your router for conflicting devices
  3. Update your router firmware

What’s the Difference Between IPv4 and IPv6?

There are two different standards for IP addresses. They are Internet Protocol Version 4 (IPv4) and Internet Protocol Version 6 (IPv6). IPv4 was the first IP address used by the public, while IPv6 is the most recent version of IP.

IPv4

The IP addresses we have been talking about so far in this article are IPv4—an Internet protocol developed in the late 70s. The protocol uses the four octets of 32 binary bits and provides about 4.29 billion possible unique addresses. Most addresses are IPv4, and it’s the most widely deployed IP on the Internet.


IPv6

IPv6 is the most recent version of IP and uses a 128-bit address instead of the 32-bit of IPv4. It was designed as an upgrade and provides more addresses. The total number of unique addresses is estimated to be about 340 undecillion—a number more than atoms on the Earth’s surface.

IPv6 uses eight blocks of four hexadecimal digits, and a typical IPv6 might look something like this:

2012:8d2:200:fg70:c6fe:fd68:ecd1:3d2f

Does IP address change with location?

Yes, your IP address changes with location. Because you are changing locations, the connection may use different cables, and it will be quite hard to keep the same IP address.

Even if you don’t change location, your dynamic IP Address can change with time. For instance, if your contract with an ISP changes or expires, so does your IP address. The only instance where you can stick to using the same IP is if you purchased a static IP Address.


Can IP address reveal identity?

No, nothing personal. It’s not unusual that some people worry about the details other people might get to know about them if they have their IP address. Sure, they might find out some things, but it’s not at all personal.

As you already know, an IP address is the address of your computer when it’s connected to the Internet. When you visit an IP Lookup page like whatismyipaddress and paste your address into the Search box, here’s what you’ll find out:

You will see IP details like your city, region, country, ISP, ZIP code, and the postal code of where you live. These details, however, aren’t always near accurate. They could be hundreds of miles off, and if the person happens to be using a VPN, that would be inaccurate information.
To learn what a VPN is and how to choose one go here

Most times, when someone checks up an IP, it’s probably only the ISP they want to see. Even if they do check the others, they cannot know your street name or address.



Conclusion

Whenever you configure the IP protocol on your device, the configuration settings require an IP address, subnet mask, and a default gateway. To configure it correctly, it’s necessary to understand IP addresses and subnet masks. Hopefully, this article has made you better understand the concepts of how IP addressing works.

Scroll to Top