**TAG:**

Network Working Group J. Stone
Status of this Memo This document specifies an Internet standards track protocol for the Copyright Notice Copyright (C) The Internet Society (2002). All Rights Reserved. Abstract Stream Control Transmission Protocol (SCTP) currently uses an Adler- Table of Contents 1 Introduction ................................................... 2 1 Introduction A fundamental weakness has been detected in SCTP's current Adler-32 One requirement of an effective checksum is that it evenly and From an email from Jonathan Stone, who analyzed the Adler-32 as part "Briefly, the problem is that, for very short packets, Adler32 is Adler-32 uses two 16-bit counters, s1 and s2. s1 is the sum of the The key is to consider the distribution of the s1 values, over some Given the further assumption that the input bytes are drawn So, for short packets, the Adler-32 s1 sum is guaranteed to be Due to this inherent weakness, exacerbated by the fact that SCTP will 1.1 Conventions The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, Bit number order is defined in [RFC1700]. 2 Checksum Procedures The procedures described in section 2.1 of this document MUST be Furthermore any references within [RFC2960] to Adler-32 MUST be 2.1 Checksum Calculation When sending an SCTP packet, the endpoint MUST strengthen the data After the packet is constructed (containing the SCTP common header 1) Fill in the proper Verification Tag in the SCTP common header and 2) Calculate the CRC-32c of the whole packet, including the SCTP 3) Put the resulting value into the Checksum field in the common When an SCTP packet is received, the receiver MUST first check the 1) Store the received CRC-32c value, 2) Replace the 32 bits of the Checksum field in the received SCTP 3) Verify that the calculated CRC-32c value is the same as the The default procedure for handling invalid SCTP packets is to Any hardware implementation SHOULD be done in a way that is We define a 'reflected value' as one that is the opposite of the CRC computation uses polynomial division. A message bit-string M is When CRCs are used at the link layer, the polynomial is derived from A convention must therefore be established for mapping SCTP transport that byte, and the most-significant SCTP bit is the least significant The SCTP transport-level CRC value should be calculated as follows: - CRC input data are assigned to a byte stream, numbered from 0 - the transport-level byte-stream is mapped to a polynomial - the CRC remainder register is initialized with all 1s and the - the polynomial is multiplied by x^32 and divided by G(x), the - the coefficients of R(x) are considered a 32 bit sequence. - the bit sequence is complemented. The result is the CRC - The CRC polynomial is mapped back into SCTP transport-level IMPLEMENTATION NOTE: Standards documents, textbooks, and vendor Implementors of SCTP are warned that both specifications are to be If SCTP could follow link level CRC use, the CRC would be computed There may be a computational advantage in validating the Association 3 Security Considerations In general, the security considerations of RFC2960 apply to the 4 IANA Considerations There are no IANA considerations required in this document. 5 Acknowledgments The authors would like to thank the following people that have Mark Adler, Ran Atkinson, Stephen Bailey, David Black, Scott Bradner, Special thanks to Dafna Scheinwald, Julian Satran, Pat Thaler, Matt Special thanks to Mr. Ross Williams and his document [Williams93]. 6 References [Castagnoli93] G. Castagnoli, S. Braeuer and M. Herrman, [McKee75] H. McKee, "Improved {CRC} techniques detects [RFC1700] Reynolds, J. and J. Postel, "ASSIGNED NUMBERS", RFC [RFC2026] Bradner, S., "The Internet Standards Process -- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C., [ITU32] ITU-T Recommendation V.42, "Error-correcting 7.1 Informative References [STONE] Stone, J., "Checksums in the Internet", Doctoral [Williams93] Williams, R., "A PAINLESS GUIDE TO CRC ERROR [Blahut 1994] R.E. Blahut, Theory and Practice of Error Control [Easics 2001] http://www.easics.be/webtools/crctool. Online tools [Feldmeier 95] David C. Feldmeier, Fast software implementation of [Glaise 1997] R. J. Glaise, A two-step computation of cyclic [Prange 1957] E. Prange, Cyclic Error-Correcting codes in two [Peterson 1972] W. W. Peterson and E.J Weldon, Error Correcting [Shie2001] Ming-Der Shieh et. al, A Systematic Approach for [Sprachman2001] Michael Sprachman, Automatic Generation of Parallel Appendix This appendix is for information only and is NOT part of the The anticipated deployment of SCTP ranges over several orders of CRCs are derived from early work by Prange in the 1950s [Prange 57]. One of the simplest techniques is direct bit-serial hardware Since LSFRs do not scale well in speed, a variety of other techniques For multi-gigabit links, the above techniques may still not be fast The literature also includes a variety of software CRC Implementors should keep in mind, the bit ordering described in One technique to accommodate this bit-reversal can be explained as The following non-normative sample code is taken from an open-source /*************************************************************/ /* Example of the crc table file */ #define CRC32C_POLY 0x1EDC6F41 unsigned long crc_c[256] = 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, #endif /* Example of table build routine */ #include <stdio.h> #define OUTPUT_FILE "crc32cr.h" unsigned long for (i = 0; i < 32; i++){ unsigned long rb = reflect_32 (index); for (i = 0; i < 8; i++){ main () printf ("\nGenerating CRC-32c table file <%s>\n", OUTPUT_FILE); fprintf (tf, "\n"); if (fclose (tf) != 0) /* Example of crc insertion */ #include "crc32cr.h" unsigned long for (i = 0; i < length; i++){ /* result now holds the negated polynomial remainder; byte0 = result & 0xff; crc32 = ((byte0 << 24) | int int /* save and zero checksum */ Authors' Addresses Jonathan Stone EMail: jonathan@dsg.stanford.edu Randall R. Stewart EMail: rrs@cisco.com Douglas Otis EMail: dotis@sanlight.net Full Copyright Statement Copyright (C) The Internet Society (2002). All Rights Reserved. This document and translations of it may be copied and furnished to The limited permissions granted above are perpetual and will not be This document and the information contained herein is provided on an Acknowledgement Funding for the RFCEditor function is currently provided by the |