Sei sulla pagina 1di 7

ISDN Data Link Layer Protocol - LAPD (Q.

921)
The purpose of LAPD is to convey user information between ISDN layer 3 entities across the ISDN network using the D channel. Two classes of service are defined. Unacknowledged information transfer service TE
DATA.request CONNECT.confirm CONNECT.indication CONNECT.response DATA.request DATA.indication DATA.indication DISCONNECT.request DISCONNECT.indication

Acknowledged information transfer service TE


CONNECT.request

NT

NT

ISDN network

ISDN network

ISDN Data Link Layer Protocol - LAPD (Q.921)


The ISDN layer 2, Data Link Layer, is used for communication between the terminal equipment and network termination over the D channel. Known as Link Access Protocol, type D (LAPD) is defined in standard Q.921 and the protocol is a subset of HDLC. Two classes of service are provided as shown above. The unacknowledged information transfer service provides for the transfer of data with no acknowledgement and no guarantee of delivery or flow control. The acknowledged information transfer service establishes a logical connection (virtual circuit) between two LAPD users, (an NT and TE for example). Once the connection is established, data is transferred over the circuit in an acknowledged manner with full flow control and error correction. Once the data has been transferred, the connection is formally terminated.

ISDN LAPD Frame Format

4 5

0
P F

N(S) N(R)

I - frame

8 bits
1 2 3 4 5

4 5

1 0 0 0 0 0 0 0
P F

Flag 0 C/R 1 SAPI TEI Control (1) Control (2) Information

N(R)

Receive Ready Receive Not Ready Reject

01111110
4 5

1 0 1 0 0 0 0 0
P F

N(R)

4 5

1 0 0 1 0 0 0 0
P F

N(R)

4 4

1 1 1 1 P 1 1 0 1 1 1 1 F 0 0 0 1 1 0 0 P 0 0 0 1 1 0 0 P 0 1 0 1 1 0 0 F 1 1 0 1 1 1 0 F 0 0 1 1 1 1 1 F 1 0 1

SABME DM UI DISC UA FRMR XID

n-2 n-1 n

CRC(1) CRC(2) Flag

X16+X12+X5+1

4 4 4 4

ISDN LAPD Frame Format


The LAPD frame format is shown in this slide. The flag field is the standard bit combination of 01111110 and zero bit insertion or bit stuffing is used to ensure that the flag cannot naturally occur within the frame except at the designated positions as shown. The next two octets (2 and 3) comprise the frame addressing. Each user device is given a unique Terminal Endpoint Identifier, TEI. These can be assigned automatically or by manual intervention. The Service Access Point Identifier, SAPI identifies the ISDN layer 3 user of the LAPD service. The Command/Response bit differentiates messages as either commands or responses. Octets 4 and 5 comprise the control octets and can take the values as shown on the right. These follow the standard Information, Supervisory and Unnumbered frames defined within HDLC. These comprise the SABME and UA frames for establishing and confirming a connection. DISC and DM for requesting and confirming the termination of a connection. For data transfer, I frames are used to transfer data. These in turn, contain the send sequence (N(S)) and receive sequence (N(R)) counts which keep track of the frame count. RR provides a positive acknowledgement of the correct receipt of I frames up to and including N(R)-1. In other words N(R) indicates the sequence number of the next I frame in the sequence, which may or may not have already been transmitted but not yet acknowledged. The RNR and REJ frames are used for flow control or to request the retransmission of frames respectively. The UI frame is used to support the unacknowledged data transfer service. The FRMR message is used to indicate the an improperly formatted frame has been received. Finally the XID message is used to negotiate certain performance parameters for the ISDN connection.

LAPD Protocol Operation


TE
SABME I{N(S)=1; N(R)=0;P/F=0} UA Full ack Normal connection establishment, data transfer and connection termination phases I{N(S)=0; N(R)=2;P/F=0} I{N(S)=2; N(R)=1;P/F=0} I{N(S)=3; N(R)=1;P/F=0} I{N(S)=4; N(R)=1;P/F=0}

NT

TE

NT
I{N(S)=0; N(R)=0;P/F=0}

Data Transfer DISC DM

Partial ack
Full ack Failed connection request

I{N(S)=1; N(R)=4;P/F=0} I{N(S)=5; N(R)=2;P/F=0} I{N(S)=2; N(R)=6;P/F=0}

SABME DM

LAPD Protocol Operation


This slide illustrates the basic operation of the LAPD protocol. On the left had side is shown the connection establishment phase. Here the process is initiated with the transmission of a SABME. The is the call establishment request. If the call can be achieved then the NT will respond with a UA. At this point the data transfer phase is entered (shown on the right). On completion of the data transfer phase the connection must be terminated. This is achieved by the transmission of a DISC frame which is acknowledged with a DM frame. Note that either side could have issued the DISC. Should a connection not be accepted then a DM would be issued in response to the SABME as shown. With regard to the data transfer phase, this is achieved with the transmission of I frames. Each I frame contains a send sequence number N(S) which indicates the number of the frame being transmitted (0-127-0; a receive sequence number N(R) which indicates the number of the next I frame expected to be received. Note that the N(R) field would acknowledge the correct reception of all I frames numbered up to an including N(R)-1 however, any I frames that have been transmitted and are numbered above this value are not acknowledged yet - this DOES NOT mean that such frames are rejected! A maximum number of I frames can be transmitted without an acknowledgement (known as the acknowledgement window size). Should this number be transmitted without having received an acknowledgement then transmission must stop until an acknowledgement is received. Finally, each I frame contains a Poll/Final bit whose operation is shown in the next slide. The data exchange shown here illustrates the transmission of I frames from the TE to NT and from the NT to TE. These I frames are in effect transferring data in one direction and providing an acknowledgement in the opposite direction. Acknowledgements can be full in that they acknowledge all I frames that have been transmitted at a particular point in time or partial in that only some of the transmitted I frames are acknowledged.

LAPD Protocol - Error Recovery and Flow Control


TE
I{N(S)=23; N(R)=17;P/F=0} I{N(S)=24; N(R)=17;P/F=0} I{N(S)=25; N(R)=17;P/F=0} REJ {N(R)=24} I{N(S)=24; N(R)=17;P/F=0} I{N(S)=25; N(R)=17;P/F=0} I{N(S)=26; N(R)=17;P/F=1} RR{N(R)=45; P/F=1} RR{N(R)=27;P/F=1} Transmission can resume I{N(S)=45; N(R)=33;P/F=0}

NT

TE
I{N(S)=42; N(R)=33;P/F=0} I{N(S)=43; N(R)=33;P/F=0} Mismatch in sequence I{N(S)=44; N(R)=33;P/F=0}

NT

***

Transmission must stop Timer Retransmissions

RNR {N(R)=45}

RR{N(R)=33; P/F=1}

LAPD Protocol - Error Recovery and Flow Control


Should an I frame be subjected to errors and either fail to arrive or arrive with a CRC error then a recovery procedure is followed. In this slide an example of an I frame which fails to arrive is shown on the left. When the next I frame, after the one that did not arrive, is received then the sequence number of this frame will not be one greater than the other most recently received I frame. The NT therefore issues a reject REJ frame which has an N(R) field equal to the I frame number from which retransmission must commence. In this case the retransmission begins with I frame N(S)=24 and continues as normal. Also shown here is the case where transmission of I frames is about to stop. The last I frame to be sent has the P/F bit set to 1. This immediately forces an acknowledgement to be issued. In this case a receive ready RR frame is issued. This frame not only acknowledges all I frames transmitted but also has the P/F bit set to show that it is in response to the I frame that had its P/F bit set to 1. On the right hand side is shown how flow control can be implemented. Having transmitted I frame N(S)=44, the NT responds with a receive not ready RNR frame. Whilst acknowledging all I frames transmitted, this frame forces the TE to stop transmission. Transmission can only resume when a RR frame is received. However, should a RR frame not be forthcoming then a poll can be issued by transmitting a RR frame with the P/F bit set to 1. This forces the NT to issue a response. In this case it sends an RR (also with the P/F set to 1) and transmission can resume.

LAPD Addressing
TEI Value User Type 0-63 64-126 127 Non-automatic TEI assignment user equipment Automatic TEI assignment user equipment Used during automatic TEI assignment SAPI Value 0 16 32-61 63 All others Related Protocol Call control procedures Packet communication conforming to X.25 level 3 Frame Relay communication Layer 2 management procedures Reserved

Terminal Equipment

Terminal Equipment

Layer 3 SAPI(a)

Layer 3

Layer 3

SAPI(b) LAPD TEI(1)

SAPI(a) LAPD TEI(2) NT

TEI + SAPI = Data Link Connection Identifier (DLCI)

LAPD Addressing
Two types of addressing are provided for within LAPD. Firstly, each piece of terminal equipment is given a unique terminal endpoint identifier (TEI). This can be achieved either automatically upon powering-up the terminal equipment or by manual intervention. Within a given piece of terminal equipment there could be a number of layer 3 protocol users of the LAPD service. Hence, a service access point identifier (SAPI) is used to indicate the corresponding layer 3 protocol entity. The value range indicates the type of service being supported as shown in the table. These SAPI values must be unique within a TEI. Taken together the TEI and SAPI are known as a Data Link Connection Identifier (DLCI).

LAPD Parameter Negotiation


Parameter Default Value T200 T201 T202 T203 N200 N201 N202 k 1 second = T200 2 seconds 10 seconds 3 260 octets 3 1 for 16kbps signalling 3 for 16 kbps packet 7 for 64 kbps Definition Time to wait for an acknowledgement Minimum time between TEI identity check messages Minimum time between TEI identity request messages Maximum time with no frames exchanged Maximum number of retransmission of a frame Maximum length of the frames information field Maximum number of retransmissions of TEI identity requests Maximum number of outstanding I frames

TE

NT

XID {parameter list with desired values} XID {parameter list with values than can be supported}

Values should be in the range: default value - requested value

LAPD Parameter Negotiation


The LAPD protocol defines certain key parameters as shown in the table above. Each parameter is assigned a default value by the standard however, the value used in practice is subject to negotiation between two LAPD entities. To negotiate (change) a parameter from the default value a LAPD entity issues an Exchange Identification XID frame. In the diagram above it is the TE that issues the XID however, it could just as easily have been the NT that initiated the XID. This XID contains a parameter list within the information field with the desired value for each parameter. Having issued an XID, the receiver of it is forced to respond with its own XID. This XID contains a parameter list with values that can be supported. Each value for these parameters must therefore be in the range between the default value and the requested value. If not, then further XIDs must be exchanged until this condition is met.

Potrebbero piacerti anche