next up previous contents index
Next: TEST Up: Protocol Specifications Previous: SWP

TCP

NAME

TCP (Transmission Control Protocol)

SPECIFICATION

Transmission Control Protocol. Request for Comments 793, USC Information Sciences Institute, Marina Del Rey, Calif., Sept. 1981

SYNOPSIS

TCP is a reliable stream transport protocol. It maintains a connection between the server and the client, and provides reliable stream delivery to the process. This implementation is an encapsulation of the Unix 4.3 BSD implementation.

This implementation of TCP supports input and output buffering. Output buffers are contained within TCP. If the amount of data sent and unacknowledged by the peer reaches the output buffer size, TCP will block subsequent xPush's (or will return XMSG_ERR_WOULDBLOCK in the case of non-blocking I/O.)

TCP provides support for users to work with finite input buffers. TCP will limit the amount of input data sent to its upper protocol via xDemux to the size of the input buffer. When data have been consumed from the user's input buffer, free buffer space must be signalled to TCP via a TCP_SETRCVBUFSPACE call (see below.) If a user does not wish to use input buffering, a control message signalling an empty buffer should be sent in response to each xDemux.

REALM

TCP is in the ASYNC realm.

PARTICIPANTS

TCP removes a pointer to a long (the TCP port number) from the participant stack. TCP ports must be less than 0x10000. If the local participant is missing, or if the local protocol number is ANY_PROT, TCP will select an unused local port.

CONTROL OPERATIONS

TCP_PUSH:
Force a TCP message to be sent. (session only)
Input:
none
Output:
none

TCP_GETSTATEINFO:
Returns state of the connection. (session only)
Input:
none
Output:
int

TCP_DUMPSTATEINFO:
Prints out statistics gathered by TCP. (protocol only)
Input:
none
Output:
none

TCP_GETFREEPORTNUM:
Returns an unused TCP port number. This port number will not be given out to subsequent TCP_GETFREEPORTNUM calls until it is released with TCP_RELEASEPORTNUM. This allows an opener to separate reservation of free ports from the actual open operation, if desired. (protocol only)
Input:
none
Output:
long

TCP_RELEASEPORTNUM:
Releases a TCP portnumber previously acquired with TCP_GETFREEPORTNUM. (protocol only)
Input:
long
Output:
none

TCP_SETRCVBUFSPACE:
Tells TCP how many bytes in the receive queue are free. (session only)
Input:
u_short
Output:
none

TCP_SETRCVBUFSIZE:
Tells TCP the size of the TCP user's receive queue. (session only)
Input:
u_short
Output:
none

TCP_GETSNDBUFSPACE:
Asks TCP for the number of free bytes its send queue. (session only)
Input:
none
Output:
u_short

TCP_SETSNDBUFSIZE:
Tells TCP to change its send queue to the indicated size (session only)
Input:
u_short
Output:
none

TCP_SETOOBINLINE:
Tells TCP whether users wants urgent data to be delivered inline (non-zero == yes.) (session only)

Input:
int
Output:
none

TCP_GETOOBDATA:
reads the urgent data (exactly one byte), returning 1 on a successful read or returning 0 if data was either read already or was not received yet (the OOB notification may precede the actual reception of the OOB data)
Input:
none
Output:
char

TCP_OOBPUSH:
send a msg in urgent mode
Input:
Msg *
Output:
char

TCP_OOBMODE:
TCP uses this to tell the user of TCP that it has urgent data present, i.e., TCP does an xControl() call on its parent --- THIS IS AN UPCALL! The first void pointer (args[0]) is of type XObj and is a pointer to the TCP session that invoked this operation. The second pointer (args[1]) is of type u_int and is the value of the urgent data mark. The oobmark indicates that the "oobmark-th" byte in the receive queue is the oobdata (or will be the oobdata.)

Note: all protocols using TCP without having OOB data delivered in-band must be prepared to accept this upcall.

Input:
void *args[2]
Output:
none

CONFIGURATION

name=tcp protocols=ip;

AUTHORS

Norm Hutchinson, Herman Rao, and David Mosberger-Tang



next up previous contents index
Next: TEST Up: Protocol Specifications Previous: SWP



Larry Peterson
Tue Jul 1 14:50:34 MST 1997