Skip to content
Skip to main content

About this free course

Download this course

Share this free course

Protocols in multi-service networks
Protocols in multi-service networks

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

3.5 Internet protocol (IP)

At the time of writing (2002), two versions of IP are available: versions 4 and 6. In this section I shall describe version 4, which is abbreviated to IPv4, as it is the more widely available version. Version 6 may eventually replace version 4 because it has some additional features that may prove essential for multiservice networks.

IPv4 is the main TCP/IP protocol in the internetwork layer of the TCP/IP reference model. It supports a connectionless service between hosts in an internetwork and its principal function is to forward the protocol data units, called datagrams in IP terminology. This is achieved by each datagram carrying a unique address of its destination. Figure 21 shows the format of an IPv4 datagram.

Figure 21
Figure 21 IPv4 datagram

The following fields are identified in Figure 21:

  • version number (4 bits) – identifies the version of IP that sent this datagram;

  • header length (4 bits) – contains the number of 32-bit words in the header;

  • type of service (8 bits) – identifies the service requirements, such as reliable data transfer or fast data transfer, which can influence the choice of route;

  • total length (16 bits) – gives the total number of bytes in the header and user data field;

  • identification (16 bits) – provides a means of identifying datagrams that carry parts of the same data from the transport layer. A router may need to fragment a datagram for transfer through sections of an internetwork, and if this occurs all datagrams carrying fragments of the original datagram have the same value in this field so that they can be re-assembled before being passed to the transport layer of the destination host;

  • DF (1 bit) – the ‘don't fragment flag’ indicates that a datagram should not be fragmented;

  • MF (1 bit) – the ‘more fragments flag’ indicates that a datagram is not the last fragment;

  • fragment offset (13 bits) – indicates where the fragment belongs when measured in multiples of 8 bytes. The first fragment has an offset of 0;

  • time to live (8 bits) – gives a way of indicating how long a datagram should exist in an internetwork. In practice, the time-to-live field is a hop counter, which is decremented by 1 each time a datagram is forwarded by a router. A datagram is discarded if the time-to-live value reaches 0;

  • protocol (8 bits) – identifies the protocol that is using IP, e.g. TCP or UDP;

  • header checksum (16 bits) – contains a simple form of cyclic redundancy check for a datagram, but is applied only to the header information;

  • source address (32 bits) – contains the network address of the host which sent the datagram;

  • destination address (32 bits) – contains the network address of the host which should receive the datagram;

  • options (0 or more 32-bit words) – provides a way of identifying optional features associated with security or routing;

  • user data (optional) – contains the data from the higher layer.

The IPv4 network addresses, which appear in the source and destination fields, are very important and are described in the next subsection.