A Guide to General Packet Radio Service -2


Here is the second post of the series GPRS guide.

The LLC (Logical Link Controller) defines the logical link control later protocol to be used for (packet) data transfer between the MS (Mobile Station) and a serving GPRS support node (SGSN).

LLC goes from the MS to the SGSN and is intended to be used for both acknowledged and unacknowledged data transfers.

LLC's defined frame formats are based on the ones defined for LAPD and RLP.Although, there are major differences between other protocols and LLC, in particular to frame delimitation methods and transparency mechanisms. These differences are necessary for independence from the radio path.

Two methods of operation are supported by LLC. These are:

- Unacknowledged peer-to-peer operation
- Acknowledged peer-to-peer operation

All LLC layer peer-to-peer exchanges are in frames of the following format:

                   1 byte
              |------------------------------|
              |            Address                    |
              |------------------------------|
              |            Control                     |
              |------------------------------|
              |          Information                  |
              |------------------------------|
              |              FCS                        |
              |------------------------------|

The address field contains the SAPI and identifies the DLCI which a downlink frame is intended and the DLCI transmitting an uplink frame. The length of the address field is 1 byte, and has the following format:
  
      _______________________________
Bit  |    8      7     56      4-1          |
      |------------------------------|
      |   PD    C/R    XX      SAPI   |
      |------------------------------|

 -  The protocol discriminator (PR) shows whether a frames is LLC or belongs to a different protocol. LLC frames have the PD bit set to zero. The frame is treated as invalid if its PD bit is set to 1.
   
 -  The C/R identifies a frame as either a command or response. The MS side sends commands with the C/R bit set to zero, and responses with it at 1.The SGSN does the opposite (commands are sent with C/R set to 1, and responses are set to 0).

 -  The XX bit is a reserved bit.

 -  Service Access Point Identifier (SAPI) identifies a point where KKC services are provided by an LLE to a layer-3 entity.

After the address, comes control. This identifies the type of frame.
There are four types of control field formats. They are:

   - Confirmed information transfer (I format)
   - Supervisory functions (S format)
   - Unconfirmed information transfer (UI format)
   - Control functions (U format)

Next is the information bit. This contains various commands and responses.

The FCS (Frame Check Sequence) field consists of a 24-bit cyclic redundancy check (CRC) code. CRC-25 is used to detect bit errors in the frame header and information fields.


SNDCP


SNDCP (Sub-Network Dependent Convergence Protocol) users the services provided by the LLC Layer, and SM (Session Management) sub-lay. The four main functions of SNDCP are:

- Multiplexing of several PDPs (Packet Data Protocol)
- Compression/Decompression of user data
- Compression/Decompression of protocol control information
- Segmentation of a network protocol data unit (N-PDU) into LLC    
  protocol data units (LL-PDUs) and re-assembly of LL-PDUs into a
  N-PDU


Data transfer is acknowledged by the SN-DATA PDU. The format of the SN-DATA PDU is:

       8     7     5     6           4-1
    |-------------------------------------------|
    |  X  |  C  |  T  |  M  |       NSAPI                |
    |-------------------------------------------|
    |        DCOMP          |       PCOMP           |
    |-------------------------------------------|
    |                                                                |
    |                    Data                                     |
    |-------------------------------------------|


The SN-UNITDATA PDU (used to Acknowledge data transfer) has a format as follows:

       8     7     5     6           4-1
    |-------------------------------------------|
    |  X  |  C  |  T  |  M  |       NSAPI                |
    |-------------------------------------------|
    |        DCOMP          |       PCOMP           |
    |-------------------------------------------|
    |     Segment offest    |    N-PDU Number   |
    |-------------------------------------------|
    |  E  |         N-PDU Number (Cont'd)         |
    |-------------------------------------------|
    |                                                                |
    |                     Data                                    |
    |-------------------------------------------|


NSAPI (Network Service Access Point Identifier). The values of this field may be any one of the following:

      0 | Escape Mechanism for Future Extensions
    ---|--------------------------------------------------
     1 | Point-to-multipoint multicast (PTM-M) information
     --|--------------------------------------------------
 2-4 | Reserved for future user
  ----|--------------------------------------------------
 5-15| Dynamically allocated NSAPI value
   ----|--------------------------------------------------


M is the more bit. It's values may be:
 ----|-------------------------------------------------------
    0 | Last Segment of N-PDU
 ----|-------------------------------------------------------
    1 | Not the last segment of N-PDU, more segments to follow
 ----|-------------------------------------------------------

The T bit, SN-PDU type specifies whether the PDU is SN-DATA (0) or SN-UNITDATA (1).

C is the compression indicator. If set to 0, the compression fields DCOMP and PCOMP are not included. While 1 tells that these fields are included.

X is the spare bit. This is always set to 0.

DCOMP (Data Compression Coding) is included if the C-bit is set.
DCOMP values are:

 ----|--------------------------------------------
    0 | No Compression
 ----|--------------------------------------------
1-14| Points to the data compression identifies
       | negotiated dynamically
 ----|--------------------------------------------
  15 |Reserved for future extensions
 ----|--------------------------------------------



PCOMP (Protocol Control Information Compression Coding) is included if the C-bit is set. The PCOMP Values are:

 ----|--------------------------------------------
    0 | No Compression
 ----|--------------------------------------------
1-14| Points to the protocol control information
       | compression identifier negotiated dynamically
 ----|--------------------------------------------
  15 |Reserved for future extensions
 ----|--------------------------------------------


N-PDU Number
0-2047 when the extension bit is set to 0.
2048-524287 if the extension bit is set to 1.

Next part will be updated soon.

Comments

Popular posts from this blog

The power of Bluetooth 4.0

How to hack your xbox 360 completely

Wii Remote IR Camera Hack with Arduino Interface