IP is the underlying protocol used by World Wide Web (WWW) to connect other computers over the network which is included in the #Internet Protocol Suite (TCP/IP). It is considered as #Network Layer protocol according to #Open Systems Interconnection (OSI) Model. Currently, it has two versions: IPv4# and IPv6#.
The size of an IP datagram usually range from 20 to 65536 bytes. Its structure is like the following:
- Header, size range from 20 to 60 bytes
- Data
- VER, indicates the version of the IP used, 4 bits or half a byte of size
- HLEN, indicates the length of the header, 4 bits or half a byte of size
- DS, specifies the type of Differentiated Service#, one byte of size
- Total length, indicates the total length of the datagram, 2 bytes of size
- Identification, used to identify the packet, 2 bytes of size
- Flags, 3 bits of size
- Fragmentation offset, used to identify the order of the packet if fragmentation was done on the packet, 13 bits of size.
- Time to live (TTL), specifies the life time of the packet, 1 byte of size
- Protocol, specifies the protocol used, 1 byte of size
- Header checksum, used for error controlling, 2 bytes of size
- Source IP Address#
- Destination IP Address
- Option (optional)
The following table shows the possible value of Protocol field to indicate which Protocol# is in used: