An IP(Internet Protocol) address is a unique address that is assigned to every single computer, printer, switch or any other network device that is part of a TCP/IP-based network.
An IP address is a 32-bit binary number having an address space of 232. Usually represented as 4 decimal values, each representing 8 bits, in the range of 0 to 255 (known as octets) separated by decimal points. This is known as “dotted decimal” notation.
There are two standards of IP address:
- IP Version 4 (IPv4)
- IP Version 6 (IPv6)
IPv4 Address
IPv4 uses 32 binary bits to create a single unique address on the network. An IPv4 address is expressed by four numbers separated by dots. Each number is the decimal representation of an eight-digit binary number, also called an octet. For example 192.168.0.1
The numbers in an IP address are divided into 2 parts:
The network part specifies which networks this address belongs
The host part further pinpoints the exact location
IP Frame Format:
Internet protocol is a layer-3 protocol that takes data segments from layer-4 and divides it into packets. IP packet encapsulates data unit received from above layer and adds to its own header information.
- Version: Version no. of Internet Protocol used( e.g. IPv4)
- Header Length: length of the entire IP header.
- Service type
- DSCP: Differentiated Services Code points; this is a type of service.
- ECN: Explicit Congestion Notification; it carries information about the congestion seen in the route.
- Total Lenght: Lenght of entire IP Packet( including IP header and IP Payload).
- Identification: If the IP packet is fragmented during the transmission, all the fragments contain the same identification number to identify the original IP packet they belong to.
- Flags: As required by the network resources, if the IP packet is too large to handle, these ‘flag’ tells if they can be fragmented or not. In this 3-bit flag, the MSB is always set to ‘0’.
- Fragment Offset: This offset tells the exact position of the fragment in the original IP packet.
- Time to Live: To avoid looping in the network, every packet is sent with some TTL value set, which tells the network how many routers this packet can cross. At each hop, its value is decremented by one, and when the value reaches zero, the packet is discarded.
- Protocol: Tells the network layer at the destination host, to which protocol this packet belongs, i.e the next level protocol. For example protocol number of ICMP is 1, TCP is 6 and UDP is 17.
- Header checksum: This field is used to keep the checksum value of the entire header which is then used to check if the packet is received error-free.
- Source Address: 32-bit address of the sender (or source) of the packet.
- Destination Address: 32-bit address of the Receiver (or destination) of the packet.
- Options: This optional field, is used if the value of Hearder length is greater than 5. These options may contain values for options such as security, Record Route, Time Stamp, etc.
I got clear concept from this article