Introduction of IP
- The Internet Protocol is the building block of the Internet.
- The Internet Protocol is fundamental for allowing computers, smartphones, and other devices to communicate with each other over the Internet.
Definition of IP
- Internet Protocol (IP) is a set of rules that govern how data is sent and received over the Internet or any network.
Feature of IP
- IP is a connectionless protocol, which means it does not exchange control information (handshake) to provide end-to-end control of communications flow. It relies on other layers to provide this function if it is required.
- IP is stateless, meaning each packet is treated independently, disregarding previous packets. This improves network efficiency but means that packets may arrive out of order or even get lost.
- IP is part of the Internet Protocol Suite, which also includes protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
- IP also relies on other TCP-IP layers to provide error detection and correction; because of this, IP is sometimes referred to as an unreliable protocol because it contains no error detection and recovery code.
- IP can be relied upon to deliver user data to the connected network accurately, but it doesn’t check whether that data was correctly received.
Types of IP
There are two types of IP used in communication in a computer network. These are –
-
IPv4 (Internet Protocol version 4):
-
The most commonly used version is represented as four numbers (e.g., 192.168.0.1) separated by dots, each ranging from 0 to 255.
-
It has a limited address space (about 4.3 billion addresses).
-
-
IPv6 (Internet Protocol version 6):
-
A newer version is designed to replace IPv4 due to the exhaustion of IPv4 addresses.
-
IPv6 addresses are longer and written as eight groups of hexadecimal numbers (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334), providing a vastly larger address space.
-
Function/Role of IP
The common functions of IP are : –
- It helps to move data between the Network Layer and the Transport Layer.
- IP supports Packet-Switching, i.e., Data is divided into small units called “packets.” Each packet contains both the data being transmitted and relevant information (headers), such as the sender’s and receiver’s IP addresses.
- IP works closely with TCP or UDP to ensure the data is transmitted reliably (TCP) or with minimal delay (UDP).
- TCP/IP (Transmission Control Protocol/Internet Protocol) is the most widely used communication protocol suite, where IP handles addressing and routing, and TCP ensures reliable delivery.
- It defines the datagram structure, which is the basic unit of transmission on the Internet.
- Addressing: Each device on the network is assigned a unique IP address (e.g., 192.168.1.1), which acts like a digital postal address to identify where data is coming from and going to. These IP addresses are defined by IP.
- Routing: Routers direct each packet along the best path toward its destination, considering the IP address. Routers use IP addresses to determine the most efficient path for forwarding packets between networks, potentially across vast distances (such as across countries). Thus, it plays a central role in routing and delivering packets (small units of data) from one device (source) to another (destination). Finally, it helps in routing datagrams to remote hosts.
- Fragmentation: In this process, data is broken down into smaller packets that can be transmitted efficiently over the network. This is called fragmentation, and the re-assembly of datagrams occurs at the destination to reconstruct the original data during transmission.
IP Header or Packet Structure
- An IPv4 packet is also called an IPv4 datagram.
- The IPv4 header or packet format defines the structure of data transmitted over IP networks(network layer), consisting of a variable-length header and payload.
- The header length varies from 20 bytes(minimum) to 60 bytes(maximum), while the data field carries the actual user information.
- An IPv4 packet format or IPv4 header consists of:
- Header (20–60 bytes) part
- Data (Payload) part
- The maximum possible size of an IPv4 packet (header + data) is: 65,535 bytes, where a 16-bit field can represent values from 0 to 65,535. Here,
- Minimum header size 20 bytes
- Maximum header size 60 bytes
- Maximum data (payload) size 65,515 bytes (65,535 − 20)
- Maximum total packet size 65,535 bytes. This limit is because the Total Length field = 16 bits, hence the maximum value of 16 bits = 2¹⁶ − 1 = 65,535.
- This is a theoretical maximum size, whereas the actual packet size depends on MTU (Maximum Transmission Unit). The larger packets beyond the defined size are fragmented during transmission
- The components or fields of the IPv4 header are –

- Version (4 bits)
-
This field indicates the IP version. For example, IPv4 means the value is always 4.
-
- Internet Header Length(IHL) (4 bits)
-
This field specifies the length of the IP header in 32-bit words. The minimum value is 5 (5 × 4 = 20 bytes).
-
- Type of Service (ToS) / DSCP(Differentiated Services Code Point) (8 bits)
- This field specifies the quality-of-service parameters, such as control priority, delay, and throughput.
- The old Type of Service (ToS) field (8 bits) is now redefined as DSCP = 6 bits and ECN = 2 bits, Total = 8 bits.
- DSCP is used for Quality of Service (QoS). It defines packet priority and handling behavior, i.e., it helps routers to decide:
- Which packet to forward first
- Which packet to delay or drop
- Total Length (16 bits)
-
This field defines the total length of the packet, including the header and data.
-
The maximum packet size is 65,535 bytes.
-
- Identification (16 bits)
-
This field uniquely identifies a packet using a unique ID.
-
It is mainly used during fragmentation to reassemble packets.
-
- Flags (3 bits)
- This field controls packet fragmentation.
- There are the following flags –
- DF (Don’t Fragment)
- MF (More Fragments)
- Fragment Offset (13 bits)
- This field indicates the position of a fragment in the original packet.
- Time To Live – TTL (8 bits)
-
This field specifies the maximum number of hops a packet can travel and is decremented by each router.
-
It prevents packets from circulating endlessly or infinite loop.
- It limits the packet lifetime.
-
- Protocol (8 bits)
-
This field identifies the upper-layer protocol.
-
Examples:
-
6 → TCP
-
17 → UDP
-
1 → ICMP
-
-
- Header Checksum (16 bits)
- This field is used to detect errors in the IP header only.
- It is recomputed at each router.
- Source IP Address (32 bits)
- This field stores the sender’s IP address.
- Destination IP Address (32 bits)
- This field stores the receiver’s IP address.
- Options (0–40 bytes)
- This optional field is used for special purposes such as security and route recording.
- It is rarely used
- Padding
- It ensures the header is a multiple of 32 bits, i.e., padding is added to make the header length a multiple of 32 bits.
-
Data (Payload)
-
This field carries the actual user data from upper-layer protocols.
-
![]()
0 Comments