Advisory Public Review Draft

Similar documents
Proposed Addendum an to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Public Review Draft. ASHRAE Standard

BACnet A Data Communication Protocol for Building Automation and Control Networks

Public Review Draft. ASHRAE Standard

Public Review Draft. ASHRAE Standard

Proposed Addendum bw to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum ao to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bx to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bl to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bn to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum al to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bd to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum be to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bj to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bp to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum ai to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum ap to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

IPv6 over MS/TP Networks

Fast Ethernet Consortium

Proposed Addendum bs to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Data Link Protocols. High Level Data. Control Protocol. HDLC Framing ~~~~~~~~ Functions of a Data Link Protocol. Framing PDUs. Addressing Destination

Proposed Addendum bd to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Proposed Addendum bd to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

Page 1. Reference: Networking and Integration of Facilities Automation Systems, Chapter 12

University of New Hampshire InterOperability Laboratory Gigabit Ethernet Consortium

Proposed Addendum aj to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

CBMS Studio BACnet Router User s Manual

Network Working Group. Obsoletes: RFC 1103 October 1990

FOREWORD. In addition, changes to BTL Specified Tests might also contain a yellow highlight to indicate the changes made by this addendum.

TECH TIP. Tritex Modbus Protocol Specification

ASHRAE STANDARD. BACnet A Data Communication Protocol for Building Automation and Control Networks

THE ETHERNET IN THE FIRST MILE CONSORTIUM. Annex 4A MAC Conformance Test Suite Version 1.0 Technical Document

ISO/IEC 8348 INTERNATIONAL STANDARD. Information technology Open Systems Interconnection Network service definition

ABSTRACT. 2. DISCUSSION The following list describes the proposed modifications to the Q.2111 Annex D baseline by section:

3GPP TS V7.2.0 ( )

FOREWORD. In addition, changes to BTL Specified Tests might also contain a yellow highlight to indicate the changes made by this addendum.

BACnet MS/TP Protocol for LabVIEW. User Manual

I Voice Trunking Format over MPLS Implementation Agreement. MPLS /Frame Relay Alliance 5.0.0

EZ Protocol. Communication Protocol for EZPLC. For use of EZAutomation and AVG Customers with EZPLC Products. Copyright 2005 AVG

3GPP TS V ( )

BACnet: A Data Communication Protocol for Building Automation and Control Networks

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

IN THE FIRST MILE CONSORTIUM. Clause 65 Test Suite v1.1 Technical Document. Last Updated: March 23, :43pm

University of New Hampshire InterOperability Laboratory Ethernet in the First Mile Consortium

This document is a preview generated by EVS

PROXIMITY-1 SPACE LINK PROTOCOL CODING AND SYNCHRONIZATION SUBLAYER

Standard for the Design of High-Performance Green Buildings Except Low-Rise Residential Buildings

Fast Ethernet Consortium

ET4254 Communications and Networking 1

G3-PLC L3/L4 Interoperability Test Procedure Manual ANNEX

Request for Comments: June MAPOS - Multiple Access Protocol over SONET/SDH Version 1

Medium Access Protocols

CCNA Exploration1 Chapter 7: OSI Data Link Layer

Summary of MAC protocols

Internetwork Protocols

Application Note: Using Modbus With the Conext CL Series. Important Safety Instructions

BACnet Errata ANSI/ASHRAE STANDARD A Data Communication Protocol for Building Automation and Control Networks.

Space engineering. SpaceWire Protocols

Proposed Addendum bj to Standard , BACnet - A Data Communication Protocol for Building Automation and Control Networks

INTERNATIONAL TELECOMMUNICATION UNION. SERIES Q: DIGITAL SUBSCRIBER SIGNALLING SYSTEM No. 1 (DSS 1), DATA LINK LAYER

Copyright 2008 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York USA All Rights Reserved.

Date: Vendor Name: Product Name: Product Model Number: Applications Software Version: Firmware Revision: BACnet Protocol Revision:

SPM90 MODBUS PROTOCOL AND REGISTER LIST V1.0

GE MDS, LLC. NETio Series. Protocol Communications Supplement. March 2013 Part No A01, Rev. C

Addendum e to BTL Test Package 15.1

G3-PLC L3/L4 Interoperability Test Procedure Manual ANNEX

SpaceWire-R DRAFT. SCDHA Issue September 2013

Internet Protocols (chapter 18)

DirectNET Host. Communications Programs. In This Chapter...

NB-GPC Family Protocol Implementation Conformance Statement (PICS)

Computer Peripherals

##)44 6 BIS $!4! #/-02%33)/. 02/#%$52%3 &/2 $!4! #)2#5)4 4%2-).!4).' %15)0-%.4 $#% 53).' %22/2 #/22%#4)/. 02/#%$52%3

Modbus/TCP is supported on some controllers. See QCI-AN028 Modbus TCP.

Data Link Layer: Overview, operations

PART X. Internetworking Part 1. (Concept, IP Addressing, IP Routing, IP Datagrams, Address Resolution)

INTERNATIONAL STANDARD

WLAN The Wireless Local Area Network Consortium

Request for Comments: 1007 June 1987

AES standard for digital audio engineering - High-resolution multi-channel audio interconnection (HRMAI) Preview only

Part 3: Applications

BACnet Errata ANSI/ASHRAE STANDARD A Data Communication Protocol for Building Automation and Control Networks.

ETSI TS V8.0.0 ( ) Technical Specification

Introduction to Internetworking

Computer and Network Security

ASHRAE ADDENDA BACnet A Data Communication Protocol for Building Automation and Control Networks

FX Server BACNET AWS Protocol Implementation Conformance Statement

Honeywell ComfortPoint TM Open Plant Controller Protocol Implementation Conformance Statement (PICS)

3. Data Link Layer 3-2

CS 4453 Computer Networks Winter

