IP

IP is a datagram protocol for internetworks, but it was introduced for use on the Internet. The Internet consists of a series of interconnected networks, which internally may be of switched or broadcast nature, linked by IP routers. IP is intended to allow communication between any two hosts connected to the Internet, whether they are on the same or separate networks. An IP datagram will, therefore, typically cross several networks, encountering gateways called IP routers. There is no concept of setup or closedown and no attempt to track sequences of related packets either on an individual link, or over the path of a message. The one exception to this is where it is necessary to fragment a single datagram to allow it to cross a network with a maximum transmission unit (MTU) (the largest IP packet that will fit into the network's biggest allowable frame), too small to accommodate it as a single PDU. In this case, the router where the datagram enters the network performs the fragmentation, and the fragments are reassembled later within the IP layer at the destination.

Before proceeding further, let us see what an IP datagram looks like. The IP protocol used at present is version 4 (IPv4) and all IPv4 datagrams have the same format, shown in Figure 1. This consists of a fixed header, five 32-bit words in length, followed by a variable length options field, which may be omitted, and a variable amount of data. Datagrams are sent, most significant bits first (in the diagram these are on the left). The fields in the header are explained below.

Figure 1           IPv4 datagram

The IP service has only two primitives, SEND, and DELIVER. SEND includes parameters which map exactly onto the features just discussed, and the service user specifies all information required to generate the IP header.