Flag, bit stuffing, and FCS computation are identical to HDLC.
The 16 bits of address contain a command/response (C/R) field, a SAPI (Service Access Point Identifier) and a TEI (Terminal Endpoint Identifier). TEIs are used to distinguish between several different devices using the same ISDN links. TEI 127 is broadcast; other TEI values are dynamically assigned (see below). SAPIs play the role of a protocol or port number, and identify the higher layer protocol being used in the data field. Q.931 messages are sent using SAPI 0, SAPI 16 means X.25, and SAPI 63 is used for TEI assignment procedures. This are usually the only SAPI values used.
Data transfer can occur in one of two formats: Information (I) frames or Unnumbered Information (UI) frames. UI, offering unreliable delivery, is the simplest of the two, since no sequence numbering, acknowledgements, or retransmissions are involved. I frames are numbered modulo 128; the frame number is included in the N(S) field. Acknowledgements are sent using the N(R) field, either piggybacked onto an I frame in the reverse direction, or sent explicitly in an RR or RNR frame. RR indicates that the receiver is ready for more data, RNR indicates a busy condition and places the circuit on hold awaiting a future RR. REJ is a negative acknowledgement, requesting retransmission beginning with frame N(R).
Before I frames can be transferred, a SABME command initializes the sequence numbers to all zeros. The DISC command terminates multi frame operation. Both SABME and DISC are acknowledged with a UA.
Protocol errors (undefined control field; incorrect length frame; invalid acknowledgement; etc) are reported by sending a FRMR with the initial fields of the erroneous frame.
Before any higher level (Q.931) functions can be performed, each ISDN device must be assigned at least one unique TEI value. These numbers can be preassigned (TEIs 0-63), or dynamically assigned (TEIs 64-126). Most TEI assignment is done dynamically, using the TEI management protocol. The user broadcasts an Identity request and the network responds with an Identity assigned containing the TEI value. Functions are also provided to verify and release TEI assignments.
All TEI management functions are performed using TEI 127 (broadcast), SAPI 63, and the following 5-byte UI frame:
The reference number is a randomly generated 16 bit value used to distinguish between different ISDN devices that might simultaneously request TEI assignment.
The possible message types are:
|Identity request (1)||user->network||127|
|Identity assigned (2)||network->user||Assigned TEI|
|Identity denied (3)||network->user|
|Identity check (4)||user->network||TEI to be checked|
|Identity check response (5)||network->user||TEI value(s) in use|
|Identity remove (6)||user->network||TEI to be removed|
|Identity verify (7)||user->network||TEI to be checked|