Links. CS125 - mylinks 1 1/22/14

SEN366 (SEN374) (Introduction to) Computer Networks

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

INTERNATIONAL TELECOMMUNICATION UNION

ETSI TS V ( ) Technical Specification

COMP 361 Computer Communications Networks. Fall Semester Final Examination: Solution key

BACnet Errata ANSI/ASHRAE STANDARD A Data Communication Protocol for Building Automation and Control Networks.

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

ECE4110 Internetwork Programming. Introduction and Overview

NB-VAV Family Protocol Implementation Conformance Statement (PICS)

NB-V3Tb Protocol Implementation Conformance Statement (PICS)

Transcription:

BSR/ASHRAE Addendum an to ANSI/ASHRAE Standard 135-2010 Advisory Public Review Draft ASHRAE Standard Proposed Addendum an to Standard 135-2010, BACnet A Data Communication Protocol for Building Automation and Control Networks First Advisory Public Review (September 2011) (Draft Shows Proposed Changes to Current Standard) This draft has been recommended for public review by the responsible project committee. To submit a comment on this proposed addendum, go to the ASHRAE website at http://www.ashrae.org/technology/page/331 and access the online comment database. The draft is subject to modification until it is approved for publication by the Board of Directors and ANSI. Until this time, the current edition of the standard (as modified by any published addenda on the ASHRAE web site) remains in effect. The current edition of any standard may be purchased from the ASHRAE Bookstore @ http://www/ashrae.org or by calling 404-636-8400 or 1-800-527-4723 (for orders in the U.S. or Canada). This standard is under continuous maintenance. To propose a change to the current standard, use the change submittal form available on the ASHRAE web site @ http://www/ashrae.org. The appearance of any technical data or editorial material in this public review document does not constitute endorsement, warranty, or guaranty by ASHRAE of any product, service, process, procedure, or design, and ASHRAE expressly disclaims such. 2011. This draft is covered under ASHRAE copyright. Permission to reproduce or redistribute all or any part of this document must be obtained from the ASHRAE Manager of Standards, 1791 Tullie Circle, NE, Atlanta, GA 30329-2305. Phone: 404-636-8400, Ext1125. Fax: 404-321-5478. E-mail: standards.section@ashrae.org. AMERICAN SOCIETY OF HEATING, REFRIGERATING AND AIR-CONDITIONING ENGINEERS, INC. 1791 Tullie Circle, NE Atlanta GA 30329-230

[This foreword and the rationales on the following pages are not part of this standard. They are merely informative and do not contain requirements necessary for conformance to the standard.] FOREWORD The purpose of this addendum is to present a proposed change for public review. These modifications are the result of change proposals made pursuant to the ASHRAE continuous maintenance procedures and of deliberations within Standing Standard Project Committee 135. The proposed changes are summarized below. 135-2010an-1 Add MS/TP Extended Frames, p. 2 In the following document, language to be added to existing clauses of ANSI/ASHRAE 135-2010 and Addenda is indicated through the use of italics, while deletions are indicated by strikethrough. Where entirely new subclauses are proposed to be added, plain type is used throughout. Only this new and deleted text is open to comment at this time. All other material in this addendum is provided for context only and is not open for public review comment except as it relates to the proposed changes. 2

135-2010an-1 Add MS/TP Extended Frames Rationale Since BACnet now supports higher baud rates for MS/TP, increasing the frame sizes will allow better throughput as well as opening up future possibilities that the ability to carry full ethernet-sized frames will enable. However, increasing the size of MS/TP payloads beyond the current 501-octet maximum without also replacing the CRC-16-CCITT with a 32-bit CRC will result in an unacceptable increase in the probability of undetected bit errors. There have been significant advances in coding theory since MS/TP was initially specified. In particular, the design space of CRCs for particular applications has been well explored. The probability of undetected errors (Pud, bit errors passed up to the client) is affected by a combination of: CRC length, CRC polynomial, bit error rate, and data word (payload) length. Among the most recent (and readable) published surveys on the evaluation of CRCs are three papers by Dr. Philip Koopman, formerly of United Technologies, and now on the faculty at Carnegie Mellon University [1][2][3]. Since the CRC-16-CCITT is widely used, many studies use it as a basis for comparison. If a picture is worth a thousand words, then the figure below demonstrates that, all other factors being equal, increasing the code word length (the covered data plus the CRC field) from 512 octets (4096 bits) to 4096 octets (32768 bits) increases the probability of undetected errors by more than three orders of magnitude. Fig. 10. Probability of undetected errors for a 16-bit Fletcher checksum and two 16-bit CRCs at a BER of 10-5. The data values for the Fletcher checksum are the mean of 10 trials using random data. [3] When we consider that nodes sending large frames are likely to utilize the recently approved higher baud rates (which may further decrease bit error rate margin) the combined effect may be even greater. The large frame discussion should focus on how to a) incorporate a larger CRC into the present MS/TP standard and b) which CRC polynomial should be selected. Solution Summary: 3

This proposal can be reformulated as a more robust alternative to the present MS/TP design, with BACnet data field lengths between 502 1497 octets and an extended (32-bit) CRC that affords greater protection from undetected bit errors. The new frame types proposed here are used to indicate frames that are covered by an extended CRC. The recommended 32-bit polynomial is CRC-32K (Koopman), which has better error detection properties than the IEEE 802.3 Frame Check Sequence polynomial for data lengths up to 114,663 4

