The drawings contained in this Recommendation have been done in Autocad. Recommendation Q.773 TRANSACTION CAPABILITIES FORMATS AND ENCODING 1 Introduction This 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. 2 Description conventions This 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. 3 Standard representation 3.1 General message structure Each 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. Fig. 1/Q.773 /T1120490-88 = 4.5 cm Each field is coded using one or more octets. Octets are labelled as shown in Figure 2/Q.773. The first octet is the first transmitted. Bits in an octet are labelled as shown in Figure 3/Q.773, with bit A the least significant and the first transmitted. Fig. 2/Q.773 /T1120500-88 = 4.5 cm PAGE38 Fascicle VI.9 - Q.733 Fig. 3/Q.773 /T1120510-88 = 4.5 cm The contents of each eleent is either one value (Primitive) or one or more information elements (Constructor), as shown in Figure 4/Q.773. Fig. 4/Q.773 /T1120520-88 = 5 cm 3.2 Tag An 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. Fig. 5/Q.773 /T1120530-88 = 3 cm 3.2.1 Tag class All 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. TABLE 1/Q.773 Coding of tag class Class Coding (HG) Universal 00 Application-wide 01 Context-specific 10 Private use 11 a all CCITT Recommendations, i.e. across CCITT No. 7 ASEs, X.400 MHS, etc. The Application-wide class is used for information elements that are standardized across all applications (ASEs) using CCITT No. 7 TC, i.e. TC-Users. The 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. The 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. The Tag codes of the Application-wide class not assigned in this Recommendation are reserved for future use. 3.2.2 Form of the element Bit 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. Both forms of elements are shown in Figure 4/Q.773. TABLE 2/Q.773 Coding element form Element form Coding (F) Primitive 0 Constructor 1 Fascicle VI.9 - Q.773 PAGE39 3.2.3 Tag code Bits 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. The 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. Figure 6/Q.773 shows the detailed format of the Tag code. Figure 6/Q.773 /T1106430-87 = 6.5 cm 3.3 Length of the Contents The 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. The 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. If 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. The 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. There 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. The 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: EOC Length Contents 00(hex) 00(hex) Absent PAGE38 Fascicle VI.9 - Q.733