SUBJECT F3)
AAL5 CRC32 Questions and Sample Code
Question: I want to implement functions to encode and decode CRC for AAL5. Are there any written code available from FTP sites? I am aware of Vince. Are there any others? Thanks.
Answer: The AAL5 CRC is the same as the Ethernet CRC. You can find example code in many PD or freeware packages such as XModem or Kermit; or by asking archie about CRC. You should be aware that while these examples all use the "look up 1 byte at a time" mode to speed things up, the programs to build the lookup tables seem to feed the bits in in the opposite order from that which the Ethernet and AAL5 CRC expects.
Additionally, C. M. Heard (heard@btr.btr.com), has provided some sample code including a set of high-endian routines for computing AAL 5 CRC-32. This is available, along with tutorial and associated code concerning the on correction of single-bit header errors, in the cell-relay mailing list archives. Check this using the Cell Relay Retreat web page http://cell-relay.indiana.edu/cell-relay/publications/software/CRC/32bitCRC.html. There you will find links to "html-ized" versions of the crc32 code and some test cases supplied by Angie Tso.
Question: Does anyone have some test cases for confirming that AAL5 CRC-32 software works on a given machine?
Answer: There are three examples of valid AAL-5 CS-PDU in I.363:
/* 40 Octets filled with "0" */
/* CPCS-UU = 0, CPI = 0, Length = 40, CRC-32 = 864d7f99 */
char pkt_data[48]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x28,0x86,0x4d,0x7f,0x99};
/* 40 Octets filled with "1" */
/* CPCS-UU = 0, CPI = 0, Length = 40, CRC-32 = c55e457a */
char pkt_data[48]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x28,0xc5,0x5e,0x45,0x7a};
/* 40 Octets counting: 1 to 40 */
/* CPCS-UU = 0, CPI = 0, Length = 40, CRC-32 = bf671ed0 */
char pkt_data[48]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,
0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,
0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,
0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
0x00,0x00,0x00,0x28,0xbf,0x67,0x1e,0xd0};
[ Back to Index | FAQ Index | Cell Relay Retreat ]
Maintained by
Cell Relay Retreat
Last Changed 25 August 1996