Vous êtes sur la page 1sur 64

TCP IP Users Guide

Charles W. Lynn, Jr. Bolt Beranek and Newman, Inc. 50 Moulton Street Cambridge MA 02238 May 1982

TCP IP Users Guide Table of Contents

May 1982

Introduction to TCP and IP . . . . . . . . . Transmission Control Protocol . Creating a TCP Connection . . Connection Descriptor Block . Sending and Receiving Data . Buffer Headers . . . . . Closing a Connection . . . Connection Status . . . . Interrupts . . . . . . . Error Returns and Codes . . Options . . . . . . . . TCP Retransmission Parameters OPEN JSYS 742 . . . . . CLOSE JSYS 743 . . . . . SEND JSYS 740 . . . . . RECV JSYS 741 . . . . . ABORT JSYS 747 . . . . . STAT JSYS 745 . . . . . CHANL JSYS 746 . . . . . SCSLV JSYS 744 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3 4 6 7 9 11 12 13 14 17 19 20 23 25 27 29 30 32 33

TELNET Protocol . . . . . . . . . . . . 34 ATNVT JSYS 274 . . . . . . . . . . . . 35 Internet User Queues . Queue Descriptor Block Packet Buffer . . . Ports . . . . . ASNIQ JSYS 756 . . RELIQ JSYS 757 . . SNDIN JSYS 754 . . RCVIN JSYS 755 . . Appendix Appendix Appendix Appendix Appendix Appendix Appendix Appendix A B C D E F G H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 38 39 41 42 43 44 45 46 47 48 49 50 51 55 59

Internet Packet Header Format Internet Address Formats . . IP Type of Service Field . . Logical Host Facility . . . IP Packet Demultiplexing . . TCP Retransmission Parameters TCP & IP Options . . . . Status Variable Names . . .

- 1 -

TCP IP Users Guide Introduction to TCP and IP

May 1982

This document describes the TOPS20 user interface to the DARPA-supported inter-networking protocols: Internet Protocol, Internet Control Message Protocol, Transmission Control Protocol, and related network functions. These protocols are available on several computer systems: HP3000, IBM, MULTICS, PDP-11, TOPS20, UNIX, and VAX as well as several minicomputers. The Internet Protocol (IP) is designed for use in interconnected systems of packet-switched computer communications networks. It allows the transmission and routing of variable length blocks of data called datagrams from sources to destinations. Sources and destinations are hosts identified by fixed-length addresses. The Internet Protocol is not designed to be absolutely reliable: some packets may not be delivered and some may be duplicated. They may also arrive in a different order than that in which they were sent. The Internet Control Message Protocol (ICMP) is used to provide some feedback about problems in the communications environment, to report errors in datagram processing, or to supply more recent routing and flow control information. The user does not interact directly with the ICMP. The Transmission Control Protocol (TCP) uses the Internet Protocol to provide users with a highly reliable, multiplexed, full-duplex, connection-based, host-to-host communications service. TCP is not, however, intended for applications for which time is critical, such as digitized speech, or for communication between more than two processes. User application programs may interface at either the IP level, through the use of Internet User Queues, or at the TCP level. Two common applications which interface at the TCP level are TELNET, a remote terminal access facility, and FTP, a file transfer facility. Name and time servers are examples of applications which typically interface at the IP level. These protocols and their interfaces have evolved over several years. This document describes the BBN TOPS20 JSYS interface. DEC is implementing a TCP: device interface to TCP. It is not described in this document. Since the interfaces are evolving, application programs should be written using the symbols defined in the MONSYM library and used in this document, instead of the symbols' numeric value, in order to reduce program maintenance if a value changes in a subsequent software release.

- 2 -

TCP IP Users Guide Introduction to TCP

May 1982

The TCP allows two processes to create a connection in order to exchange zero or more octets of data, where an octet consists of eight data bits. A connection is uniquely specified by the 48-bit identifiers of its local and foreign ends. The 48-bit identifier is composed of a 32-bit internet address, which identifies the host, and a 16-bit port number, which identifies a process at that host. Since connections are full-duplex, each end may both send and receive data. TCP data transfer has high reliability: both the headers and all data octets are checksummed. If a packet is received and its checksum is not correct, it is immediately discarded. Each octet of data is conceptually assigned a 32-bit sequence number. The sequence numbers are used by the receiver to discard duplicated packets and to detect lost, or out-of-sequence packets. The receipt of data is acknowledged by returning to the sender the sequence number of the next octet the receiver wants to receive; this implies that all lower numbered octets have been received. The sender continues to retransmit data until it is acknowledged. The retransmission rate is a user-specified parameter. If data unacknowledged for a period of time, the connection is broken and the user is notified of a Transmission Timeout error. This time period is also specified by the user. TCP automatically provides flow control for each connection. The data receiving TCP periodically notifies the sending TCP of the number of additional data octets it is willing to accept (the "window"). This number is based on the amount of buffer space available at the receiving TCP. The sending TCP is not to exceed this window. The TOPS20 monitor has nine TCP related JSYSi which will be explained in following sections. They are: OPEN, SEND, RECV, CLOSE, ABORT, STAT, CHANL, ATNVT, SCSLV, to to to to to to to to to specify the ends of, and synchronize, a connection; send data to the foreign end; receive data from the foreign end; begin closing a connection; break a connection; obtain status information about a connection or TCP; specify interrupt channels; translate a connection into an NVT descriptor; and specify security levels.

- 3 -

TCP IP Users Guide Creating a TCP Connection

May 1982

A connection is created by passing the address of a Connection Descriptor block (which identifies the two ends of the connection), a Transmission Timeout, and a Retransmission Parameters word to the OPEN JSYS. A successful OPEN will return a Job Connection Number or "JCN". The JCN is a small job-relative number which is given to the other JSYSi to identify the connection. (The use of a JCN with the TCP JSYSi is analogous to the use of JFNs with the file system JSYSi. The DEC user interface uses JFNs and file system JSYSi instead of the JSYSi documented here.) Each connection must be unique. This is guaranteed by the selection of a 16-bit local port value. Unfortunately, there is no easy way to find which port values are unused other than by trial and error. Use of local port values less than 256 is discouraged as they have been reserved for "well known" functions. A suggested local port value contains the user's job number in the left-most 8 bits and anything else in the right-most 8 bits. If the connection is not unique, OPEN will return a Connection Already Exists error and another local port value should be selected and tried. There are three basic ways to specify a connection. They are a fully specified active open, a fully specified passive open, and a partially wild passive open. A fully specified active open is used to initiate a connection; the identifier of the foreign end of the connection must be known. In this case, the Connection Descriptor block contains a non-zero, 16-bit local port; the foreign host's 32-bit internet address; and the 16-bit foreign port. The TCP%FS flag must also be set. It causes a SYN packet to be sent to the foreign host/port specified in the Connection Descriptor block. If the SYN packet is acknowledged and a SYN is received from the foreign TCP, the connection is synchronized and OPEN succeeds. If the foreign end of the connection does not exist, a RESET will be returned causing the OPEN to fail. A fully specified passive open is used to wait for a connection request from a particular foreign TCP. If a connection with a specific foreign host and port is desired, the Connection Descriptor block specifies the desired local port, foreign host, and foreign port. The TCP%FS flag is not set. In this case, no SYN packet will be sent. TCP will wait indefinitely until a SYN (or RESET) packet is received from the foreign TCP. When a SYN is received, an acknowledgement/SYN packet is returned to the foreign TCP; its acknowledgement of the SYN successfully opens the connection. - 4 -

TCP IP Users Guide Creating a TCP Connection

May 1982

The third case is a partially wild passive open. It is used to wait for a connection request from any one of a set of possible foreign hosts and ports. If the foreign port entry in the Connection Descriptor block is zero, any foreign port will be accepted. Similarly, if the network field and/or host field in the foreign internet address entry is zero, a connection request by any foreign network and/or host will be accepted. A typical example is the local host's Login responder which accepts connection requests to local port 23 from any port at any internet address. In this case, the local port entry is 23; the foreign net, host, and port entries are zero. The OPEN JSYS has both blocking and non-blocking forms which are differentiated by the setting of the TCP%WT flag. The blocking form (TCP%WT flag set) will not return control to the user program until either the connection has been successfully established or an error has occurred. The non-blocking form (TCP%WT flag not set) will return a success indication immediately (unless there was a syntax error or the Connection Already Exists). The user can subsequently check whether the connection has opened correctly by attempting to send or receive data or requesting the connection status. A program interrupt may also be enabled for the connection opening (or closing) event.

- 5 -

TCP IP Users Guide Connection Descriptor Block

May 1982

Information describing a connection is passed to TCP in a Connection Descriptor block via the OPEN JSYS. The block contains .TCPCS words. Unspecified words and bits should be zero. Word Offset Bits .TCPLH B4-35

Meaning The Local Host's internet address (a host may have more than one). If the default (or only) local host address is to be used, specify zero.

.TCPLP B20-35 A unique non-zero Local Port number. It is recommended the left-most eight bits contain the job number in order to avoid conflicts with other connections. The GJINF JSYS can be used to determine the job number. .TCPFH B4-35 The Foreign Host's internet address, or, in a passive open, zero to accept a connection from any foreign host. It is possible to specify an explicit network field and a zero host field to restrict connections to hosts on a given network. See Appendix B for a description of internet addresses.

.TCPFP B20-35 Either a non-zero Foreign Port number, or, in a passive open, zero to allow a connection from any foreign port. .TCPOP B0-17 The address of an IP Option block, or zero. B18-35 The address of a TCP Option block, or zero. See the section on Options and Appendix G for further details about Option blocks. .TCPIP 1B1 IP datagram parameters: Do-not-Fragment this datagram. If set, IP is not allowed to fragment a datagram. Packets which are too large for an intermediate network will be discarded, not delivered (in fragments). in seconds. Datagrams delivered in the specified be discarded. The default used if the field is zero.

377B17 Maximum Time-to-Live, which have not been number of seconds will value of 60 seconds is

377B35 IP Type-of-Service field; See Appendix C. - 6 -

TCP IP Users Guide Sending and Receiving Data

May 1982

Data is transferred between the user and TCP in buffers. Associated with each buffer is a Buffer Header which contains control information. Data to be sent to the foreign end is placed into one or more buffers, the associated headers are filled in, and the address of each Buffer Header is passed to TCP using the SEND JSYS. The TCP collects data from the user buffers and decides, based on the current window, etc., when to create a packet and transmit it to the foreign end. The user can force TCP to transmit data in a buffer by setting the PUSH flag, TCP%PU, in the Buffer Header before doing the SEND. When TCP has finished extracting the data from a SEND buffer it sets the DONE flag, TCP%DN, in the Buffer Header and optionally generates an interrupt. It is also possible to cause a process to block until a buffer has been processed by setting the TCP%WT flag in AC1; the TCP%PU flag should also be set in the Buffer Header. Beware of the trap of setting TCP%WT without TCP%PU--the process may be blocked forever. The SEND will not return control to the user program until the data has been placed into a packet and, due to the presence of TCP%PU, sent. Data is received from the foreign end by first passing TCP (one or more) empty buffers using the RECV JSYS. The TCP%WT flag may be specified if control should not be returned to the user program until the buffer has been filled. When data arrives, TCP places it into the buffers. RECV buffers are returned to the user either when full or when a packet arrives which has the PUSH flag set. Before returning a buffer, TCP sets the TCP%DN flag and places an error code in the Buffer Header. The TCP%PU flag will be set if the buffer is being returned because the received packet had the PUSH flag set. (The buffer might not be full in this case.) It is only possible to send and receive whole octets. If an application requires transfer of some number of bits which is not a multiple of eight, then control information must be placed into the data stream. Note the PUSH function cannot be used to signal the other end of "record boundaries"; the number of (RECV) buffers with TCP%PU set may be less than the number of PUSHes received which may be less than the number of (SEND) buffers which had the TCP%PU flag set. Several buffers may be passed to TCP using SEND and/or RECV if the non-blocking form of the calls is used. (TCP%WT was not set in AC1.) - 7 -

TCP IP Users Guide Sending and Receiving Data

May 1982

TCP also provides an asynchronous signal mechanism called URGENT. If a (SEND) Buffer Header has the TCP%UR flag set, an urgent signal is associated with the last data octet in the buffer. Its sequence number is communicated to the receiving TCP. The receiving user will then find the TCP%UR flag set in all RECV Buffer Headers whose associated data buffer contains lower sequence numbered octets. An interrupt may be enabled for the Urgent data has arrived event. If the sender signals another URGENT, the new sequence number is used. The receiver may only "see" one URGENT if data is being processed slowly or the system is heavily loaded.

- 8 -

TCP IP Users Guide Buffer Headers

May 1982

Data is transferred between the user program and TCP in buffers. Each Data Buffer contains zero or more octets of data, packed four octets per word, in bits 0-31. Data is transferred between TCPs beginning with the left-most bit of the left-most octet. There is no padding between individual buffers. Associated with each Data Buffer is a Buffer Header containing control information describing the data. A Buffer Header is .TCPBS words long. The address of the Buffer Header is passed to TCP in AC2 by the SEND and RECV JSYSi. The format of a Buffer Header is: Word Offset Bits .TCPBF B0-17

Meaning Flags (note that the following flags have fullword values, not half-word). TCP%ER This buffer has an error associated with it. TCP%LE The error occurred at the local end, not the foreign end. TCP%PE The error is permanent, not temporary. TCP%EC Field containing the error code. See the Error Codes section for a listing of error codes. TCP%DN Asynchronous flag, cleared by TCP when it receives the buffer, set by TCP when processing associated with the buffer has been completed. TCP%UR SEND: The last octet in the buffer should be communicated to the receiver as Urgent Data. RECV: There is more Urgent Data. TCP%PU SEND: Promptly send (any buffered data and) data in this buffer to the receiving user (do not wait for more data to fill a packet). RECV: Sender requested that data in this buffer be delivered promptly, even if the buffer is not full. - 9 -

TCP IP Users Guide Buffer Headers

May 1982

TCP%WM The Data buffer is formatted as 36-bit bytes. Off if the Data buffer has four left-justified 8-bit bytes per word. Note: 36-bit mode is not yet implemented. B18-35 Reserved for user program, not used by TCP. .TCPBA B18-35 Address of first data octet (note that the Data Buffer need not follow the Buffer Header). Each word of the Data Buffer (except the last) contains four left-justified eight-bit data octets (the last word may contain from one to four octets). Data is transmitted beginning with the left-most bit of the first word. .TCPBC B0-35 Data Buffer count. SEND: The number of octets of data in the buffer. Updated when TCP has finished with the buffer to the number of octets not sent (usually 0). RECV: The number octets available for data. Updated when TCP has finished with the buffer to the number of unused data octets.

.TCPBO B0-17 The address of an IP Option block, or zero. B18-35 The address of a TCP Option block, or zero. SEND: If the address is not zero, merge the options from the Option block with those which have been received from the foreign end for inclusion in future packets. RECV: If the address is not zero, return any options from the most recently received packet in the Option block. See the section on Options and Appendix G for further details about option formats. Any unspecified bits in the Buffer Header should be zero.

- 10 -

TCP IP Users Guide Closing a Connection

May 1982

When a user has no more data to be sent, the connection should be "closed". The CLOSE JSYS is used to communicate this fact to the foreign end of the connection. Since CLOSE implies a PUSH, any data which TCP has internally buffered will first be sent; then a FIN packet will be sent. The FIN causes the foreign user to be notified that the connection is "Closing". After doing a CLOSE, no more SENDs are allowed. CLOSE, by itself, does not fully "close" the full-duplex connection since there may still be data from the other end to process (and the other end may even have more data to be sent). There are two recommended procedures for closing a connection. If the user is notified (either by a RECV error code or an interrupt) that the connection is "Closing", no more RECVs should be attempted. Any data for the foreign end should be sent using SEND, and then a CLOSE with the TCP%WT flag set should be issued. The CLOSE will block until the connection is fully "Closed". If CLOSE returns without error, it has also released the JCN. If an error is returned, the JCN has not been released; it should be released using the ABORT JSYS. If a CLOSE is issued before being notified that the connection is "Closing", the TCP%WT flag should not be set. (Setting the TCP%WT flag in this case is a frequent cause of "connections failing to close".) Control will be returned to the user program to allow RECVs to be issued until the foreign end (CLOSEs and consequently) sends a FIN packet, which will cause a "Closed" error to be returned. (Failure to RECV this data (or more frequently "unexpected data") is another common cause of "connections failing to close".) The JCN should then be released using the ABORT JSYS. A connection may be abnormally terminated at any time by issuing the ABORT JSYS. ABORT also releases the JCN associated with the connection. After a connection has been fully CLOSEd or ABORTed, the internal connection block (TCB) is retained by TCP for several seconds to allow any packets which might still be in the network (e.g., old retransmissions) to arrive and be discarded. During this period, an attempt to reuse the same connection (internet addresses and port numbers) will fail.

- 11 -

TCP IP Users Guide Connection Status

May 1982

