📄 rfc663.txt
字号:
at the point where the break occurred using the C-channelspecified by the LMR message. This will restore thecommunication path X. What happens if S can not restorecommunication at the break point because it does not have therelevant messages any more? This issue can be solved in one ofthe two ways: either let the protocol specify a fixed rule that Swill be required to close the connection, or the protocol couldallow S and R (and may be the users on whose behalf S and R arecommunicating on X) to negotiate the action to be taken. For theprotocol to be presented here, we have taken the approach that Smay, at its option, either close the connection or negotiate withR. What action a specific host takes can either be built intoits NCP or determined dynamically. Those hosts that do not havevery powerful machines will probably chose the static option ofclosing the connection; other hosts may make the decisiondepending upon the circumstances. For example, a host may decidethat loss of messages is not acceptable during file transferswhereas loss of a single message can be ignored for terminaloutput to interactive users. A host might even let the userprocesses decide the course of action to be taken. If Sdetermines that it can not retransmit lost messages, it may wantto let R decide what action is to be taken. If S so decides,then it may communicate this fact to R by transmitting a_L_o_s_t__M_e_s_s_a_g_e__f_r_o_m__S_e_n_d_e_r (LMS) control message to R on thechannel S->R. An LMS message is of the following form: LMS(X,CN, MSN, COUNT), where X is the name of the channel, CN is thename of the C-channel obtained from the LMR message, MSN is themessage sequence number of the first message in the sequence oflost messages, and COUNT is the number of messages in thesequence. S resets its own synch-state for connection X to S(X,CN, MSN+COUNT). When S has informed R of its inability toretransmit lost messages, the burden of the decision falls on R,and S simply awaits R's reply before taking any action for thechannel X. When R receives the LMS, it may either decide thatloss is unacceptable and close the connection, or it may decideto let S continue. In the later case R informs S of its decision - 7 -to continue by transmitting a L__o_s_s__o_f__M_e_s_s_a_g_e__A_c_c_e_p_t_a_b_l_e (LMA)control message to S. Upon receiving the LMA control message, Sresumes transmission on X. To avoid the possibility of errors inexchange of control messages, the LMA control message isspecified to be an exact replica of the LMS control message,except for the message code which determines whether a controlmessage is LMA or LMS or something else.In general, a sending host has only a limited amount of memoryavailable for storing messages for possible retransmission later.In section 2.6 we provide a status exchange mechanism that can beused to determine when to discard these messages.2.5 RECOVERY ON CONTROL LINKSWe continue our discussion with the scenario developed in theprevious section. The receiver R may detect loss of messages oncontrol channels by examining the message sequence numbers on themessages. When R detects that a message has been lost on thechannel S->R, it (R) may transmit an LMR to S on R->Scommunicating the fact of loss of messages. When S receives theLMR for the control link, it must either retransmit the lostmessages, or "close" the connection. (In the context ofHost-to-Host protocol, closing the network connection for controllink implies exchange of reset commands, which has the effect ofreinitializing all communication between R and S.) For controllinks, S does not have the option of sending an LMS to thereceiver. If S can not retransmit the lost messages then itaborts the output queue (if any) for the channel S->R, andinserts a Reset command at the break point. Essentially, we arespecifying that if S can not retransmit lost control messagesthen the error would be considered irrecoverable and fatal. Alluser communication between S and R is broken and must berestarted from the beginning.In the above paragraph, we considered the situation in which Rwas able to detect the loss of messages. It is however possiblethat it is the last message transmitted on S->R that is lost. Inthis case, R will not be aware of the loss. In this situation,recovery can be initiated only if S can either positivelydetermine or simply suspect that a message has been lost. Ingeneral, after having transmitted a control message, S would beexpecting some sort of response from R. For example, if Stransmits a Request-for-Connection (RFC) control message to R, Sexpects R to reply either with a Close (CLS) command or anotherRFC. If, after an appropriate time interval has elapsed and Shas received no reply from R, our protocol specifies that S mayretransmit the control message. In retransmitting, S must use - 8 -the same C-channel and MSN values that were used for the originalmessage. Since R can, now, receive duplicate copies, westipulate that if R receives a duplicate of the message that ithas already received, it may simply ignore the duplicate.2.6 SOME OTHER PROBLEMSThere are two problems that have not yet been solved. First, asending host will usually have only a limited amount of bufferspace in which it can save messages for possible laterretransmission. So far, we have not provided any method by whicha host may positively determine whether the receiver hascorrectly received a certain message or not. Thus it has no firmbasis on which it may decide to release the space used up bymessages that have been already transmitted. The second problemis created by our recycling the message sequence numbers. Forthe MSN mechanism to work correctly, it is essential that at anygiven instant of time there be no more than 15 messages in thetransmission path. If there were more than 15 messages, some ofthese messages would have same MSN and LRN, and if one of thesemessages were to be lost, it would be impossible to identify thelost message. However, the second problem should not arise inthe ARPA Network, since the IMP sub-network will not allow morethan eight outstanding messages between any host pair (NWG-RFC#660).We can solve both these problems by a simple yet highly flexiblescheme. In this scheme, there are two new control messages. Oneof these, called R__e_q_u_e_s_t S__t_a_t_u_s _f_r_o_m S__e_n_d_e_r (RSS), can be used bythe sending host to query the receiver regarding the receiver'ssynch-state. The receiver can supply its copies of C-channelnumber and MSN for a transmission path by sending a S__t_a_t_u_s _f_r_o_mR__e_c_e_i_v_e_r (SFR) control message over the control channel. An SFRprovides positive acknowledgement; differing with the usualacknowledgement schemes in only that here acknowledgement isprovided only upon demand. Upon receiving SFR, the sender knowsexactly which messages have been properly delivered, and it mayfree the buffer space used by these messages. The RSS and SFRscheme can also be used to ensure that there are no more thanfifteen messages in the transmission path at any given time. - 9 -3.0 LOST MESSAGE DETECTION AND RECOVERY PROTOCOLThis protocol is proposed as an amendment to the Host-to-HostProtocol for the purpose of letting hosts detect the loss ofmessages in the network. It also provides recovery proceduresfrom such losses. This protocol is divided into two parts. Part1 states the compatibility requirements. Part 2 states the newprotocol and must be implemented by hosts that desire to have theability to recover from loss of messages in the network. Thereader will find many comments interspersed throughout thedescription of this protocol. These comments are not part of theprotocol and are provided solely for the purpose of improving thereader's understanding of this protocol.The terminology used in this protocol is similar to that used inthe Host-to-Host protocol. We speak of a "network connection"between a pair of hosts, called the "receiver" and the "sender."A network connection is described by a pair of socket numbers,and once established, a network connection is associated with alink (which is described by a link number.) A network connectionis a logical communication path and the link assigned to it is aphysical communication path. In addition to links associatedwith the network connections, there are "control-links" for thetransmission of "control commands." When we use the term"connection" it may refer to either a network connection or thelink assigned to it; the context decides which one. The term"links" encompasses the connection-associated-links as well ascontrol-links. Notice that a receiver of a connection maytransmit control commands regarding this connection.3.1 DEFINTIONS3.1.1 HOST TYPE "A"Those hosts that have not adopted the part 2 of this protocolamendment will be known as type A hosts.(Comment: All existing hosts are type A hosts.)3.1.2 HOST TYPE "B"Those hosts, that adopt the part 2 of this protocol amendmentwill be known as type B hosts. - 10 -3.1.3 MESSAGE SEQUENCE NUMBER (MSN)A four bit number associated with regular messages and containedin the bits 25 through 28 of the Host-to-IMP and IMP-to-Hostleaders for regular messages [BBN Report No. 1822]. This numberis used by the type B hosts to detect loss of messages on agiven link. Type A hosts always set the MSN (for the messagesthey send out) to zero. When in use by a type B host, the firstmessage on a link (after the connection has been established) hasthe MSN value of one. For each successive message on this link,the MSN value is increased by one until it reaches a value of 15.The next message has the MSN value of one.(Comments: Type B hosts will use the MSN mechanism only whencommunicating with other type B hosts. If a type B host iscommunicating with a type A host, the type B host willessentially simulate the behaviour of a type A host and use zeroMSN values for this communication.)3.1.4 LINK RESYNCH NUMBER (LRN)The Link Resynch Number is an eight bit number associated with alink and used for resynchronizing the communication. For linksassociated with a network connection (i.e. user links), it isintially set to zero. For control links, it is set to zero atthe time of the Network Control Program (NCP) initialization.For a given link, its current LRN value is copied into the LRNfield of all messages sent out on the link. The LRN values maybe manipulated by type B hosts in accordance with the protocoldescribed later.(Comments: Our protocol specifies that for all communicationinvolving a type A host, the LRN value will never change fromzero. Since the LRN field is presently unused, all hosts set itto zero even though they do not explicitly recognize this fieldas an LRN field. This guarantees compatibility.)3.1.5 LRN FIELDAn eight bit field in the bits 33 through 40 of the Host-to-Hostmessage header. - 11 -3.2 NEW CONTROL COMMANDS3.2.1 LMR - LOST MESSAGE FROM RECEIVER___8______8_______8_______8____| I I I II LMR | link | LRN | MSN II______I_______I_______I______I_The LMR command is sent by a receiving host to let the sendinghost know that one or more messages have been lost. The MSNfield specifies the message sequence number of the first messagelost. The LRN field specifies the new LRN value that must beused if and when communication is restored.(Comments: As will be seen later, the LMR command also has theeffect of resetting the bit and message allocation in the sendinghost to zero. In order to permit a sender to restorecommunication, an LMR command will be usually accompanied with anallocate command. However notice that these comments do notapply to the control links because there is no allocationmechanism for the control links.)3.2.2 LMS - LOST MESSAGE FROM SENDER____8_________8________8__________8_________8_____I I I I I II LMS I Link I LRN I MSN I COUNT II__________I________I_________I__________I________I_This command is sent by a sender host in reply to an LMR commandif it (the sender) can not retransmit the lost messages specifiedby the LMR command. The purpose of this command is to query thereceiver whether or not the loss of messages is acceptable.After sending this command, the sender waits for a reply beforetransmitting any messages over the link involved. This commandmay not be sent for control links. The LRN and MSN values aresame as those specified by the LMR command. COUNT specifies thenumber of messages lost.3.2.3 LMA - LOSS OF MESSAGES ACCEPTABLEThis command is identical to the LMS command accept for thecommand code. Upon receipt of an LMS command, a receiver may - 12 -send this command to the sender to let the sender know that lossof messages is acceptable. All fields in this command are set tocorresponding values in the LMS command.3.2.4 CLS2 - CLOSE2____8___________3_2_______________3_2_____________8_______8______I I I I I II CLS2 I my socket I your socket I LRN I MSN II________I_______________I__________________I________I_______I_The CLS2 command is similar to the current CLS command except forthe LRN and MSN fields included in the new command. Both thereceiving and sending hosts copy their values of LRN and MSN intothe CLS2 command. Upon receiving a CLS2 command, a host comparesthe LRN and MSN values contained in the CLS2 command with its ownvalues for the connection involved. If these values do notmatch, then an error has occurred and a host may initiaterecovery procedures.(Comments: The purpose of this command is to ensure that thelast message transmitted on a connection has been receivedsuccesfully.)3.2.5 ECLS - ERROR CLOSE_____8___________3_2___________3_2_________I I I II ECLS I my socket I your socketII_________I______________I______________I_The ECLS command is similar to the current CLS command. It is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -