WPCL 2BJ|x H   & 6p&6p& I   `   c4 P Fascicle VI.9 - Q.773 PAGE39 I    c4 P PAGE38  c4 P Fascicle VI.9 - Q.733  X p` 0 X`h    Ё  c4 P The drawings contained in this Recommendation have been done in Autocad. Recommendation Q.773 C c4 P TRANSACTION CAPABILITIES FORMATS AND ENCODING  c4 P 1X pIntroduction pThis Recommendation provides the format and encoding of Transaction Capabilities Application Part (TCAP) messages. Formats and Encoding for the Intermediate Service Part (ISP) are for further study. This Recommendation is based on the encoding rules provided in CCITT Recommendation X.209 and is consistent with that Recommendation. 2X pDescription conventions   Ё pThis Recommendation does not use Recommendation X.209 formal description language. This Recommendation uses the description method of other Q.700 series Recommendations. Annex A uses the formal decription language to supplement this Recommendation. 3X pStandard representation 3.1hpGeneral message structure  pEach information element within TCAP message has the same structure. An information element consists of three fields, which always appear in the following order. The Tag distinguishes one type from another and governs the interpretation of the Contents. The Length specifies the length of the Contents. The Contents is the substance of the element, containing the primary information the element is intended to convey. Figure 1/Q.733 shows an overview of a TCAP message and an information element. K c4 P Fig. 1/Q.773 /T112049088 = 4.5 cm  c4 P  pEach field is coded using one or more octets. Octets are labelled as shown in Figure2/Q.773. The first octet is the first transmitted. Bits in an octet are labelled as shown in Figure3/Q.773, with bit A the least significant and the first transmitted. K c4 P Fig. 2/Q.773 /T112050088 = 4.5 cm  c4 P   c4 P  KFig. 3/Q.773 /T112051088 = 4.5 cm  c4 P  pThe contents of each eleent is either one value (Primitive) or one or more information elements (Constructor), as shown in Figure 4/Q.773. L c4 P Fig. 4/Q.773 /T112052088 = 5 cm  c4 P  3.2hpTag  pAn information element is first interpreted according to its position within the syntax of the message. The Tag distinguishes one information element from another and governs the interpretation of the Contents. It is one or more octets in length. The Tag is composed of "Class", "Form" and "Tag code", as shown in Figure 5/Q.773. L c4 P Fig. 5/Q.773 /T112053088 = 3 cm  c4 P   p 3.2.1` Tag class  pAll Tags use the two most significant bits (H and G) to indicate the Tag Class. These bits are coded as shown in Table 1/Q.773. V c4 P TABLE 1/Q.773 S Coding of tag class  c4 P 0 ҇ Z c4 P Class WCoding (HG)   p` 0 X`h  c4 P ш   c4 P 0 ҇ c4 P Universal hE00    c4 P ш   c4 P 0 ҇ X  c4 P Application-wide H01    c4 P ш   c4 P 0 ҇ X  c4 P Context-specific H10    c4 P ш   c4 P 0 ҇ c4 P Private use hE11    c4 P ш  p` 0 X`h Ёaall CCITT Recommendations, i.e. across CCITT No. 7 ASEs, X.400 MHS, etc. pThe Application-wide class is used for information elements that are standardized across all applications (ASEs) using CCITT No. 7 TC, i.e. TC-Users. pThe Context-specific class is used for information elements that are specified within the context of the next higher construction and take into account the sequence of other data elements within the same construction. This class may be used for tags in a construction, and the tags may be re-used in any other construction. pThe Private Use class is reserved for information elements specific to a nation, a network or a private user. Such information elements are beyond the scope of the TC Recommendations. pThe Tag codes of the Application-wide class not assigned in this Recommendation are reserved for future use.  p 3.2.2` Form of the element  pBit F is used to indicate whether the element is "Primitive" or "Constructor", as is shown in Table 2/Q.773. A primitive element is one whose structure is atomic (i.e. one value only). A constructor element is one whose content is one or more information elements which may themselves be constructor elements. pBoth forms of elements are shown in Figure 4/Q.773. X c4 P TABLE 2/Q.773 U Coding element form  c4 P  ҇ X c4 P Element form YCoding (F)  X p` 0 X`h  c4 P ш X  c4 P  ҇ c4 P Primitive XJ0  X  c4 P ш X  c4 P  ҇ c4 P Constructor XJ1  X  c4 P ш  p` 0 X`h  p 3.2.30 Tag code    pBits A to E of the first octet of the Tag plus any extension octets represent a Tag code that distinguishes one element type from another of the same class. Tag codes in the range 00000 to 11110 (0 to 30 decimal) are provided in one octet. pThe extension mechanism is to code bits A to E of the first octet as 11111. Bit H of the following octet serves as an extension indication. If bit H of the extension octet is set to 0, then no further octets for this tag are used. If bit H is set to 1, the following octet is also used for extension of the Tag code. The resultant Tag consists of bits A to G of each extension octet, with bit G of the first extension octet being most significant and bit A of the last extension octet being least significant. Tag code 31 is encoded as 0011111 in bits G to A of a single extension octet. Higher tag codes continue from this point using the minimum possible number of extension octets. pFigure 6/Q.773 shows the detailed format of the Tag code. J c4 P Figure 6/Q.773 /T110643087 = 6.5 cm  c4 P  3.3hpLength of the Contents  pThe Length of the Contents is coded to indicate the number of octets in the Contents. The length does not include the Tag nor the Length of the Contents octets. pThe Length of the Contents uses the short, long or indefinite form. If the length is less than 128 octets, the short form is used. In the short form, bit H is coded 0, and the length is encoded as a binary number using bits A to G. pIf the Length of the contents is greater than 127 octets, then the long form of the Length of the Contents is used. The long form Length is from 2 to 127 octets long. Bit H of the first octet is coded 1, and bits A to G of the first octet encode a number one less than the size of the Length in octets as an unsigned binary number whose MSB and LSB are bits G and A, respectively. The length itself is encoded as an unsigned binary number whose MSB and LSB are bit H of the second octet and bit A of the last octet, respectively. This binary number should be encoded in the fewest possible octets, with no leading octets having the value 0. pThe indefinite form is one octet long and may (but need not) be used in place of the short or long form, whenever the element is a constructor. It has the value 10000000. When this form is employed, a special end-of-contents (EOC) indicator terminates the Contents. pThere is no notation for the end-of-contents indicator. Although considered part of the Contents syntactically, the end-of-contents indicator has no semantic significance. pThe representation for the end-of-contents indicator is an element whose class is universal, whose form is primitive, whose ID Code has the value 0, and whose Contents is unused and absent:  p` pEOC Length Contents  p` p00(hex) 00(hex)"X%Absent