2.4.8.3	Timer T3
	The DCE shall support a Timer T3 system parameter, the value of which shall be made known to the DTE.
	The period of Timer T3, at the end of which an indication of an observed excessively long idle channel state condition is passed to the Packet Layer, shall be sufficiently greater than the period of the DCE Timer T1 (i.e. T3 > T1) so that the expiration of T3 provides the desired level of assurance that the data link channel is in a non–active, non–operational state, and is in need of data link set–up before normal data link operation can resume.
2.4.8.4	Maximum number of attempts to complete a transmission N2
	The value of the DTE N2 system parameter may be different than the value of the DCE N2 system parameter. These values shall be made known to both the DTE and the DCE, and agreed to for a period of time by both the DTE and the DCE.
	The value of N2 shall indicate the maximum number of attempts made by the DCE or DTE to complete the successful transmission of a frame to the DTE or DCE, respectively.
2.4.8.5	Maximum number of bits in an I frame N1
	The value of the DTE N1 system parameter may be different than the value of the DCE N1 system parameter. These values shall be made known to both the DTE and the DCE.
	The values of N1 shall indicate the maximum number of bits in an I frame (excluding flags and 0 bits inserted for transparency) that the DCE or DTE is willing to accept from the DTE or DCE, respectively.
	In order to allow for universal operation, a DTE should support a value of DTE N1 which is not less than 1080 bits (135 octets). DTEs should be aware that the network may transmit longer packets (see § 5.2), that may result in a data link layer problem.
	All networks shall offer to a DTE which requires it, a value of DCE N1 which is greater than or equal to 2072 bits (259 octets) plus the length of the address, control and FCS fields at the DTE/DCE interface, and greater than or equal to the maximum length of the data packets which may cross the DTE/DCE interface plus the length of the address, control and FCS fields at the DTE/DCE interface.
	Appendix II provides a description of how the values stated above are derived.
2.4.8.6	Maximum number of outstanding I frames k
	The value of the DTE k system parameter shall be the same as the value of the DCE k system parameter. This value shall be agreed to for a period of time by both the DTE and the DCE.
	The value of k shall indicate the maximum number of sequentially numbered I frames that the DTE or DCE may have outstanding (i.e. unacknowledged) at any given time. The value of k shall never exceed seven for modulo 8 operation, or one hundred and twenty–seven for modulo 128 operation. All networks (DCEs) shall support a value of seven. Other values of k (less than and greater than seven) may also be supported by networks (DCEs).
2.5	Multilink procedure (MLP) (Subscription–time selectable option)
	The multilink procedure (MLP) exists as an added upper sublayer of the Data Link Layer, operating between the Packet Layer and a multiplicity of single data link protocol functions (SLPs) in the Data Link Layer (see Figure 1/X.25).
	A multilink procedure (MLP) must perform the functions of accepting packets from the Packet Layer, distributing those packets across the available DCE or DTE SLPs for transmission to the DTE or DCE SLPs, respectively, and resequencing the packets received from the DTE or DCE SLPs for delivery to the DTE or DCE Packet Layer, respectively.
Figure 1/X.25 - T0702221-87

2.5.1	Field of application
	The optional multilink procedure (MLP) described below is used for data interchange over one or more single link procedures (SLPs), each conforming to the description in §§ 2.2, 2.3 and 2.4, in parallel between a DCE and a DTE. The multilink procedure provides the following general features:
a)	achieve economy and reliability of service by providing multiple SLPs between DCE and a DTE;
b)	permit addition and deletion of SLPs without interrupting the service provided by the multiple SLPs;
c)	optimize bandwidth utilization of a group of SLPs through load sharing;
d)	achieve graceful degradation of service when an SLP(s) fails;
e)	provide each multiple SLP group with a single logical Data Link Layer appearance to the Packet Layer; and
f)	provide resequencing of the received packets prior to delivering them to the Packet Layer.
2.5.2	Multilink frame structure
	All information transfers over an SLP are in multilink frames conforming to one of the formats shown in Table 9/X.25.
Table 9/X.25 (comme figure) - CCITT 34731

2.5.2.1	Multilink control field
	The multilink control field (MLC) consists of two octets, and its contents are described in § 2.5.3.
2.5.2.2	Multilink information field
	The information field of a multilink frame, when present, follows the MLC. See §§ 2.5.3.2.3 and 2.5.3.2.4 for the various codings and groupings of bits in the multilink information field.
2.5.3	Multilink control field format and parameters
2.5.3.1	Multilink control field format
	The relationship shown in Table 10/X.25 exists between the order of bits delivered to/received from an SLP and the coding of the fields in the multilink control field.
2.5.3.2	Multilink control field parameters
	The various parameters associated with the multilink control field format are described below. See Table 10/X.25 and Figure 2/X.25.
Tableau 10/X.25 (comme figure) - CCITT 34740

Figure 2/X.25 - CCITT 34750

2.5.3.2.1	Void sequencing bit (V)
	The void sequencing bit (V) indicates if a received multilink frame shall be subjected to sequencing constraints. V set to 1 means sequencing shall not be required. V set to 0 means sequencing shall be required.
	Note – For purposes of this Recommendation, this bit shall be set to 0.
2.5.3.2.2	Sequence check option bit (S)
	The sequence check option bit (S) is only significant when V is set to 1 (indicating that sequencing of received multilink frames shall not be required). S set to 1 shall mean no MN(S) number has been assigned. S set to 0 shall mean an MN(S) number has been assigned, so that although sequencing shall not be required, a duplicate multilink frame check may be made, as well as a missing multilink frame identified.
	Note – For purposes of this Recommendation, this bit shall be set to 0.
2.5.3.2.3	MLP reset request bit (R)
	The MLP reset request bit (R) is used to request a multilink reset (see § 2.5.4.2). R set to 0 is used in normal communication, i.e. no request for a multilink reset. R set to 1 is used by the DCE MLP or DTE MLP to request the reset of the DTE MLP or DCE MLP state variables, respectively. In this R = 1 case, the multilink information field does not contain Packet Layer information, but may contain an optional 8 bit Cause Field that incorporates the reason for the reset.
	Note – The encoding of the Cause Field is a subject for further study.
2.5.3.2.4	MLP reset confirmation bit (C)
	The MLP reset confirmation bit (C) is used in reply to an R bit set to 1 (see § 2.5.3.2.3) to confirm the resetting of the multilink state variables (see § 2.5.4.2). C set to 0 is used in normal communications, i.e. no multilink reset request has been activated. C set to 1 is used by the DCE MLP or DTE MLP in reply to a DTE MLP or DCE MLP multilink frame, respectively, with R set to 1, and indicates that the DCE MLP or DTE MLP state variable reset process has been completed by the DCE or DTE, respectively. In this C = 1 case, the multilink frame is used without an information field.
2.5.3.2.5	Multilink send state variable MV(S)
	The multilink send state variable MV(S) denotes the sequence number of the next in–sequence multilink frame to be assigned to an SLP. This variable can take on the value 0 through 4095 (modulo 4096). The value of MV(S) is incremented by 1 with each successive multilink frame assignment.
2.5.3.2.6	Multilink sequence number MN(S)
	Multilink frames contain the multilink sequence number MN(S). Prior to the assignment of an in–sequence multilink frame to an available SLP, the value of MN(S) is set equal to the value of the multilink send state variable MV(S). The multilink sequence number is used to resequence and to detect missing and duplicate multilink frames at the receiver before the contents of a multilink frame information field is delivered to the Packet Layer.
2.5.3.2.7	Transmitted multilink frame acknowledged state variable MV(T)
	MV(T) is the state variable at the transmitting DCE MLP or DTE MLP denoting the oldest multilink frame which is awaiting an indication that a DCE SLP or DTE SLP has received an acknowledgement from its remote DTE SLP or DCE SLP, respectively. This variable can take on the value 0 through 4095 (modulo 4096). Some multilink frames with sequence numbers higher than MV(T) may already have been acknowledged.
2.5.3.2.8	Multilink receive state variable MV(R)
	The multilink receive state variable MV(R) denotes the sequence number at the receiving DCE MLP or DTE MLP of the next in–sequence multilink frame to be received and delivered to the Packet Layer. This variable can take on the value 0 through 4095 (modulo 4096). The value of MV(R) is updated as described in § 2.5.4.3.2 below. Multilink frames with higher sequence numbers in the DCE MLP or DTE MLP receive window may already have been received.
2.5.3.2.9	Multilink window size MW
	MW is the maximum number of sequentially numbered multilink frames that the DCE MLP or DTE MLP may transfer to its SLPs beyond the lowest numbered multilink frame which has not yet been acknowledged. MW is a system parameter which can never exceed 4095 – MX. The value of MW shall be agreed for a period of time with the Administration and shall have the same value for both the DCE MLP and the DTE MLP for a given direction of information transfer.
	Note – Factors which will affect the value of parameter MW include, but are not limited to, single link transmission and propagation delays, the number of links, the range of multilink frame lengths, and SLP parameters N2, T1, and k.
	The MLP transmit window contains the sequence numbers MV(T) to MV(T) + MW – 1 inclusive.
	The MLP receive window contains the sequence numbers MV(R) to MV(R) + MW – 1 inclusive. Any multilink frame received within this window shall be delivered to the Packet Layer when its MN(S) becomes the same as MV(R).
2.5.3.2.10	Receive MLP window guard region MX
	MX is a system parameter which defines a guard region of multilink sequence numbers of fixed size beginning at MV(R) + MW. The range of MX shall be large enough for the receiving MLP to recognize the highest MN(S) outside of its receive window that it may legitimately receive after a multilink frame loss has occurred.
	A multilink frame with sequence number MN(S) = Y received in this guard region indicates that those missing multilink frame(s) in the range MV(R) to Y – MW has(have) been lost. MV(R) is then updated to Y – MW + 1.
	Note – A number of methods may be selected in calculating a value for the guard region MX:
a)	In a system where the transmitting MLP assigns hi in–sequence contiguous multilink frames at a time to the ith SLP, MX should be greater than or equal to the sum of the hi + 1 – hmin, where hmin equals the smallest hi encountered. Where there are L SLPs in the multilink group, MX should be greater than or equal to:
			Li=1 hi + 1 = hmin; or
b)	In a system where the transmitting MLP assigns on a rotation basis h in–sequence contiguous multilink frames at a time to each SLP, MX at the receiving MLP should be greater than or equal to h(L – 1) + 1, where L is the number of SLPs in the multilink group; or
c)	MX should be no larger than MW.
Additional methods of selecting MX values are for further study.
2.5.4	Description of multilink procedure (MLP)
	The procedure below is presented from the perspective of the transmitter and receiver of multilink frames.
	The arithmetic is performed modulo 4096.
2.5.4.1	Initialization
	The DCE or DTE will perform an MLP initialization by first resetting MV(S), MV(T) and MV(R) to zero and then initializing each of its SLPs. Upon successful initialization of at least one of the SLPs, the DCE shall, and the DTE should, perform the multilink resetting procedure as described in § 2.5.4.2. An SLP initialization is performed according to § 2.4.4.1 of this Recommendation.
	Note – An SLP that cannot be initialized should be declared out of service and appropriate recovery action should be taken.
2.5.4.2	Multilink resetting procedure
	The multilink resetting procedure provides the mechanism for synchronizing the sending and receiving MLPs in both the DCE and the DTE, when deemed necessary by either the DCE or the DTE. Exact cases where the MLP resetting procedures are invoked is for further study. Following a successful multilink resetting procedure, the multilink sequence numbering in each direction begins with the value 0. Appendix III provides examples of the multilink resetting procedures when initiated by either the DCE or the DTE, or by both the DCE and the DTE simultaneously.
	A multilink frame with R = 1 is used to request multilink reset, and a multilink frame with C = 1 confirms that the multilink reset process has been completed. An MLP resets MV(S) and MV(T) to zero on transfer of a multilink frame with R = 1; and resets MV(R) to zero on receipt of a multilink frame with R = 1.
	When the DCE MLP or DTE MLP initiates the resetting procedure, it removes all of the unacknowledged multilink frames that are held in that MLP and its associated SLPs, and retains control of those frames. Hereafter, the initiating MLP does not transfer a multilink frame with R = C = 0 until the reset process is completed. (One method to remove multilink frames in the SLP is to disconnect the data link of that SLP.) The initiating MLP then resets its multilink send state variable MV(S) and its transmitted multilink frame acknowledged state variable MV(T) to zero. The initiating MLP then transfers a multilink frame with R = 1 as a reset request on one of its SLPs and starts Timer MT3. The value of the MN(S) field in the R = 1 frame may be any value, since when R = 1 the MN(S) field is ignored by the receiving MLP. The initiating MLP continues to receive and process multilink frames from the remote MLP, in accordance with the procedures as described in § 2.5.4.4 below until it receives a multilink frame with R = 1 from the remote MLP.
	An MLP which has received a multilink frame with R = 1 (reset request) in the normal communication status from an initiating MLP starts the operation as described above; the MLP should receive no multilink frame with R = C = 0 from the other MLP until the reset process is completed. Any such multilink frame received is discarded. When an MLP has already initiated its own multilink resetting procedure and has transferred the multilink frame with R = 1 to one of its SLPs for transmission, that MLP does not repeat the above operation upon receipt of a multilink frame with R = 1 from the other MLP.
	Receipt of a frame with R = 1 (reset request) causes the receiving MLP to deliver to the Packet Layer those packets already received and to identify those multilink frames assigned to SLPs but unacknowledged. The Packet Layer may be informed of the packet loss at the original value of MV(R) and at any subsequent value(s) of MV(R) for which there has been no multilink frame received up to and including the highest numbered multilink frame received. The receiving MLP then resets its multilink receive state variable MV(R) to zero.
	After an MLP assigns a multilink frame with R = 1 to one of its SLPs, it shall receive indication of successful or unsuccessful transmission from that SLP as one of the conditions before transferring a multilink frame with C = 1; when the initiating MLP then receives a multilink frame with R = 1, and has completed the multilink state variable resetting operation described above, the initiating MLP transfers a multilink frame with C = 1 (reset confirmation) to the other MLP. When an MLP has:
(1)	received a multilink frame with R = 1,
(2)	transferred a multilink frame with R = 1 on one of its SLPs, and
(3)	completed the multilink state variable resetting operation above,
that MLP then transfers a multilink frame with C = 1 (reset confirmation) to the other MLP as soon as possible, given that indication of the successful or unsuccessful transmission of the R = 1 multilink frame has been received from that MLP's SLP. The C = 1 multilink frame is a reply to the multilink frame with R = 1. The value of the MN(S) field in the above C = 1 frame may be any value, since when C = 1 the MN(S) field is ignored by the receiving MLP. The multilink sequence number MN(S) received in each direction following multilink reset will begin with the value zero.
	When an MLP uses only one SLP to transmit the multilink frame with R = 1 and the multilink frame with C = 1, the MLP can transfer the multilink frame with C = 1 immediately after the multilink frame with R = 1 without waiting for SLP indication of transmission completion. An MLP shall not retransmit a multilink frame with R = 1 or a multilink frame with C = 1 unless Timer MT3 (see § 2.5.5.3 below) runs out. An MLP may use two different SLPs as long as one is used for transmitting the multilink frame with R = 1 and the other is used for transmitting the multilink frame with C = 1 following receipt of the SLP indication of successful or unsuccessful transmission of the R = 1 multilink frame. A multilink frame with R = C = 1 is never used.
	When an MLP receives the multilink frame with C = 1, the MLP stops its Timer MT3. The transmission of the multilink frame with C = 1 to a remote SLP and the reception of a multilink frame with C = 1 from the remote MLP completes the multilink resetting procedure for an MLP. The first multilink frame transferred with R = C = 0 shall have a multilink sequence number MN(S) value of zero. After an MLP transfers a multilink frame with C = 1 to an SLP, the MLP may receive one or more multilink frames with R = C = 0. After an MLP receives a multilink frame with C = 1, the MLP may transfer one or more multilink frames with R = C = 0 to its SLPs.
	When an MLP additionally receives one or more multilink frames with R = 1 between receiving a multilink frame with R = 1 and transferring a multilink frame with C = 1, the MLP shall discard the extra multilink frames with R = 1. When an MLP receives a multilink frame with C = 1, which is not a reply to a multilink frame with R = 1, the MLP shall discard the multilink frame with C = 1.
	After an MLP transfers a multilink frame with C = 1 on one of its SLPs, the MLP may receive a multilink frame with R = 1 from the other MLP. The MLP shall regard the multilink frame with R = 1 as a new reset request and shall start the multilink resetting procedure from the beginning. When an MLP which has not received a multilink frame with R = 1, transfers a multilink frame with R = 1, and therefore receives a multilink frame with C = 1, the MLP shall restart the resetting procedure from the beginning.
	When Timer MT3 runs out, the MLP restarts the multilink resetting procedure from the beginning. The value of Timer MT3 shall be large enough to include the transmission, retransmission and propagation delays in the SLPs, and the operation time of the MLP that receives a multilink frame with R = 1 and responds with a multilink frame with C = 1.
2.5.4.3	Transmitting multilink frames
2.5.4.3.1	General
	The transmitting DCE or DTE MLP shall be responsible for controlling the flow of packets from the Packet Layer into multilink frames and then to the SLPs for transmission to the receiving DTE or DCE MLP, respectively.
	The functions of the transmitting DCE or DTE MLP shall be to:
a)	accept packets from the Packet Layer;
b)	allocate multilink control fields, containing the appropriate sequence number MN(S), to the packets;
c)	assure that MN(S) is not assigned outside the MLP transmit window (MW);
d)	pass the resultant multilink frames to the SLPs for transmission;
e)	accept indications of successful transmission acknowledgements from the SLPs;
f)	monitor and recover from transmission failures or difficulties that occur at the SLP sublayer; and
g)	accept flow control indications from the SLPs and take appropriate actions.
2.5.4.3.2	Transmission of multilink frames
	When the transmitting DCE MLP accepts a packet from the Packet Layer, it shall place the packet in a multilink frame, set the MN(S) equal to MV(S), assure that MN(S) is not assigned outside the transmit window (MW), set V, S, R and C to 0, and then increment MV(S) by 1.
	In the following, incrementing send and receive state variables is in reference to a continuously repeated sequence series, i.e. 4095 is 1 higher than 4094, and 0 is 1 higher than 4095 for modulo 4096 series.
	If the MN(S) is less than MV(T) + MW, and the DTE has not indicated a busy condition on all available DCE SLPs, the transmitting DCE MLP may then assign the new multilink frame to an available DCE SLP. The transmitting DCE MLP shall always assign the lowest MN(S) unassigned multilink frame first. Also, the transmitting DCE MLP may assign a multilink frame to more than one DCE SLP. When the DCE SLP successfully completes the transmission of (a) multilink frame(s) by receiving an acknowledgement from the DTE SLP, it shall indicate this to the transmitting DCE MLP. The transmitting DCE MLP may then discard the acknowledged multilink frame(s). As the transmitting DCE receives new indications of acknowledgements from the DCE SLPs, MV(T) shall be advanced to denote the lowest numbered multilink frame not yet acknowledged.
	Whenever a DCE SLP indicates that it has attempted to transmit a multilink frame N2 times, the DCE MLP will then assign the multilink frame to the same or one or more other DCE SLPs unless the MN(S) has been acknowledged on some previous DCE SLP. The DCE MLP shall always assign the lowest MN(S) multilink frame first.
	Note – If a DCE MLP implementation is such that a multilink frame is assigned to more than one DCE SLP (e.g. to increase the probability of successful delivery) there is a possibility that one of these multilink frames (i.e. a duplicate) may be delivered to the remote DTE MLP after an earlier one has been acknowledged [the earlier multilink frame would have resulted in the receiving DTE MLP having incremented its MV(R) and the transmitting DCE MLP having incremented its MV(T)]. To ensure that an old duplicate multilink frame is not mistaken for a new frame by the receiving DTE MLP, it is required that the transmitting DCE MLP shall never assign to a DCE SLP a new multilink frame with MN(S) equal to MN(S)` – MW – MX, where MN(S)` is associated with a duplicate multilink frame that was earlier assigned to other DCE SLPs, until all DCE SLPs have either successfully transmitted the multilink frame MN(S)` or have attempted the transmission the maximum number of times. Alternatively, the incrementing of MV(T) may be withheld until all DCE SLPs that were assigned the multilink frame MN(S)` have either successfully transferred the multilink frame MN(S)` or have attempted the transmission the maximum number of times. These and other alternatives are for further study.
	Flow control is achieved by the window size parameter MW, and through busy conditions being indicated by the DTE SLPs.
	The DCE MLP will not assign a multilink frame with an MN(S) greater than MV(T) + MW – 1. At the point where the next DCE multilink frame to be assigned has an MN(S) = MV(T) + MW, the DCE MLP shall hold this and subsequent multilink frames until an indication of an acknowledgement that advances MV(T) is received from the DCE SLPs.
	The DTE MLP may exercise flow control of the DCE MLP by indicating a busy condition over one or more DTE SLPs. The number of SLPs made busy will determine the degree of DCE MLP flow control realized. When the DCE MLP receives an indication of a DTE SLP busy condition from one or more of its DCE SLPs, the DCE MLP may reassign any unacknowledged multilink frames that were assigned to those DCE SLPs. The DCE MLP will assign the multilink frames containing the lowest MN(S) to an available DCE SLP as specified above.
	Note 1 – The action to be taken on the receipt of an RNR frame by the DCE SLP whose unacknowledged multilink frames have been reassigned is for further study.
	In the event of a circuit failure, a DCE SLP reset, or a DCE SLP or DTE SLP disconnection, all DCE MLP multilink frames that were unacknowledged on the affected DCE SLPs shall be reassigned to an operational DCE SLP(s) which is(are) not in the busy condition.
	Note 2 – The means of detecting transmitting DCE MLP malfunctions (e.g. sending more than MW multilink frames) and the actions to be taken are for further study.
2.5.4.4	Receiving multilink frames
	Any multilink frame less than two octets in length shall be discarded by the receiving DCE MLP.
	Note – The procedures to be followed by the receiving DCE MLP when V and/or S is equal to 1 are for further study. The procedures to be followed by the receiving DCE MLP when R or C is equal to 1 are described in § 2.5.4.2 above.
	When the DCE MLP receives multilink frames from one of the DCE SLPs, the DCE MLP will compare the multilink sequence number MN(S) of the received multilink frame to its multilink receive state variable MV(R), and act on the multilink frame as follows:
a)	If the received MN(S) is equal to the current value of MV(R), i.e. is the next expected in–sequence multilink frame, the DCE MLP delivers the packet to the Packet Layer.
b)	If the MN(S) is greater than the current value of MV(R) but less than MV(R) + MW + MX, the DCE MLP keeps the received multilink frame until condition a) is met, or discards it if it is a duplicate.
c)	If the MN(S) is other than in a) and b) above, the multilink frame is discarded.
	Note – In case c) above, the recovery from desynchronization greater than MX between the local and the remote MLP, i.e., the value of MN(S) reassigned to new multilink frames at the remote MLP is higher than MV(R) + MW + MX at the local MLP, is for further study.
	On receipt of each multilink frame, MV(R) is incremented by the DCE MLP in the following way:
i)	If MN(S) is equal to the current value of MV(R), the MV(R) is incremented by the number of consecutive in–sequence multilink frames that have been received. If additional multilink frames are awaiting delivery pending receipt of a multilink frame with MN(S) equal to the updated MV(R), then Timer MT1 (see § 2.5.5.1 below) is restarted; otherwise Timer MT1 is stopped.
ii)	If MN(S) is greater than the current value of MV(R) but less than MV(R) + MW, MV(R) remains unchanged. Timer MT1 is started, if not already running.
iii)	If MN(S) is  MV(R) + MW but < MV(R) + MW + MX, MV(R) is incremented to MN(S) – MW + 1 and then the Packet Layer may be informed of the packet loss at the original value of MV(R). As MV(R) is being incremented, if any multilink frame with MN(S) = MV(R) has not yet been received, the Packet Layer may be informed of that packet loss also; if the multilink frame with MN(S) = MV(R) has been received, it is delivered to the Packet Layer. After MV(R) reaches MN(S) – MW + 1, it will then be incremented further (as in i) above) until the first unacknowledged MN(S) is encountered. See Figure 3/X.25.
iv)	If the MN(S) is other than that in i), ii) and iii) above, MV(R) remains unchanged.
Figure 3/X.25 - T0702230-87

	If Timer MT1 runs out, MV(R) is incremented to the MN(S) of the next multilink frame awaiting delivery to the Packet Layer and then the Packet Layer may be informed of the packet loss at the original MV(R). The procedure follows a) and i) above as long as there are consecutive in–sequence multilink frames which have been received.
	When flow control of the DTE MLP is desired, one or more DCE SLP(s) may be made to indicate a busy condition. The number of DCE SLPs made busy determines the degree of flow control realized.
	If the DCE MLP can exhaust its receive buffer capacity before resequencing can be completed, Timer MT2 (see § 2.5.5.2 below) may be implemented. Whenever a busy condition is indicated by the DCE MLP on all DCE SLPs, and multilink frames at the DCE MLP are awaiting resequencing, Timer MT2 shall be started. When the busy condition is cleared on one or more DCE SLPs by the DCE MLP, Timer MT2 shall be stopped.
	If Timer MT2 runs out, the multilink frame with MN(S) = MV(R) is blocked and shall be considered lost. MV(R) shall be incremented to the next sequence number not yet received, and the packets contained in multilink frames with intervening multilink sequence numbers are delivered to the Packet Layer. Timer MT2 shall be restarted if the busy condition remains in effect on all DCE SLPs and more multilink frames are awaiting resequencing.
2.5.4.5	Taking an SLP out of service
	A DCE SLP may be taken out of service for maintenance, traffic, or performance considerations.
	A DCE SLP is taken out of service by disconnecting at the Physical Layer or the Data Link Layer. Any outstanding DCE MLP multilink frames will be reassigned to one or more other DCE SLPs, unless the MN(S) has been previously acknowledged on some other DCE SLP. The usual procedure for taking a DCE SLP out of service at the Data Link Layer would be to flow control the DTE SLP with an RNR frame, and then logically disconnect the DCE SLP (see § 2.4.4.3 above).
	If the DCE SLP Timer T1 has run out N2 times and the DCE SLP data link resetting procedure is unsuccessful, then the DCE SLP will enter the disconnected phase, taking the DCE SLP out of service (see §§ 2.4.5.8 and 2.4.7.2 above).
	Note – In the case where all SLPs are out of service, the recovery mechanism is based on initiating the multilink resetting procedures. Other recovery procedures are for further study.
2.5.5	List of multilink system parameters
2.5.5.1	Lost–frame Timer MT1 (multilink)
	Timer MT1 is used at a receiving DCE MLP to provide a means to identify during low traffic periods that the multilink frame with MN(S) equal to MV(R) is lost.
2.5.5.2	Group busy Timer MT2 (multilink)
	Timer MT2 is provided at a receiving DCE MLP to identify a “blocked” multilink frame condition (e.g. a buffer exhaust situation) that occurs before required resequencing can be accomplished. Timer MT2 is started when all DCE SLPs are busy and there are multilink frames awaiting resequencing. If Timer MT2 runs out before the “blocked” multilink frame MV(R) is received, the “blocked” multilink frame(s) is(are) declared lost. MV(R) is incremented to the value of the next in–sequence multilink frame to be received, and any packets in intervening multilink frames are delivered to the Packet Layer.
	Note – Timer MT2 may be set to infinity; e.g. when the receiving DCE always has sufficient storage capacity.
2.5.5.3	MLP reset confirmation Timer MT3 (multilink)
	Timer MT3 is used by the DCE MLP to provide a means of identifying that the DTE MLP multilink frame with the C bit set to 1 that is expected following the transmission of the DCE MLP multilink frame with R bit set to 1, has not been received.
2.6	LAP elements of procedure
2.6.1	The LAP elements of procedure are defined in terms of actions that occur on receipt of frames at the DCE or DTE.
	The elements of procedure specified below contain the selection of commands and responses relevant to the LAP data link and system configurations described in § 2.1 above. Together, §§ 2.2 and 2.6 form the general requirements for the proper management of a LAP access data link.
2.6.2	LAP control field formats and parameters
2.6.2.1	Control field formats
	The control field contains a command or a response, and sequence numbers where applicable.
	Three types of control field formats (see Table 11/X.25) are used to perform numbered information transfer (I format), numbered supervisory functions (S format) and unnumbered control functions (U format).
TABLE 11/X.25
LAP control field formats (modulo 8)
Control field bits	 1	 2	 3	 4	 5	 6	 7	 8	
 I format	 0	 N(S)			 P	 N(R)			
 S format	 1	 0	 S	 S	 P/F	 N(R)			
 U format	 1	 1	 M	 M	 P/F	 M	 M	 M	
N(S)	Transmitter send sequence number (bit 2 = low–order bit)
N(R)	Transmitter receive sequence number (bit 6 = low–order bit)
S	Supervisory function bit
M	Modifier function bit
P/F	Poll bit when issued as a command, final bit when issued as a response. (1 = Poll/Final)
P	Poll bit (1 = Poll)
2.6.2.1.1	Information transfer format – I
	The I format is used to perform an information transfer. The functions of N(S), N(R) and P are independent, i.e. each I frame has an N(S), an N(R) which may or may not acknowledge additional I frames received by the DCE or DTE, and a P bit that may be set to 0 or 1.
2.6.2.1.2	Supervisory format – S
	The S format is used to perform data link supervisory control functions such as acknowledge I frames, request retransmission of I frames, and to request a temporary suspension of transmission of I frames. The functions of N(R) and P/F are independent, i.e. each supervisory frame has an N(R) which may or may not acknowledge additional I frames received by the DCE or DTE, and a P/F bit that may be set to 0 or 1.
2.6.2.1.3	Unnumbered format – U
	The U format is used to provide additional data link control functions. This format contains no sequence numbers, but does include a P/F bit that may be set to 0 or 1.
2.6.2.2	Control field parameters
	The various parameters associated with the control field formats are described below.
2.6.2.2.1	Modulus
	Each I frame is sequentially numbered and may have the value 0 through modulus minus 1 (where “modulus” is the modulus of the sequence numbers). The modulus equals 8 and the sequence numbers cycle through the entire range.
2.6.2.2.2	Send state variable V(S)
	The send state variable V(S) denotes the sequence number of the next in–sequence I frame to be transmitted. V(S) can take on the value 0 through modulus minus 1. The value of V(S) is incremented by 1 with each successive I frame transmission, but cannot exceed N(R) of the last received I or supervisory frame by more than the maximum number of outstanding I frames (k). The value of k is defined in § 2.7.7.6 below.
2.6.2.2.3	Send sequence number N(S)
	Only I frames contain N(S), the send sequence number of transmitted I frames. At the time that an in–sequence I frame is designated for transmission, the value of N(S) is set equal to the value of the send state variable V(S).
2.6.2.2.4	Receive state variable V(R)
	The receive state variable V(R) denotes the sequence number of the next in–sequence I frame expected to be received. V(R) can take on the values 0 through modulus minus 1. The value of V(R) is incremented by 1 with the receipt of an error free, in–sequence I frame whose send sequence number N(S) equals the receive state variable V(R).
2.6.2.2.5	Receive sequence number N(R)
	All I frames and supervisory frames contain N(R), the expected send sequence number of the next received I frame. At the time that a frame of the above types is designed for transmission, the value of N(R) is set equal to the current value of the receive state variable V(R). N(R) indicates that the DCE or DTE transmitting the N(R) has received correctly all I frames numbered up to and including N(R) – 1.
2.6.2.2.6	Poll/Final bit P/F
	All frames contain P/F, the Poll/Final bit. In command frames the P/F bit is referred to as the P bit. In response frames it is referred to as the F bit.
2.6.3	Functions of the Poll/Final bit
	The Poll bit set to 1 is used by the DCE or DTE to solicit (poll) a response from the DTE or DCE, respectively. The Final bit set to 1 is used by the DCE or DTE to indicate the response frame transmitted by the DTE or DCE, respectively, as a result of the soliciting (poll) command.
	The use of the P/F bit is described in § 2.7.2 below.
2.6.4	Commands and responses
	The commands and responses represented in Table 12/X.25 will be supported by the DCE and the DTE.
	For purposes of the LAP procedures, the supervisory function bit encoding “11” and those encodings of the modifier function bits in Table 11/X.25 not identified in Table 12/X.25 are identified as “undefined or not implemented” command and response control fields.
TABLE 12/X.25
LAP commands and responses
					1	2	3	4	5	6	7	8	
Format	Command		Response		Encoding								
Information transfer	I	(information)			0	N(S)			 P	N(R)			
Supervisory	 RR	 (receive ready)	 RR	 (receive ready)	 1	 0	 0	 0	P/F	N(R)			
	RNR	(receive not ready)	RNR	(receive not ready)	1	0	1	0	P/F	N(R)			
	REJ	 (reject)	 REJ	 (reject)	 1	 0	 0	 1	 P/F	N(R)			
Unnumbered	SARM	 (set asynchronous response mode)			1	 1	 1	 1	 P	 0	 0	0	
	DISC	 (disconnect)			1	 1	 0	 0	 P	 0	 1	 0	
			CMDR	(command reject)	 1	 1	 1	 0	 F	 0	 0	 1	
			UA	(unnumbered acknowledgement)	 1	 1	 0	 0	 F	 1	 1	 0	
Note – RR, RNR and REJ supervisory commands are transmitted by the DCE.
	The commands and responses in Table 12/X.25 are defined as follows:
2.6.4.1	Information (I) command
	The function of the information (I) command is to transfer across a data link a sequentially numbered frame containing an information field.
2.6.4.2	Receive ready (RR) command and response
	The receive ready (RR) supervisory frame is used by the DCE or DTE to:
1)	indicate it is ready to receive an I frame; and
2)	acknowledge previously received I frames numbered up to and including N(R) – 1.
	An RR frame may be used to indicate the clearance of a busy condition that was reported by the earlier transmission of an RNR frame by that same station (DCE or DTE). The RR command with the P bit set to 1 may be used by the DTE to ask for the status of the DCE.
2.6.4.3	Reject (REJ) command and response
	The reject (REJ) supervisory frame is used by the DCE or DTE to request transmission of I frames starting with the frame numbered N(R). I frames numbered N(R) – 1 and below are acknowledged. Additional I frames pending initial transmission may be transmitted following the retransmitted I frame(s).
	For a given direction of information transfer, only one REJ exception condition may be established at any time. The REJ exception condition is cleared (reset) upon the receipt of an I frame with an N(S) equal to the N(R) of the REJ frame.
	An REJ frame may be used to indicate the clearance of a busy condition that was reported by the earlier transmission of an RNR frame by that same station (DCE or DTE). The REJ command with the P bit set to 1 may be used by the DTE to ask for the status of the DCE.
2.6.4.4	Receive not ready (RNR) command and response
	The receive not ready (RNR) supervisory frame is used by the DCE or DTE to indicate a busy condition, i.e. temporary inability to accept additional incoming I frames. I frames numbered up to and including N(R) – 1 are acknowledged. I frame N(R) and any subsequent I frames received, if any, are not acknowledged; the acceptance status of these I frames will be indicated in subsequent exchanges.
	The RNR command with the P bit set to 1 may be used by the DTE to ask for the status of the DCE.
2.6.4.5	Set asynchronous response mode (SARM) command
	The SARM unnumbered command is used to place the addressed DCE or DTE in the asynchronous response mode (ARM) information transfer phase, where all command/response control fields will be one octet in length.
	No information field is permitted with the SARM command. A DCE or DTE confirms acceptance of an SARM command by the transmission at the first opportunity of a UA response. Upon acceptance of this command, the DCE or DTE receive state variable V(R) is set to 0.
	Previously transmitted I frames that are unacknowledged when this command is actioned remain unacknowledged. It is the responsibility of a higher layer (e.g. Packet Layer) to recover from the possible loss of the contents (packets) of such I frames.
2.6.4.6	Disconnect (DISC) command
	The DISC unnumbered command is used to terminate the mode previously set. It is used to inform the DCE or DTE receiving the DISC that the DTE or DCE sending the DISC command is suspending operation. No information field is permitted with the DISC command. Prior to actioning the DISC command, the DCE or DTE receiving the DISC command confirms the acceptance of the DISC command by the transmission of a UA response. The DTE or DCE sending the DISC command enters the disconnected phase when it receives the acknowledging UA response.
	Previously transmitted I frames that are unacknowledged when this command is actioned remain unacknowledged. It is the responsibility of a higher layer (e.g. Packet Layer) to recover from the possible loss of the contents (packets) of such I frames.
2.6.4.7	Unnumbered acknowledgement (UA) response
	The UA unnumbered response is used by the DCE or DTE to acknowledge the receipt and acceptance of the mode–setting commands. Received mode–setting commands are not actioned until the UA response is transmitted. The UA response is transmitted as directed by the received U format command. No information field is permitted with the UA response.
2.6.4.8	Command reject (CMDR) response
	The CMDR unnumbered response is used by the DCE or DTE to report an error condition not recoverable by retransmission of the identical frame, i.e. at least one of the following conditions, which results from the receipt of a valid command frame:
1)	the receipt of a command control field that is undefined or not implemented;
2)	the receipt of an I frame with an information field which exceeds the maximum established length;
3)	the receipt of an invalid N(R) (see § 2.7.5.1), or
4)	the receipt of a frame with an information field which is not permitted or the receipt of a supervisory or unnumbered frame with incorrect length.
	An undefined or not implemented control field is any of the control field encodings that are not identified in Table 12/X.25.
	An invalid N(R) is defined as one which points to an I frame which has previously been transmitted and acknowledged or to an I frame which has not been transmitted and is not the next sequential I frame awaiting transmission.
	An information field which immediately follows the control field, and consists of 3 octets, is returned with this response and provides the reason for the CMDR response. This format is given in Table 13/X.25.
TABLEAU 13/X.25
LAP CMDR information field format
Information field bits													
1  2  3  4  5  6  7  8	 9	 10  11  12	 13	 14 15 16	 17	 18	 19	 20	 21	 22	 23	 24	
Rejected command control field	 0	 V(S)	 0	 V(R)	 W	 X	 Y	 Z	 0	 0	 0	 0	
 –	Rejected command control field is the control field of the received command which caused the command reject.
–	V(S) is the current send state variable value at the DCE or DTE reporting the rejection condition (bit 10 = low–order bit).
–	V(R) is the current receive state variable value at the DCE or DTE reporting the rejection condition (bit 14 = low–order bit).
–	W set to 1 indicates that the control field received and returned in bits 1 through 8 was undefined or not implemented.
–	X set to 1 indicates that the control field received and returned in bits 1 through 8 was considered invalid because the frame contained an information field which is not permitted with this frame or is a supervisory or unnumbered frame with an incorrect length. Bit W must be set to 1 conjunction with this bit.
–	Y set to 1 indicates that the information field received exceeded the maximum established capacity of the DCE or DTE reporting the rejection condition.
–	Z set to 1 indicates the control field received and returned in bits 1 through 8 contained an invalid N(R).
Note – Bits 9, 13 and 21 to 24 shall be set to 0.
2.6.5	Exception condition reporting and recovery
	The error recovery procedures which are available to effect recovery following the detection/occurrence of an exception condition at the Data Link Layer are described below. Exception conditions described are those situations which may occur as the result of transmission errors, DCE or DTE malfunction, or operational situations.
2.6.5.1	Busy condition
	The busy condition results when the DCE or DTE is temporarily unable to continue to receive I frames due to internal constraints, e.g. receive buffering limitations. In this case an RNR frame is transmitted from the busy DCE or DTE. I frames pending transmission may be transmitted from the busy DCE or DTE prior to or following the RNR frame.
	An indication that the busy condition has cleared is communicated by the transmission of a UA (only in response to a SARM command), RR, REJ or SARM frame.
2.6.5.2	N(S) sequence error condition
	The information field of all I frames received whose N(S) does not equal the receive state variable V(R) will be discarded.
	An N(S) sequence error exception condition occurs in the receiver when an I frame received contains an N(S) which is not equal to the receive state variable V(R) at the receiver. The receiver does not acknowledge (increment its receive state variable) the I frame causing the sequence error, or any I frames which may follow, until an I frame with the correct N(S) is received.
	A DCE or DTE which receives one or more valid I frames having sequence errors but otherwise errorless shall accept the control information contained in the N(R) field and the P bit to perform data link control functions, e.g. to receive acknowledgement of previously transmitted I frames and to cause the DCE or DTE to respond (P bit set to 1). Therefore, the retransmitted frame may contain an N(R) and a P bit that are updated from, and therefore different from, those contained in the originally transmitted I frame.
	The methods specified in §§ 2.6.5.2.1 and 2.6.5.2.2 shall be available for initiating the retransmission of lost of errored I frames following the occurrence of an N(S) sequence error condition.
2.6.5.2.1	REJ recovery
	The REJ frame is used by a receiving DCE or DTE to initiate a recovery (retransmission) following the detection of an N(S) sequence error.
	With respect to each direction of transmission on the data link, only one “sent REJ” exception condition from a DCE or DTE, to a DTE or DCE, is established at a time. A “sent REJ” exception condition is cleared when the requested I frame is received.
	A DCE or DTE receiving an REJ frame initiates sequential (re)transmission of I frames starting with the I frame indicated by the N(R) obtained in the REJ frame.
2.6.5.2.2	Time–out recovery
	If a DCE or DTE, due to a transmission error, does not receive (or receives and discards) a single I frame or the last I frame(s) in a sequence of I frames, it will not detect an N(S) sequence error condition and, therefore, will not transmit an REJ frame. The DTE or DCE, which transmitted the unacknowledged I frame(s) shall, following the completion of a system specified time–out period (see §§ 2.7.4.8 and 2.7.7.1 below), take appropriate recovery action to determine at which I frame retransmission must begin.
2.6.5.3	Invalid frame condition
	Any frame which is invalid will be discarded, and no action will be taken as the result of that frame. An invalid frame is defined as one which:
a)	is not properly bounded by two flags;
b)	contains fewer than 32 bits between flags;
c)	contains a Frame Check Sequence (FCS) error; or
d)	contains an address other than A or B.
	For those networks that are octet–aligned, a detection of non–octet alignment may be made at the Data Link Layer by adding a frame validity check that requires the number of bits between the opening flag and the closing flag, excluding bits inserted for transparency, to be an integral number of octets in length. Otherwise the frame is considered invalid.
2.6.5.4	Command rejection condition
	A command rejection condition is established upon the receipt of an error–free command frame with one of the conditions listed in § 2.6.4.8 above.
	At the DCE or DTE, this command rejection exception condition is reported by a CMDR response for appropriate DTE or DCE action, respectively. Once a DCE has established such an exception condition, no additional I frames are accepted until the condition is reset by the DTE, except for examination of the P bit. The CMDR response may be repeated at each opportunity, as specified in § 2.7.6.5, until recovery is effected by the DTE, or until the DCE initiates its own recovery.
2.6.5.5	Excessive idle channel state condition on the incoming channel
	Upon detection of an idle channel state condition (see § 2.2.12.2 above) on the incoming channel, the DCE shall not take any action for a period T3 (see § 2.7.7.3 below), while waiting for detection of a return to the active channel state (i.e. detection of at least one flag sequence). After the period T3, the DCE shall notify the Packet Layer of the excessive idle channel state condition, but shall not take any action that would preclude the DTE from establishing the data link by normal data link set–up procedures.
	Note – Other actions to be taken by the DCE at the Data Link Layer upon expiration of period T3 is a subject for further study.
2.7	Description of the LAP procedure
2.7.1	LAP procedure for addressing
	The address field identifies a frame as either a command or a response. A command frame contains the address of the DCE or DTE to which the command is being sent. A response frame contains the address of the DCE or DTE sending the frame.
	Frames containing commands transferred from the DCE to the DTE will contain the address A.
	Frames containing responses transferred from the DCE to the DTE will contain the address B.
	Frames containing commands transferred from the DTE to the DCE shall contain the address B.
	Frames containing responses transferred from the DTE to the DCE shall contain the address A.
	A and B addresses are coded as follows:
Address	1 2 3 4 5 6 7 8
  A	1 1 0 0 0 0 0 0
  B	1 0 0 0 0 0 0 0
	Note – The DCE will discard all frames received with an address other than A or B; the DTE should do the same.
2.7.2	LAP procedure for the use of the P/F bit
	The DCE or DTE receiving an SARM, DISC, supervisory command or I frame with the P bit set to 1 will set the F bit to 1 in the next response frame it transmits.
	The response frame returned by the DCE to an SARM or DISC command with the P bit set to 1 will be a UA response with the F bit set to 1. The response frame returned by the DCE to an I frame with the P bit set to 1, received during the information transfer phase, will be an RR, REJ, RNR or CMDR response with the F bit set to 1. The response frame returned by the DCE to a supervisory command frame with the P bit set to 1, received during the information transfer phase, will be an RR, RNR, REJ or CMDR response with the F bit set to 1.
	The P bit may be used by the DCE in conjunction with the timer recovery condition (see § 2.7.4.8 below).
	Note – Other use of the P bit by the DCE is a subject for further study.
2.7.3	LAP procedures for data link set–up and disconnection
2.7.3.1	Data link set–up
	The DCE will indicate that it is able to set up the data link by transmitting contiguous flags (active channel state).
	The DTE shall indicate a request for setting up the data link by transmitting an SARM command to the DCE. Whenever receiving an SARM command, the DCE will return a UA response to the DTE and set its receive state variable V(R) to 0.
	Should the DCE wish to indicate a request for setting up the data link, or after transmission of a UA response to a first SARM command from the DTE as a request for setting up the data link, the DCE will transmit an SARM command to the DTE and start Timer T1 in order to determine when too much time has elapsed waiting for a reply (see § 2.7.7.1 below). The DTE will confirm the reception of the SARM command by transmitting a UA response. When receiving the UA response the DCE will set its send state variable to 0 and stop its Timer T1.
	If Timer T1 runs out before the UA response is received by the DCE, the DCE will retransmit an SARM command and restart Timer T1. After transmission of the SARM command N2 times by the DCE, appropriate recovery action will be initiated. The value of N2 is defined in § 2.7.7.4 below.
2.7.3.2	Information transfer phase
	After having both transmitted the UA response to a received SARM command and having received the UA response to a transmitted SARM command, the DCE will accept and transmit I and supervisory frames according to the procedures described in § 2.7.4 below.
	When receiving an SARM command, the DCE will conform to the data link resetting procedure described in § 2.7.6 below. The DTE may also receive an SARM command while in the information transfer phase.
2.7.3.3	Data link disconnection
	During the information transfer phase the DTE shall indicate a request for disconnecting the data link by transmitting a DISC command to the DCE. Whenever receiving a DISC command, the DCE will return a UA response to the DTE.
	During an information transfer phase, should the DCE wish to indicate a request for disconnecting the data link, or when receiving from the DTE a first DISC command as a request for disconnecting the data link, the DCE will transmit a DISC command to the DTE and start Timer T1 (see § 2.7.7.1 below). The DTE will confirm reception of the DISC command by returning a UA response. After transmitting an SARM command, the DCE will not transmit a DISC command until a UA response is received for this SARM command or until Timer T1 runs out. When receiving a UA response to the DISC command, the DCE will stop its Timer T1.
	If Timer T1 runs out before a UA response is received by the DCE, the DCE will retransmit a DISC command and restart Timer T1. After transmission of the DISC command N2 times by the DCE, appropriate recovery action will be initiated. The value of N2 is defined in § 2.7.7.4 below.
2.7.4	LAP procedures for information transfer
	The procedures which apply to the transmission of I frames in each direction during the information transfer phase are described below.
	In the following, “number 1 higher” is in reference to a continuously repeated sequence series, i.e. 7 is 1 higher than 6, and 0 is 1 higher than 7 for modulo 8 series.
2.7.4.1	Sending I frames
	When the DCE has an I frame to transmit (i.e. an I frame not already transmitted, or having to be retransmitted as described in § 2.7.4.5 below), it will transmit it with an N(S) equal to its current send state variable V(S), and an N(R) equal to its current receive state variable V(R). At the end of the transmission of the I frame, the DCE will increment its send state variable V(S) by 1.
	If Timer T1 is not running at the time of transmission of an I frame, it will be started.
	If the send state variable V(S) is equal to the last value of N(R) received plus k (where k is the maximum number of outstanding I frames – see § 2.7.7.6 below), the DCE will not transmit any new I frames, but may retransmit an I frame as described in § 2.7.4.6 or § 2.7.4.9 below.
	When the DCE is in the busy condition, it may still transmit I frames provided that the DTE is not busy. When the DCE is in the command rejection condition, it may still transmit I frames.
2.7.4.2	Receiving an I frame
2.7.4.2.1	When the DCE is not in a busy condition and receives a valid I frame whose send sequence number N(S) is equal to the DCE receive state variable V(R), the DCE will accept the information field of this frame, increment by 1 its receive state variable V(R), and act as follows:
i)	If an I frame is available for transmission by the DCE, it may act as in § 2.7.4.1 above and acknowledge the received I frame by setting N(R) in the control field of the next transmitted I frame to the value of the DCE receive state variable V(R). Alternatively the DCE may acknowledge the received I frame by transmitting an RR response with the N(R) equal to the value of the DCE receive state variable V(R).
ii)	If no I frame is available for transmission by the DCE, it will transmit an RR response with N(R) equal to the value of the DCE receive state variable V(R).
2.7.4.2.2	When the DCE is in a busy condition, it may ignore the information field contained in any received I frame.
2.7.4.3	Reception of invalid frames
	When the DCE receives an invalid frame (see § 2.6.5.3), this frame will be discarded.
2.7.4.4	Reception of out–of–sequence I frames
	When the DCE receives a valid I frame whose FCS is correct, but whose send sequence number N(S) is incorrect, i.e. not equal to the current DCE receive state variable V(R), it will discard the information field of the I frame and transmit an REJ response with the N(R) set to one higher than the N(S) of the last correctly received I frame. The DCE will then discard the information field of all I frames received until the expected I frame is correctly received. When receiving the expected I frame, the DCE will then acknowledge the I frame as described in § 2.7.4.2 above. The DCE will use the N(R) and P bit information in the discarded I frames as described in § 2.6.5.2 above.
2.7.4.5	Receiving acknowledgement
	When correctly receiving an I frame or a supervisory frame (RR, RNR or REJ), even in the busy condition, the DCE will consider the N(R) contained in this frame as an acknowledgement for all I frames it has transmitted with 
an N(S) up to and including the received N(R) – 1. The DCE will stop Timer T1 when it correctly receives an I frame or a supervisory frame with the N(R) higher than the last received N(R) (actually acknowledging some I frames) or an REJ frame with an N(R) equal to the last received N(R).
	If Timer T1 has been stopped and if there are outstanding I frames still unacknowledged, the DCE will restart Timer T1. If Timer T1 then runs out, the DCE will follow the recovery procedure (in §§ 2.7.4.6 and 2.7.4.9 below) with respect to the unacknowledged I frames.
2.7.4.6	Receiving an REJ frame
	When receiving an REJ frame, the DCE will set its send state variable V(S) to the value of the N(R) received in the REJ control field. It will transmit the corresponding I frame as soon as it is available or retransmit it in accordance with the procedures described in § 2.7.4.1 above. (Re)transmission will conform to the following:
i)	If the DCE is transmitting a supervisory or unnumbered command or response when it receives the REJ frame, it will complete that transmission before commencing transmission of the requested I frame.
ii)	If the DCE is transmitting an I frame when the REJ frame is received, it may abort the I frame and commence transmission of the requested I frame immediately after abortion.
iii)	If the DCE is not transmitting any frame when the REJ frame is received, it will commence transmission of the requested I frame immediately.
	In all cases, if other unacknowledged I frames have already been transmitted following the one indicated in the REJ frame, then those I frames will be retransmitted by the DCE following the retransmission of the requested I frame. Other I frames not yet transmitted may be transmitted following the retransmitted I frames.
	If the REJ frame was received from the DTE as a command with the P bit set to 1, the DCE will transmit an RR or RNR response with the F bit set to 1 before transmitting or retransmitting the corresponding I frame.
2.7.4.7	Receiving an RNR frame
	After receiving an RNR frame, the DCE may transmit or retransmit the I frame with the send sequence number equal to the N(R) indicated in the RNR frame. If Timer T1 runs out after the reception of the RNR frame, the DCE will follow the procedure described in § 2.7.4.9 below. In any case, the DCE will not transmit any other I frames before receiving an RR or REJ frame, or before the completion of a data link resetting procedure.
2.7.4.8	DCE busy condition
	When the DCE enters a busy condition, it will transmit an RNR response at the earliest opportunity. While in the busy condition, the DCE will accept and process supervisory frames, will accept and process the contents of the N(R) fields of I frames, and will return an RNR response with the F bit set to 1 if it receives a supervisory command or I command frame with the P bit set to 1. To clear the busy condition, the DCE will transmit either an REJ response or an RR response, with N(R) set to the current receive state variable V(R), depending on whether or not it discarded information fields of correctly received I frames.
	Note – The DTE when encountering a DCE busy condition, may send supervisory command frames with the P bit set to 1. In the event that the DTE has not implemented supervisory commands, it may follow the procedures of the DCE (see § 2.7.4.7).
2.7.4.9	Waiting acknowledgement
	The DCE maintains an internal transmission attempt variable which is set to 0 when the DCE sends a UA response, when the DCE receives a UA response or an RNR command or response, or when the DCE correctly receives an I frame or supervisory frame with the N(R) higher than the last received N(R) (actually acknowledging some outstanding I frames).
	If Timer T1 runs out waiting for the acknowledgement from the DTE for an I frame transmitted, the DCE will enter the timer recovery condition, add one to its transmission attempt variable and set an internal variable x to the current value of its send state variable V(S).
	The DCE will restart Timer T1, set its send state variable V(S) to the last N(R) received from the DTE, and retransmit the corresponding I frame with the P bit set to 1.
	The timer recovery condition is cleared when the DCE receives a valid supervisory frame from the DTE, with the F bit set to 1.
	If, while in the timer recovery condition, the DCE correctly receives a supervisory frame with the F bit set to 1 and with an N(R) within the range from its current send state variable V(S) to x included, it will clear the timer recovery condition (including stopping Timer T1) and set its send state variable V(S) to the received N(R), and may then resume with I frame transmission or retransmission, as appropriate.
	If, while in the timer recovery condition, the DCE correctly receives an I or supervisory frame with the P/F bit set to 0 and with N(R) within the range from its current send state variable V(S) to x included, it will not clear the timer recovery condition. The value of the received N(R) may be used to update the send state variable V(S). However, the DCE may decide to keep the last transmitted I frame in store (even if it is acknowledged) in order to be able to retransmit it with the P bit set to 1 when Timer T1 runs out at a later time.
	If Timer T1 runs out in the timer recovery condition, the DCE will add one to its transmission attempt variable, restart Timer T1, and retransmit the I frame sent with the P bit set to 1.
	If the transmission attempt variable is equal to N2, the DCE will initiate a data link resetting procedure for the direction of transmission from the DCE as described in § 2.7.6.3 below. N2 is a system parameter (see § 2.7.7.4 below).
	Note – Although the DCE may implement the internal variable x, other mechanisms do exist that achieve the identical function. Therefore, the internal variable x is not necessarily implemented in the DTE.
2.7.5	LAP command rejection conditions
2.7.5.1	Rejection conditions causing a data link resetting of the transmission of information from the DCE
	The DCE will initiate a data link resetting procedure as described in § 2.7.6.3 below when receiving a frame which is not invalid (see § 2.6.5.3) with the address A (coded 11000000) and with one of the following conditions:
–	the frame type is unknown as one of the responses supported;
–	the information field is invalid;
–	the N(R) contained in the control field is invalid; or
–	the response contains an F bit set to 1 except during a timer recovery condition as described in § 2.7.4.9 above.
	The DCE will also initiate a data link resetting procedure as described in § 2.7.6.3 below when receiving an I or supervisory frame which is not invalid (see § 2.6.5.3) with the address B (coded 10000000) and with an invalid N(R) contained in the control field.
	A valid N(R) must be within the range from the lowest send sequence number N(S) of the still unacknowledged frame(s) to the current DCE send state variable V(S) included, even if the DCE is in a rejection condition, but not if the DCE is in the timer recovery condition (see § 2.7.4.9 above).
2.7.5.2	Rejection conditions causing the DCE to request a data link resetting of the transmission of information from the DTE
	The DCE will enter the command rejection condition as described in § 2.7.6.5 below when receiving a frame which is not invalid (see § 2.6.5.3) with the address B (coded 10000000) and with one of the following conditions:
–	the frame type is unknown as one of the commands supported; or
–	the information field is invalid.
2.7.6	LAP procedures for data link resetting
2.7.6.1	The data link resetting procedure is used to reinitialize one direction of information transfer according to the procedure described below. The data link resetting procedures only apply during the information transfer phase.
2.7.6.2	The DTE will indicate a data link resetting of the information transmission from the DTE by transmitting an SARM command to the DCE. When receiving an SARM command correctly, the DCE will return, at the earliest opportunity, a UA response to the DTE and set its receive state variables V(R) to zero. This also indicates a clearance of a DCE and/or DTE busy condition, if present.
2.7.6.3	The DCE will indicate a data link resetting of the information transmitted from the DCE by transmitting an SARM command to the DTE and will start Timer T1 (see § 2.7.7.1 below). The DTE will confirm reception of the SARM command by returning a UA response to the DCE. When receiving this UA response to the SARM command, 
the DCE will set its send state variable V(S) to 0 and stop its Timer T1. If Timer T1 runs out before the UA response is received by the DCE, the DCE will retransmit an SARM command and restart Timer T1. After transmission of the SARM command N2 times, appropriate higher layer recovery action will be initiated. The value of N2 is defined in § 2.7.7.4 below.
	The DCE will not act on any received response frame which arrives before the UA response command. The value of N(R) contained in any correctly received I command frame arriving before the UA response will also be ignored.
2.7.6.4	When receiving a CMDR response from the DTE, the DCE will initiate a data link resetting of the information transmission from the DCE as described in § 2.7.6.3 above.
2.7.6.5	If the DCE transmits a CMDR response, it enters the command rejection condition. The command rejection condition is cleared when the DCE receives an SARM or DISC command. Any other command received while in the command rejection condition will cause the DCE to retransmit the CMDR response. The coding of the CMDR response will be as described in § 2.6.4.8 above.
2.7.7	List of LAP system parameters
	The DCE and DTE system parameters are as follows:
2.7.7.1	Timer T1
	The value of the DTE Timer T1 system parameter may be different than the value of the DCE Timer T1 system parameter. These values shall be made known to both the DTE and the DCE, and agreed to for a period of time by both the DTE and the DCE.
	The period of Timer T1, at the end of which retransmission of a frame may be initiated (see §§ 2.7.4 and 2.7.5 above for the DCE), shall take into account whether T1 is started at the beginning or the end of the transmission of a frame.
	The proper operation of the procedure requires that the transmitter's (DCE or DTE) Timer T1 be greater than the maximum time between transmission of a frame (SARM, DISC, I, or supervisory command, or CMDR response) and the reception of the corresponding frame returned as an answer to that frame (UA or acknowledging frame). Therefore, the receiver (DCE or DTE) should not delay the response or acknowledging frame returned to one of the above frames by more than a value T2, where T2 is a system parameter (see § 2.7.7.2).
	The DCE will not delay the response or acknowledging frame returned to one of the above DTE frames by more than a period T2.
2.7.7.2	Parameter T2
	The value of the DTE parameter T2 may be different than the value of the DCE parameter T2. These values shall be made known to both the DTE and the DCE, and agreed to for a period of time by both the DTE and the DCE.
	The period of parameter T2 shall indicate the amount of time available at the DCE or DTE before the acknowledging frame must be initiated in order to ensure its receipt by the DTE or DCE, respectively, prior to Timer T1 running out at the DTE or DCE (parameter T2 < Timer T1).
	Note – The period of parameter T2 shall take into account the following timing factors: the transmission time of the acknowledging frame, the propagation time over the access data link, the state processing times at the DCE and the DTE, and the time to complete the transmission of the frames in the DCE or DTE transmit queue that are neither displaceable or modifiable in an orderly manner.
	Given a value for Timer T1 for the DTE or DCE, the value of parameter T2 at the DCE or DTE, respectively, must be no larger than T1 minus 2 times the propagation time over the access data link, minus the frame processing time at the DCE, minus the frame processing time at the DTE, and minus the transmission time of the acknowledging frame by the DCE or DTE, respectively.
2.7.7.3	Timer T3
	The DCE shall support a Timer T3 system parameter, the value of which shall be made known to the DTE.
	The period of Timer T3, at the end of which an indication of an observed excessively long idle link channel state condition is passed to the Packet Layer, shall be sufficiently greater than the period of the DCE Timer T1 (i.e. T3 > T1) so that the expiration of T3 provides the desired level of assurance that the data link channel is in a non–active, non–operational state, and is in need of data link set–up before normal data link operation can resume.
2.7.7.4	Maximum number of attempts to complete a transmission N2
	The value of the DTE N2 system parameter may be different than the value of the DCE N2 system parameter. These values shall be made known to both the DTE and the DCE, and agreed to for a period of time by both the DTE and the DCE.
	The value of N2 shall indicate the maximum number of attempts made by the DCE or DTE to complete the successful transmission of a frame to the DTE or DCE, respectively.
2.7.7.5	Maximum number of bits in an I frame N1
	The value of the DTE N1 system parameter may be different than the value of the DCE N1 system parameter. These values shall be made known to both the DTE and the DCE.
	The values of N1 shall indicate the maximum number of bits in an I frame (excluding flags and 0 bits inserted for transparency) that the DCE or DTE is willing to accept from the DTE or DCE, respectively.
	In order to allow for universal operation, a DTE should support a value of DTE N1 which is not less than 1080 bits (135 octets). DTEs should be aware that the network may transmit longer packets (see § 5.2), that may result in a data link layer problem.
	All networks shall offer to a DTE which requires it, a value of DCE N1 which is greater than or equal to 2072 bits (259 octets) plus the length of the address, control and FCS fields at the DTE/DCE interface, and greater than or equal to the maximum length of the data packets which may cross the DTE/DCE interface plus the length of the address, control and FCS fields at the DTE/DCE interface.
2.7.7.6	Maximum number of outstanding I frames k
	The value of the DTE k system parameter shall be the same as the value of the DCE k system parameter. This value shall be agreed to for a period of time by both the DTE and the DCE.
	The value of k shall indicate the maximum number of sequentially numbered I frames that the DTE of DCE may have outstanding (i.e. unacknowledged) at any given time. The value of k shall never exceed seven. All networks (DCEs) shall support a value of seven. Other values of k (less than seven) may also be supported by networks (DCEs).
3	Description of the packet level DTE/DCE interface
	This and subsequent sections of the Recommendation relate to the transfer of packets at the DTE/DCE interface. The procedures apply to packets which are successfully transferred across the DTE/DCE interface.
	Each packet to be transferred across the DTE/DCE interface shall be contained within the data link layer information field which will delimit its length, and only one packet shall be contained in the information field.
	Note – Some networks require the data fields of packets to contain an integral number of octets. The transmission by the DTE of data fields not containing an integral number of octets to the network may cause a loss of data integrity. DTEs wishing universal operation on all networks should transmit all packets with data fields containing only an integral number of octets. Full data integrity can only be assured by exchange of octet–oriented data fields in both directions of transmission.
	This section covers a description of the packet layer interface for virtual call and permanent virtual circuit services.
	Procedures for the virtual circuit service (i.e., virtual call and permanent virtual circuit services) are specified in § 4. Packet formats are specified in § 5. Procedures and formats for optional user facilities are specified in §§ 6 and 7.
3.1	Logical channels
	To enable simultaneous virtual calls and/or permanent virtual circuits, logical channels are used. Each virtual call or permanent virtual circuit is assigned a logical channel group number (less than or equal to 15) and a logical channel number (less than or equal to 255). For virtual calls, a logical channel group number and a logical channel number are assigned during the call set–up phase. The range of logical channels used for virtual calls is agreed with the Administration at the time of subscription to the service (see Annex A). For permanent virtual circuits, logical channel group numbers and logical channel numbers are assigned in agreement with the Administration at the time of subscription to the service (see Annex A).
3.2	Basic structure of packets
	Every packet transferred across the DTE/DCE interface consists of at least three octets. These three octets contain a general format identifier, a logical channel identifier and a packet type identifier. Other packet fields are appended as required (see § 5).
	Packet types and their use in association with various services are given in Table 14/X.25.
TABLE 14/X.25
Packet types and their use in various services
Packet type		Service		
 From DCE to DTE	 From DTE to DCE	 VC	 PVC	
 Call set–up and clearing (see Note 1)				
 Incoming call	 Call request	 X		
 Call connected	 Call accepted	 X		
 Clear indication	 Clear request	 X		
 DCE clear confirmation	 DTE clear confirmation	 X		
 Data and interrupt (see Note 2)				
 DCE data	 DTE data	 X	 X	
 DCE interrupt	 DTE interrupt	 X	 X	
 DCE interrupt confirmation	 DTE interrupt confirmation	 X	 X	
 Flow control and reset (see Note 3)				
 DCE RR	 DTE RR	 X	 X	
 DCE RNR	 DTE RNR	 X	 X	
	DTE REJ a)	 X	X	
 Reset indication	 Reset request	 X	 X	
 DCE reset confirmation	 DTE reset confirmation	 X	 X	
 Restart (see Note 4)				
 Restart indication	 Restart request	 X	 X	
 DCE restart confirmation	 DTE restart confirmation	 X	 X	
 Diagnostic (see Note 5)				
 Diagnostic a)		 X	X	
 Registration a) (see Note 6)				
 Registration Confirmation		 X	X	
	Registration Request	 X	X	

a)	Not necessarily available on all networks.
VC	Virtual call
PVC	Permanent virtual circuit
Note 1 – See §§ 4.1 and 6.16 for procedures, § 5.2 for formats.
Note 2 – See § 4.3 for procedures and § 5.3 for formats.
Note 3 – See §§ 4.4 and 6.4 for procedures, §§ 5.4 and 5.7.1 for formats.
Note 4 – See § 3.3 for procedures and § 5.5 for formats.
Note 5 – See § 3.4 for procedures and § 5.6 for formats.
Note 6 – See § 6.1 for procedures and § 5.7.2 for formats.
3.3	Procedure for restart
	The restart procedure is used to initialize or reinitialize the packet layer DTE/DCE interface. The restart procedure simultaneously clears all the virtual calls and resets all the permanent virtual circuits at the DTE/DCE interface (see § 4.5).
	Figure B–1/X.25 gives the state diagram which defines the logical relationships of events related to the restart procedure.
	Table C–2/X.25 specifies actions taken by the DCE on the receipt of packets from the DTE for the restart procedure.
3.3.1	Restart by the DTE
	The DTE may at any time request a restart by transferring across the DTE/DCE interface a restart request packet. The interface for each logical channel is then in the DTE restart request state (r2).
	The DCE will confirm the restart by transferring a DCE restart confirmation packet and placing the logical channels used for virtual calls in the ready state (p1), and the logical channels used for permanent virtual circuits in the flow control ready state (d1).
	Note – States p1 and d1 are specified in § 4.
	The DCE restart confirmation packet can only be interpreted universally as having local significance. The time spent in the DTE restart request state (r2) will not exceed time–limit T20 (see Annex D).
3.3.2	Restart by the DCE
	The DCE may indicate a restart by transferring across the DTE/DCE interface a restart indication packet. The interface for each logical channel is then in the DCE restart indication state (r3). In this state of the DTE/DCE interface, the DCE will ignore all packets except for restart request and DTE restart confirmation.
	The DTE will confirm the restart by transferring a DTE restart confirmation packet and placing the logical channels used for virtual calls in the ready state (p1), and the logical channels used for permanent virtual circuits in the flow control ready state (d1).
	The action taken by the DCE when the DTE does not confirm the restart within time–out T10 is given in Annex D.
3.3.3	Restart collision
	Restart collision occurs when a DTE and a DCE simultaneously transfer a restart request and a restart indication packet. Under these circumstances, the DCE will consider that the restart is completed. The DCE will not expect a DTE restart confirmation packet and will not transfer a DCE restart confirmation packet. This places the logical channels used for virtual calls in the ready state (p1), and the logical channels used for permanent virtual circuits in the flow control ready state (d1).
3.4	Error handling
	Table C–1/X.25 specifies the reaction of the DCE when special error conditions are encountered. Other error conditions are discussed in § 4.