[Add new entries to Clause 25, 691] 25 REFERENCES IEEE/IFIP International Conference on Dependable Systems and Networks (DSN 2002), 32-Bit Cyclic Redundancy Codes for Internet Applications, P. Koopman. IEEE/IFIP International Conference on Dependable Systems and Networks (DSN 2004), Cyclic Redundancy Code (CRC) Polynomial Selection for Embedded Networks, P. Koopman and T. Chakravarty IEEE Transactions on Dependable and Secure Computing, Vol. 6, No. 1, January March 2009, The Effectiveness of Checksums for Embedded Control Networks, T. Maxino and P. Koopman IEEE, IEEE Standard for Information technology - Telecommunications and information exchange between systems - Local and metropolitan area networks - Specific requirements - Part 3: Carrier sense multiple access with Collision Detection (CSMA/CD) Access Method and Physical Layer Specifications, December 2008. Sources for Reference Material Koopman: http://www.ece.cmu.edu/~koopman/projects.html#crc IEEE 802.3: http://standards.ieee.org/about/get/802/802.3.html [Change Table 6-1, p. 52] Table 6-1. Maximum NPDU Lengths When Routing Through Different BACnet Data Link Layers Data Link Technology Maximum NPDU Length ISO 8802-3 ("Ethernet"), as defined in Clause 7 ARCNET, as defined in Clause 8 MS/TP, as defined in Clause 9 Point-To-Point, as defined in Clause 10 LonTalk, as defined in Clause 11 BACnet/IP, as defined in Annex J ZigBee, as defined in Annex O 1497 octets 501 octets 501 1497 octets 501 octets 228 octets 1497 octets 501 octets [Change Clause 9.1 and subclauses, p. 79] 9.1 Service Specification MS/TP is not intended to be a general purpose LAN under ISO 8802-2. Instead, MS/TP includes a data link layer sufficient to provide to the BACnet network layer the same services as are offered by ISO 8802-2 Type 1. This subclause describes the primitives and parameters associated with the provided services. The parameters are described in an abstract sense, which does not constrain the implementation method. Primitives and their parameters are described in a form that echoes their specification in ISO 8802-2. This is intended to provide a consistent interface to the BACnet network layer. 5

9.1.1 DL-UNITDATA.request 9.1.1.1 Function This primitive is the service request primitive for the unacknowledged connectionless-mode data transfer service. 9.1.1.2 Semantics of the Service Primitive The primitive shall provide parameters as follows: DL-UNITDATA.request ( source_address, destination_address, data, priority, data_expecting_reply data_expecting_reply, frame_type ) Each source and destination address consists of the logical concatenation of a medium access control (MAC) address and a link service access point (LSAP). For the case of MS/TP devices, since MS/TP supports only the BACnet network layer, the LSAP is omitted and these parameters consist of only the device MAC address. The 'data' parameter specifies the link service data unit (LSDU) to be transferred by the MS/TP entity. There is sufficient information associated with the link service data unit for the MS/TP entity to determine the length of the data unit. The 'priority' parameter specifies the priority desired for the data unit transfer. The priority parameter is ignored by MS/TP. The 'data_expecting_reply' parameter specifies whether or not the data unit to be transferred expects a reply. The 'frame_type' parameter specifies the value of the MS/TP Frame Type field. The frame_type parameter is ignored by BACnet-only MS/TP entities. 9.1.1.3 When Generated This primitive is passed from the network layer to the MS/TP entity to request that a network protocol data unit (NPDU) be sent to one or more remote LSAPs using unacknowledged connectionless-mode procedures. 9.1.1.4 Effect on Receipt Receipt of this primitive causes the MS/TP entity to attempt to send the NPDU using unacknowledged connectionlessmode procedures. 9.1.2 DL-UNITDATA.indication 9.1.2.1 Function This primitive is the service indication primitive for the unacknowledged connectionless-mode data transfer service. 9.1.2.2 Semantics of the Service Primitive DL-UNITDATA.indication ( source_address, destination_address, data, priority, data_expecting_reply 6

data_expecting_reply, frame_type ) Each source and destination address consists of the logical concatenation of a medium access control (MAC) address and a link service access point (LSAP). For the case of MS/TP devices, since MS/TP supports only the BACnet network layer, the LSAP is omitted and these parameters consist of only the device MAC address. The 'data' parameter specifies the link service data unit that has been received by the MS/TP entity. The 'priority' parameter specifies the priority desired for the data unit transfer. The priority parameter is ignored by MS/TP. The 'data_expecting_reply' parameter specifies whether or not the data unit that has been received expects a reply. The 'frame_type' parameter specifies the value of the MS/TP Frame Type field. The frame_type parameter is ignored by BACnet-only MS/TP entities. 9.1.2.3 When Generated This primitive is passed from the MS/TP entity to the network layer to indicate the arrival of an NPDU from the specified remote entity. 9.1.2.4 Effect on Receipt The effect of receipt of this primitive by the network layer is unspecified. [Change Clause 9.3, p. 92] N.15.1 MS/TP Frame Format All frames are of the following format: Preamble Frame Type Destination Address Source Address Length Header CRC Data Data CRC Extended Data CRC (pad) two octet preamble: X'55', X'FF' one octet one octet address one octet address two octets, most significant octet first one octet (present only if Length is non-zero) (present only if Length is non-zero and Frame Type is not BACnet Extended Data Expecting Reply, BACnet Extended Data Not Expecting Reply, or IPv6 over MS/TP) two octets, least significant octet first (present only if Length is non-zero and Frame Type is BACnet Extended Data Expecting Reply, BACnet Extended Data Not Expecting Reply, or IPv6 over MS/TP) four octets, least significant octet first (optional) at most one octet of padding: X'FF' The Frame Type is used to distinguish between different types of MAC frames. Defined types are: 00 Token 01 Poll For Master 02 Reply To Poll For Master 03 Test_Request 7

04 Test_Response 05 BACnet Data Expecting Reply 06 BACnet Data Not Expecting Reply 07 Reply Postponed 08 BACnet Extended Data Expecting Reply 09 BACnet Extended Data Not Expecting Reply 10 IPv6 over MS/TP Frame Types 811 through 127 are reserved by ASHRAE. Frame Types 128 through 255 are available to vendors for proprietary (non-bacnet) frames. Use of proprietary frames might allow a Brand-X controller, for example, to send proprietary frames to other Brand-X controllers that do not implement BACnet while using the same medium to send BACnet frames to a Brand-Y panel that does implement BACnet. Token, Poll For Master, and Reply To Poll For Master frames shall be understood by both proprietary and BACnet master nodes. The Destination and Source Addresses are one octet each. A Destination Address of 255 (X'FF') denotes broadcast. A Source Address of 255 is not allowed. Addresses 0 to 127 are valid for both master and slave nodes. Addresses 128 to 254 are valid only for slave nodes. The Length field specifies the length in octets of the Data field. The Data and Data CRC fields are conditional on the Frame Type and the Length, as specified in the description of each Frame Type. If the Length field is zero, that is, if both length octets are zero, then the Data and Data CRC fields shall not be present. The length of the Data field for frame types BACnet Extended Data Expecting Reply and BACnet Extended Data Not Expecting Reply shall be between 502 and 1497 octets. For all other BACnet frame types, the length of the Data field shall be between 0 and 501 octets. Subclause 9.6 and Annex G describe in detail the generation and checking of the Header and Data CRC octets. [Change Clause 9.3.9, renumbering to make room for new frame types, p. 93] 9.3.912 Frame Types 128 through 255: Proprietary Frames These frames are available to vendors as proprietary (non-bacnet) frames. The first two octets of the Data field shall specify the unique vendor identification code, most significant octet first, for the type of vendor-proprietary frame to be conveyed. The length of the data portion of a Proprietary frame shall be in the range of 2 to 501 octets. [Insert new Clauses 9.3.9-11, p. 93] 9.3.9 Frame Type 08: BACnet Extended Data Expecting Reply This frame is used by master nodes to convey the data parameter of a DL_UNITDATA.request whose DER parameter is TRUE and whose data portion length is greater than 501 octets. The length of the Data field of a BACnet Extended Data Expecting Reply frame shall be between 502 and 1497 octets. 9.3.10 Frame Type 09: BACnet Extended Data Not Expecting Reply This frame is used to convey the data parameter of a DL_UNITDATA.request whose DER parameter is FALSE and whose data portion length is greater than 501 octets. The length of the Data field of a BACnet Extended Data Not Expecting Reply frame shall be between 502 and 1497 octets. 8

[Insert new 9.3.11, p. 93] 9.3.11 Frame Type 10: IPv6 over MS/TP The format of the data portion of this frame is defined by the IETF. [Change Clause 9.5.2, p. 95] 9.5.2 Variables A number of variables and timers are used in the descriptions that follow: DataCRC Used to accumulate the CRC on the data field of a frame ExtendedDataCRC Used to accumulate the extended CRC on the data field of a frame. InputBuffer[] An array of octets, used to store octets as they are received. InputBuffer is indexed from 0 to InputBufferSize-1. The maximum size of a frame an MS/TP NPDU (including non- BACnet, or proprietary frames) is 501 1500 octets. Implementations that support IPv6 over MS/TP frames shall support an InputBufferSize of 1500. (This is intentionally longer than the maximum BACnet NPDU in order to carry ISO 8802-3 MSDUs without fragmentation.) A smaller value for InputBufferSize may be used by some implementations. [Change Clause 9.5.3, p. 96] 9.5.3 Parameters Parameter values used in the description: N max_npdu_size The maximum permissible MS/TP NPDU size: 1500. N max_defined_type The highest Frame Type defined by ASHRAE: 10. 9

[Change Figure 9-3, p. 97] [Existing Figure] EatAnOctet EatAnError Bad CRC Timeout Preamble 1 Repeated Preamble 1 DATA CRC Good CRC IDLE Error PREAMBLE CRC 1 CRC2 DATA Data Timeout Error Timeout Error Done BadCRC NoData NotForUs NotPreamble Timeout Error HeaderCRC Preamble 2 HEADER Frame Type Destination Data Octet SKIP DATA Data Not For Us HEADER CRC Length 2 Source FrameTooLong Length 1 Data Octet [Revised Figure] Bad CRC Good CRC EatAnOctet EatAnError Preamble 1 Timeout Error NotPreamble CRC 2 Timeout Error Timeout Error Done DataNotForUs FrameTooLong 10

[Change Clause 9.5.4.4, p. 99] 9.5.4.4 HEADER_CRC In the HEADER_CRC state, the node validates the CRC on the fixed message header and tests for illegal values in other fields. BadCRCBadHeader If the value of HeaderCRC is not X '55', or the value of FrameType is greater than N max_defined_type and less than 128, or the value of SourceAddress is 255 (broadcast), or DataLength is greater than N max_npdu_size then set ReceivedInvalidFrame to TRUE to indicate that an error has occurred during the reception of a frame, and enter the IDLE state to wait for the start of the next frame. NotForUs If the value of the HeaderCRC is X '55' and DataLength is zero and the value of DestinationAddress is not equal to either TS (this station) or 255 (broadcast), then enter the IDLE state to wait for the start of the next frame. DataNotForUs If the value of the HeaderCRC is X 55 and DataLength is not zero and the value of DestinationAddress is not equal to either TS (this station) or 255 (broadcast), FrameTooLong NoData then set Index to zero and enter the SKIP_DATA state to consume the data and data CRC or extended data CRC portions of the frame. If the value of the HeaderCRC is X '55' and the value of DestinationAddress is equal to either TS (this station) or 255 (broadcast) and DataLength is greater than InputBufferSize, then set ReceivedInvalidFrame to TRUE to indicate that a frame with an illegal or unacceptable data length has been received, set Index to zero, and enter the SKIP_DATA state to consume the data and data CRC or extended data CRC portions of the frame. If the value of HeaderCRC is X '55' and the value of DestinationAddress is equal to either TS (this station) or 255 (broadcast) and DataLength is zero, then set ReceivedValidFrame to TRUE to indicate that a frame with no data has been received, and enter the IDLE state to wait for the start of the next frame. Data If the value of HeaderCRC is X'55' and the value of DestinationAddress is equal to either TS (this station) or 255 (broadcast) and DataLength is not zero and DataLength is less than or equal to InputBufferSize and FrameType is not equal to BACnet Extended Data Expecting Reply, BACnet Extended Data Not Expecting Reply, or IPv6 over MS/TP, ExtendedData then set Index to zero; set DataCRC to X'FFFF'; and enter the DATA state to receive the data portion of the frame. 11

If the value of HeaderCRC is X'55' and the value of DestinationAddress is equal to either TS (this station) or 255 (broadcast) and DataLength is not zero and DataLength is less than or equal to InputBufferSize and FrameType is equal to BACnet Extended Data Expecting Reply, BACnet Extended Data Not Expecting Reply, or IPv6 over MS/TP, then set Index to zero; set ExtendedDataCRC to X'FFFFFFFF'; and enter the EXTENDED_DATA state to receive the data portion of the frame. [Insert new Clause 9.5.4.8-9, p. 101] 9.5.4.8 EXTENDED_DATA In the EXTENDED_DATA state, the node waits for the data portion of a frame. Timeout If SilenceTimer is greater than T frame_abort, Error then set ReceivedInvalidFrame to TRUE to indicate that an error has occurred during the reception of a frame, and enter the IDLE state to wait for the start of the next frame. If ReceiveError is TRUE, then set ReceiveError to FALSE; set SilenceTimer to zero; set ReceivedInvalidFrame to TRUE to indicate that an error has occurred during the reception of a frame; and enter the IDLE state to wait for the start of the next frame. DataOctet If ReceiveError is FALSE and DataAvailable is TRUE and Index is less than DataLength, then set DataAvailable to FALSE; set SilenceTimer to zero; accumulate the contents of DataRegister into ExtendedDataCRC; save the contents of DataRegister at InputBuffer[Index]; increment Index by 1; and enter the EXTENDED_DATA state. CRC1 If ReceiveError is FALSE and DataAvailable is TRUE and Index is equal to DataLength, then set DataAvailable to FALSE; set SilenceTimer to zero; accumulate the contents of DataRegister into ExtendedDataCRC; increment Index by 1; and enter the EXTENDED_DATA state. CRC2 If ReceiveError is FALSE and DataAvailable is TRUE and Index is equal to DataLength plus 1, then set DataAvailable to FALSE; set SilenceTimer to zero; accumulate the contents of DataRegister into ExtendedDataCRC; increment Index by 1; and enter the EXTENDED_DATA state. CRC3 If ReceiveError is FALSE and DataAvailable is TRUE and Index is equal to DataLength plus 2, then set DataAvailable to FALSE; set SilenceTimer to zero; accumulate the contents of DataRegister into ExtendedDataCRC; increment Index by 1; and enter the EXTENDED_DATA state. CRC4 If ReceiveError is FALSE and DataAvailable is TRUE and Index is equal to DataLength plus 3, 12

then set DataAvailable to FALSE; set SilenceTimer to zero; accumulate the contents of DataRegister into ExtendedDataCRC; and enter the EXTENDED_DATA_CRC state. 9.5.4.9 EXTENDED_DATA_CRC In the EXTENDED_DATA_CRC state, the node validates the ExtendedCRC of the message data. BadCRC If the value of ExtendedDataCRC is not X 0843323B, then set ReceivedInvalidFrame to TRUE to indicate that an error has occurred during the reception of a frame, and enter the IDLE state to wait for the start of the next frame. GoodCRC If the value of ExtendedDataCRC is X 0843323B, then set ReceivedValidFrame to TRUE to indicate the complete reception of a valid frame, and enter the IDLE state to wait for the start of the next frame. [Change Clause 9.5.5, p. 101] 9.5.5 The SendFrame Procedure (g) If there are data octets and Frame Type is either BACnet Extended Data Expecting Reply or BACnet Extended Data Not Expecting Reply, initialize ExtendedDataCRC to X'FFFFFFFF'. Otherwise, initialize DataCRC to X'FFFF'. (h) Transmit any data octets. If Frame Type is either BACnet Extended Data Expecting Reply or BACnet Extended Data Not Expecting Reply, accumulate each octet into ExtendedDataCRC. Otherwise, Aaccumulate each octet into DataCRC. As each octet is transmitted, set SilenceTimer to zero. (i) If Frame Type is either BACnet Extended Data Expecting Reply or BACnet Extended Data Not Expecting Reply, transmit the ones-complement of ExtendedDataCRC, least significant octet first. Otherwise, Ttransmit the onescomplement of DataCRC, least significant octet first. As each octet is transmitted, set SilenceTimer to zero. [Change Clause 9.5.6.2, p. 104] 9.5.6.2 IDLE In the IDLE state, the node waits for a frame. ReceivedDataNoReply If ReceivedValidFrame is TRUE and DestinationAddress is equal to either TS (this station) or 255 (broadcast) and FrameType is equal to BACnet Data Not Expecting Reply, Test_Response, BACnet Extended Data Not Expecting Reply, or a proprietary type known to this node that does not expect a reply, then indicate successful reception to the higher layers; set ReceivedValidFrame to FALSE; and enter the IDLE state. ReceivedDataNeedingReply If ReceivedValidFrame is TRUE and DestinationAddress is equal to TS (this station) and FrameType is equal to BACnet Data Expecting Reply, Test RequestTest_Request, BACnet Extended Data Expecting Reply, or a proprietary type known to this node that expects a reply, 13

then indicate successful reception to the higher layers (management entity in the case of Test_Request); set ReceivedValidFrame to FALSE; and enter the ANSWER_DATA_REQUEST state. BroadcastDataNeedingReply If ReceivedValidFrame is TRUE and DestinationAddress is equal to 255 (broadcast) and FrameType is equal to either BACnet Data Expecting Reply or BACnet Extended Data Expecting Reply, then indicate successful reception to the higher layers; set ReceivedValidFrame to FALSE; and enter the IDLE state to wait for the next frame. [Change Clause 9.5.6.3, p. 105] 9.5.6.3 USE_TOKEN In the USE_TOKEN state, the node is allowed to send one or more data frames. These may be BACnet Data frames or proprietary frames. NothingToSend If there is no data frame awaiting transmission, then set FrameCount to N max_info_frames and enter the DONE_WITH_TOKEN state. SendNoWait If the next frame awaiting transmission is of type Test_Response, BACnet Data Not Expecting Reply, BACnet Extended Data Not Expecting Reply, a proprietary type that does not expect a reply, or a frame of type Data Expecting Reply with a DestinationAddress that is equal to 255 (broadcast) or has a DestinationAddress that is equal to 255 (broadcast) and a FrameType equal to either BACnet Data Expecting Reply or BACnet Extended Data Expecting Reply, then call SendFrame to transmit the frame; increment FrameCount; and enter the DONE_WITH_TOKEN state. SendAndWait If the next frame awaiting transmission is of type Test_Request, BACnet Data Expecting Reply, a proprietary type that expects a reply, or a frame of type Data Expecting Reply with a DestinationAddress that is not equal to 255 (broadcast) or has a DestinationAddress that is not equal to 255 (broadcast) and a FrameType equal to either BACnet Data Expecting Reply or BACnet Extended Data Expecting Reply, then call SendFrame to transmit the data frame; increment FrameCount; and enter the WAIT_FOR_REPLY state. [Change Clause 9.5.6.4, p. 105] 9.5.6.4 WAIT_FOR_REPLY In the WAIT_FOR_REPLY state, the node waits for a reply from another node. ReplyTimeout If SilenceTimer is greater than or equal to T reply_timeout, then assume that the request has failed. Set FrameCount to N max_info_frames and enter the DONE_WITH_TOKEN state. Any retry of the data frame shall await the next entry to the USE_TOKEN 14

state. (Because of the length of the timeout, this transition will cause the token to be passed regardless of the initial value of FrameCount.) InvalidFrame If SilenceTimer is less than T reply_timeout and ReceivedInvalidFrame is TRUE, then there was an error in frame reception. Set ReceivedInvalidFrame to FALSE and enter the DONE_WITH_TOKEN state. ReceivedReply If SilenceTimer is less than T reply_timeout and ReceivedValidFrame is TRUE and DestinationAddress is equal to TS (this station) and FrameType is equal to Test_Response, BACnet Data Not Expecting Reply, BACnet Extended Data Not Expecting Reply, or a proprietary type that indicates a reply, then indicate successful reception to the higher layers; set ReceivedValidFrame to FALSE; and enter the DONE_WITH_TOKEN state. ReceivedPostpone If SilenceTimer is less than T reply_timeout and ReceivedValidFrame is TRUE and DestinationAddress is equal to TS (this station) and FrameType is equal to Reply Postponed, then the reply to the message has been postponed until a later time. Set ReceivedValidFrame to FALSE and enter the DONE_WITH_TOKEN state. ReceivedUnexpectedFrame If SilenceTimer is less than T reply_timeout and ReceivedValidFrame is TRUE and either (a) DestinationAddress is not equal to TS (the expected reply should not be broadcast) or (b) FrameType has a value other than Test_Response, BACnet Data Not Expecting Reply, BACnet Extended Data Not Expecting Reply, or proprietary reply frame, then an unexpected frame was received. This may indicate the presence of multiple tokens. Set ReceivedValidFrame to FALSE, and enter the IDLE state to synchronize with the network. This action drops the token. [Change Clause 9.5.6.9, p. 109] 9.5.6.9 ANSWER_DATA_REQUEST The ANSWER_DATA_REQUEST state is entered when a BACnet Data Expecting Reply, BACnet Extended Data Expecting Reply, a Test_Request, or a proprietary frame that expects a reply is received. Reply If a reply is available from the higher layers within T reply_delay after the reception of the final octet of the requesting frame (the mechanism used to determine this is a local matter), then call SendFrame to transmit the reply frame and enter the IDLE state to wait for the next frame. 15

[Change Clause 9.5.7.2, p. 110] 9.5.7.2 IDLE In the IDLE state, the node waits for a frame. ReceivedUnwantedFrame If ReceivedValidFrame is TRUE and either (a) DestinationAddress is not equal to either TS (this station) or 255 (broadcast) or (b) DestinationAddress is equal to 255 (broadcast) and FrameType has a value of BACnet Data Expecting Reply, BACnet Extended Data Expecting Reply, Test RequestTest_Request, or a proprietary type known to this node that expects a reply (such frames may not be broadcast) or (c) FrameType has a value of Token, Poll For Master, Reply To Poll For Master, Reply Postponed, or a standard or proprietary frame type not known to this node, then an unexpected or unwanted frame was received. Set ReceivedValidFrame to FALSE, and enter the IDLE state to wait for the next frame. ReceivedDataNoReply If ReceivedValidFrame is TRUE and DestinationAddress is equal to either TS (this station) or 255 (broadcast) and FrameType is equal to BACnet Data Not Expecting Reply, BACnet Extended Data Not Expecting Reply, Test_Response, or a proprietary type known to this node that does not expect a reply, then indicate successful reception to the higher layers, set ReceivedValidFrame to FALSE, and enter the IDLE state. ReceivedDataNeedingReply If ReceivedValidFrame is TRUE and DestinationAddress is equal to TS (this station) and FrameType is equal to BACnet Data Expecting Reply, BACnet Extended Data Expecting Reply, Test RequestTest_Request, or a proprietary type known to this node that expects a reply, then indicate successful reception to the higher layers (management entity in the case of Test_Request), set ReceivedValidFrame to FALSE, and enter the ANSWER_DATA_REQUEST state. [Change Clause 9.5.7.3, p. 110] 9.5.7.3 ANSWER_DATA_REQUEST The ANSWER_DATA_REQUEST state is entered when a BACnet Data Expecting Reply, BACnet Extended Data Expecting Reply, a Test_Request, or a proprietary frame that expects a reply is received. Reply If a reply is available from the higher layers within T reply_delay after the reception of the final octet of the requesting frame (the mechanism used to determine this is a local matter), then call SendFrame to transmit the reply frame, and enter the IDLE state to wait for the next frame. 16

[Change Clause 9.6, p. 111] 9.6 Cyclic Redundancy Check (CRC) The MS/TP data CRC uses the CRC-CCITT polynomial G(X) = X 16 + X 12 + X 5 + 1 In operation, at the transmitter, the initial content of the CRC register of the device computing the remainder of the division is preset to all ones. The register is then modified by division by the generator polynomial G(x) of the Data field. The ones-complement of the resulting remainder is transmitted, least significant octet first, as the 16 bit Data CRC. At the receiver, the initial content of the CRC register of the device computing the remainder of the division is preset to all ones. The register is then modified by division by the generator polynomial G(x) of the Data and Data CRC fields of the incoming message. In the absence of transmission errors, the resultant remainder will be 1111 0000 1011 1000 (x0 through x 15, respectively). NOTE: The initialization of the CRC register to all ones and the complementing of the register before transmission prevent the CRC from having a value of zero if the covered field is all zeros. The MS/TP Extended Data CRC uses the CRC-32K (Koopman) polynomial G(X) = X 32 + X 30 + X 29 + X 28 + X 26 + X 20 + X 19 + X 17 + X 16 + X 15 + X 11 + X 10 + X 7 + X 6 + X 4 + X 2 + X + 1 = (X + 1)(X 3 + X 2 + 1)(X 28 + X 22 + X 20 + X 19 + X 16 + X 14 + X 12 + X 9 + X 8 + X 6 + 1) In operation, at the transmitter, the initial content of the Extended Data CRC register of the device computing the remainder of the division is preset to all ones. The register is then modified by division by the generator polynomial G(x) of the Data field. The ones-complement of the resulting remainder is transmitted, least significant octet first, as the 32-bit Extended Data CRC. At the receiver, the initial content of the Extended Data CRC register of the device computing the remainder of the division is preset to all ones. The register is then modified by division by the generator polynomial G(x) of the Data and Extended Data CRC fields of the incoming message. In the absence of transmission errors, the resultant remainder will be 0000 1000 0100 0011 0011 0010 0011 1011 (x 0 through x 31, respectively). NOTE: The initialization of the Extended Data CRC register to all ones and the complementing of the register before transmission prevent the Extended Data CRC from having a value of zero if the covered field is all zeros. Annex G describes the implementation of the CRC algorithms in software. [Insert new Clause G.3 and subclauses, p. 808] G.3 Calculation of the Extended Data CRC The equivalence of hardware and software methods for calculating CRCs is demonstrated by the examples shown previously in Clauses G.1 and G.2. There are numerous open source examples of CRC algorithms available, including A Painless Guide to CRC Error Detection Algorithms. It describes a library that can implement arbitrary CRC systems based on input parameters such as CRC length, polynomial, initial value, shift direction (based on the transmission order of the underlying data link), etc. 17

A typical open source example may be found in RFC 1171, which fixes these parameters to implement the CRC-16- CCITT. The example below is equivalent to the sample implementation shown in Clause G.2.1, but the code is somewhat more transparent. Here the coefficients of the polynomial are represented in reverse order (X 0 is represented by the most-significant bit in crcvalue, X 15 is represented by the least-significant bit, and X 16 is omitted). The algorithm is simply to XOR each data bit in turn (from least- to most-significant) with the output bit (X 16 ) of the CRC shift register. If the result is X 01, then shift the CRC value and XOR it with the polynomial coefficients (to accumulate the feedback), otherwise simply shift the CRC value. /* Accumulate "datavalue" into the CRC in "crcvalue". * Return value is updated CRC. * * Assumes that "unsigned char" is equivalent to one octet. * Assumes that "unsigned short" is 16 bits. * The ^ operator means exclusive OR. * * Derived from RFC 1171. */ unsigned short CalcDataCRC(unsigned char datavalue, unsigned short crcvalue) { unsigned char data; unsigned short crc; unsigned int b; } data = datavalue; crc = crcvalue; for (b = 0; b < 8; b++) { if ((data & 1) ^ (crc & 1)) { crc >>= 1; crc ^= 0x8408; /* CRC-16-CCITT polynomial, 1 + x**5 + x**12 (+ x**16) */ } else { crc >>= 1; } data >>= 1; } return crc; G.3.1 Sample Implementation of the Extended Data CRC in C An example C language implementation for the CRC-32K (Koopman) polynomial is shown below. Inputs are the octet to be processed and the accumulated CRC value. The function return value is the updated CRC. Note that Koopman publishes his CRC polynomial representations in X 32 X 1 order (X 0 can be omitted because it is always equal to X 01 ). The polynomial specified in subclause 9.6 is represented in his notation as X BA0DC66B. When this is reversed and represented in X 0 X 31 order (X 32 can be omitted because it is always equal to X 01 ), the polynomial representation becomes X EB31D82E. /* Accumulate "datavalue" into the CRC in "crcvalue". * Return value is updated CRC. * * Assumes that "unsigned char" is equivalent to one octet. * Assumes that "unsigned long" is 32 bits. * The ^ operator means exclusive OR. */ unsigned long CalcExtendedDataCRC(unsigned char datavalue, unsigned long crcvalue) { unsigned char data; 18

} unsigned long crc; unsigned int b; data = datavalue; crc = crcvalue; for (b = 0; b < 8; b++) { if ((data & 1) ^ (crc & 1)) { crc >>= 1; crc ^= 0xEB31D82E; /* CRC-32K polynomial, 1 + x**1 + + x**30 (+ x**32) */ } else { crc >>= 1; } data >>= 1; } return crc; In operation, the extended data CRC register C31-C0 is initialized to all ones. During transmission, the Data are passed through the calculation before transmission. The one's complement of the final extended data CRC register value is then transmitted with the least significant octet first (i.e. in right to left order). At the receiving end, all the data octets, including the received extended data CRC octets, are passed through the calculation. If all the octets are received correctly, then the final value of the receiver s extended data CRC register (termed the residue ) will be the constant X 0843323B. NOTE: correct residue for a given polynomial can be determined by passing a string of zeros equal in the length to the size of the CRC register through the calculation. 0000 1000 0100 0011 0011 0010 0011 1011 <- 0 -><- 8 -><- 4 -><- 3 -><- 3 -><- 2 -><- 3 -><- B -> As an example of usage, consider a data sequence X 01, X 22, X 30: Description Value Extended Data CRC after octet is processed X FFFFFFFF (initial value) first data octet X 01 X 56381747 second data octet X 22 X 12557D20 third data octet X 30 X 83DD5A41 (one's complement is X 7C22A5BE ) CRC1 (least significant octet) X BE X C0D1F128 CRC2 X A5 X 1C708944 CRC3 X 22 X 7FC2C8BD CRC4 (most significant octet) X 7F X 0843323B Thus, the transmitter would calculate the extended data CRC on the three octets X 01, X 22, X 30 to be X 83DD5A41. The ones complement of this is X 7C22A5BE, which is appended to the frame least significant octet first as X BE, X A5, X 22, X 7F. The receiver would calculate the extended data CRC on the seven octets X 01, X 22, X 30, X BE, X A5, X 22, and X 7F to be X 0843323B, which is the expected result for a correctly received frame. G.3.2 Sample Implementation of the Extended Data CRC in Assembly Language One way to generate an efficient assembly language implementation of the Extended Data CRC function is to crosscompile the C example above for a given target processor, examine the assembly language listing, and hand optimize register usage, etc. As an example, the assembly language implementation of the Extended Data CRC for the Atmel 8-bit AVR instruction set is presented below. The output of the gcc compiler is more than 60 instructions, but the example below is less than half that number. The AVR calling conventions are observed, and all modified registers are available for use by the compiler. 19

; unsigned long ; CalcCRC32K(unsigned char datavalue, unsigned long crcvalue) ; ; call: ; ; r24 datavalue ; r23-r20 crcvalue (LSB-MSB) ; ; return: ; ; r25-r22 updated crcvalue (LSB-MSB) ; CalcCRC32K: _for: ldi r18, 0x01 ; r18 = constant ONE ldi r19, 0x00 ; for (b = 0; ; Calculate and save result of ((data ^ crc) & 1) mov r25, r24 ; data lsb eor r25, r20 ; ^crc msb and r25, r18 ; crc >>= 1 in either case lsr ror ror ror r23 r22 r21 r20 ; If result of previous calculation was '1', accumulate feedback cp r25, r18 brne _else ; crc ^= 0xEB31D82E; CRC-32K polynomial, 1 + x**1 + + x**30 (+ x**32) ldi eor ldi eor ldi eor ldi eor r25, 0xEB r23, r25 r25, 0x31 r22, r25 r25, 0xD8 r21, r25 r25, 0x2E r20, r25 _else: ; data >>= 1; lsr r24 add r19, r18 ; b++; cpi r19, 0x08 brlt _for ; b < 8; movw r24,r22 ; copy 32-bit return value to r25-r22 20

movw ret r22,r20 G.3.3 Parallel Implementation of the Extended Data CRC Other implementations of the Extended Data CRC algorithm are possible. It can be seen that the new Extended Data CRC value may be factored into the exclusive OR of two terms. One term is the most significant octet of the prior Extended Data CRC value. The other term is a function of the least significant octet of the prior Extended Data CRC exclusive OR ed with the data value. A lookup table with 256 elements may be used to quickly determine the value of the second term, using the least significant octet of the prior Extended Data CRC exclusive OR ed with the data value as an index. This term may then be exclusive OR ed with the most significant octet of the prior Extended Data CRC value to form the new Extended Data CRC value. The contents of the table may be computed using an implementation similar to the one shown in Clause G.3.1. A sample implementation appears below. CreateCRC32Table() { unsigned int data; unsigned long crc; unsigned int b; } printf( "static const unsigned long CRC32Table[256] = {" ); for (data = 0; ; ) { if (data % 8 == 0) printf("\n"); crc = data & 0xFF; for (b = 0; b < 8; b++) { if (crc & 1) { crc >>= 1; crc ^= 0xEB31D82E; } else { crc >>= 1; } } printf( "0x%08lX", crc ); if (++data == 256) break; printf( ", " ); } printf( "\n};\n" ); /* Update running "crcvalue" with "datavalue" * The crcvalue must be initialized to all ones. * * For transmission, the returned value must be complemented and then * sent low-order byte first (i.e., right to left). * * On reception, if Data ends with a correct CRC, the returned value * will be 0x0843323B. (0000 1000 0100 0011 0011 0010 0011 1011) */ unsigned long LookupExtendedDataCRC(unsigned char datavalue, unsigned long crcvalue) { crcvalue = CRC32Table[(crcValue ^ datavalue) & 0xFF] ^ (crcvalue >> 8); return (crcvalue); } 21

22