Internet Protocol


See this article in another language:

Internet Protocol

IP stands for Internet Protocol. The most important task of the IP protocol is to route and specify the origin and destination of a packet. IP, like many other protocols in the network, has different versions and standards.

Currently, what is very common in computer networks is IPv4. Naturally, IPv6 should have been used in all computer networks by the end of 2022.

In fact, one of IPv4's big problems is how small it is compared to computers around the world. The structure of IPv4 is different from IPv6. The IPv4 structure consists of four 8-bit sections, with a period between each 8 bit; That is, in general, IPv4 is a 32-bit address.

That is, in the real world, you will be able to have 4,294,967,296 IPv4 numbers, which is very small compared to the number of computers in the world. The IP address consists of two parts NetID and HostID.

NetID or net id determines the extent of your computer network and host ID makes your computer unique in a computer network. Unlike the story we had in different sections of MAC address, in IP address, the value of net id and host id may not be same in one IP address.

What I mean is that in the 48-bit MAC address we said, it consists of two parts: OUI and Device ID, each of these parts is 24 bits, that is, the number of their bits is equal to each other. But in IP address, in most cases, network id and host id are not same number of bits.

Subnet mask

The important question here is: what determines how many bits of each IP address are related to the host ID and how many bits are related to the network ID?

Next to each IP address, another component called a subnet is specified, which determines the Net ID bits. In computer networks, the network administrator determines what IP address each computer on which subnet will have.

The subnet mask actually determines how much of an IP address belongs to the Net ID. For example, you need to enter a subnet mask when setting the IP on your computer.

If you enter the value in this field, it means that your Net id contains 24 bits and your Host id contains 8 bits. In some systems, this value is also referred to as 24.

That is, the high value is displayed as "" in some systems. After the "/" sign, the number of bits belonging to the net id is placed. In fact, everything is related to the conversion of decimal numbers to binary.

You can't have any subnet mask you want. Actually, since the bits are added one by one, no desired subnet mask can be created.
In the table below, I have written for you the available subnet masks for IPv4:


Subnet mask

Binary mask





















































If you use subnet mask in your network then two bits left for hostid and you can generate 4 IPs with these two bits.

If you use subnet mask in your network, you will have three bits for hostid and you can generate 8 ip with these three bits. And likewise, if you use the /24 subnet, you can have 256 IPs in total.

It means you can produce 0 to 255 numbers with 8 bits. This means that, in total, we will have 256 one-octet numbers. If all host ID bits in an IP address are zero, this IP address is called a network ID.

And if all hostid bits in an IP address are equal to one, this IP address is called IP broadcast. It means that it is true that we have the ability to create 256 IP addresses with 8 bits, but we cannot assign this number to hosts on the network.

Out of these 256 IP addresses, we have two IP addresses related to Broadcast IP and Network ID. Consequently, out of these 256 IP addresses, we can only assign 254 IP addresses to hosts in the network.

That is, if you use the /30 subnet mask, you can only have two hosts in your network.

IP Address version 6

The main reason for producing IPv6 was that there was a limit on the number of IPs in IPv4. Of course, IPv4 had other flaws that we haven't seen in IPv6.
IP is actually the logical address used in the third layer of the alleged OSI model.

Leave your comment