Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!amd!amdcad!lll-crg!seismo!brl-adm!ron From: ron@brl-adm.UUCP Newsgroups: mod.sources.doc Subject: rfc793 (7 of 10) Message-ID: <710@brl-adm.ARPA> Date: Thu, 15-May-86 00:00:19 EDT Article-I.D.: brl-adm.710 Posted: Thu May 15 00:00:19 1986 Date-Received: Sat, 24-May-86 22:09:31 EDT Distribution: net Organization: Ballistic Research Lab Lines: 590 Approved: RON@BRL.ARPA September 1981 Transmission Control Protocol Functional Specification OPEN Call SYN-SENT STATE SYN-RECEIVED STATE ESTABLISHED STATE FIN-WAIT-1 STATE FIN-WAIT-2 STATE CLOSE-WAIT STATE CLOSING STATE LAST-ACK STATE TIME-WAIT STATE Return "error: connection already exists". [Page 55] September 1981 Transmission Control Protocol Functional Specification SEND Call SEND Call CLOSED STATE (i.e., TCB does not exist) If the user does not have access to such a connection, then return "error: connection illegal for this process". Otherwise, return "error: connection does not exist". LISTEN STATE If the foreign socket is specified, then change the connection from passive to active, select an ISS. Send a SYN segment, set SND.UNA to ISS, SND.NXT to ISS+1. Enter SYN-SENT state. Data associated with SEND may be sent with SYN segment or queued for transmission after entering ESTABLISHED state. The urgent bit if requested in the command must be sent with the data segments sent as a result of this command. If there is no room to queue the request, respond with "error: insufficient resources". If Foreign socket was not specified, then return "error: foreign socket unspecified". SYN-SENT STATE SYN-RECEIVED STATE Queue the data for transmission after entering ESTABLISHED state. If no space to queue, respond with "error: insufficient resources". ESTABLISHED STATE CLOSE-WAIT STATE Segmentize the buffer and send it with a piggybacked acknowledgment (acknowledgment value = RCV.NXT). If there is insufficient space to remember this buffer, simply return "error: insufficient resources". If the urgent flag is set, then SND.UP <- SND.NXT-1 and set the urgent pointer in the outgoing segments. [Page 56] September 1981 Transmission Control Protocol Functional Specification SEND Call FIN-WAIT-1 STATE FIN-WAIT-2 STATE CLOSING STATE LAST-ACK STATE TIME-WAIT STATE Return "error: connection closing" and do not service request. [Page 57] September 1981 Transmission Control Protocol Functional Specification RECEIVE Call RECEIVE Call CLOSED STATE (i.e., TCB does not exist) If the user does not have access to such a connection, return "error: connection illegal for this process". Otherwise return "error: connection does not exist". LISTEN STATE SYN-SENT STATE SYN-RECEIVED STATE Queue for processing after entering ESTABLISHED state. If there is no room to queue this request, respond with "error: insufficient resources". ESTABLISHED STATE FIN-WAIT-1 STATE FIN-WAIT-2 STATE If insufficient incoming segments are queued to satisfy the request, queue the request. If there is no queue space to remember the RECEIVE, respond with "error: insufficient resources". Reassemble queued incoming segments into receive buffer and return to user. Mark "push seen" (PUSH) if this is the case. If RCV.UP is in advance of the data currently being passed to the user notify the user of the presence of urgent data. When the TCP takes responsibility for delivering data to the user that fact must be communicated to the sender via an acknowledgment. The formation of such an acknowledgment is described below in the discussion of processing an incoming segment. [Page 58] September 1981 Transmission Control Protocol Functional Specification RECEIVE Call CLOSE-WAIT STATE Since the remote side has already sent FIN, RECEIVEs must be satisfied by text already on hand, but not yet delivered to the user. If no text is awaiting delivery, the RECEIVE will get a "error: connection closing" response. Otherwise, any remaining text can be used to satisfy the RECEIVE. CLOSING STATE LAST-ACK STATE TIME-WAIT STATE Return "error: connection closing". [Page 59] September 1981 Transmission Control Protocol Functional Specification CLOSE Call CLOSE Call CLOSED STATE (i.e., TCB does not exist) If the user does not have access to such a connection, return "error: connection illegal for this process". Otherwise, return "error: connection does not exist". LISTEN STATE Any outstanding RECEIVEs are returned with "error: closing" responses. Delete TCB, enter CLOSED state, and return. SYN-SENT STATE Delete the TCB and return "error: closing" responses to any queued SENDs, or RECEIVEs. SYN-RECEIVED STATE If no SENDs have been issued and there is no pending data to send, then form a FIN segment and send it, and enter FIN-WAIT-1 state; otherwise queue for processing after entering ESTABLISHED state. ESTABLISHED STATE Queue this until all preceding SENDs have been segmentized, then form a FIN segment and send it. In any case, enter FIN-WAIT-1 state. FIN-WAIT-1 STATE FIN-WAIT-2 STATE Strictly speaking, this is an error and should receive a "error: connection closing" response. An "ok" response would be acceptable, too, as long as a second FIN is not emitted (the first FIN may be retransmitted though). [Page 60] September 1981 Transmission Control Protocol Functional Specification CLOSE Call CLOSE-WAIT STATE Queue this request until all preceding SENDs have been segmentized; then send a FIN segment, enter CLOSING state. CLOSING STATE LAST-ACK STATE TIME-WAIT STATE Respond with "error: connection closing". [Page 61] September 1981 Transmission Control Protocol Functional Specification ABORT Call ABORT Call CLOSED STATE (i.e., TCB does not exist) If the user should not have access to such a connection, return "error: connection illegal for this process". Otherwise return "error: connection does not exist". LISTEN STATE Any outstanding RECEIVEs should be returned with "error: connection reset" responses. Delete TCB, enter CLOSED state, and return. SYN-SENT STATE All queued SENDs and RECEIVEs should be given "connection reset" notification, delete the TCB, enter CLOSED state, and return. SYN-RECEIVED STATE ESTABLISHED STATE FIN-WAIT-1 STATE FIN-WAIT-2 STATE CLOSE-WAIT STATE Send a reset segment: All queued SENDs and RECEIVEs should be given "connection reset" notification; all segments queued for transmission (except for the RST formed above) or retransmission should be flushed, delete the TCB, enter CLOSED state, and return. CLOSING STATE LAST-ACK STATE TIME-WAIT STATE Respond with "ok" and delete the TCB, enter CLOSED state, and return. [Page 62] September 1981 Transmission Control Protocol Functional Specification STATUS Call STATUS Call CLOSED STATE (i.e., TCB does not exist) If the user should not have access to such a connection, return "error: connection illegal for this process". Otherwise return "error: connection does not exist". LISTEN STATE Return "state = LISTEN", and the TCB pointer. SYN-SENT STATE Return "state = SYN-SENT", and the TCB pointer. SYN-RECEIVED STATE Return "state = SYN-RECEIVED", and the TCB pointer. ESTABLISHED STATE Return "state = ESTABLISHED", and the TCB pointer. FIN-WAIT-1 STATE Return "state = FIN-WAIT-1", and the TCB pointer. FIN-WAIT-2 STATE Return "state = FIN-WAIT-2", and the TCB pointer. CLOSE-WAIT STATE Return "state = CLOSE-WAIT", and the TCB pointer. CLOSING STATE Return "state = CLOSING", and the TCB pointer. LAST-ACK STATE Return "state = LAST-ACK", and the TCB pointer. [Page 63] September 1981 Transmission Control Protocol Functional Specification STATUS Call TIME-WAIT STATE Return "state = TIME-WAIT", and the TCB pointer. [Page 64]