What is the Internet Protocol and what does it have in common with sending letters?

If two or more computers are networked together, a standardised data transfer protocol is required to ensure data exchange between different operating systems and their computing methods.

Table of contents

If two or more computers are networked together, a standardised data transfer protocol is required to ensure data exchange between different operating systems and their computing methods. So, similar to sending a letter, you need the right address. In contrast to a home address, Internet Protocols (IP addresses) are not tied to a location, but are assigned to the network device when the connection is established.

The TCP/IP protocol (Transmission Control Protocol / Internet Protocol) handles this data exchange. This was developed by DARPA (Defense Advanced Research Projects Agency) at the end of the 1960s. The Internet, a globally available communication network, owes much of its success to the TCP/IP protocols.

Layer on which the IP is located

Internet Protocol is used in the OSI model (reference model for network protocols) Layer 2. In the OSI layer model, TCP/IP forms the basis for all communication connections.  

Examples of other Layer 2 protocols: IEEE 802.3 Ethernet, TLAP, FDDI, MAC, Token Ring and ARCNET

Versions: IPv4 or IPv6

There are two different variants: IPv4 and IPv6.

IPv4IPv6
32 Bit
128 Bit
4 Byte16 Byte

Protocols are divided into connection-oriented and connectionless protocols.

With connectionless protocols, the individual packets are sent by the source host in a predefined order. The destination host receives those packets in different sequences. In contrast, a connection-orientated protocol first establishes a connection between the source host and the destination host and only then transmits the packets.

The Internet Protocol belongs to the group of connectionless protocols, as it only deals with sending and receiving.

Structure of an IP packet

The Internet Protocol is responsible for ensuring that each data packet is preceded by the important structural properties in the header and assigned to the appropriate transport protocol.

0481216 20242831 Bit
VersionIHLTOSTotal Length
IdentificationFlagsFragment Offset
TTLProtocolHeader Checksum
Source Address
Destination Address
Options and Padding (optional)

Each IP header begins with the 4-bit version number. 4-7 represents information about the IHL (IP Header Lenght). The total length can be calculated from this value by multiplying it by 32 bits. Bits 8 - 15 contain instructions for handling or priority. From 16 - 31 bits it is the total length.

Identification

Each fragment of a diagram has the same identification number, which is transmitted by the sender.

Flag

The flag has indicator status, containing information and guidelines on fragmentation.

The first bit (bit0) is reserved and must always have the value 0. The second bit (bit1) shows whether the packet may be fragmented (0) or not (1). The last bit (bit2) demonstrates whether further fragments follow (1) or whether the packet is completed with the current fragment.

Fragment Offset

This field provides information on where the individual fragments belong so that the datagram can be completely reassembled. The fragment offset is a number which, for fragmented packets, indicates the position within the packet from which the fragment begins. The numbering refers to data blocks of 8 bytes (64 bits). A packet can therefore be split into smaller fragments several times in succession if necessary. Only the number of the first data block contained (offset) and the total length field must be adapted to the length of the fragment. The fragment, or a non-fragmented packet, contains the value zero as the offset. If a packet with 800 bytes of user data is split into two fragments, the offset of the second fragment is the number 50. As the offset does not contain any indication of how large the original packet is, the very last fragment must set the MF flag to zero.

TTL (Time to Live) - Lifetime

TTL is an 8-bit field that specifies the lifetime of the packet. If this field has the value zero, the packet is discarded. Each station (router) on the packet's path reduces this value by one. This is to prevent packets from being forwarded forever (for example, if the packet is incorrectly routed in a circle and would therefore overload the network).

The 1981 standard stipulates that each station reduces the TTL value by the number of seconds that the packet remains at the station, but at least by one. Today it is implemented as a hop count.

Protocol

The follow-up protocol is 8 bits in size. This field contains the user data transported in the relevant IPv4 packet. For example, if the IP packet contains a TCP packet, the value 6 represents a UDP packet 17. Since RFC 3232, these values have been defined and maintained by the IANA in an online database for protocol numbers.

This field also exists in the IPv6 header, but it is called Next Header there. The permitted values are the same as for IPv4.

Header Checksum

The 16-bit checksum field contains the checksum for the header. A checksum therefore only secures the header data area. IP itself has no mechanisms for checking the payload for correctness. This is ensured in the TCP/IP reference model by the transport layer. This value is re-verified at each station and - because the TTL changes per hop - recalculated.

Source Adress

The source and destination addresses each contain 32 bits, i.e. 4 bytes in ‘network byte order’. These IP addresses are written in four decimal numbers separated by dots.

Options und Padding

The option field specifies further additional information for the specific packet. The options are only optional in the header, but must be supported by all IP models. The format of the options is described in RFC 791. The maximum number of bytes that can be assigned with options in a specific packet results from (IHL*4)-20. As the 4 bits in IHL encode a value range from 0 to 15, up to 40 bytes can be assigned with options. The individual options themselves can have different lengths. There are both fixed-length and variable-length options. As the total length of the IP header is only defined in multiples of 4 bytes by the IHL field, unused bytes are filled with zeros (padding).

IP addressing

Structure of an IP address

An IP address is always dotted decimal: 192.168.10.1/24 or 255.255.255.0

An IP address consists of a network part and a host part. The network part identifies a subnetwork, the host part identifies a device (host) within a subnetwork. The exact division between the network part and the host part is defined by a subnet mask.

Example:

IP address: 194.95.162.121
Network share: 194.95.162.0
Subnet mask: 255.255.255.0
Host share: 0.0.0.121

The broadcast address is the last address in the network. After this, you have to go over to the neighbouring network. For example, if you arrive at 192.168.10.255, the next address is 192.168.11.1.

The Internet Protocol (IP) is used to address networks and their subscribers. This means that the respective data packets only reach the network in which the destination is located and are not misdirected. Addressing requires procedures in firmly defined network classes.

Network classes

Network classes are the various groups into which TCP/IP networks are divided. The first byte of an IP address can be used to recognise the corresponding class:

Classes

A            1.0.0.0 – 127.255.255.255/8                      255.0.0.0
B            128.0.0.0 – 191.255.255.255/16               255.255.0.0
C            192.0.0.0 – 223.255.255.255/24               255.255.255.0

Special classes:

D            224.0.0.0 – 239.255.255.255                     Multicasts
E             240.0.0.0 – 255.255.255.255                      Fix reserved

Private IPs:

A            10.0.0.0 – 10.255.255.255
B            172.16.0.0 – 172.31.255.255
C            192.168.0.0 – 192.168.255.255