3.5.4 Primitives
The two abstract primitives described in the specification of IPv4 are given in Table 9 but, as with TCP, different systems may implement the interface in different ways. In some computer systems the TCP and IP software may be written as a single software module, and in these cases there is not a clear interface between the two layers.
Primitive name | Primitive parameters |
---|---|
Recv | Buffer pointer, protocol, source address, destination address, type of service, length of buffer, optional user data |
Returns a report on the outcome of the primitive | |
Send | Source address, destination address, protocol, type of service, time to live, buffer pointer, length of buffer, identifier, don't fragment flag, optional user data |
Returns a report on the outcome of the primitive |
You should be able to match most of the parameters to fields in IPv4 datagrams.
SAQ 13
Identify the protocol data units and primitives required to send an HTTP command between a client and server in the transport and internetwork layers.
Answer
Assuming that a connection does not already exist between the HTTP application running on the client and the HTTP server application, the client application layer requests that the transport layer sets up a connection by issuing a TCP open primitive. Note that the foreign socket includes port number 80. (Before this request, the application would have to translate the host name to a network address to create the foreign socket value required by the open primitive.)
The transport layer encapsulates the TCP segment that is setting up the connection in an IP datagram by invoking an IP send primitive. In other words, the TCP segment is the optional user data parameter of an IP send primitive. The TCP segment that is the third part of the three-way handshake, acknowledging the connection in the opposite direction, is encapsulated in another IP datagram. This is accomplished by the transport layer invoking another IP send primitive.
The HTTP client application requests that the data representing the HTTP command be transferred to the HTTP server application by invoking a TCP send primitive. The transport layer transfers this data by invoking an IP send primitive, thereby encapsulating the TCP segment in an IP datagram. Depending on the size of the command, the transport layer may have to fragment the user data over several segments. Similarly, during the transport of the datagram(s) further fragmentation may take place.