📄 rfc1644.txt
字号:
does not contain an ACK bit. According to the state model of the basic TCP specification [STD- 007], the server side must explicitly issued a passive OPEN call, creating a TCB in LISTEN state, before an initial SYN may be accepted. To accommodate truncation of TIME-WAIT state within this model, it is necessary to add the five "I-states" shown in Figure 10. The I-states are: LISTEN-LA, LISTEN-LA*, LISTEN-CL, LISTEN-CL*, and LISTEN-TW. These are 'bridge states' between two successive the state diagrams of two successive incarnations. Here D is the duration of the previous connection, i.e., the elapsed time since the connection opened. The transitions labeled with lower-case letters are taken from Figure 8. Fortunately, many TCP implementations have a different user interface model, in which the use can issue a generic passive open ("listen") call; thereafter, when a matching initial SYN arrives, a new TCB in LISTEN state is automatically generated. With this user model, the I-states of Figure 10 are unnecessary. For example, suppose an initial SYN segment arrives for a connection that is in LAST-ACK state. If this segment carries a CC option and if SEG.CC is greater than TCB.CCrecv in the existing TCB, the "q" transition shown in Figure 10 can be made directly from the LAST-ACK state. That is, the previous TCB is processed as if an ACK(FIN) had arrived, causing the user to be notified of a successful CLOSE and the TCB to be deleted. Then processing of the new SYN segment is repeated, using a new TCB that is generated automatically. The same principle can be used to avoid implementing any of the I-states.Braden [Page 23]RFC 1644 Transaction/TCP July 1994 ______________________________| P: Passive OPEN / || || Q: Rcv SYN, special TAO test | d'| d|| (see text) / Delete TCB, | ________ ___V____ || create TCB, snd SYN | |LISTEN- | P | LAST- | || | | LA* |<-----| ACK* | || Q': (same as Q) if D < MSL | |________| |________| || | | | | || R: Rcv ACK(FIN) / Delete TCB,| Q| c'| c'| || create TCB | | | | || | | ___V____ V______V| S': Active OPEN if D < MSL / | | |LISTEN- | P | LAST- || Delete TCB, create TCB, | | | LA |<-----| ACK || snd SYN. | | |________| |________||______________________________| | | | | | Q| R| f| ________ ________ | | | | e''' | | P |LISTEN- | | | V V ---->|CLOSING*|----->| CL* | | | LISTEN CLOSED |________| |________| | | | | Q| | | c'| c'| V V V | | ESTABLISHED* ____V___ V_______ e'' | | P |LISTEN- | ---->|CLOSING |------>| CL | |________| |________| | R| Q| f| V V | LISTEN ESTABLISHED* ____V___ _________ e |TIME- | P | LISTEN- | ---->| WAIT |------------->| TW | |________| |_________| / | | | | S'/ T| T| Q'| |S' | _____V_ h _____V__ | V | | |-------->| | | SYN-SENT | | CLOSED |<--------| LISTEN | | | |________| ------|________| | | | / | j| | | a| a'/ i| V V | | / | ESTABLISHED* V V V V SYN-SENT ... Figure 10: I-States for TIME-WAIT TruncationBraden [Page 24]RFC 1644 Transaction/TCP July 1994 3.4 T/TCP Processing Rules This section summarizes the rules for sending and processing the T/TCP options. INITIALIZATION I1: All cache entries cache.CC[*] and cache.CCsent[*] are undefined (zero) when a host system initializes, and CCgen is set to a non-zero value. I2: A new TCB is initialized with TCB.CCrecv = 0 and TCB.CCsend = current CCgen value; CCgen is then incremented. If the result is zero, CCgen is incremented again. SENDING SEGMENTS S1: Sending initial <SYN> Segment An initial <SYN> segment is sent with either a CC option or a CC.NEW option. If cache.CCsent[fh] is undefined or if TCB.CCsend < cache.CCsent[fh], then the option CC.NEW(TCB.CCsend) is sent and cache.CCsent[fh] is set to zero. Otherwise, the option CC(TCB.CCsend) is sent and cache.CCsent[fh] is set to CCsend. S2: Sending <SYN,ACK> Segment If the sender's TCB.CCrecv is non-zero, then a <SYN,ACK> segment is sent with both a CC(TCB.CCsend) option and a CC.ECHO (TCB.CCrecv) option. S3: Sending Non-SYN Segment A non-SYN segment is sent with a CC(TCB.CCsend) option if the TCB.CCrecv value is non-zero, or if the state is SYN- SENT or SYN-SENT* and cache.CCsent[fh] is non-zero (this last is required to send CC options in the segments following the first of a multi-segment request message; see segment #2 in Figure 6). RECEIVING INITIAL <SYN> SEGMENT Suppose that a server host receives a segment containing a SYN bit but no ACK bit in LISTEN, SYN-SENT, or SYN-SENT* state.Braden [Page 25]RFC 1644 Transaction/TCP July 1994 R1.1:If the <SYN> segment contains a CC or CC.NEW option, SEG.CC is stored into TCB.CCrecv of the new TCB. R1.2:If the segment contains a CC option and if the local cache entry cache.CC[fh] is defined and if SEG.CC > cache.CC[fh], then the TAO test is passed and the connection is half-synchronized in the incoming direction. The server host replaces the cache.CC[fh] value by SEG.CC, passes any data in the segment to the user, and processes a FIN bit if present. Acknowledgment of the SYN is delayed to allow piggybacking on a response segment. R1.3:If SEG.CC <= cache.CC[fh] (the TAO test has failed), or if cache.CC[fh] is undefined, or if there is no CC option (but possibly a CC.NEW option), the server host proceeds with normal TCP processing. If the connection was in LISTEN state, then the host executes a 3-way handshake using the standard TCP rules. In the SYN-SENT or SYN- SENT* state (i.e., the simultaneous open case), the TCP sends ACK(SYN) and enters SYN-RECEIVED state. R1.4:If there is no CC option (but possibly a CC.NEW option), then the server host sets cache.CC[fh] undefined (zero). Receiving an ACK for a SYN (following application of rule R1.3) will update cache.CC[fh], by rule R3. Suppose that an initial <SYN> segment containing a CC or CC.NEW option arrives in an I-state (i.e., a state with a name of the form 'LISTEN-xx', where xx is one of TW, LA, L8, CL, or CL*): R1.5:If the state is LISTEN-TW, then the duration of the current connection is compared with MSL. If duration > MSL then send a RST: <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK> drop the packet, and return. R1.6:Perform a special TAO test: compare SEG.CC with TCB.CCrecv. If SEG.CC is greater, then processing is performed as if an ACK(FIN) had arrived: signal the application that the previous close completed successfully and delete the previous TCB. Then create a new TCB in LISTEN state and reprocess the SYN segment against the new TCB.Braden [Page 26]RFC 1644 Transaction/TCP July 1994 Otherwise, silently discard the segment. RECEIVING <SYN,ACK> SEGMENT Suppose that a client host receives a <SYN,ACK> segment for a connection in SYN-SENT or SYN-SENT* state. R2.1:If SEG.ACK is not acceptable (see [STD-007]) and cache.CCsent[fh] is non-zero, then simply drop the segment without sending a RST. (The new SYN that the client is (re-)transmitting will eventually acknowledge any outstanding data and FIN at the server.) R2.2:If the segment contains a CC.ECHO option whose SEG.CC is different from TCB.CCsend, then the segment is unacceptable and is dropped. R2.3:If cache.CCsent[fh] is zero, then it is set to TCB.CCsend. R2.4:If the segment contains a CC option, its SEG.CC is stored into TCB.CCrecv of the TCB. RECEIVING <ACK> SEGMENT IN SYN-RECEIVED STATE R3.1:If a segment contains a CC option whose SEG.CC differs from TCB.CCrecv, then the segment is unacceptable and is dropped. R3.2:Otherwise, a 3-way handshake has completed successfully at the server side. If the segment contains a CC option and if cache.CC[fh] is zero, then cache.CC[fh] is replaced by TCB.CCrecv. RECEIVING OTHER SEGMENT R4: Any other segment received with a CC option is unacceptable if SEG.CC differs from TCB.CCrecv. However, a RST segment is exempted from this test. OPEN REQUEST To allow truncation of TIME-WAIT state, the following changes are made in the state diagram for OPEN requests (see Figure 10): O1.1:A new passive open request is allowed in any of the states: LAST-ACK, LAST-ACK*, CLOSING, CLOSING*, or TIME- WAIT. This causes a transition to the corresponding I-Braden [Page 27]RFC 1644 Transaction/TCP July 1994 state (see Figure 10), which retains the previous state, including the retransmission queue and timer. O1.2 A new active open request is allowed in TIME-WAIT or LISTEN-TW state, if the elapsed time since the current connection opened is less than MSL. The result is to delete the old TCB and create a new one, send a new SYN segment, and enter SYN-SENT or SYN-SENT* state (depending upon whether or not the SYN segment contains a FIN bit). Finally, T/TCP has a provision to improve performance for the case of a client that "sprays" transactions rapidly using many different server hosts and/or ports. If TCB.CCrecv in the TCB is non-zero (and still assuming that the connection duration is less than MSL), then the TIME-WAIT delay may be set to min(K*RTO, 2*MSL). Here RTO is the measured retransmission timeout time and the constant K is currently specified to be 8. 3.5 User Interface STD-007 defines a prototype user interface ("transport service") that implements the virtual circuit service model [STD-007, Section 3.8]. One addition to this interface in required for transaction processing: a new Boolean flag "end-of-file" (EOF), added to the SEND call. A generic SEND call becomes: Send Format: SEND (local connection name, buffer address, byte count, PUSH flag, URGENT flag, EOF flag [,timeout]) The following text would be added to the description o
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -