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

This free course is available to start right now. Review the full course description and key learning outcomes and create an account and enrol if you want a free statement of participation.

Free course

Protocols in multi-service networks

3.4.2 Primitives

TCP primitives are implemented as application program interfaces (APIs). Those provided on a particular computer system depend on how the TCP software is written. I shall now briefly describe the abstract interface given in the specification of TCP. You should bear in mind that, although specific implementations will perform similar functions, the methods of achieving them may differ. Table 5 lists the primitives and their parameters. Most of the parameters are fairly self-explanatory but parameters of the open primitive are described below.

Table 5: TCP primitives

Primitive name Primitive parameters
Abort Local connection name
Close Local connection name
Open Local port number, foreign socket, active/passive flag, time-out, precedence, security/compartment, options
Returns a local connection name
Receive Local connection name, buffer address, byte count
Returns a byte count and status of the urgent and push flags
Send Local connection name, buffer address, byte count, push flag, urgent flag, time-out
Status Local connection name
Returns status data about the network addresses, port numbers, state, buffers, etc.

The local port number in the open primitive is the 16-bit number chosen by the application to identify itself. The foreign socket identifies the host to which it wants to be connected, and consists of the network address and port number of the destination host.

The active/passive flag indicates the type of open primitive. An active open will begin to open a specific connection immediately, whereas a passive open will cause the host to listen for an incoming connection. For example, an HTTP server may request a passive open for port 80 which indicates that it is willing to receive HTTP commands from any host that has a destination port of 80.

The open primitive returns a local connection name, which is specified in other primitives to identify the connection.

The operation of the transmission control protocol follows that of a finite state machine, and Figure 19 shows a state diagram representation of the TCP connection management. However, not all possible state changes are represented in this simplified diagram. It is meant to illustrate the operation of TCP, not to be a specification.

Figure 19
Figure 19 TCP connection finite state machine

SAQ 9

Amend the signal sequence diagram in Figure 19 to show the state of each host after it receives an incoming signal. Assume that the TCP entities in both hosts start in the ‘CLOSED’ state. You will need to infer the arrival of a primitive for some state transitions and you should include the primitives on the diagram.

Answer

See Figure 20. The names of the states appear in rectangles at appropriate points in the signal sequence diagram.

Figure 20
Figure 20 Answer to SAQ 9

SAQ 10

Briefly describe what you believe is the function of each primitive listed in Table 5 based on its name and its parameters.

Answer

My descriptions are given below:

  • abort – to terminate a connection and discard all pending data awaiting transmission or reception;

  • close – to clear a connection once all data awaiting transmission is transmitted;

  • open – to open a connection, in either passive or active mode;

  • receive – to allocate buffer space to store incoming data;

  • send – to indicate the buffer containing the data to be sent over a connection;

  • status – to request information about the status of a connection.

The primitives are described more fully in RFC 793.

T822_1

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to university level study, find out more about the types of qualifications we offer, including our entry level Access courses and Certificates.

Not ready for University study then browse over 900 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus