menu_web

my_menu_bird

LAPD

Data Link Layer Concept (LAPD)
As mentioned in OSI Article 2, Data Link layer (layer 2 of OSI model) provide a reliable link between two network entities. We will see at the concepts taking example of LAPD (ISDN Link Access Protocol for 'D' channel). LAPD is part of HDLC (High-level Data Link Control) group. Other protocols from HDLC group are LAPB (X.25 Link Access Protocol for 'B' channel in X.25), V.120 (ISDN Terminal Adaptors), PPP (Point-to-point protocol for Modem), LLC (GPRS Logical Link Control) etc.
Main functions of DL layer are establishing/maintaining/tearing down the link, flow control, and error detection.
To do above functions, DL layer works on chunk of data called Frames. In addition to L3 data, Frames contain addition data for Error Detection, Addressing, and Control as shown below:
LAPD Frame
(module 128) 
  Flag
  (8 bit)
 0111 1110 
  Frame Check Sequence
  (16 bit) 
  L3 data
  (0 to 260 bytes) 
  Control field
  (16 bit) 
  Address field
  (16 bit) 
  Flag
  (8 bit)
0111 1110 
Addressing
Receiving DL layer need to know to which L3 entity (TEI) and/or to which Queue (SAPI), L3 data need to be injected. Address field contain this information as shown below:
Address field   Terminal End Identifier
(TEI)
 EA bit
  1  
  Service Access Point Identifier
(SAPI)
  C/R bit   EA bit
  0  
Error detection





FCS provide means for error detection. FCS is calculated based on L3, Control, and Address data that is to be sent. Receiving side calculates FCS based on received L3, Control, and Address data. Mismatch between calculated FCS and received FCS indicate error. If the error is detected, receiving side indicate it to sending side through Control means.
Note for LAPDm (L2 of GSM Air interface): LAPDm do not need FCS as GSM coding takes care of error detection (and correction).
Control
Control fields distinguish between types of frames: Information frame, Supervisory frames, and Unnumbered frames. Particular type frame is used for specific operation.
Let us take an GSM example of BTS-BSC connection setup and later teardown:
After Layer 1 is established, BSC sends SABME frame to BTS repeatedly. BTS too sends SABME frame to BSC. Upon receiving SABME from BTS, BSC sends UA, followed by another SABME. BTS responds back with UA for latest SABME. BSC now sends RR frame - which indicate to BTS that BSC is Ready to Receive. BTS also sends back RR frame indicating that Layer 2 link is now in service fully.

BTSBSC

-

SABME frame

SABME frame

SABME frame

UA frame

SABME frame

UA frame

RR frame

RR frame

-

Once Layer 2 is in service, I-frame is used for later transmission of Layer 3 data. Sequence numbers (part of Supervisory and Information frames) are used for flow control as shown below. Sequence numbers indirectly shows that link is in service.

BTSBSC

-

I-frame, Sent=0, Received=0

RR-frame, Received=1

I-frame, Sent=0, Received=1

RR-frame, Received=1

I-frame, Sent=1, Received=1.
.
.

L3 data transfer

Layer 3 data has Length indicator at the beginning.

LAPD Frames

Frame types are:
o Information
o Supervisory
o Unnumbered
Bit 0 and 1 of control field distinguish between frame types:
For Information frame type, bit 0 is 0,
For Supervisory frame type, bit 1 and 0 are 0 and 1 respectively, and
For Supervisory frame type, bit 1 and 0 are 1 and 1 respectively.
Control field for frame types are shown below:

Information frame   N(R)
  (7 bits)  
  P bit    N(S)
  (7 bits)  
  0 bit  
Supervisory frames   N(R)
  (7 bits)  
  P/F bit    6 bits    0 bit    1 bit  
Unnumbered frames   8 bits
  do not care  
  3 bits    P/F bit    2 bits    1 bit    1 bit  

Poll (P/F) bit is set when sender expect response from receiver; this is useful while establishing connection or as a periodic check during idle period when connection is already established and present.
Information frame

I
Information
Used to carry Layer 3 data.

Supervisory Frames

RR
Receive Ready
This frame is used to acknowledg reception of I-frame. This frame along with RNR-frame is used for flow control. During idle period of no L3 data transfer, RR-frame is used periodically from both sides.
RNR
Receive Not Ready
This frame is used for flow control. RNR indicate that the side is not ready to accept any more I-frames (may be due to storage restrictions). Once it is ready, it sends RR-frame to indicate that it is now ready to accept further I-frames.
REJ
REJect
This frame indicate that error has been detected (through FCS calculations) in last received I-frame. Other side then need to re-transmit the frame which can identified by N(R) value).

Unnumbered Frames

SABME
Set Asynchronous Balance Mode Extended
This frame is used to establish L2 connection as discussed earlier.
DM
Disconnected Mode
DM-frame indicate to receiver that L2 connection is being taken down by sender due to some (may be L1 problem) error (without requiring acknowledgement). DISC-frame also disconnects L2 connection but this is normal scenario or graceful tearing down of L2 connection.
UI
Unnumbered Information
UI-frame are similar to I-frame except that UI do not need acknowledgement. This is in a way one time transmission.
DISC
DISConnect
DISC-frame initiates tearing down on L2 connection as shown in diagram below for MS-BTS (during release procedure)
UA
Unnumbered Acknowledgement
UA frame is used to acknowledg L2 establishment or tearing down
FRMR
FRaMe Reject
FRMR-frame is used to indicate that received frame is wrong (e.g. protocol error) such that retranmission will not be able to correct the error.
XID
eXchane IDentification
XID-frame is for correcting various transmission parameters (like timers)

MSBTS

-

1) SDCCH, RR - Channel Release

2) L2 DISC frame

3) L2 UA frame

-

This complete the brief on Data Link layer concepts.

Re-transmission 
One of the major functions of Layer 2 is "Error Control". Error control mean error detection and correction. Different services require different error rates. Of course, lower error rate would mean better quality. For example, voice call may not require so low error rate as required by internet browsing. Few bits corrupted in voice transmission do not cause "that much trouble" in resulting analog voice, but same percercentage of bits corrupted would result in unreadable web page ! Layer 2 has the responsibility of keeping error rate (normally measured as Bit Error Rate i.e. BER) under control.
Error correction with additional bits
Typically to detect and/or correct error, few redundant bits are added to actual information bits. Though this would result in lower effective information rate , it is must for error control. Needless to say, additional bits are calculated from original information bits. The way of calculation makes one error detection/correction technique different from another. At the receiving side, the additional bits are used in error detection and correction.
An error correction technique - popular in wireless communications - is Forward Error Correction (FEC). Details needed about FEC and other such techniques.
These type of error correction techniques are typically known as "coding schemes" in wireless communications. Well known coding schemes are Convolutional coding, Turbo coding etc. "Coding rate" is a ratio signifying the amount of added error correction. k/n coding rate imply that every k bits of information have been coded as n bits.
ARQ
Retransmission of erroneous information (packets) is another way of error correction. Error correction from retransmission is popularly known as ARQ (Automatic Repeat reQuest).
Note that retransmission is not possible for all bearer services (e.g. constant bit rate). Typically, services in which retransmission is not an option, appropriate error correction technique is chosen based on factors like allowed error rate, type of medium, modulation technique etc.
As retransmission reduce the effective or overall information rate, either we need to avoid retransmissions as much as possible or find out a way to improve overall information rate even after retransmissions.
HARQ
HARQ (Hybrid ARQ) is a retransmission technique which combine ARQ with FEC like error correction techniques. In HARQ, when error correction fail, retransmission is requested. As retransmission is done only when error correction fail, (on an average) HARQ will give better information rate than ARQ.
Note that in HARQ, erroneous packets are discarded. These discarded packets - even though erroneous - do contain "some correct information". Immediate question is: is it possible to use discarded packets ?
HARQ with soft combining
HARQ with soft combining techniques takes retransmissions a step further; it "combines" earlier received erroneous packets with retransmitted packet to come out with correct packet. If it fails, retransmission is requested again. Below is a symbolic illustration of this technique:


In HARQ with soft combining, there are two possibilities for retransmissions: retransmit the same packet or retransmit variation of it. First method is known as "HARQ with Chase Combining". Second method is known as "HARQ with Incremental Redundancy".