More About SAPI  &  TEI

               The SAPI is a 6-bit subfield carried in the first octet of the address field, as depicted in the figure above. Although this allows up to 64 SAPI definitions, the ITU-T has currently defined only four and the remaining values are reserved for future. The four SAPI values and the purpose of each is given below:

       * SAPI value 0  -  For ISDN call control procedures using messages from the
                                      ISDN layer 3 protocol, Q.931 messages.
       * SAPI value 1  -  For packet-mode communications using the Q.931
       * SAPI value 16 - For packet data communication conforming to X.25
                                      layer 3 protocol.
       * SAPI value 63 - For LAPD management operations.

                 The TEI is a 7-bit subfield carried in the second octet of the address field.  So, up to 127 individual TEIs can be assigned assigned at a single interface. The ITU-T limits the number of TEs per BRI to eight. There are three different classes of TEI used for various user types. They are:

       * TEI value   0-63    -   Nonautomatic TEI assignment user equipment
       * TEI value  64-126 - Automatic TEI assignment user equipment
       * TEI value    127     -  Group assignment (broadcast) TEI
 
       Nonautomatic TEI assignment user equipment :  Assigned to TE that is unable to use LAPD procedures to request a TEI form the network.
       Automatic TEI assignment user equipment : Assigned to TE that is able to ; use LAPD procedures to automatically request a TEI assignment from the network.
       Group address (broadcast) : Used to address all ISDN terminals at an interface; it can also be used temporarily by a TE prior to TEI assignment.
 

TEI management

               A TEI is uniquely assigned to one ISDN terminal on a BRI interface. But multiple TEIs can  be assigned to a single device, this situation could arise when the terminal contains more than one layer 3 process supporting a given type of service.
                For example, if a TE supports two applications using and X.25 packet ; service, both layer 3 entities might be assigned a SAPI of 16. These two services represent different user applications, however, and therefore must somehow be differentiated. One way to accomplish this is to assign two TEIs to the TE so that the two packet services operate on different logical links.
                 TEIs are managed by using LAPDs TEI management procedures and a set of TEI identity messages. These messages are carried in LAPD unnumbered information (UI) frames with a SAPI of 63 (OAM) and TEI of 127 ( broadcast ).