. BACnet: A Data Communication Protocol for Building Automation and Control Networks.......... CS495 Computer Networking Research Project Submitted By: Eric Durant Submitted To: Dr. Henry Welch Date: Wednesday 4 November 1997
. BACnet: A Data Communication Protocol for Building Automation and Control Networks Executive Summary An overview of BACnet (ANSI 1 /ASHRAE 2 Standard 1995-135 3 ) is presented. The protocol, network topology and data object types are examined with a focus on applications. Finally, more detailed applications, including tag management and embedded control system data structures are examined. Introduction BACnet is a four-layer protocol optimized for building automation and control networks. By eliminating the three OSI layers that do not provide significant benefits to typical building applications, the protocol is simplified and overhead greatly reduced. BACnet is compatible with many existing physical standards, such as Ethernet, ARCNET and EIA-232. Low standard data rates (9600 b/s) emphasize that BACnet is a reliable and robust protocol optimized for small messages. BACnet also defines several standard data object types, using the member-class relationship as the basis of its extensible conceptual data model. 1 American National Standards Institute 2 American Society of Heating, Refrigerating and Air-conditioning Engineers, Inc. 3 Approved 19 December 1995, ISSN 1041-2336.
Protocol Architecture Due to the importance of modularity and division of function, BACnet is based on the sevenlayer OSI model. Emphasizing efficient, lightweight communication and optimized for small networks, small internetworks and short messages (such as an analog input from a field device), though, BACnet eliminates the transport, session and presentation layers (layers four through six) of the OSI model. Since BACnet is a connectionless protocol, the need for message segmentation and end-toend error checking is much less than in a connection-based protocol. Thus, the overhead of a discrete transport layer is not justified and the functions normally in a transport layer are delegated to the application layer. Likewise, since BACnet is connectionless, a session layer is not needed. Further, since BACnet uses a fixed encoding scheme and offloads security to the application layer, a separate presentation layer is not needed. BACnet Layers BACnet Application Layer Equivalent OSI Layers Application This leaves four of the seven OSI BACnet Network Layer Network layers in the BACnet architecture: ISO 8802-2 (IEEE 802.2) Type 1 MS/TP PTP Data Link physical, data link, network and ISO 8802-3 (IEEE 802.3) ARCNET EIA - 485 EIA - 232 LonTalk Physical application (see Figure 1). These are discussed below. [adapted from Fig 4-2, p10 of ASHRAE Standard 135-1995.] Figure 1: BACnet Collapsed Architecture Physical and Data Link Layers BACnet provides five options encompassing the physical layer and data link layers. The physical layer defines the electrical and signal carrying capabilities of the medium, while the data link layer regulates medium access and packetizes data for the underlying physical medium. The five options supported by BACnet follow are illustrated in Figure 1. Network Layer BACnet greatly simplifies the routing problem by declaring that there is exactly one path between any two active nodes in the network. BACnet supports internetworking, and so 2
provides for local to global address translation, network translation, packet slicing and sequencing. Application Layer The application layer provides applications access to BACnet data types, which are discussed in greater detail below in Object Types (Defined and Extensible). Network Topology To support the widest variety of existing networks, BACnet supports four LAN architectures, and both serial and dial-up asynchronous serial communications. In BACnet, repeaters connect physical segments on the same physical layer to form logical BACnet segments. Logical segments are connected by bridges to form networks. Networks are connected by routers (or two half routers for point to point communications) to form a BACnet internetwork. Object Types (Defined and Extensible) BACnet uses an object metaphor to access data in field devices connected to network nodes. Several object types are defined (binary and analog values as inputs, outputs and software values, devices, control loops, schedules, commands, files, etc.) with rich, strongly-typed attributes. Being object-oriented, the majority of these types represent domain objects, encapsulating their behavior (PID control, reliability range of sensors, engineering units, etc.). Further, containership is implemented in the model, allowing constructs such as devices and schedules. It is the responsibility of the field device interface to translate between the field device data format and the BACnet data format. Additionally, BACnet supports an event model, whereby devices can indicate that they have gone out of range, for example, triggering error-handling logic. A variety of the BACnet object types are discussed below. 3
Binary Input The binary input object type, representing a Boolean value input from a field device, is quite robust in BACnet, having a total of 24 attributes. In addition to a unique identifier, type identifier and assigned name, a binary input object holds the present input value, the physical value, the physical to logical mapping, various status and reliability flags, time stamps for change of state and counter reset and descriptions of both active and inactive states. Many of these attributes are optional, but even if all the optional attributes are omitted, eight attributes remain. All attributes are readable, per the specification. Certain elements may also be writable, at the option of the designer. Given the rich attributes of a binary input, several status flags are maintained. These allow concise querying of the object for various conditions, including alarm state, fault state, override state, and out of service state. The descriptions of active and inactive states, stored as strings, allow documentation to be kept with the device, achieving encapsulation in a physical system and supporting enhanced diagnostics. Analog Output The analog output object type, representing a continuous value fed to a field device (such as pressure to a pneumatic actuator), has 26 attributes, of which 16 are optional. Per the specification, only the output value, which is stored as a real number, must be writable. Other attributes may be writable depending on the implementation. The attributes are similar to those of a binary input, but the analog output includes a reliability range, resolution, and bipolar alarm limits. Another useful attribute of the analog output is a reliability enumeration type. This attribute may indicate no fault, open loop, shorted loop, no output, or other unreliable state. This support for error conditions in the low level data structures encourages their use and provides a standard way of registering errors, aiding error handling and documentation. 4
Device There is a one-to-one correspondence between a device object and a BACnet Device 4. The device object contains various domain attributes, such as vendor name, model name, firmware revision, software version and physical location. It also encapsulates a day/date clock and network interaction parameters (retry limit, timeout, etc.) for the device. The device also contains an array of object identifiers, allowing the device to own more primitive objects, such as its analog and digital I/O. Also provided is an introspection architecture, where the device can tell a client which protocols and services it supports. The device object can support 56-bit DES encryption, preventing tampering on unsecured networks. Loop The loop object encapsulates a PID-type feedback control loop. It contains object identifiers for its process variable (analog output or manipulated variable), controlled variable (analog input) and setpoint (analog value). Detailed support is provided for engineering units for each of the P, I and D constants. Additionally, bias settings and alarm events are specified in the object type. Command A command object differs from most of the other data types specified by BACnet in that it focuses on a process or method, not a state or attribute. A command object provides nonqueued primitive 5 transaction support. A command is triggered by writing a command value (perhaps an enumeration type) to its present value attribute. The command object contains an array of actions and corresponding textual descriptions. In addition, a flag in the command object indicates the completion and error status of the last operation. This is an ideal construct for event handling and encapsulation of higher level behavior (analogous to stored procedures in database terminology). 5
Applications Although BACnet s object model was designed with HVAC&R 6 in mind, great efforts were made to make the model general and extensible so as to promote use in other domains. While other building systems (such as fire, security, lighting and access control) and industrial control systems are perhaps the most obvious additional application areas for BACnet, any SCADA 7 system or embedded control system can benefit from elements of the BACnet architecture and data model. The Tag Problem By tightly coupling attributes with their description and supporting hierarchical containership, BACnet provides a tool to address the tag management problem, which often occurs, for example, in PLC systems. For example, instead of only being able to associate short descriptions and no behavior with physical addresses such as F22:3 and F31:7, the BACnet model provides more robust primitives and the concept of device, allowing semantics to flow naturally from syntax. Parallels to Senior Design Object Architecture In the author s senior design project 8, data structures were used to represent external power supplies and their capabilities. In this embedded control system, custom data structures were also used to maintain system state and error status. Although the high digital control bandwidth requirements of this project were not amenable to BACnet s protocol architecture, the BACnet data model would have provided insight to the data-modeling problem. Especially helpful would have been the concepts of a device containing primitives, control objects and primitives raising alarm events. Instead of developing these data models from 4 A BACnet device is defined as any device, real or virtual, that supports digital communication using the BACnet protocol. 5 that is, roll-back is not supported in the reference object model 6 Heating, Ventilating, Air Conditioning and Refrigeration 7 Supervisory Control And Data Acquisition 6
scratch, the BACnet data model could have been scaled down and customized to meet the needs of the embedded control application. Summary BACnet defines a protocol, network topology and object metamodel optimized for reliable and brief object messaging on a LAN. Based on OSI and OOA principles, BACnet is readily extended to many domains outside of the building automation and control networks for which it was originally intended, such as other tag management applications and embedded control. In many of these applications, a specific part of BACnet can be applied with great benefit, while other needs are better served by different technologies. 8 Push-Button Power, a digitally controlled laboratory power supply with embedded measurement see http://www.msoe.edu/~durante/seed/ for more information 7