How IP addresses work
IP addresses

How IP addresses work

IP addresses

Every device connected to the network (computer, tablet, mobile phone, camera, or anything else) needs a unique identifier so that other devices can know how to communicate with it. In the world of TCP / IP networks, this identifier is the same as the Internet Protocol (IP) address. If you want to take a closer look at the meaning of the numbers used in these URLs, this article is for you.

If you’ve worked with a computer for a while, you’ve probably encountered IP addresses (a series of numbers similar to Most of the time we do not deal with them directly and our device and network do the related work behind the scenes. What we do in this regard is often just following the instructions for entering these numbers in the specified sections. But if you want to take a closer look at the meaning of these numbers, follow the rest of this article.

But why do these numbers matter? In fact, understanding how IP addresses work is crucial for times when you want to troubleshoot your network problems, or why a particular device is not connecting to the network as usual. Also, if you want to make advanced and custom network settings (such as hosting a game server or media server that specifies which of your friends can connect to it over the Internet), you should consider IP addressing. Have information. And that getting acquainted with such technologies will not be without grace.

Note that in this article we will cover the basics of IP addressing in a way that people use in IP addresses but do not know why. This article skips the discussion of professional and complex basics, IP classification, and custom subnets.

What is an IP address?

An IP address is a unique representation of a device on a network. You have dealt with such addresses a lot: they are something like An IP address is always a set of four numbers like this. Each number can be in the range between 0 and 255. All IP addressing is in the range of to

The reason each number can only be up to 255 is that each of these numbers is actually an eight-digit binary number (called an octet). In octet numbers, the number zero will be 00000000 and the number 255 is represented by 11111111 (the maximum number that octet can reach). This ip address we mentioned earlier ( in binary format would look something like this:


Computers work in binary or binary formats, but we humans do much easier to work in decimal formats. Do not worry, we are not going to go into too much detail about binary numbers or math in this article. So just join us in this.

Two parts of an IP address

In fact, the IP address of a device consists of two separate parts:

  • Network ID: The network ID is the part of the IP address that starts on the left and identifies the specific network in which the device is located. In a normal home network where the IP address is assigned to a device, section 192.168.1 of this address will be the network ID. Usually the last part is filled with zero by default, so you can say that the network ID of this device is
  • Host ID: The host ID is the part of the IP address that is not occupied by the network ID and indicates a specific device (in the TCP / IP world we call devices host) in this network. In the IP address of our example the host ID is 34. This unique host ID is

There may be several devices on your home network with IP addresses such as,, 192.168.1 30 and All of these are unique devices (in our example with host IDs 1, 2, 30 and 34) on a single network (with network ID

To better understand these, let us proceed with a practical example. Addressing the streets in a city is a similar example. Consider an address similar to 2013 Paradise Street. The street name is synonymous with the network ID and the house plate is the same as our host ID. Inside the city, the names of two streets are not similar, just as in a network no two network identifiers are named alike. In a given street, each house has its own license plate number, just like all host IDs within a network ID that are unique.

Subnet Mask

Now how does your device detect which part of the IP address represents the network ID and which part represents the host ID? For this they use a third number that you always see with an IP address. This number is called the Subnet Mask.

In most simple networks (similar to those used in homes and small offices) you will see a Subnet Mask similar to, all of which consists of 255 or 0 numbers. The change position from 255 to 0 indicates the separation between the network ID and the host. These 255s separate the network identifier from the rest of the equation.

Note: The basic subnet masks we describe here are known as the default subnet masks. In larger networks, the issue becomes more complex. People often use custom subnet masks (where the position of the intersection between zeros and ones is shifted by an octave numbering) to build multiple subnets on the same network.

Default gateway address

In addition to the IP address and subnet mask assigned to it, you will also see a default gateway address in the data list. Depending on the platform you are using, this address may be referred to by a different name. Sometimes from names like “router,” “router address,” default route, “or just” gateway. ” Is used. All of this points to a specific issue. This is the default IP address that a device uses when sending data to a different network (a network with a different network ID) from the network where the device is located.

The simplest example of this is normal home networks. If you have a home network with multiple devices, you are likely to use a router that is also connected to the Internet via a modem. This router may be a separate device or it may be part of a modem / router combination device. This router sits between computers and devices within your network and moves traffic between them.

Suppose you open your browser and go to . Your computer will send a request to the IP address of the network site. Because the servers of the network site are located on the Internet instead of your home network, this traffic is sent from your computer to the router (the same as Gateway) and your router transmits this request to our server. The server then sends the correct information to your router, and finally this information is transferred to the device that made this request, and you see the network site in your browser.

Routers are usually configured by default to use their own IP address (their address on the local network) as the first host ID. So, for example, on a home network that uses for the network ID, the router is usually identified by the address Of course, like many other things, you can configure it to use a different address.

DNS servers

There is also a final piece of information that you will see next to a device’s IP address, subnet mask, and default gateway address, which includes the address of one or two domain name system (DNS) servers. We humans work with a better name than a number. Typing in the browser’s address bar is much easier than memorizing and typing the ip address of this site.

DNS works like a phone book. Looks for the names of websites and converts these names to the associated IP address. DNS does this by storing this information on a DNS server system across the Internet. Your device must know the address of these DNS servers in order to send your request to them.

On a home network or small office, the IP address of the DNS server is often the same as the default gateway address. Devices send their DNS request to your router, from where it is redirected to the DNS server address specified in your router’s configuration. This is the default DNS server provided by your ISP, but you can change it to use the DNS server you want. You may get better results using DNS servers provided by third-party providers such as Google or OpenDNS.

To change the DNS server to Google it to read

What is the difference between IPv4 and IPv6?

You may come across a different type of IP address called IPv6 while checking settings. The IP address we talked about so far was called IP version 4 (IPv4). The protocol was developed in the late 1970s. They use 32-bit binaries (four octet classes) to provide 4.29 billion unique addresses possible. Although this figure is very high, but a long time ago all the available addresses were assigned to different businesses. Although many of them are unused, they are occupied and cannot be used for other purposes.

In the mid-1990s, concerns about the possibility of a shortage of IP addresses led the Internet Engineering Task Force (IETF) to design IPv6. IPv6 uses 128-bit addresses instead of 32-bit addresses, so the sum of the number of unique addresses reaches a number that is unlikely to expire any time soon.

Unlike the decimal point symbol used in IPv4, IPv6 addresses are expressed in groups of eight separated by a colon (:). Each group consists of four hexadecimal digits representing 16 binary digits (hence the name hexadecimal or hexadecimal). An IPv6 address is something like this:

2601: 7c1: 100: ef69: b5ed: ed57: dbc0: 2c1e

How does a device get its IP address?

Now that you know the basics of how IP addresses work, let’s talk a little bit about assigning IP addresses to devices. There are two types of IP allocation: static and dynamic.

A dynamic IP address is automatically assigned to the device when it is connected to the network. The vast majority of networks today (including your home network) use something called Dynamic Host Configuration Protocol (DHCP) to do this. DHCP is built into your router. When a device connects to the network, it sends an IP address request message. DHCP receives this message and after a set of available free addresses, assigns an IP address to that device.

There is a specific private IP address range that routers use for this purpose. What these URLs look like depends on your router’s settings for this purpose. This range of private IP addresses includes:

  • – If you are a Comcast / Xfinity client, the router provided by your Internet service provider selects the addresses assigned within this range. Some other service providers also use these URLs. Apple, for example, uses this structure in its AirPort routers.
  • – Most commercial routers are configured to specify IP addresses in this range. For example, most LinkSite routers use the network, while D-Link and NetGeer use the range.
  • – This range is rarely used by commercial vendors.
  • – This is a special domain used by a protocol called Automatic Private IP Addressing. If your computer (or other devices) is configured to automatically receive its IP address but cannot find a DHCP server, it will receive its address within that range. So if you see one of these addresses, it means that your device could not find a DHCP server and you may have a network problem.

The thing about dynamic addresses is that they can change sometimes. DHCP servers temporarily provide IP addresses to devices, and the device must receive a new address when this time expires.

Most of the time, this is not a problem and everything continues to work. But from time to time you may want the IP address of a device to remain the same. For example, you may have a device that you want to access manually and need to remember its IP address, or you may have an application that only connects to your network and device via an IP address.

In such cases, you can assign a static or IP address to these devices. There are several ways to do this. You can manually set up a static IP address for the device, which is a bit time consuming and tedious. A better solution is to configure your router to assign a static IP address to specific devices via the DHCP server. This way the IP address will never change.

follow on facebook
follow on linkedin
follow on Reddit