The status of a particular connection (or the values of TCP's internal counters) may be examined using the STAT JSYS. The most frequent use of STAT is to determine the addresses/ports associated with a connection or the state of its send and receive sides. Use of the symbolic name form of STAT call is strongly recommended to reduce site and software release dependencies. The following table lists the names of the most interesting variables. Appendix H lists all the quantities which are available. See the description of the STAT JSYS for details. ASCII Name TFH TLH TFP TLP TRSYN TSSYN Contents Foreign Host internet Address Local Host internet Address Foreign Port Local Port Receive Side State (see below) Send Side State (see below) Receive Send (TRSYN) (TSSYN) Symbol Symbol SYNABL SYNRCV SYNCED FINRCV NOTSYN SYNABL SYNSNT SYNCED FINSNT NOTSYN

Value 4 5 7 2 0

Meaning Waiting for SYN packet to arrive/be sent SYN packet received or sent Connection synchronized, data may be sent FIN packet received or sent FIN acknowledged, connection closed

- 12 -

TCP IP Users Guide Interrupts

May 1982

TCP allows the user to specify software interrupt channels for five TCP related events: Connection open/closing/closed, SEND buffer done, RECV buffer done, presence of URGENT data, and error. They may each be left assigned to no channel, or assigned to separate channels, or they may share a common channel. An interrupt may be reassigned to another channel at any time; but once assigned, the interrupt cannot be assigned to "no channel" (although it may be assigned to a channel whose interrupts are "ignored"). Since the TCP typically runs at a higher priority than most user programs, successive interrupts may occur more quickly than the user program can process them. One can thus not expect, for example, that the number of RECV buffer full interrupts be the same as the number of RECVs issued; it may be less if two buffers were filled without the user program being run in between. The open/closing/closed interrupt occurs when the connection has become fully synchronized ("open"), when a FIN is received from the other end ("closing"), and when the connection is fully closed ("closed"). Note that these interrupts will NOT occur if the connection is being ABORTed. The error interrupt occurs when a reset is received (Connection Rejected) or when a transmission timeout has occurred (Transmission Timeout). Note that these interrupts will NOT occur if the connection is being ABORTed. The urgent data interrupt occurs when a packet containing urgent data arrives. If another packet arrives with more urgent data, a second interrupt will NOT be given unless the program has already RECVed all of the urgent data from the first packet. Note that this interrupt will NOT occur if the connection is being ABORTed.

- 13 -

TCP IP Users Guide Error Returns and Codes

May 1982

All of the TCP JSYSi are called with arguments in one or more of ACs 1 through 4. If the call is successful the JSYS will skip an instruction when control is returned to the user program. The contents of ACs 1 through 4 may be changed depending on the particular JSYS involved. If the call was not successful, control is returned to the instruction in the user's program immediately following the JSYS. In this case AC1 contains an error code which identifies the cause of the problem. The error codes returned (with the exception of ATNVT) are not in the format of other TOPS20 errors, but are instead in the form of the Buffer Header error field. The error byte consists of three flag bits and a 5-bit error code, right-justified in AC1. The AC1 bits and the corresponding Buffer Header symbols are listed in the table below. Buffer AC1 Header Bit TCP%ER 1B28 TCP%LE 1B29 TCP%PE 1B30 TCP%EC 37B35

Meaning Set if an error was detected ("E"), zero otherwise ("X"). Set if the error was detected locally ("L"), zero if the error was detected by the foreign TCP ("F"). Set if the error is permanent ("P"), zero if the error is temporary ("T"). Error Code.

The Error flag indicates an error occurred. The Local flag indicates whether the problem was detected at the local host or the foreign host. The Permanent flag indicates whether the problem is permanent or temporary. Temporary errors are usually associated with resource shortages; repeating the request later is encouraged. Permanent errors should not be retried. Some error codes are only associated with a JSYS, some may only be returned by a JSYS if the TCP%WT flag was set in AC1, and some are only returned in a Buffer Header.

- 14 -

TCP IP Users Guide Error Returns and Codes The Error Codes and their meanings are: Key j w b Codes 0 b 1 j 2 j 3 j 4 j

May 1982

Error can be returned in AC1 by a JSYS. Error can be returned in AC1 by a JSYS which set TCP%WT. Error code can be returned in a Buffer Header.

5 6 j 7 wb 9 w 12 wb

13 j 14 wb 15 j 16 j 17 j

No Error. The buffer was processed without error. Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. Invalid Options specified. The routing option does not parse or an option length exceeds the amount of option space available. Connection Not Open. Attempt to CLOSE a connection which is not open. Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. Wild foreign host/port only allowed if listening. Connection Already Exists. Attempt to OPEN a connection which has already been OPENed. Connection Rejected or Reset. A RESET was received for the connection. Transmission Timeout. Connection Closed or Closing. Closed locally or remotely; cannot (re)activate the connection because it was not fully closed. Note: this code, without the "error" flag set, is returned in RECV Buffer Headers after a FIN has been received (the foreign end is closing). Wild local port is illegal. A zero local port is not allowed. Connection Reset. A Transmission Timeout has occurred or the connection is being aborted. Bad Buffer Argument. The Buffer Header count (.TCPBC) is negative or the end of the buffer is beyond the end of memory section 0. Insufficient resources to process data buffer. Either insufficient free storage or TCP%WT was specified and there are no free "wait flags". Invalid interrupt channel. A channel number is not 0-5 or 23-35. - 15 -

TCP IP Users Guide Error Returns and Codes 20 j 21 j 22 j 29 j 30 j 31 j

May 1982

Bad STAT offset. Offset to too large for TCB Statistics area. Bad STAT count. Count is zero, positive, or forms offset which is too large. Bad STAT name. An ASCII name is not in STAT's table. Changing security levels is not allowed. Use of TCP%VT not allowed. Only Job0 (internet fork) create TVTs (Use ATNVT). TCP not available. TCP has not been initialized or been turned off.

or an

can has

- 16 -

TCP IP Users Guide Options

May 1982

Both TCP and IP provide the means to include a selection of standard options in packets. Options are only required in special situations. Most options are automatically processed by TCP. In particular, the routing options are automatically inverted without user intervention. Received options are automatically merged with those specified by the user. If an option is both specified by the user and received in a packet, the received version is ignored. Options may be specified with OPEN or SEND. Options are specified using the .TCPOP word in the Connection Descriptor block and the .TCPBO word in the Buffer Header block. The left-half contains the address of a block for IP options, and the right-half contains the address of a block for TCP options. Each block is .TCPOW words long and contains one to forty option octets, packed four left-justified octets per word. Once specified, the options are sent in each packet generated. If an Option block address is zero, the corresponding options remain unchanged. The current options may be cancelled by specifying an address pointing to an Option block which begins with an End-of-Options octet (zero). Options contained in packets which are received may be obtained by specifying non-zero address(es) in the .TCPBO word associated with a RECV. Options have the form of a string of one to forty octets. Except for NOP and End-of-options which are each one octet long, an individual option is a string of two or more octets. The first octet identifies the type of option; the second is its length in octets (counting the type and length octets), followed by additional octets relevant to the particular option.

- 17 -

TCP IP Users Guide Options The currently defined TCP options are: Option Code 0 1 2 Option (Length) Meaning End-of-Options (single octet). string. NOP (single octet). Ignored.

May 1982

Terminates the option

Maximum Segment Size (four octets). The receiver of this option should not generate packets whose packet length exceeds the number of octets specified by the 16-bit number contained in the third and fourth octets. This option should be specified with OPEN.

The format of the IP options may be found in Appendix G. The processing which TCP automatically provides for each IP option is listed in the following table. Note that the most significant bit of IP options indicates, if set, that the option must be copied into each fragment of a fragmented datagram. Option Code 0 1 7 Option Action taken by TCP End-of-Options. None. NOP. None. Record Route. The recorded route is inverted and changed into a Strict Source Route for inclusion in subsequently generated packets. Internet Timestamp. If the space reserved for timestamps is not yet full, the option is copied and returned to the originator. Security. None. Loose Source Routing. The source route is automatically inverted for inclusion in subsequently generated packets. Stream Identifier. Copied for inclusion in subsequently generated packets. Strict Source Routing. The source route is automatically inverted for inclusion in subsequently generated packets. - 18 -

68

130 131 136 137

TCP IP Users Guide TCP Retransmission Parameters

May 1982

Both OPEN and SEND require a Transmission Timeout and Retransmission Parameters. The Transmission Timeout is the number of seconds for which retransmissions of unacknowledged octets should be attempted before returning a Transmission Timeout error to the user program. Permissible values are 1 to 300 seconds, or zero. A zero value means that there is no timeout and retransmissions should continue "forever" (until the other end sends a RESET or the program is ^C'd and the connection ABORTed). If you are not interested in the details of retransmissions, use zero for the Retransmission Parameters. The standard retransmission algorithm, based on measured round trip delay, will be used. For a detailed description of the available retransmission algorithms see Appendix F.

- 19 -

TCP IP Users Guide OPEN OPEN JSYS 742

May 1982

Specifies a TCP connection and returns its JCN. ACCEPTS IN AC1: Flags ! Address-of-Connection-Descriptor-Block TCP%FS Set to initiate synchronization (active open); cleared to await foreign connection attempt (passive open). TCP%WT Block until either the connection has been synchronized or an error has occurred. TCP%VT Create a TCP virtual terminal connection. Note: Only Job 0 may use this flag. User programs should use the ATNVT JSYS. TCP%PS If set and the connection attempt results in a failure, (wait a couple seconds and) restart the connection procedure. Note: Use of this flag is not recommended. TCP%HP Connection should be high priority. OBSOLETE, use the Type-of-Service byte in the .TCPIP word of the Connection Descriptor block (see Appendix C). TCP%SC Secure connection. Unsupported, see the IP Security option in Appendix G. TCP%ET Reserved, must be 0. TCP%PT Reserved, must be 0. AC2: Transmission Timeout, in seconds (5 minute max) AC3: Retransmission Parameters Word (See Appendix F) B0-9 Backoff Numerator B10-17 Backoff Denominator B18-35 Initial Retransmission Interval RETURNS +1: Failure, TCP error byte in B28-35 of AC1. If a JCN had been assigned before the error was detected, it is in the left-half of AC1 (it should be ABORTed). - 20 -

TCP IP Users Guide OPEN

May 1982

+2: Success, AC1 contains the JCN in the right-half with the TCP%JS flag set. The format of the .TCPCS-word Connection Descriptor block, whose address is contained in the right-half of AC1, was described in the Connection Descriptor block section. The JCN returned in AC1 should be used to specify this connection to the other TCP JSYSi. If the TCP%WT flag is not set, control will be returned to the user program as soon as the connection parameters have been validated, The internal control block (TCB) created, and, if the TCP%FS flag was set, the connection synchronization process begun. The connection will (probably) not yet be fully synchronized. An interrupt may be enabled for the connection fully synchronized event, or the state of the internal TSOPN flag may be checked using the STAT JSYS. Note that SENDs and RECVs may be issued before a connection is fully synchronized. OPEN ERROR CODES: ELP+1 ELP+2 ELT+4 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. Invalid Options specified. The routing option does not parse or an option length exceeds the amount of option space available. Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. Connection Already Exists. Attempt to OPEN a connection which has already been OPENed. Connection Rejected or Reset. A RESET was received for the connection. Transmission Timeout. Connection Closed or Closing. Closed locally or remotely; cannot (re)activate the connection because it was not fully closed. Wild local port is illegal. A zero local port is not allowed. Connection Reset. A Transmission Timeout has occurred or the connection is being aborted. Use of TCP%VT not allowed. Only Job0 (internet fork) can create TVTs (Use ATNVT). - 21 -

ELP+6 EFP+7 ELP+9 ELP+12 ELP+13 ELP+14 ELP+30

TCP IP Users Guide OPEN

May 1982

ELT+31 TCP not available. TCP has not been initialized or has been turned off.

- 22 -

TCP IP Users Guide CLOSE CLOSE Close a TCP connection. ACCEPTS IN AC1: TCP%JS ! Flags ! JCN JSYS 743

May 1982

TCP%JS Must be set since right-half has a JCN. TCP%WT Wait for close to happen in both directions or for an error to occur. RETURNS +1: Failure, TCP error byte in B28-35 of AC1. +2: Success.

The CLOSE JSYS causes any data in TCP's buffers to be sent to the receiver. A FIN is then sent to notify the receiver that no more data will be sent to it. After a CLOSE, SENDs are illegal. Note that if the TCP%WT flag is not set, the JCN will remain valid, allowing more RECVs. RECVs should be repeated until a Connection Closed error is returned. ABORT is then used to release the JCN. If the TCP%WT flag is set, the CLOSE JSYS will block until FINs have been exchanged to fully close the connection, or an error is detected. Note that a connection cannot be fully closed if there is data which has not been RECVed. If no error was detected, the JCN is also released. CLOSE ERROR CODES: ELP+1 ELP+3 ELT+4 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. Connection Not Open. Attempt to CLOSE a connection which is not open. Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. Connection Rejected or Reset. A RESET was received for the connection. Connection does not exist. There is no TCB for the specified connection. Transmission Timeout.

EFP+7 ELP+7 ELP+9

- 23 -

TCP IP Users Guide CLOSE

May 1982

ELP+14 Connection Reset. A Transmission Timeout has occurred or the connection is being aborted.

- 24 -

TCP IP Users Guide SEND SEND JSYS 740

May 1982

Send a buffer of data over a TCP connection. ACCEPTS IN AC1: TCP%JS ! Flags ! JCN TCP%JS Must be set since right-half has a JCN. TCP%WT Wait for data to be copied into a packet, or for an error. Note the packet may not be sent if the TCP%PU flag was not set in the Buffer Header. TCP%HP Connection should be high priority. OBSOLETE, use the Type-of-Service byte in the .TCPIP word of the Connection Descriptor block (see Appendix C). TCP%SC Secure connection. Unsupported, see the IP Security option in Appendix G. AC2: Buffer Header Address AC3: Transmission Timeout, in seconds (5 minute max) AC4: Retransmission Parameters Word (See Appendix F) B0-9 Backoff Numerator B10-17 Backoff Denominator B18-35 Initial Retransmission Interval RETURNS +1: Failure, TCP error byte in B28-35 of AC1. +2: Success.

The format of the .TCPBS-word Buffer Header block whose address is contained in AC2 was described in the Buffer Header section. Unused words and bits should be zero. When TCP accepts the Buffer Header, the Error field and TCP%DN flag are cleared. Retransmissions will occur as specified by the Retransmission Parameters word, if necessary, until the data has been acknowledged by the receiver, the Transmission Timeout has passed, or an error is detected. When processing of the data has been completed, an error code is placed into the Error field, the count word is changed to the number of octets not sent (normally 0), and the TCP%DN flag is set.

- 25 -

TCP IP Users Guide SEND

May 1982

If the TCP%WT flag is not specified, control will return immediately to the user program. The buffer will remain in use until the TCP%DN flag is set. An interrupt may be enabled for this event. SEND ERROR CODES: ELP+1 ELP+2 ELP+3 ELT+4 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. Invalid Options specified. The routing option does not parse or an option length exceeds the amount of option space available. Connection Not Open. Attempt to CLOSE a connection which is not open. Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. Connection Rejected or Reset. A RESET was received for the connection. Transmission Timeout. Connection Closed or Closing. Closed locally or remotely; cannot (re)activate the connection because it was not fully closed. Wild local port is illegal. A zero local port is not allowed. Connection Reset. A Transmission Timeout has occurred or the connection is being aborted. Bad Buffer Argument. The Buffer Header count (.TCPBC) is negative or the end of the buffer is beyond the end of memory section 0. Insufficient resources to process data buffer. Either insufficient free storage or TCP%WT was specified and there are no free "wait flags". Use of TCP%VT not allowed. Only Job0 (internet fork) can create TVTs (Use ATNVT). TCP not available. TCP has not been initialized or has been turned off.

EFP+7 ELP+9 ELP+12 ELP+13 ELP+14 ELP+15 ELT+16 ELP+30 ELT+31

- 26 -

TCP IP Users Guide RECV RECV JSYS 741

May 1982

Receive a buffer of data from a TCP connection. ACCEPTS IN AC1: TCP%JS ! Flags ! JCN TCP%JS Must be set since right-half has a JCN. TCP%WT Wait for data buffer to be filled, or for an error. AC2: Buffer Header Address RETURNS +1: Failure, TCP error byte in B28-35 of AC1. +2: Success.

The format of the .TCPBS-word Buffer Header block whose address is contained in AC2 was described in the Buffer Header section. Unused words and bits should be zero. The count word in the Buffer Header should contain the (maximum) number of octets the Data Buffer will hold. When TCP accepts the Buffer Header, the Error field and TCP%UR, TCP%PU, and TCP%DN flags are cleared. Data received will be placed into the buffer until either it is full or a PUSH is received. When TCP is finished with the buffer, an error code will be placed into the Error field and the TCP%DN flag will be set. The count word will be set to the number of unused octets remaining in the buffer. If there is more Urgent data, the TCP%UR flag will be set. If the buffer is being returned due to the presence of a PUSH, the TCP%PU flag will be set. If the TCP%WT flag is not specified, control will return immediately to the user program. The buffer will remain in use until the TCP%DN flag is set. An interrupt may be enabled for this event. RECV ERROR CODES: ELP+1 ELT+4 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded.

- 27 -

TCP IP Users Guide RECV EFP+7 ELP+7 ELP+9 ELP+12

May 1982

XLP+12 ELP+13 ELP+14 ELP+15 ELT+16 ELP+30 ELT+31

Connection Rejected or Reset. A RESET was received for the connection. Connection does not exist. There is no TCB for the specified connection. Transmission Timeout. Connection Closed or Closing. Closed locally or remotely; cannot (re)activate the connection because it was not fully closed. Note: this code, without the "error" flag set, is returned in RECV Buffer Headers after a FIN has been received (the foreign end is closing). Connection Closing. Closed remotely, no more data to be RECVed. Wild local port is illegal. A zero local port is not allowed. Connection Reset. A Transmission Timeout has occurred or the connection is being aborted. Bad Buffer Argument. The Buffer Header count (.TCPBC) is negative or the end of the buffer is beyond the end of memory section 0. Insufficient resources to process data buffer. Either insufficient free storage or TCP%WT was specified and there are no free "wait flags". Use of TCP%VT not allowed. Only Job0 (internet fork) can create TVTs (Use ATNVT). TCP not available. TCP has not been initialized or has been turned off.

- 28 -

TCP IP Users Guide ABORT ABORT Abort a TCP connection. ACCEPTS IN AC1: TCP%JS ! JCN JSYS 747

May 1982

TCP%JS Must be set since right-half has a JCN. RETURNS +1: Failure, TCP error byte in B28-35 of AC1. +2: Success, Connection broken, JCN released.

The local end of the connection is forgotten: partially processed packets are deleted, queued SEND and RECV buffers are returned, the retransmission queue is purged. An attempt is made to send a RESET packet to the remote end. Should this not be delivered, the other end will discover its half-open connection the next time it attempts to use it. Note that TCP's internal connection block (TCB) will remain for several seconds to allow any packets which were in transit to arrive and be discarded. An attempt to reuse the same connection (host addresses and ports) will fail until the waiting time has passed. ABORT ERROR CODES: ELP+1 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid.

- 29 -

TCP IP Users Guide STAT STAT JSYS 745

May 1982

Obtain information about either a connection or TCP's internal counters. ACCEPTS IN AC1: Flags ! (TVT- or connection-index, or JCN, or 0) TCP%JS Return information about the connection whose JCN is in the right-half of AC1. TCP%ST Return TCP statistics information instead of information about a connection. The right-half of AC1 is ignored. The names of the entries in the statistics area are listed in Appendix H (see TCP30SY). TCP%NI Return in AC2 an AOBJN counter for the currently active connections. (See TCP%IX.) TCP%IX Return information about the connection specified by the index in the right-half of AC1. The index is a system-wide identifier whose binding may change from call to call. (See TCP%NI.) TCP%NT Return in AC2 an AOBJN counter for the currently active TVTs. (See TCP%TV.) TCP%TV Return information about the TVT specified by the index in the right-half of AC1. The index is a system-wide identifier whose binding may change from call to call. (See TCP%NT.) TCP%SY The right-half of AC2 contains the address of a list of ASCII variable names associated with either a connection (TCB) or TCP Statistics for which information should be returned. TCP%SD An LDB pointer should be returned for each of the specified symbols instead of the value. (The pointers assume AC14 (octal) is pointing to a TCB image and AC13 (octal) is pointing at STAT0 (offset 0 of the statistics area).) Requires TCP%SY to be set and a valid connection identifier (e.g. TCP%IX!1). - 30 -

TCP IP Users Guide STAT

May 1982

AC2: -N,,Offset into TCB or Statistics area, N successive words are desired beginning at the specified; or AC2: -N,,Address of symbol names, N symbols are given beginning at the specified address. AC3: -M,,Address in user's space to which information should be returned; the area contains M words. RETURNS +1: Failure, TCP error byte in B28-35 of AC1. +2: Success, Data copied to user specified area, counts and addresses in AC2 and AC3 updated.

The TCB offset identifies the transfer starting point and the Address in user space identifies the starting point of the destination area. If successful, min(M,N) words have been transferred from the TCB (or statistics area) to the caller's space. Beware: the order/entries may be site dependent. STAT ERROR CODES: ELP+1 ELT+4 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. Wild local port is illegal. A zero local port is not allowed. Bad STAT offset. Offset to too large for TCB or Statistics area. Bad STAT count. Count is zero, positive, or forms an offset which is too large. Bad STAT name. An ASCII name is not in STAT's table. TCP not available. TCP has not been initialized or has been turned off.

ELP+13 ELP+20 ELP+21 ELP+22 ELT+31

- 31 -

TCP IP Users Guide CHANL CHANL JSYS 746

May 1982

Specify PSI channels for TCP interrupts. ACCEPTS IN AC1: TCP%JS ! JCN TCP%JS Must be set since right-half has a JCN. AC2: Six channel numbers. B0-5 B6-11 B12-17 B18-23 B24-29 B30-35 RETURNS Urgent data available RECV buffer done SEND buffer done Error Connection change (open/closing/closed) Reserved, must be 77 (octal)

+1: Failure, TCP error byte in B28-35 of AC1. +2: Success. This fork will receive TCP PSIs for the specified events.

Each of the 6-bit bytes may be either a decimal channel number (0-5 or 24-35) or 77 (octal) if no change is desired for the corresponding event. PSIs may be dropped or may be tardy on heavily loaded systems. Some defensive programming is required to guard against these problems. CHANL ERROR CODES: ELP+1 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. ELT+4 Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. ELP+13 Wild local port is illegal. A zero local port is not allowed. ELP+17 Invalid interrupt channel. A channel number is not 0-5 or 23-35. ELT+31 TCP not available. TCP has not been initialized or has been turned off.

- 32 -

TCP IP Users Guide SCSLV SCSLV JSYS 744

May 1982

Set the security level for a TCP connection. Note: SCSLV has not been tested in the current release. ACCEPTS IN AC1: TCP%JS ! JCN TCP%JS Must be set since right-half has a JCN. AC2: 36-bit security value RETURNS +1: Failure, TCP error byte in B28-35 of AC1. +2: Success, The security value has been associated with the connection.

The security value is not interpreted by the TCP (except to see that it matches). The number of bits of the security value actually used varies depending on the actual security procedure in use. In all cases, the right-most bits of the word are used. SCSLV ERROR CODES: ELP+1 Argument Error in JSYS. An AC1 flag (TCP%xx) was set which is inappropriate for the JSYS; the TVT or connection index or JCN is invalid. ELT+4 Temporarily Out of Resources. A new connection cannot be created due to a lack of JCNs (for the job), free storage for the TCB, an available TVT, or because the system limit on simultaneous connections would be exceeded. ELP+13 Wild local port is illegal. A zero local port is not allowed. ELP+29 Changing security levels is not allowed. ELT+31 TCP not available. TCP has not been initialized or has been turned off.

- 33 -

TCP IP Users Guide TELNET Protocol

May 1982

The TELNET Protocol is a general 8-bit byte oriented communications facility intended for use in remote terminal access situations. It uses TCP as the data transfer protocol. An open TCP connection which has not been used for SENDs or RECVs may be converted by the ATNVT JSYS into a Network Virtual Terminal using the TELNET protocol. ATNVT is given the JCN of the connection (which it releases). It returns a TOPS20 TTY designator. The designator can then be used to obtain input and output JFNs and the connection can be used as any other TOPS20 TTY.

- 34 -

TCP IP Users Guide ATNVT ATNVT JSYS 274

May 1982

Attach a Network Virtual Terminal to a TCP connection. ACCEPTS IN AC1: AN%TCP ! AN%NTP ! JCN AN%TCP This flag is set to indicate that the right-half of AC1 has a JCN (instead of a JFN). AN%NTP This flag is ASSUMED since TCP only supports the "new" TELNET protocol. RETURNS +1: Failure, TOPS20 error code in AC1, the JCN is still valid. +2: Success, The terminal designator for the Network Virtual Terminal is in AC1, the JCN has been released.

The caller must first OPEN a TCP connection, as described above. The connection must be synchronized with no intervening SENDs or RECVs before the ATNVT call. If successful, the JCN is released and the connection is transferred to the Network Virtual Terminal whose TTY designator is returned in AC1. If unsuccessful, one of the error codes listed below is returned and the JCN remains valid. (It should probably be ABORTed.) ATNVT ERROR CODES: ATNX1 ATNX2 ATNX3 ATNX5 ATNX6 ATNX8 ATNX11 ATNX13 Invalid JCN Receive side not SYNCED User CLOSEd/ABORTed connection Receive side has been used (RECVs) Connection has been closed or has errors Send side not SYNCED Send side has been used (SENDs) No free TVTs

- 35 -

TCP IP Users Guide Internet User Queues

May 1982

The Internet User Queue facility allows user programs to send and receive internet datagrams. In order to use this facility a program must first assign an Internet User Queue using ASNIQ. ASNIQ's argument is the address of a Queue Descriptor block containing a set of mask and value words that determine what messages may be sent from this queue and which of the incoming messages will be delivered to this queue. A successful ASNIQ returns an Internet Queue Handle (a small system-wide number identifying this queue). Datagrams may be sent by creating an IP packet image and calling SNDIN with the Internet Queue Handle and the address of the packet image. Various fields of the header are checked for legality. The source host internet address is validated if it was specified, or it is filled in with the default host address if it was not specified (i.e. was zero). The internet header checksum is computed and placed into the packet's internet header. The routing algorithms select a network interface, and a local leader for that network is constructed in the packet. The packet is then queued for output on the selected interface. User programs have no control over which network or interface will be selected for transmission of a datagram. This decision will be made by the routing algorithms based on routing information supplied by internet gateways. This means that all network interfaces to which a host is connected must go down before internet communications will be completely stifled; and even then, processes within a host will be able to communicate due to the local delivery mechanism. User programs also have no knowledge of which interface received an incoming packet. There is an exception when a system is equipped with a "Raw Packet Interface" (RPI, which is used to connect to a remote gateway or an encryption device such as a BCR). Flag AQ%SCR will mark the queue as using the RPI rather than the normal interfaces. Datagrams are received by giving RCVIN an Internet Queue Handle and the address of an empty buffer into which an IP packet should be copied. RCVIN normally blocks if there are no datagrams waiting in the queue. The non-blocking form is specified by setting the RIQ%NW flag. If it is set and no datagrams are waiting, an error code of -1 is returned in the right-half of AC1. RELIQ is used to release an Internet Queue Handle when the user program has finished with it. The argument is either a specific Internet Queue Handle, or a job or (multiple) fork - 36 -

TCP IP Users Guide Internet User Queues

May 1982

handle if all Internet User Queues associated with the job/fork are to be released. An Internet User Queue which contains a received datagram is flushed if the datagram is not RCVINed within 30 seconds. The number of messages which will be placed into a queue is limited to eight. Flooding the input queue of a slow receiver will thus result in dropped messages. (Note that the stated limits are monitor assembly parameters and may vary from site to site.) Datagrams sent from the local host to itself will ordinarily be delivered without sending them over any network and are reasonably fast. Programs using Internet User Queues must handle the cases of datagrams not being delivered in the order in which they were sent, being dropped, or being duplicated. Some may traverse a broadcast network and may be clobbered by other packets, lightning, etc. Thus, some higher level protocol is needed in most cases. TCP is one example, but there are others (the "Datagram Protocol", XNET, etc.). The local host may receive ICMP error messages relating to datagrams for an Internet User Queue. Normally these messages are discarded. The user may, however, request that these datagrams be placed into the input queue so that they may be processed. To enable this option, the AQ%ICM flag must be specified when the queue is assigned. RCVIN may then be used to read received ICMP error messages, and SNDIN may be used to send ICMP error messages.

- 37 -

TCP IP Users Guide Queue Descriptor Block

May 1982

The Queue Descriptor block is used to identify datagrams which may be sent from or delivered to an Internet User Queue. The packets are (de)multiplexed based on four fields: the source and destination internet addresses, the protocol number, and the source and destination port numbers. For each field the Queue Descriptor block contains a value entry and a mask entry. A one bit in the mask entry means that the corresponding bit in the value entry and the datagram must match. ASNIQ will return an error unless the current Queue Descriptor block differs in the masked bits from all other Internet User Queues which are assigned. The format of the Queue Descriptor block is shown in the following table. Word Offset Bits

Usage

.IQPRV B24-31 Internet protocol number. .IQFHV B0-31 .IQSHV B0-31 Foreign host internet address. Local host internet address.

.IQPTV B0-15 Local port. B16-31 Foreign port (ignored if AQ%SPT is set). .IQPRM B24-31 Mask for internet protocol number. .IQFHM B0-31 .IQSHM B0-31 Mask for foreign host internet address. for any foreign host.) (Zero

Mask for local host internet address. (Zero for any of this host's addresses.)

.IQPTM B0-15 Mask for local port. B16-31 Mask for foreign port (zero if AQ%SPT is set). Note B0-31 should be zero for portless protocols.

- 38 -

TCP IP Users Guide Packet Buffer

May 1982

The Packet Buffer begins with one word containing the length of the buffer followed immediately by an IP header of five or more words and the contents of the IP datagram (the "data"). The right-half of the length word contains, for SNDIN, the length in words of the IP packet to be sent, plus one for the length word. For RCVIN the right-half should contain the maximum number of words, including the length word, available for a received IP packet; the left-half will be set to the number of words actually received plus one for the length word. The IP header and data use the left-most 32 bits of each word. Word Offset Bits 0 0 B0-17

Contents

RCVIN: Number of valid words actually used by the IP packet, plus one (this word). B18-35 RCVIN: Maximum number of words in the buffer, including this word. SNDIN: Number of words in the IP packet to be sent, plus one (this word). Beginning of IP Header (See Appendix A)

1 1 1 1 2

B0-3 B4-7

IP Version number. This field must contain 4. Data Offset. The length of the IP header, in words (5 to 15). B8-15 Type of Service byte. See Appendix C. B16-31 Datagram Length, in octets, beginning with this word (20 to 2**16-1). B0-15 Segment ID. This field should be unique for each datagram sent; it is used to identify which fragments should be combined to reconstruct a fragmented datagram. B16 Reserved, must be zero. B17 Do-not-Fragment flag. If set, a packet may not be fragmented by an internet module. If the packet is too large to process, it will be discarded. B18 More-Fragments flag. Set if this is NOT the last fragment of a packet. Since user programs do not send fragments, it should be zero. B19-31 Fragment-Offset. Since user programs do not send fragments, it should be zero.

2 2

2 2

- 39 -

TCP IP Users Guide Packet Buffer 3 3 3 B0-7

May 1982

Time-to-Live, in seconds. If the packet cannot be delivered in the time specified, the packet should be discarded. B8-15 Protocol number. Protocol numbers are assigned by Jon Postel@ISI. B16-31 IP header checksum. This field is filled in by SNDIN; the user program does not have to compute it. B0-31 B0-31 Source host internet address. Destination host internet address. IP options, if desired. If necessary, the last word of options is padded with zero (End-of-Options) octets to fill the word.

4 5

6-15 B0-31

End of IP Header H+1 H+1 B0-15 Port number, for single-port protocols, or source port number for two-port protocols, or nonexistent for portless protocols. B16-31 Destination port number for two-port protocols, or nonexistent for single-port or portless protocols. B0-31 Data.

...

- 40 -

TCP IP Users Guide Ports

May 1982

Not all internet protocols have ports. If an application does not have ports, then .IQPTM in the Queue Descriptor block should contain a zero. If the protocol uses both local and foreign ports, they are expected to be in the first two 16-bit bytes following the internet header (offset H+1 in the table above), source port in left-most 16 bits, and destination port in the next 16 bits. The location of this word is found by adding the contents of the Data Offset field to the address of the first word of the internet header. Provision has been made for protocols (such as XNET) which have only a local port. Turning on the AQ%SPT control flag for ASNIQ selects single-port mode. The first 16-bit byte following the internet header is expected to contain the port. This port is used both for demultiplexing incoming packets and for checking access when packets are being sent. Note that for a given set of addresses and protocol numbers, etc., a single-port protocol queue will not be assigned if a dual-port version already exists, and vice versa. This rule permits an incoming packet to specify a unique queue. Without the rule, either the first or second 16-bit field following the internet header would have to be used for demultiplexing; but we cannot know which unless there is something else to tell which queue is being addressed.

- 41 -

TCP IP Users Guide ASNIQ ASNIQ JSYS 756

May 1982

Assign an Internet User Queue (NET WIZARD capability must be enabled) ACCEPTS IN AC1: Flags ! Address of Queue Descriptor block AQ%SPT Set for single-port protocols, cleared for two-port or portless protocols. AQ%ICM Deliver ICMP error datagrams to this queue and allow them to be sent from it. AQ%SCR Use Raw Packet Interface. AC2: Reserved, must be 0 AC3: Reserved, must be 0 RETURNS +1: Failure, TOPS20 error code in AC1, conflicting job number in AC2. +2: Success, Internet Queue Handle returned in AC1 and maximum IP packet size (before fragmentation will occur) in AC2.

The mask words specify those bit positions where a match is required. Thus, one can make .IQFHM contain zero in order to communicate with any internet host. By making, for example, the low 3 bits of the local port mask word zero, the queue owns eight ports. Note that an error will occur unless the Queue Descriptor block differs in the masked bits from all other Internet User Queues assigned at the instant the ASNIQ is issued. The job number of the job which owns a conflicting queue is returned in AC2. If the queue is assigned, the Internet Queue Handle is returned in AC1; the maximum size packet (before fragmentation) is returned in AC2. ASNIQ ERROR CODES: NTWZX1 NET WIZARD capability required ASNSX1 All Internet User Queues in use (or IP not initialized) ASNSX2 Conflict with some other job (# in AC2)

- 42 -

TCP IP Users Guide RELIQ RELIQ Release an Internet User Queue. JSYS 757

May 1982

ACCEPTS IN AC1: An Internet Queue Handle, or -1 for all queues owned by this job, or a job or fork-relative process handle. AC2: Reserved, must be 0 AC3: Reserved, must be 0 RETURNS +1: Failure, TOPS20 error code in AC1. +2: Success.

RELIQ releases ownership of an Internet User Queue so that other jobs can assign it. See the TOPS20 Monitor Calls Reference Manual for a description of the various process handles. RELIQ ERROR CODES: SQX1 SQX2 Internet Queue Handle out of range Internet Queue Handle not assigned

- 43 -

TCP IP Users Guide SNDIN SNDIN Send an internet datagram. JSYS 754

May 1982

ACCEPTS IN AC1: Internet Queue Handle AC2: Address of Packet Buffer containing the IP packet AC3: Reserved, must be 0 RETURNS +1: Failure, TOPS20 error code in AC1. +2: Success.

The format of the Packet Buffer was described in the Packet Buffer section. If port filtering is being used (.IQPTM was non-zero for ASNIQ), the port(s) must be located in the word following the internet header. The address of this word is found by adding the address of word-1 in the Packet Buffer to the number in the Data Offset field. IP validates the source host field in the packet and fills in the internet header checksum. The rest of the header is supplied by the user. SNDIN ERROR CODES: SQX1 SQX2 SNDIX1 SNDIX2 SNDIX4 Internet Queue Handle out of range Internet Queue Handle not assigned Invalid message size Insufficient resources (no buffers available) Invalid header value for this queue (includes Datagram Length too big, Data Offset too small, filtering on ports but Datagram Length is too small for packet to contain a port word, or header does not fit the ASNIQ arguments)

- 44 -

TCP IP Users Guide RCVIN RCVIN Receive internet datagram. ACCEPTS IN AC1: Flags ! Internet Queue Handle JSYS 755

May 1982

RIQ%NW Set to cause fail-return instead of blocking when no datagram is waiting. AC2: Address of a Packet Buffer to hold the IP packet AC3: Reserved, must be 0 RETURNS +1: Failure, TOPS20 error code in AC1. +2: Success

Each RCVIN gets one datagram from the specified queue. These datagrams match the values in the Queue Descriptor block when masked by the mask words in the block. The maximum size of the Packet Buffer (including the count word) is expected in the right-half of word-0 of the Packet Buffer when the RCVIN is executed. When a datagram is available, it is placed into the user supplied Packet Buffer. The number of words filled plus one (for the count word) is set into the left-half of word-0 (the count word) of the Packet Buffer. Ordinarily this can be ignored, but if the datagram was too big for the Packet Buffer, this tells how much space would have been required. If the datagram was too big (determined by the Datagram Length field), as much of the datagram as will fit into the Packet Buffer is transferred and an error is returned. No retry for the same datagram is possible. RCVIN ERROR CODES: SQX1 SQX2 SNDIX1 777777 Internet Queue Handle out of range Internet Queue Handle not assigned Invalid datagram size RIQ%NW was on and no datagrams were waiting

- 45 -

Appendix A

TCP IP Users Guide Internet Packet Header Format

May 1982

The following structure definitions have been excerpted from the file INPAR.MAC which is used in building TOPS20 and TENEX monitors with internet code. Those who are unfamiliar with the structure facility should refer to SYS:MACSYM.MAC. Briefly, DEFSTR(Name,Location,Bit,Size) defines a field called Name. This field is held in the word (possibly indexed) at Location. The right-most bit number is Bit and the field is Size bits wide. A typical reference to the data offset field might be: LOAD 1,PIDO,(PKT) where PKT is an index register which points at the first word of the packet structure. Word offsets: .IPKVR==0 .IPKSG==1 .IPKPR==2 .IPKSH==3 .IPKDH==4 ; ; ; ; ; Word Word Word Word Word with with with with with version, type of service, etc. segmentation information time to live, checksum, protocol source host destination host ; PACKET.INTERNET.VERSION ; PACKET.INTERNET.DATA-OFFSET ; PACKET.INTERNET.TYPE-OF-SERVICE ; ; ; ; PACKET.IP.PRECEDENCE PACKET.IP.LOW-DELAY PACKET.IP.HIGH-THROUGHPUT PACKET.IP.HIGH-RELIABILITY

DEFSTR(PIVER,.IPKVR,3,4) DEFSTR(PIDO,.IPKVR,7,4) DEFSTR(PITOS,.IPKVR,15,8) ; Overlays for the above: DEFSTR(PIPRC,.IPKVR,10,3) DEFSTR(PILDY,.IPKVR,11,1) DEFSTR(PIHTR,.IPKVR,12,1) DEFSTR(PIHRL,.IPKVR,13,1) ; 2 Unused bits DEFSTR(PIPL,.IPKVR,31,16) DEFSTR(PISID,.IPKSG,15,16) DEFSTR(PIFLG,.IPKSG,18,3) ; Overlays for the above: ; Unused bit DEFSTR(PIDF,.IPKSG,17,1) DEFSTR(PIMF,.IPKSG,18,1) DEFSTR(PIFO,.IPKSG,31,13) DEFSTR(PITTL,.IPKPR,7,8) DEFSTR(PIPRO,.IPKPR,15,8) DEFSTR(PICKS,.IPKPR,31,16) DEFSTR(PISH,.IPKSH,31,32) DEFSTR(PIDH,.IPKDH,31,32)

; PACKET.INTERNET.PACKET-LENGTH ; PACKET.INTERNET.SEGMENT-ID ; PACKET.INTERNET.FLAGS ; ; ; ; ; ; ; ; PACKET.INTERNET.DONT-FRAGMENT PACKET.INTERNET.MULTIFRAGMENT PACKET.INTERNET.FRAGMENT-OFFSET PACKET.INTERNET.TIME-TO-LIVE PACKET.INTERNET.PROTOCOL PACKET.INTERNET.HEADER-CHECKSUM PACKET.INTERNET.SOURCE-HOST PACKET.INTERNET.DESTINATION-HOST

- 46 -

Appendix B

TCP IP Users Guide Internet Address Formats

September 1981

An internet address is a 32-bit quantity, in which the left-most one, two, or three octets specify the network number and the remaining octets identify a host on that network.

Class A addresses begin with a zero bit, followed by a 7-bit network number and a 24-bit local address. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0 Network Local Address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Class B addresses begin with bits 10, followed by a 14-bit network number and a 16-bit local address. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 0 Network Local Address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Class C addresses begin with bits 110, followed by a 21-bit network number and an 8-bit local address. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1 0 Network Local Address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Class D addresses begin with bits 111. The interpretation of the remaining bits is currently unspecified. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1 1 Unspecified +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

- 47 -

Appendix C

TCP IP Users Guide IP Type of Service

September 1981

The IP Type-of-Service field is composed of six sub-fields, two of which are currently undefined. +------+------+------+------+------+------+------+------+ Low High High Precedence Delay Throu- Relia0 0 ghput bility +------+------+------+------+------+------+------+------+ The left-most three bits form the Precedence field. Its eight possible values are: 7 6 5 4 3 2 1 0 Network Control Internetwork Control CRITIC/ECP Flash Override Flash Immediate Priority Routine

The next bit is the Delay flag. If the flag is set, the packet will be processed in a manner which tends to minimize "delay" through the internet. If the flag is not set, the packet will be treated in the "standard" manner with respect to delay. The next bit is the Throughput flag. If the flag is set the packet will be processed in a manner which tends to maximize "throughput" through the internet. If the flag is not set, the packet will be treated in the "standard" manner with respect to throughput. The next bit is the Reliability flag. If the flag is set, the packet will be processed in a manner tending to maximize "reliability" through the internet. If the flag is not set, the packet will be treated in the "standard" manner with respect to reliability. The remaining two bits are reserved and should be zero. Note that setting any of the Delay, Throughput, or Reliability flags may increase user "costs" in some sense; setting all three flags is illegal.

- 48 -

Appendix D

TCP IP Users Guide Logical Host Facility

May 1982

The internet Logical Host facility allows several internet addresses to share a single (physical) network interface. This is implemented by having IP modules which make routing decisions "ignore" certain (network dependent) bits in the local address field (see Appendix D). The destination IP module, however, includes those bits when it demultiplexes packets. The TOPS20 IP is given a Logical-Host-Mask (for each network to which it has an interface) which identifies the particular bits to be so treated (if any). In the case of the ARPANET, which is Class A network 10, the logical host field is the third octet in the internet address.

- 49 -

Appendix E

TCP IP Users Guide IP Packet Demultiplexing

May 1982

When the destination IP receives a packet, it must pass it to the appropriate protocol module for further processing. This decision is based on the values in three fields. The first is the internet Version Number; if it is not 4, the packet is discarded. The other two fields are the internet Protocol field and the Logical Host field in the destination host internet address (see Appendix B). If the value in the logical host field is less than or equal to (an installation-dependent constant whose default value is) 3, the packet is passed to the internal routine for the protocol identified by the internet Protocol field if one is implemented, or to the Internet User Queue dispatcher if it isn't implemented. If the value in the logical host field is greater than the installation dependent constant, an attempt is first made to pass the packet to an internal routine for the protocol identified by the Logical Host field value, times 256., plus the value from the packet's internet Protocol field if one is implemented, or secondly, to the Internet User Queue dispatcher if such a protocol is not implemented. A packet for logical host 2 protocol 6 (TCP) would thus be passed to the standard TOPS20 TCP routines since protocol 6 is implemented. A packet for logical host 5 protocol 6 would be passed to an Internet User Queue if one has been assigned (which might be an experimental TCP implementation) since protocol 1286 (5*256+6) is not an internally implemented protocol. This means that no messages of a particular protocol type implemented internally will be passed to users via Internet User Queues. Assigning such a queue will still be possible, but no traffic will reach the user unless the internal protocol module has been disabled.

- 50 -

Appendix F

TCP IP Users Guide TCP Retransmission Parameters

May 1982

Both OPEN and SEND require a Transmission Timeout and a Retransmission Parameters word. The Transmission Timeout is the number of seconds for which retransmissions of unacknowledged octets should be attempted before returning a Transmission Timeout error to the user program. Permissible values are 1 to 300 seconds, or zero. A zero value means that there is no timeout, and retransmissions should continue "forever" (until the other end sends a RESET or the program is ^C'd and the connection ABORTed). The Retransmission Interval is the time between successive transmissions of a packet. The user's choice of which of two algorithms to use in its computation is specified by the value of the Retransmission Parameters word. Both algorithms are based on an estimate of the round trip delay associated with the connection. The default algorithm is used as long as the value of the Retransmission Parameters word is zero; if a non-zero value is ever specified, the second algorithm is activated for the duration of the connection. The default algorithm maintains an estimate of the round trip delay based on the equation: ERTT = ERTT' * alpha + MRTT * (1.-alpha) where MRTT ERTT' ERTT is the measured round trip delay of a packet, is the prior estimate of the round trip delay, (initially 3 seconds), alpha is a smoothing factor equal to 0.8125, and is the new estimate.

The Initial Retransmission Interval for a packet is then computed from: IRXI where ERTT beta IRXI is the current round trip delay estimate, is a variance factor equal to 1.5, and is the Initial Retransmission Interval. = ERTT * beta

The retransmission interval is essentially doubled for successive retransmissions of the same packet. NRXI = CT - TG where CT TG is the current time, is the time at which the packet was generated, and - 51 -

Appendix F NRXI

TCP IP Users Guide TCP Retransmission Parameters is the Next Retransmission Interval.

May 1982

A second algorithm, which allows the user specify its factors, is activated if the Retransmission Parameters word is ever non-zero. The right-half, if not zero, is the Initial Retransmission Interval, in seconds. If the right-half is zero, the Initial Retransmission Interval will be computed based on the estimated round trip delay. As each packet is acknowledged, this algorithm updates a minimum and maximum round trip delay variable. MNRTT = MIN(MNRTT',MRTT) MXRTT = MAX(MXRTT',MRTT) where MRTT is the measured round trip delay of a packet, MNRTT' is the shortest delay encountered during 30-second interval (initially 3 seconds if right-half word was 0), MNRTT is the new minimum, MXRTT' is the longest delay encountered during 30-second interval (initially 3 seconds if right-half word was 0), MXRTT is the new maximum. the the the the

Every thirty seconds the minimum and maximum delay times are reset, and a new Initial Retransmission Interval, IRXI, is computed according to the equations: MNRTT = MNRTT + (MXRTT-MNRTT)/10. MXRTT = MXRTT - (MXRTT-MNRTT)/2. IRXI = (MNRTT+MXRTT)/2 + 1/2 second. The left-half of the Retransmission Parameters word contains two 9-bit quantities, called the Backoff Numerator (in B0-8) and the Backoff Denominator (in B9-17). In computing the Next Retransmission Interval for a packet, the last interval is multiplied by the Numerator and then divided by the Denominator (using integer arithmetic). NRXI = ( NRXI' * BN ) / BD where NRXI' BN BD NRXI is the last Next Retransmission (initially IRXI), is the Backoff Numerator, is the Backoff Denominator, and is the Next Retransmission Interval. Interval

- 52 -

Appendix F

TCP IP Users Guide TCP Retransmission Parameters

May 1982

The Backoff Numerator must be greater than or equal to the Backoff Denominator. Default values are used if a factor is zero: Initial Interval 3 seconds Backoff Numerator 3 Backoff Denominator 2 Both algorithms clamp the retransmission interval between a minimum value of 1 second and a maximum value of 60 seconds. There are several details which might be of interest. One involves the computation of the measured round trip delay. This delay is the time between TCP's filling a packet (and passing it to IP) and the time that its last octet is acknowledged. The delay thus includes the time the packet spent in IP waiting to enter the network and the time the receiving TCP required to send an acknowledgement in addition to actual "network" delays. Note also that if nothing has been received (e.g., before the first SYN or ACK arrives), then the round trip estimate cannot be computed (and the initial guess of 3 seconds is used). Packets are transmitted and placed into the retransmission queue when they are generated (filled). A timer is set for the Initial Retransmission Interval, and the Transmission Timeout time is recorded. If the retransmission timer goes off, the packet with the lowest unacknowledged sequence number is checked to see if it should be retransmitted. If the packet is still in IP's (or the network's) output queue, the timer is just reset. (Since it hasn't yet been transmitted, the network might be off or be blocking.) Otherwise, if the packet has never been retransmitted, its Transmission Timeout time and Initial Retransmission Interval are recomputed (there may be better estimates now), the packet is retransmitted, and a timer for the interval is started. If a packet has already been retransmitted, then the transmission timeout is checked; if it has passed, a Transmission Timeout error is returned to the user and the connection is broken. If the timeout has not yet passed, the Next Retransmission Interval (the elapsed time since the packet was generated, or the last interval times the backoff numerator divided by the backoff denominator) is computed, the packet is retransmitted, and a timer for the interval is started. There is also interaction between the measured round trip delay and retransmissions since TCP cannot tell which of several - 53 -

Appendix F

TCP IP Users Guide TCP Retransmission Parameters

May 1982

possible retransmissions of a packet is being acknowledged. The prior TCP release did not include retransmitted packets in its delay measurements. This omission had the undesirable effect of never updating the initial three-second guess if the actual delay was much greater than three seconds. The current TCP release includes such measurements (timed from the initial transmission). This method seems more reasonable since it is correct if there is just a large delay. On the other hand, if a retransmitted packet is being acknowledged, then a packet was lost (probably due to congestion somewhere). Thus, slowing things down is reasonable.

- 54 -

Appendix G

TCP IP Users Guide TCP & IP Options

May 1982

Both TCP and IP provide the means to include a selection of standard options in packets. Options are only required in special situations. See the section on Options for a description of using options with TCP; the section on the Packet Buffer should be consulted to use options with Internet User Queues. A TCP or IP option has the form of a string of one to forty octets. Except for NOP and End-of-Options, which are each one octet long, an individual option is a string of two or more octets. The first octet identifies the type of option, the second is its length in octets (counting the type and length octets), followed by additional octets relevant to the particular option. The currently defined TCP options are: Option Code 0 1 2 Option (Length) Meaning End-of-Options (single octet). string. NOP (single octet). Ignored. Maximum Segment Size (four octets). The receiver of this option should not generate packets whose packet length exceeds the number of octets specified by the 16-bit number contained in the third and fourth octets. This option should be specified with OPEN. Terminates the option

The most significant bit of IP options indicates, if set, that the option must be copied into each fragment of a fragmented datagram. The currently defined TCP options are: Option Code 0 1 Option (Length) Meaning End-of-Options (single octet). string. NOP (single octet). Ignored. Terminates the option

- 55 -

Appendix G 7

TCP IP Users Guide TCP & IP Options

May 1982

Record Route (seven to thirty-nine octets). The originator of this option provides space for each IP module which processes this datagram to insert its (sending) internet address into the Route Data area at the position specified by the Pointer (whose minimum value is four). As each address is added, the value of the pointer is increased by four. If the value of the pointer exceeds that of the Length, the Route Data area is full and some IP modules may not have been able to insert their addresses. +-------------+-------------+-------------+ 7 Length Pointer +-------------+-------------+-------------+-------------+ Route Data (internet addresses) +-------------+-------------+-------------+-------------+ ... +-------------+-------------+-------------+-------------+

68

Internet Timestamp (eight to forty octets). The originator of this option provides space for intermediate IP modules to record the time when the packet was processed and, optionally, their internet address. The option begins with the Type and Length octets which are followed by Pointer and Control octets and a data area. Each entry in the data area contains four octets. +-------------+-------------+-------------+-------------+ 68 Length Pointer Ovfl Frmt +-------------+-------------+-------------+-------------+ Internet Address (Frmt 1 or 3 only) +-------------+-------------+-------------+-------------+ Timestamp +-------------+-------------+-------------+-------------+ ... +-------------+-------------+-------------+-------------+ The four-bit Frmt field specifies the format of the the data portion of the packet. Frmt 0 means that only Timestamps appear; there are no Internet Addresses. For Frmts 1 and 3, each Timestamp is preceded by an Internet Address. Each IP module fills in its address if Frmt is 1. In Frmt 3, the Internet Addresses are pre-specified; the IP module only enters its Timestamp if (one of) its address(es) is next. The Pointer specifies the current position in the data area for the next (Internet Address and) Timestamp. The - 56 -

Appendix G

TCP IP Users Guide TCP & IP Options

May 1982

minimum value of 5 indicates the first entry (the octet following the Ovfl/Frmt octet). It is incremented by four (Frmt 0) or eight (Frmts 1 and 3). If it points beyond the last data entry (i.e., Pointer exceeds Length), no further entries can be made. The Ovfl field is incremented in this case (Frmts 0 and 1). The format of the Timestamps is the number of milliseconds since midnight Universal Time. If the time is not known in that format, any local time may be used with the left-most bit set. 130 Security (eleven octets). Security, Compartmentation, Handling Restrictions, and TCC parameters are specified. The type and length octets are followed by two octets which specify one of sixteen Security levels. The valid values are: 00000000 11110001 01111000 10111100 01011110 10101111 11010111 01101011 00110101 10011010 01001101 00100100 00010011 10001001 11000100 11100010 00000000 00110101 10011010 01001101 00100110 00010011 10001000 11000101 11100010 11110001 01111000 10111101 01011110 10101111 11010110 01101011 Unclassified Confidential EFTO MMMM PROG Restricted Secret Top Secret (Reserved for (Reserved for (Reserved for (Reserved for (Reserved for (Reserved for (Reserved for (Reserved for

future future future future future future future future

use) use) use) use) use) use) use) use)

Two Compartment field octets follow the Security octets. They may be obtained from the Defense Intelligence Agency. Next are two Handling Restriction octets. The control and release markings are given in the "Standard Security Markings" section of Defense Intelligence Agency Manual DIAM 65-19. The last three octets are used to segregate Traffic and define Controlled Communities of subscribers. Their values may be obtained from HQ DCA Code 530.

- 57 -

Appendix G 131

TCP IP Users Guide TCP & IP Options

May 1982

Loose Source Routing (eleven to thirty-nine octets). The originator of this option specifies the addresses of IP modules through which the datagram must pass on its way to the destination. The Pointer indicates the Next Address in the Route Data area; its initial value is four. The last address in the Route Data area must be the destination address. As each entry is processed, the IP module's out-going internet address replaces the Next Address, and the Pointer is increased by four. If the value of Pointer exceeds that of Length, the source route is exhausted and the option is ignored (sent to the destination in the IP header). The route is Loose because any number of intermediate gateways may be used between successive Route Data entries. +-------------+-------------+-------------+ 131 Length Pointer +-------------+-------------+-------------+-------------+ Route Data (internet addresses) +-------------+-------------+-------------+-------------+ ... +-------------+-------------+-------------+-------------+

136 137

Stream Identifier (four octets). The two-octet SATNET stream ID is passed through the internet in this option. Strict Source Routing (eleven to thirty-nine octets). The originator of this option specifies the addresses of IP modules through which the datagram must pass on its way to the destination. The Pointer indicates the Next Address in the Route Data area; its initial value is four. The last address in the Route Data area must be the destination address. As each entry is processed, the IP module's out-going internet address replaces the Next Address, and the Pointer is increased by four. If the value of Pointer exceeds that of Length, the source route is exhausted and the option is ignored (sent to the destination in the IP header). The route is Strict because only those gateways specifically listed may be used. +-------------+-------------+-------------+ 137 Length Pointer +-------------+-------------+-------------+-------------+ Route Data (internet addresses) +-------------+-------------+-------------+-------------+ ... +-------------+-------------+-------------+-------------+ - 58 -

Appendix H

TCP IP Users Guide Status Variable Names

May 1982

The names of the the variables in a connection's internal control block (TCB) and the TCP statistics area which may be given to the STAT JSYS are listed below. They are defined in STG.MAC (TOPS20) or STORAG.MAC (TENEX) between STAT0 and STATZZ. The following TCP statistics are always collected. Statistic Variable BGRNC BYTRC BYTSC DGRNC DUPKC FINRC FINSC INTBY IPPKC IPRNC OPPKC OPRNC PZPKC PZRNC RAPKC RARNC RSTRC RSTSC RXPKC RXRNC SYNRC SYNSC TASKC Contents

Number of times the TCP background process (BG) has run Total number of data octets received Total number of data octets sent Number of times the TCP delayed action process (DG) has run Total number of duplicate packets received Total number of FIN packets received Total number of FIN packets sent -1 if the internal bypass (local delivery mechanism) is enabled, 0 if not Total number of packets received Number of times the TCP input process (IP) has run Total number of packets (instances) sent (includes retransmissions) Number of times the TCP output process (OP) has run Total number of packets generated Number of times the TCP packetizer process (PZ) has run Total number packets reassembled Number of times the TCP reassembler process (RA) has run Total number of RESET packets received Total number of RESET packets sent Total number of packet (instances) retransmitted Number of times the TCP retransmitter process (RX) has run Total number of SYN packets received Total number of SYN packets sent Total number of times a TCP process has been run

The following TCP statistics are not usually collected and will probably be zero. Statistic Variable Length ACDLA BGUSE DGUSE 17. Contents Activation delay histogram Total time charged to background process Total time charged to delayed action process - 59 -

Appendix H IPDLA IPUSE OHUSE OPDLA OPUSE PZDLA PZUSE RADLA RAUSE RXDLA RXUSE 17. 17. 17. 17. 17.

TCP IP Users Guide Status Variable Names

May 1982

Input delay histogram Total time charged to input process Total time charged to TCP overhead Output delay histogram Total time charged to output process Packetizer delay histogram Total time charged to packetizer process Reassembler delay histogram Total time charged to reassembler process Retransmitter delay histogram Total time charged to retransmitter process

The internal connection block (TCB) for each connection contains: TCB Variable Length TABTF TCBIO TCBIR TCBIU TCBTO TCBTR TCBTU TCTBS TCTSQ TERBF TERJN TERR TERRF TERRT TFH TFP TIFDF TIPDO TIPOR TIPOU TJCN TLH TLP TMNRT TMXRT TOFRK TOPFH TOPFP 10. 10. 10. 10. 10. 10. Contents ForkX of fork ABORTing this connection IP options to be sent IP options received in last packet IP options specified by user program TCP options to be sent TCP options received in last packet TCP options specified by user program (unimplemented) (unimplemented) (unimplemented) (unimplemented) Error field Error wait bit index (unimplemented) Foreign host internet address Foreign port number IP Do-not-Fragment flag Send IP Data Offset (words) Number of received IP option bytes Number of user specified IP option bytes Connection's JCN Local host internet address Local port number Retransmission factor "MNRTT" Retransmission factor "MXRTT" ForkN number of fork which owns this connection Foreign host internet address from the Connection Descriptor block Foreign port number from the Connection Descriptor block - 60 -

Appendix H TOPLH TOPNF TOWNR TPICA TPICE TPICR TPICS TPICU TPICX TPIFA TPIFE TPIFR TPIFS TPIFU TPIFX TRBS TRCBY TRIS TRLAK TRLFT TRLWN TRPP TRSYN TRURG TRURP TRWND TRXI TRXPD TRXPI TRXPN TSABT TSBYT TSCB TSCR TSEP TSFP TSLFT TSLVC TSLVN TSMRT TSMXB TSMXP TSOPN TSPRS TSSEQ TSSV

TCP IP Users Guide Status Variable Names

May 1982

Local host internet address from the Connection Descriptor block OPEN wait bit index Job number of job owning this connection Channel to receive "reserved" interrupt Channel to receive error interrupt Channel to receive receive buffer full interrupt Channel to receive send buffer empty interrupt Channel to receive urgent data interrupt Channel to receive open/closing/closed interrupt Fork to receive "reserved" interrupt Fork to receive error interrupt Fork to receive receive buffer full interrupt Fork to receive send buffer empty interrupt Fork to receive urgent data interrupt Fork to receive open/closing/closed interrupt Amount of user receive buffer space available Byte number of next octet to be reassembled Initial receive sequence number Sequence number of last acknowledgement sent Sequence number of next octet to be reassembled Sequence number of last receive window sent Have a partially reassembled packet State of receive side of connection Have more urgent data to be reassembled Sequence number of last (+1) receive urgent octet Receive window Retransmission factor "IRXI" Retransmission factor "BD" Retransmission factor Initial Interval Retransmission factor "BN" Connection is being ABORTed (RESET/CLZFF JSYSi) Number of octets available to be sent Current send (internal) buffer header Secure connection Packetizer is being encouraged to generate a packet Packetizer is being forced to generate a packet Sequence number of oldest unacknowledged octet Current security level Next security level Retransmission factor "ERTT" (unimplemented) Maximum send packet size User has been notified connection is open TCP%PS was set at OPEN Current send sequence number TSSEQ is valid - 61 -

Appendix H TSSYN TSTO TSUOP TSURG TSURP TSWND TTOS TTPDO TTPOR TTPOU TTTL TTVT TVTL TWLDN TWLDP TWLDT

TCP IP Users Guide Status Variable Names

May 1982

State of send side of connection Retransmission timeout User program opened connection Urgent send mode Sequence number of current send urgent octet Current send window IP Type-of-Service field Send TCP Data Offset (words) Number of received TCP option bytes Number of user specified TCP option bytes Initial IP Time-to-Live Connection is a TVT Associated TVT line number Connection was opened with wild net field Connection was opened with wild port field Connection was opened with wild host field

- 62 -

Vous aimerez peut-être aussi