📄 rfc2823.txt
字号:
RFC 2823 PPP SDL on SONET/SDH May 2000 } u32 crc32(u32 crcval, u8 cval) { int i; crcval ^= cval << 24; for (i = 8; i--; ) crcval = crcval & 0x80000000 ? (crcval << 1) ^ POLY32 : crcval << 1; return crcval; } u16 crc16_special(u8 *buffer, int len) { u16 crc; crc = 0; while (--len >= 0) crc = crc16(crc,*buffer++); return crc; } u16 crc16_payload(u8 *buffer, int len) { u16 crc; crc = 0xFFFF; while (--len >= 0) crc = crc16(crc,*buffer++); return crc ^ 0xFFFF; } u32 crc32_payload(u8 *buffer, int len) { u32 crc; crc = 0xFFFFFFFFul; while (--len >= 0) crc = crc32(crc,*buffer++); return crc ^ 0xFFFFFFFFul; }Carlson, et al. Experimental [Page 22]RFC 2823 PPP SDL on SONET/SDH May 2000 void make_sdl_header(int packet_length, u8 *buffer) { u16 crc; buffer[0] = (packet_length >> 8) & 0xFF; buffer[1] = packet_length & 0xFF; crc = crc16_special(buffer,2); buffer[0] ^= 0xB6; buffer[1] ^= 0xAB; buffer[2] = ((crc >> 8) & 0xFF) ^ 0x31; buffer[3] = (crc & 0xFF) ^ 0xE0; }8.2. Error Correction Tables To generate the error correction table, the following implementation may be used. It creates a table called sdl_error_position, which is indexed on CRC residue value. The tables can be used to determine if no error exists (table entry is equal to FE hex), one correctable error exists (table entry is zero-based index to errored bit with MSB of first octet being 0), or more than one error exists, and error is uncorrectable (table entry is FF hex). To use for eight octet messages, the bit index from this table is used directly. To use for four octet messages, the index is treated as an unrecoverable error if it is below 32, and as bit index plus 32 if it is above 32. The program also prints out the error syndrome table shown in section 3.10. This may be used as part of a "switch" statement in a hardware implementation. u8 sdl_error_position[65536]; /* Calculate new CRC from old^(byte<<8) */ u16 crc16_t8(u16 crcval) { u16 f1,f2,f3; f1 = (crcval>>8) | (crcval<<8); f2 = (crcval>>12) | (crcval&0xF000) | ((crcval>>7)&0x01E0); f3 = ((crcval>>3) & 0x1FE0) ^ ((crcval<<4) & 0xF000); return f1^f2^f3; }Carlson, et al. Experimental [Page 23]RFC 2823 PPP SDL on SONET/SDH May 2000 void generate_error_table(u8 *bptab, int nbytes) { u16 crc; int i, j, k; /* Marker for no error */ bptab[0] = 0xFE; /* Marker for >1 error */ for (i = 1; i < 65536; i++ ) bptab[i] = 0xFF; /* Mark all single bit error cases. */ printf("Error syndrome table:\n"); for (i = 0; i < nbytes; i++) { putchar(' '); for (j = 0; j < 8; j++) { crc = 0; for (k = 0; k < i; k++) crc = crc16_t8(crc); crc = crc16_t8(crc ^ (0x8000>>j)); for (k++; k < nbytes; k++) crc = crc16_t8(crc); bptab[crc] = (i * 8) + j; printf(" %04X",crc); } putchar('\n'); } } int main(int argc, char **argv) { u8 buffer[8] = { 0x01,0x55,0x02,0xaa, 0x99,0x72,0x18,0x56 }; u16 crc; int i; generate_error_table(sdl_error_position,8); /* Run sample message through check routine. */ crc = 0; for (i = 0; i < 8; i++) crc = crc16_t8(crc ^ (buffer[i]<<8));Carlson, et al. Experimental [Page 24]RFC 2823 PPP SDL on SONET/SDH May 2000 /* Output is 0000 64 -- no error encountered. */ printf("\nError test: CRC %04X, bit position %d\n", crc,sdl_error_position[crc]); }9. Security Considerations The reliability of public SONET/SDH networks depends on well-behaved traffic that does not disrupt the synchronous data recovery mechanisms. This document describes framing and scrambling options that are used to ensure the distribution of transmitted data such that SONET/SDH design assumptions are not likely to be violated.10. References [1] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994. [2] Simpson, W., Editor, "PPP in HDLC-like Framing", STD 51, RFC 1662, July 1994. [3] Malis, A. and W. Simpson, "PPP over SONET/SDH", RFC 2615, June 1999. [4] "American National Standard for Telecommunications - Synchronous Optical Network (SONET) Payload Mappings," ANSI T1.105.02-1995. [5] ITU-T Recommendation G.707, "Network Node Interface for the Synchronous Digital Hierarchy (SDH)," March 1996. [6] Doshi, B., Dravida, S., Hernandez-Valencia, E., Matragi, W., Qureshi, M., Anderson, J., Manchester, J.,"A Simple Data Link Protocol for High Speed Packet Networks", Bell Labs Technical Journal, pp. 85-104, Vol.4 No.1, January-March 1999. [7] Demers, A., S. Keshav, and S. Shenker, "Analysis and simulation of a fair queueing algorithm," ACM SIGCOMM volume 19 number 4, pp. 1-12, September 1989. [8] Floyd, S. and V. Jacobson, "Random Early Detection Gateways for Congestion Avoidance," IEEE/ACM Transactions on Networking, August 1993. [9] Simpson, W., Editor, "PPP LCP Extensions", RFC 1570, January 1994.Carlson, et al. Experimental [Page 25]RFC 2823 PPP SDL on SONET/SDH May 2000 [10] ITU-T Recommendation I.432.1, "B-ISDN User-Network Interface - Physical Layer Specification: General Characteristics," February 1999. [11] ITU-T Recommendation V.41, "Code-independent error-control system," November 1989. [12] ITU-T Recommendation G.783, "Characteristics of synchronous digital hierarchy (SDH) equipment functional blocks," April 1997.11. Acknowledgments PPP over SONET was first proposed by Craig Partridge (BBN) and is documented by Andrew Malis and William Simpson as RFC 2615. Much of the material in this document was supplied by Lucent. Other length-prefixed forms of framing for PPP have gone before SDL, such as William Simpson's "PPP in Ether-like Framing" expired draft.12. Working Group and Chair Address The working group can be contacted via the mailing list (ietf- ppp@merit.edu; send mail to ietf-ppp-request@merit.edu to subscribe), or via the current chair: Karl Fox Extant, Inc. 3496 Snouffer Road, Suite 100 Columbus, Ohio 43235 EMail: karl@extant.net13. Intellectual Property Notices The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made toCarlson, et al. Experimental [Page 26]RFC 2823 PPP SDL on SONET/SDH May 2000 obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director.14. Authors' Addresses James Carlson Sun Microsystems, Inc. 1 Network Drive MS UBUR02-212 Burlington MA 01803-2757 Phone: +1 781 442 2084 Fax: +1 781 442 1677 EMail: james.d.carlson@sun.com Paul Langner Lucent Technologies Microelectronics Group 555 Union Boulevard Allentown PA 18103-1286 EMail: plangner@lucent.com Enrique J. Hernandez-Valencia Lucent Technologies 101 Crawford Corners Rd. Holmdel NJ 07733-3030 EMail: enrique@lucent.com James Manchester Lucent Technologies 101 Crawford Corners Rd. Holmdel NJ 07733-3030 EMail: sterling@hotair.hobl.lucent.comCarlson, et al. Experimental [Page 27]RFC 2823 PPP SDL on SONET/SDH May 200015. Full Copyright Statement Copyright (C) The Internet Society (2000). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.Acknowledgement Funding for the RFC Editor function is currently provided by the Internet Society.Carlson, et al. Experimental [Page 28]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -