The word “IP ” stands for “Internet Protocol.” An Internet Protocol address or IP Address is a unique logical numeric address has assigned to every single computer, printer, switch, router or any other network device. It is the core component of the TCP/IP network. There is no possibility of a network without an IP address. The IP address uniquely identifies every host in the network. There are two parts of the IP address
The network part
The network part specifies the unique number assigned to the network. It also identifies the class of the IP address. All hosts in a network are grouped in a single IP address range which is called it’s net or subnet.
The host part
This is part identify the host uniquely in the network. Each host assigns a unique address from the range of the network. Each network has a different address range and routers that operate on layer 3 connect these different networks.
Note:- Each host on the network, the network part of the address will be the same, but the host part should be different.
How Do IP Addresses Work?
As network devices generate a TCP or UDP segments, it adds a header with source IP address and destination IP address among other information. This PDU (protocol data unit) called a packet. When a router receives a packet, it looks at the destination address in the header and forwards it to the destination network. The packet may pass through multiple routers before it reaches the destination network. Each router it has to go through called a hop.
IP address Fields
This field plays a very important role in sending data through different hops. Version 4 is the most used version in today networking. The Figure below illustrates the header structure of the IPv4 address.
This field shows the version of the IP address. For IPv4 address, this value is 4.
Header length specifies the size of the header itself. The smallest size is 20 bytes. The figure does not show the rarely used options field that is of a variable length. Most IPv4 headers are 20 bytes in length.
The Differentiated Services field marking packets for Different Quality-Of-Service (QoS) levels. For example, data belonging to voice and video protocols have no acceptance for the delay. The DS field marks packets carrying data belonging to these protocols so that they get priority treatment through the network. On the other hand, peer-to-peer traffic considered a major problem and can mark down to give in best effort treatment.
The total length field specifies the size of the packet. The length contains the size of the header including the size of the data.
When a device receives a segment from TCP or UDP, It may require to break the segment into chunks called fragments before sending it out to the network. Identification fields find the fragments that make up the original segment. Each fragment of a segment will have the same identification number.
Used for fragmentation process.
Fragment offset field identifies the fragment number to reassemble the segment in the correct order.
Time to Live (TTL)
The TTL value is set to the originating host. Each router that the packet passes through reduces the TTL by one. If the TTL reaches 0 before reaching the destination; the packet is dropped. This is done to prevent the packet from moving around the network endlessly.
Protocol field identifies the protocol to which the data carrying belongs. For example, a value of 6 implies that the data has a TCP segment while a value of 17 signifies a UDP segment. Apart from TCP and UDP, there are many protocols whose data can carry in an IP packet.
The header checksum field is used to check for errors in the header. Each router and at the destination, a cyclic redundancy check performed on the header and the result should match the value stored in this field. If the value does not match, the packet is discarded.
Source IP address
This field stores the IP address of the source of the packet.
Destination IP address
This field stores the IP address of the destination of the packet.