WHAT IS IP?
It is an abbreviation formed by the initials of the phrase Internet Protocol. It is a number required for each device in the network to communicate with each other, to be aware of each other and to transfer data to each other.
Let’s imagine that two computers in the network are sending any data to each other. There may be many devices in the network. With the large number of devices, an address is needed to direct the data to the correct destination. This address is IP.
IP addresses are not fixed like MAC addresses, so they can be changed at any time. This prevents IP addresses from being occupied unnecessarily. If a device is not active on the network, the IP used by that device can be used by another device entering the network. This prevents unnecessary IP occupation. This feature also gives rise to the concept of dynamic IP. The device entering the network uses the IP assigned by the service provider. Likewise, users can request a static IP from the service provider if they wish.Türk Telekom has recently started to offer this service in our country.
The IP address must be different for each device. Otherwise, there will be conflicts and there will be problems in the communication or data sharing of devices on the network.
IP addresses are 32-bit numbers consisting of 4 octets (groups of 8). They are written in decimal to make them easier to read. However, to better analyze the IP, it is necessary to convert each octet into 8bit (1 byte) values.
IP addresses consist of two parts. The first part is the network ID and indicates the network where the device is located. The second part is called host ID and indicates the address of the device on the network. For example, let’s take the IP 192.168.10.189. Here 192.168.10 is the network ID. 189 is the host ID. In order for the device on the network to understand which network it has, it needs a value called subnet mask. It finds its own network address by putting the IP address and the subnet mask value into a logic AND operation. In order to understand the subnet mask value, we need to learn the network classes first.
PRIVATE IP ADDRESSES
Some IP numbers are reserved for use in local networks. You cannot go on the internet with these IPs. These addresses are called private addresses. The IP addresses we use on the internet are called public addresses.
- 10.0.0.0 ile 10.255.255.254
- 172.16.0.0 ile 172.31.255.254
- 192.168.0.0 ile 192.168.255.254
CLASS A ADDRESSES
The first address in an IP address is between 0 and 127. But 0 and 127 are special cases not used in the network. The first octet shows the network ID and the other 3 octets show the host ID, so the number of networks that can use class A is 126. The subnet mask is 255.0.0.0.0.
CLASS B ADDRESSES
The first octet in the IP address is between 128 and 191. The first two octets indicate the network ID and the other two octets indicate the host ID. The subnet mask is 255.255.255.0.0.
CLASS C ADDRESSES
The first octet in the ID address is between 192 and 233 and the default subnet value is 255.255.255.255.0. So the first 3 octets are the network ID and the last octet is the host ID.
CLASS D ADDRESSES
The first octet in the IP address is between 224 and 239. This addressing class is used for multicast.
CLASS E ADDRESSES
The first octet in the IP address is between 240 and 247. These addresses are reserved for future development.
SUBNETS
The physical part of the network separated from other parts by a router is called a subnet. Subnetting is needed to reduce traffic in the network and to use different network topologies. Also, addressing is easier with subnets. Subnets in the same network must have different network IDs. For this reason, it is necessary to create a new subnet with the IP class we have.
SUBNET MASK CALCULATION
First the IP number is converted from decimal to binary. Then the class of the IP is determined. The subnet mask of the IP whose class is known is also converted to binary value. Then the IP and subnet mask converted to binary value are put into logic AND operation. The resulting value is converted back to decimal and thus the network ID is found. We can explain this even more simply with an example:
Take the IP 192.168.2.1. We first convert this value to binary.
- 11000000 10101001 00000010 00000001
Since the first octet is 192, we determine that this IP is in class C and the subnet mask is 255.255.255.255.0 and convert this value to binary.
- 11111111 11111111 11111111 00000000
And finally we put these two values into a logic AND operation.
- 11000000 10101001 00000010 00000001
- 11111111 11111111 11111111 00000000
- 11000000 10101001 00000010 00000000
The last result we get is our network ID. And finally we convert this value to the decimal system.
- 192.168.2.0 is the network ID we want to obtain.
We can also make it even easier with numbers after the ID number indicating how many ones are in the subnet. For example
- In IP written as 192.168.2.1/24, we can understand that we will AND the IP address with a subnet containing 24 one from the beginning.
IP PROTOCOLS
Today, IPv4 and IPv6 protocols are widely used.
IPV4
They are IPs consisting of 32 bits. IPv4 as the internet world is growing rapidly
The over 4 billion IP numbers created by IPv4 were no longer enough. To prevent this, the NAT protocol was added as a patch to IPv4. The purpose of NAT is to make an IPv4 address available for multiple computers to share when going out to the internet. It allows private IP addresses to exit to the internet. Thus, it acts as a gateway between computers. But because of this, it has destroyed point to point addressing and packet integrity. Since it was seen that the NAT protocol did more harm than good, the transition to IPv6 was mandatory.
IPV6
IPv6, which is 128 bits, was developed when IPv4 became insufficient. With this new addressing structure, an almost unlimited address range was created. In addition, packet headers have been removed in this version, resulting in faster transmission, and by assigning priority to video and audio packets, it will overcome the audio and video problem that IPv4 supports with qos but is insufficient. In addition, the encryption system is more secure.