draft-ietf-6lo-6lobac-04.txt   draft-ietf-6lo-6lobac-05.txt 
6Lo Working Group K. Lynn, Ed. 6Lo Working Group K. Lynn, Ed.
Internet-Draft Verizon Labs Internet-Draft Verizon Labs
Intended status: Standards Track J. Martocci Intended status: Standards Track J. Martocci
Expires: August 25, 2016 Johnson Controls Expires: December 18, 2016 Johnson Controls
C. Neilson C. Neilson
Delta Controls Delta Controls
S. Donaldson S. Donaldson
Honeywell Honeywell
February 22, 2016 June 16, 2016
Transmission of IPv6 over MS/TP Networks Transmission of IPv6 over MS/TP Networks
draft-ietf-6lo-6lobac-04 draft-ietf-6lo-6lobac-05
Abstract Abstract
Master-Slave/Token-Passing (MS/TP) is a medium access control method Master-Slave/Token-Passing (MS/TP) is a medium access control method
for the RS-485 physical layer, which is used extensively in building for the RS-485 physical layer, which is used extensively in building
automation networks. This specification defines the frame format for automation networks. This specification defines the frame format for
transmission of IPv6 packets and the method of forming link-local and transmission of IPv6 packets and the method of forming link-local and
statelessly autoconfigured IPv6 addresses on MS/TP networks. statelessly autoconfigured IPv6 addresses on MS/TP networks.
Status of This Memo Status of This Memo
skipping to change at page 1, line 39 skipping to change at page 1, line 39
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on August 25, 2016. This Internet-Draft will expire on December 18, 2016.
Copyright Notice Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 28 skipping to change at page 2, line 28
7. IPv6 Link Local Address . . . . . . . . . . . . . . . . . . . 8 7. IPv6 Link Local Address . . . . . . . . . . . . . . . . . . . 8
8. Unicast Address Mapping . . . . . . . . . . . . . . . . . . . 9 8. Unicast Address Mapping . . . . . . . . . . . . . . . . . . . 9
9. Multicast Address Mapping . . . . . . . . . . . . . . . . . . 9 9. Multicast Address Mapping . . . . . . . . . . . . . . . . . . 9
10. Header Compression . . . . . . . . . . . . . . . . . . . . . 10 10. Header Compression . . . . . . . . . . . . . . . . . . . . . 10
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10
12. Security Considerations . . . . . . . . . . . . . . . . . . . 10 12. Security Considerations . . . . . . . . . . . . . . . . . . . 10
13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 11 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 11
14. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 11
Appendix A. Abstract MAC Interface . . . . . . . . . . . . . . . 13 Appendix A. Abstract MAC Interface . . . . . . . . . . . . . . . 13
Appendix B. Consistent Overhead Byte Stuffing [COBS] . . . . . . 16 Appendix B. Consistent Overhead Byte Stuffing [COBS] . . . . . . 16
Appendix C. Encoded CRC-32K [CRC32K] . . . . . . . . . . . . . . 20 Appendix C. Encoded CRC-32K [CRC32K] . . . . . . . . . . . . . . 19
Appendix D. Example 6LoBAC Packet Decode . . . . . . . . . . . . 22 Appendix D. Example 6LoBAC Packet Decode . . . . . . . . . . . . 21
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26
1. Introduction 1. Introduction
Master-Slave/Token-Passing (MS/TP) is a medium access control (MAC) Master-Slave/Token-Passing (MS/TP) is a medium access control (MAC)
protocol for the RS-485 [TIA-485-A] physical layer, which is used protocol for the RS-485 [TIA-485-A] physical layer, which is used
extensively in building automation networks. This specification extensively in building automation networks. This specification
defines the frame format for transmission of IPv6 [RFC2460] packets defines the frame format for transmission of IPv6 [RFC2460] packets
and the method of forming link-local and statelessly autoconfigured and the method of forming link-local and statelessly autoconfigured
IPv6 addresses on MS/TP networks. The general approach is to adapt IPv6 addresses on MS/TP networks. The general approach is to adapt
elements of the 6LoWPAN specifications [RFC4944], [RFC6282], and elements of the 6LoWPAN specifications [RFC4944], [RFC6282], and
[RFC6775] to constrained wired networks. [RFC6775] to constrained wired networks.
An MS/TP device is typically based on a low-cost microcontroller with An MS/TP device is typically based on a low-cost microcontroller with
limited processing power and memory. Together with low data rates limited processing power and memory. Together with low data rates
and a small MAC address space, these constraints are similar to those and a small MAC address space, these constraints are similar to those
faced in 6LoWPAN networks and suggest some elements of that solution faced in 6LoWPAN networks and suggest some elements of that solution
might be leveraged. MS/TP differs significantly from 6LoWPAN in at might be leveraged. MS/TP differs significantly from 6LoWPAN in at
least three respects: a) MS/TP devices typically have a continuous least three respects: a) MS/TP devices typically have a continuous
source of power, b) all MS/TP devices on a segment can communicate source of power, b) all MS/TP devices on a segment can communicate
directly so there are no hidden node or mesh routing issues, and c) directly so there are no hidden node or mesh routing issues, and c)
recent changes to MS/TP provide support for large payloads, recent changes to MS/TP provide support for larger payloads,
eliminating the need for fragmentation and reassembly below IPv6. eliminating the need for fragmentation and reassembly below IPv6.
The following sections provide a brief overview of MS/TP, then The following sections provide a brief overview of MS/TP, then
describe how to form IPv6 addresses and encapsulate IPv6 packets in describe how to form IPv6 addresses and encapsulate IPv6 packets in
MS/TP frames. This document also specifies a header compression MS/TP frames. This document also specifies a header compression
mechanism, based on [RFC6282], that is REQUIRED in order to reduce mechanism, based on [RFC6282], that is REQUIRED in order to reduce
latency and make IPv6 practical on MS/TP networks. latency and make IPv6 practical on MS/TP networks.
1.1. Requirements Language 1.1. Requirements Language
skipping to change at page 3, line 45 skipping to change at page 3, line 45
1.3. MS/TP Overview 1.3. MS/TP Overview
This section provides a brief overview of MS/TP, which is specified This section provides a brief overview of MS/TP, which is specified
in ANSI/ASHRAE 135-2012 (BACnet) Clause 9 [Clause9] and included in ANSI/ASHRAE 135-2012 (BACnet) Clause 9 [Clause9] and included
herein by reference. BACnet [Clause9] also covers physical layer herein by reference. BACnet [Clause9] also covers physical layer
deployment options. deployment options.
MS/TP is designed to enable multidrop networks over shielded twisted MS/TP is designed to enable multidrop networks over shielded twisted
pair wiring. It can support network segments up to 1000 meters in pair wiring. It can support network segments up to 1000 meters in
length at a data rate of 115,200 baud, or segments up to 1200 meters length at a data rate of 115,200 bit/s, or segments up to 1200 meters
in length at lower baud rates. An MS/TP link requires only a UART, in length at lower bit rates. An MS/TP link requires only a UART, an
an RS-485 [TIA-485-A] transceiver with a driver that can be disabled, RS-485 [TIA-485-A] transceiver with a driver that can be disabled,
and a 5ms resolution timer. These features make MS/TP a cost- and a 5 ms resolution timer. These features make MS/TP a cost-
effective field bus for the most numerous and least expensive devices effective field bus for the most numerous and least expensive devices
in a building automation network. in a building automation network.
The differential signaling used by [TIA-485-A] requires a contention- The differential signaling used by [TIA-485-A] requires a contention-
free MAC. MS/TP uses a token to control access to a multidrop bus. free MAC. MS/TP uses a token to control access to a multidrop bus.
A master node may initiate the transmission of a data frame when it A master node may initiate the transmission of a data frame when it
holds the token. After sending at most a configured maximum number holds the token. After sending at most a configured maximum number
of data frames, a master node passes the token to the next master of data frames, a master node passes the token to the next master
node (as determined by MAC address). Slave nodes do not support the node (as determined by MAC address). If present on the link, legacy
frame format required to convey IPv6 over MS/TP and therefore SHALL MS/TP implementations (including all slave nodes) ignore the frame
NOT be considered part of this specification. format defined in this specification.
MS/TP COBS-encoded* frames have the following format: BACnet Addendum 135-2012an [Addendum_an] defines a range of Frame
Type values to designate frames that contain larger data and data CRC
fields, encoded using Consistent Overhead Byte Stuffing [COBS] (see
Appendix B). The purpose of COBS encoding is to eliminate preamble
sequences from the Encoded Data and Encoded CRC-32K fields. The
maximum length of an MSDU as defined by this specification is 1500
octets (before encoding). The Encoded Data is covered by a 32-bit
CRC [CRC32K] (see Appendix C). The CRC-32K is then COBS encoded.
MS/TP COBS-encoded frames have the following format:
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x55 | 0xFF | Frame Type* | DA | | 0x55 | 0xFF | Frame Type | DA |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SA | Length (MS octet first) | Header CRC | | SA | Length (MS octet first) | Header CRC |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. . . .
. Encoded Data* (2 - 1506 octets) . . Encoded Data (2 - 1506 octets) .
. . . .
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | Encoded CRC-32K* (5 octets) | | | Encoded CRC-32K (5 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
| | optional 0xFF | | | optional 0xFF |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: MS/TP COBS-Encoded Frame Format Figure 1: MS/TP COBS-Encoded Frame Format
*NOTE: BACnet Addendum 135-2012an [Addendum_an] defines a range of
Frame Type values to designate frames that contain data and data CRC
fields encoded using Consistent Overhead Byte Stuffing [COBS] (see
Appendix B). The purpose of COBS encoding is to eliminate preamble
sequences from the Encoded Data and Encoded CRC-32K fields. The
maximum length of an MSDU as defined by this specification is 1500
octets (before encoding). The Encoded Data is covered by a 32-bit
CRC [CRC32K] (see Appendix C), which is itself then COBS encoded.
MS/TP COBS-encoded frame fields have the following descriptions: MS/TP COBS-encoded frame fields have the following descriptions:
Preamble two octet preamble: 0x55, 0xFF Preamble two octet preamble: 0x55, 0xFF
Frame Type one octet Frame Type one octet
Destination Address one octet address Destination Address one octet address
Source Address one octet address Source Address one octet address
Length two octets, most significant octet first Length two octets, most significant octet first
Header CRC one octet Header CRC one octet
Encoded Data 2 - 1506 octets (see Appendix B) Encoded Data 2 - 1506 octets (see Appendix B)
Encoded CRC-32K five octets (see Appendix C) Encoded CRC-32K five octets (see Appendix C)
skipping to change at page 5, line 33 skipping to change at page 5, line 33
Frame Types 8 - 31 and 35 - 127 are reserved for assignment by Frame Types 8 - 31 and 35 - 127 are reserved for assignment by
ASHRAE. Frame Types 32 - 127 designate COBS-encoded frames and MUST ASHRAE. Frame Types 32 - 127 designate COBS-encoded frames and MUST
convey Encoded Data and Encoded CRC-32K fields. All master nodes convey Encoded Data and Encoded CRC-32K fields. All master nodes
MUST understand Token, Poll For Master, and Reply to Poll For Master MUST understand Token, Poll For Master, and Reply to Poll For Master
control frames. See Section 2 for additional details. control frames. See Section 2 for additional details.
The Destination and Source Addresses are each one octet in length. The Destination and Source Addresses are each one octet in length.
See Section 3 for additional details. See Section 3 for additional details.
For COBS-encoded frames, the Length field specifies the combined For COBS-encoded frames, the Length field indicates the size of the
length of the [COBS] Encoded Data and Encoded CRC-32K fields in [COBS] Encoded Data field in octets, plus three. (This adjustment is
octets, minus two. (This adjustment is required for backward required in order for legacy MS/TP devices to ignore COBS-encoded
compatibility with legacy MS/TP devices.) See Section 4 and frames.) See Section 4 and Appendices for additional details.
Appendices for additional details.
The Header CRC field covers the Frame Type, Destination Address, The Header CRC field covers the Frame Type, Destination Address,
Source Address, and Length fields. The Header CRC generation and Source Address, and Length fields. The Header CRC generation and
check procedures are specified in BACnet [Clause9]. check procedures are specified in BACnet [Clause9].
1.4. Goals and Constraints 1.4. Goals and Constraints
The primary goal of this specification is to enable IPv6 directly on The primary goal of this specification is to enable IPv6 directly on
wired end devices in building automation and control networks by wired end devices in building automation and control networks by
leveraging existing standards to the greatest extent possible. A leveraging existing standards to the greatest extent possible. A
secondary goal is to co-exist with legacy MS/TP implementations. secondary goal is to co-exist with legacy MS/TP implementations.
Only the minimum changes necessary to support IPv6 over MS/TP were Only the minimum changes necessary to support IPv6 over MS/TP were
specified in BACnet [Addendum_an] (see Note in Section 1.3). specified in BACnet [Addendum_an] (see Section 1.3).
In order to co-exist with legacy devices, no changes are permitted to In order to co-exist with legacy devices, no changes are permitted to
the MS/TP addressing modes, frame header format, control frames, or the MS/TP addressing modes, frame header format, control frames, or
Master Node state machine as specified in BACnet [Clause9]. Master Node state machine as specified in BACnet [Clause9].
2. MS/TP Mode for IPv6 2. MS/TP Mode for IPv6
ASHRAE has assigned an MS/TP Frame Type value of 34 to indicate IPv6 ASHRAE has assigned an MS/TP Frame Type value of 34 to indicate IPv6
over MS/TP (LoBAC) Encapsulation. This falls within the range of over MS/TP (LoBAC) Encapsulation. This falls within the range of
values that designate COBS-encoded data frames. values that designate COBS-encoded data frames.
All MS/TP master nodes (including those that support IPv6) must All MS/TP master nodes (including those that support IPv6) must
understand Token, Poll For Master, and Reply to Poll For Master implement the Master Node state machine specified in BACnet [Clause9]
control frames and support the Master Node state machine as specified and handle Token, Poll For Master, and Reply to Poll For Master
in BACnet [Clause9]. MS/TP master nodes that support IPv6 must also control frames. MS/TP master nodes that support IPv6 must also
support the Receive Frame state machine as specified in [Clause9] and implement the Receive Frame state machine specified in [Clause9] as
extended by BACnet [Addendum_an]. extended by BACnet [Addendum_an].
All MS/TP nodes that support IPv6 MUST support a data rate of 115,200 All MS/TP nodes that support IPv6 MUST support a data rate of 115,200
baud and MAY optionally support lower data rates as defined in BACnet bit/s and MAY optionally support lower data rates as defined in
[Clause9]. BACnet [Clause9].
3. Addressing Modes 3. Addressing Modes
MS/TP node (MAC) addresses are one octet in length. The method of MS/TP node (MAC) addresses are one octet in length. The method of
assigning MAC addresses is outside the scope of this specification. assigning MAC addresses is outside the scope of this specification.
However, each MS/TP node on the link MUST have a unique address in However, each MS/TP node on the link MUST have a unique address in
order to ensure correct MAC operation. order to ensure correct MAC operation.
BACnet [Clause9] specifies that addresses 0 through 127 are valid for BACnet [Clause9] specifies that addresses 0 through 127 are valid for
master nodes. The method specified in Section 6 for creating a MAC- master nodes. The method specified in Section 6 for creating a MAC-
layer-derived Interface Identifier (IID) ensures that an IID of all layer-derived Interface Identifier (IID) ensures that an IID of all
zeros can never result. zeros can never result.
A Destination Address of 255 (all nodes) indicates a MAC-layer A Destination Address of 255 (all nodes) indicates a MAC-layer
broadcast. MS/TP does not support multicast, therefore all IPv6 broadcast. MS/TP does not support multicast, therefore all IPv6
multicast packets SHOULD be broadcast at the MAC layer and filtered multicast packets SHOULD be broadcast at the MAC layer and filtered
at the IPv6 layer. A Source Address of 255 MUST NOT be used. at the IPv6 layer. A Source Address of 255 MUST NOT be used.
This specification assumes that at most one unique local and/or Hosts learn IPv6 prefixes via router advertisements according to
global IPv6 prefix is assigned to each MS/TP segment. Hosts learn [RFC4861].
IPv6 prefixes via router advertisements according to [RFC4861].
4. Maximum Transmission Unit (MTU) 4. Maximum Transmission Unit (MTU)
BACnet [Addendum_an] supports MSDUs up to 2032 octets in length. BACnet [Addendum_an] supports MSDUs up to 2032 octets in length.
This specification defines an MSDU length of at least 1280 octets and This specification defines an MSDU length of at least 1280 octets and
at most 1500 octets (before encoding). This is sufficient to convey at most 1500 octets (before encoding). This is sufficient to convey
the minimum MTU required by IPv6 [RFC2460] without the need for link- the minimum MTU required by IPv6 [RFC2460] without the need for link-
layer fragmentation and reassembly. Support for an MSDU length of layer fragmentation and reassembly. Support for an MSDU length of
1500 octets is RECOMMENDED. 1500 octets is RECOMMENDED.
skipping to change at page 7, line 49 skipping to change at page 7, line 47
The Dispatch value may be treated as an unstructured namespace. Only The Dispatch value may be treated as an unstructured namespace. Only
a single pattern is used to represent current LoBAC functionality. a single pattern is used to represent current LoBAC functionality.
Pattern Header Type Pattern Header Type
+------------+-----------------------------------------------------+ +------------+-----------------------------------------------------+
| 01 1xxxxx | LOWPAN_IPHC - LOWPAN_IPHC compressed IPv6 [RFC6282] | | 01 1xxxxx | LOWPAN_IPHC - LOWPAN_IPHC compressed IPv6 [RFC6282] |
+------------+-----------------------------------------------------+ +------------+-----------------------------------------------------+
Figure 3: LoBAC Dispatch Value Bit Pattern Figure 3: LoBAC Dispatch Value Bit Pattern
Other IANA-assigned 6LoWPAN Dispatch values do not apply to this Other IANA-assigned 6LoWPAN Dispatch values do not apply to 6LoBAC
specification. unless otherwise specified.
6. Stateless Address Autoconfiguration 6. Stateless Address Autoconfiguration
This section defines how to obtain an IPv6 Interface Identifier. The This section defines how to obtain an IPv6 Interface Identifier. The
general procedure for creating a MAC-address-derived IID is described general procedure for creating a MAC-address-derived IID is described
in [RFC4291] Appendix A, "Creating Modified EUI-64 Format Interface in [RFC4291] Appendix A, "Creating Modified EUI-64 Format Interface
Identifiers", as updated by [RFC7136]. Identifiers", as updated by [RFC7136].
The IID SHOULD NOT embed an [EUI-64] or any other globally unique The IID SHOULD NOT embed an [EUI-64] or any other globally unique
hardware identifier assigned to a device (see Section 12). hardware identifier assigned to a device (see Section 12).
skipping to change at page 8, line 30 skipping to change at page 8, line 30
|0 1|1 3|3 4|4 6| |0 1|1 3|3 4|4 6|
|0 5|6 1|2 7|8 3| |0 5|6 1|2 7|8 3|
+----------------+----------------+----------------+----------------+ +----------------+----------------+----------------+----------------+
|0000000000000000|0000000011111111|1111111000000000|0000000001001111| |0000000000000000|0000000011111111|1111111000000000|0000000001001111|
+----------------+----------------+----------------+----------------+ +----------------+----------------+----------------+----------------+
This is the RECOMMENDED method of forming an IID for use in link- This is the RECOMMENDED method of forming an IID for use in link-
local addresses, as it affords the most efficient header compression local addresses, as it affords the most efficient header compression
provided by the LOWPAN_IPHC [RFC6282] format specified in Section 10. provided by the LOWPAN_IPHC [RFC6282] format specified in Section 10.
A 64-bit privacy IID is RECOMMENDED for routable addresses and SHOULD A 64-bit privacy IID is RECOMMENDED for each forwardable address and
be locally generated according to one of the methods cited in SHOULD be locally generated according to one of the methods cited in
Section 12. A node that generates a 64-bit privacy IID MUST register Section 12. A node that generates a 64-bit privacy IID MUST register
it with its local router(s) by sending a Neighbor Solicitation (NS) it with its local router(s) by sending a Neighbor Solicitation (NS)
message with the Address Registration Option (ARO) and process message with the Address Registration Option (ARO) and process
Neighbor Advertisements (NA) according to [RFC6775]. Neighbor Advertisements (NA) according to [RFC6775].
An IPv6 address prefix used for stateless autoconfiguration [RFC4862] An IPv6 address prefix used for stateless autoconfiguration [RFC4862]
of an MS/TP interface MUST have a length of 64 bits. of an MS/TP interface MUST have a length of 64 bits.
7. IPv6 Link Local Address 7. IPv6 Link Local Address
skipping to change at page 10, line 28 skipping to change at page 10, line 28
When a 16-bit address is called for (i.e., an IEEE 802.15.4 "short When a 16-bit address is called for (i.e., an IEEE 802.15.4 "short
address") it MUST be formed by padding the MS/TP address to the left address") it MUST be formed by padding the MS/TP address to the left
with a zero: with a zero:
0 1 0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x00 | MS/TP address | | 0x00 | MS/TP address |
+-+-+-+-+-+-+-+-+---------------+ +-+-+-+-+-+-+-+-+---------------+
If LOWPAN_IPHC compression [RFC6282] is used with context, the border If LOWPAN_IPHC compression [RFC6282] is used with context, the
router(s) directly attached to the MS/TP segment MUST disseminate the router(s) directly attached to the MS/TP segment MUST disseminate the
6LoWPAN Context Option (6CO) according to [RFC6775], Section 7.2. 6LoWPAN Context Option (6CO) according to [RFC6775], Section 7.2.
11. IANA Considerations 11. IANA Considerations
This document uses values previously reserved by [RFC4944] and This document uses values previously reserved by [RFC4944] and
[RFC6282] and makes no further requests of IANA. [RFC6282] and makes no further requests of IANA.
Note to RFC Editor: this section may be removed upon publication. Note to RFC Editor: this section may be removed upon publication.
12. Security Considerations 12. Security Considerations
Routable addresses that contain IIDs generated using MS/TP node Forwardable addresses that contain IIDs generated using MS/TP node
addresses may expose a network to address scanning attacks. For this addresses may expose a network to address scanning attacks. For this
reason, it is RECOMMENDED that a different (but stable) IID be reason, it is RECOMMENDED that a different (but stable) IID be
generated for each routable address in use according to, for example, generated for each forwardable address in use according to, for
[RFC3315], [RFC3972], [RFC4941], [RFC5535], or [RFC7217]. example, [RFC3315], [RFC3972], [RFC4941], [RFC5535], or [RFC7217].
MS/TP networks are by definition wired and not susceptible to to MS/TP networks are by definition wired and not susceptible to casual
casual eavesdropping. By the same token, MS/TP nodes are stationary eavesdropping. By the same token, MS/TP nodes are stationary and
and correlation of activities or location tracking of individuals is correlation of activities or location tracking of individuals is
unlikely. unlikely.
13. Acknowledgments 13. Acknowledgments
We are grateful to the authors of [RFC4944] and members of the IETF We are grateful to the authors of [RFC4944] and members of the IETF
6LoWPAN working group; this document borrows liberally from their 6LoWPAN working group; this document borrows liberally from their
work. Ralph Droms and Brian Haberman provided indispensable guidance work. Ralph Droms and Brian Haberman provided indispensable guidance
and support from the outset. Peter van der Stok, James Woodyatt, and and support from the outset. Peter van der Stok, James Woodyatt, and
Carsten Bormann provided detailed reviews. Stuart Cheshire invented Carsten Bormann provided detailed reviews. Stuart Cheshire invented
the very clever COBS encoding. Michael Osborne made the critical the very clever COBS encoding. Michael Osborne made the critical
observation that seperately encoding the data and CRC32K fields would observation that separately encoding the data and CRC32K fields would
allow the CRC to be calculated on-the-fly. Alexandru Petrescu, Brian allow the CRC to be calculated on-the-fly. Alexandru Petrescu, Brian
Frank, Geoff Mulligan, and Don Sturek offered valuable comments. Frank, Geoff Mulligan, and Don Sturek offered valuable comments.
14. References 14. References
14.1. Normative References 14.1. Normative References
[Addendum_an] [Addendum_an]
ASHRAE, "ANSI/ASHRAE Addenda an, at, au, av, aw, ax, and ASHRAE, "ANSI/ASHRAE Addenda an, at, au, av, aw, ax, and
az to ANSI/ASHRAE Standard 135-2012, BACnet - A Data az to ANSI/ASHRAE Standard 135-2012, BACnet - A Data
skipping to change at page 13, line 52 skipping to change at page 13, line 52
[TIA-485-A] [TIA-485-A]
Telecommunications Industry Association, "TIA-485-A, Telecommunications Industry Association, "TIA-485-A,
Electrical Characteristics of Generators and Receivers for Electrical Characteristics of Generators and Receivers for
Use in Balanced Digital Multipoint Systems (ANSI/TIA/EIA- Use in Balanced Digital Multipoint Systems (ANSI/TIA/EIA-
485-A-98) (R2003)", March 2003. 485-A-98) (R2003)", March 2003.
Appendix A. Abstract MAC Interface Appendix A. Abstract MAC Interface
This Appendix is informative and not part of the standard. This Appendix is informative and not part of the standard.
BACnet [Clause9] defines support for MAC-layer clients through its BACnet [Clause9] provides support for MAC-layer clients through its
SendFrame and ReceivedDataNoReply procedures. However, it does not SendFrame and ReceivedDataNoReply procedures. However, it does not
define a network-protocol independent abstract interface for the MAC. define a network-protocol independent abstract interface for the MAC.
This is provided below as an aid to implementation. This is provided below as an aid to implementation.
A.1. MA-DATA.request A.1. MA-DATA.request
A.1.1. Function A.1.1. Function
This primitive defines the transfer of data from a MAC client entity This primitive defines the transfer of data from a MAC client entity
to a single peer entity or multiple peer entities in the case of a to a single peer entity or multiple peer entities in the case of a
broadcast address. broadcast address.
A.1.2. Semantics of the Service Primitive A.1.2. Semantics of the Service Primitive
The semantics of the primitive are as follows: The semantics of the primitive are as follows:
MA-DATA.request ( MA-DATA.request (
destination_address, destination_address,
source_address, source_address,
data, data,
priority,
type type
) )
The 'destination_address' parameter may specify either an individual The 'destination_address' parameter may specify either an individual
or a broadcast MAC entity address. It must contain sufficient or a broadcast MAC entity address. It must contain sufficient
information to create the Destination Address field (see Section 1.3) information to create the Destination Address field (see Section 1.3)
that is prepended to the frame by the local MAC sublayer entity. The that is prepended to the frame by the local MAC sublayer entity. The
'source_address' parameter, if present, must specify an individual 'source_address' parameter, if present, must specify an individual
MAC address. If the source_address parameter is omitted, the local MAC address. If the source_address parameter is omitted, the local
MAC sublayer entity will insert a value associated with that entity. MAC sublayer entity will insert a value associated with that entity.
The 'data' parameter specifies the MAC service data unit (MSDU) to be The 'data' parameter specifies the MAC service data unit (MSDU) to be
transferred by the MAC sublayer entity. There is sufficient transferred by the MAC sublayer entity. There is sufficient
information associated with the MSDU for the MAC sublayer entity to information associated with the MSDU for the MAC sublayer entity to
determine the length of the data unit. 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 'type' parameter specifies the value of the MS/TP Frame Type The 'type' parameter specifies the value of the MS/TP Frame Type
field that is prepended to the frame by the local MAC sublayer field that is prepended to the frame by the local MAC sublayer
entity. entity.
A.1.3. When Generated A.1.3. When Generated
This primitive is generated by the MAC client entity whenever data This primitive is generated by the MAC client entity whenever data
shall be transferred to a peer entity or entities. This can be in shall be transferred to a peer entity or entities. This can be in
response to a request from higher protocol layers or from data response to a request from higher protocol layers or from data
generated internally to the MAC client, such as a Token frame. generated internally to the MAC client, such as a Token frame.
skipping to change at page 15, line 36 skipping to change at page 15, line 29
broadcast address. broadcast address.
A.2.2. Semantics of the Service Primitive A.2.2. Semantics of the Service Primitive
The semantics of the primitive are as follows: The semantics of the primitive are as follows:
MA-DATA.indication ( MA-DATA.indication (
destination_address, destination_address,
source_address, source_address,
data, data,
priority,
type type
) )
The 'destination_address' parameter may be either an individual or a The 'destination_address' parameter may be either an individual or a
broadcast address as specified by the Destination Address field of broadcast address as specified by the Destination Address field of
the incoming frame. The 'source_address' parameter is an individual the incoming frame. The 'source_address' parameter is an individual
address as specified by the Source Address field of the incoming address as specified by the Source Address field of the incoming
frame. frame.
The 'data' parameter specifies the MAC service data unit (MSDU) as The 'data' parameter specifies the MAC service data unit (MSDU) as
received by the local MAC entity. There is sufficient information received by the local MAC entity. There is sufficient information
associated with the MSDU for the MAC sublayer client to determine the associated with the MSDU for the MAC sublayer client to determine the
length of the data unit. 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 'type' parameter is the value of the MS/TP Frame Type field of The 'type' parameter is the value of the MS/TP Frame Type field of
the incoming frame. the incoming frame.
A.2.3. When Generated A.2.3. When Generated
The MA_DATA.indication is passed from the MAC sublayer entity to the The MA_DATA.indication is passed from the MAC sublayer entity to the
MAC client entity or entities to indicate the arrival of a frame to MAC client entity or entities to indicate the arrival of a frame to
the local MAC sublayer entity that is destined for the MAC client. the local MAC sublayer entity that is destined for the MAC client.
Such frames are reported only if they are validly formed, received Such frames are reported only if they are validly formed, received
without error, and their destination address designates the local MAC without error, and their destination address designates the local MAC
skipping to change at page 16, line 40 skipping to change at page 16, line 29
cases, this resulted in dropped frames due to loss of frame cases, this resulted in dropped frames due to loss of frame
synchronization. The solution is to encode the Data and 32-bit Data synchronization. The solution is to encode the Data and 32-bit Data
CRC fields before transmission using Consistent Overhead Byte CRC fields before transmission using Consistent Overhead Byte
Stuffing [COBS] and decode these fields upon reception. Stuffing [COBS] and decode these fields upon reception.
COBS is a run-length encoding method that nominally removes '0x00' COBS is a run-length encoding method that nominally removes '0x00'
octets from its input. Any selected octet value may be removed by octets from its input. Any selected octet value may be removed by
XOR'ing that value with each octet of the COBS output. BACnet XOR'ing that value with each octet of the COBS output. BACnet
[Addendum_an] specifies the preamble octet '0x55' for removal. [Addendum_an] specifies the preamble octet '0x55' for removal.
The minimum overhead of COBS is one ectet per encoded field. The The minimum overhead of COBS is one octet per encoded field. The
worst-case overhead in long fields is bounded to one octet in 254, or worst-case overhead in long fields is bounded to one octet per 254,
less than 0.4%, as described in [COBS]. or less than 0.4%, as described in [COBS].
Frame encoding proceeds logically in two passes. The Encoded Data Frame encoding proceeds logically in two passes. The Encoded Data
field is prepared by passing the MSDU through the COBS encoder and field is prepared by passing the MSDU through the COBS encoder and
XOR'ing the preamble octet '0x55' with each octet of the output. The XOR'ing the preamble octet '0x55' with each octet of the output. The
Encoded CRC-32K field is then prepared by calculating a CRC-32K over Encoded CRC-32K field is then prepared by calculating a CRC-32K over
the Encoded Data field and formatting it for transmission as the Encoded Data field and formatting it for transmission as
described in Appendix C. The combined length of these fields, minus described in Appendix C. The combined length of these fields, minus
two octets for compatibility with existing MS/TP devices, is placed two octets for compatibility with existing MS/TP devices, is placed
in the MS/TP header Length field before transmission. in the MS/TP header Length field before transmission.
Example COBS encoder and decoder functions are shown below for Example COBS encoder and decoder functions are shown below for
illustration. Complete examples of use and test vectors are provided illustration. Complete examples of use and test vectors are provided
in BACnet [Addendum_an]. in BACnet [Addendum_an].
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#define CRC32K_INITIAL_VALUE (0xFFFFFFFF)
#define MSTP_PREAMBLE_X55 (0x55)
/* /*
* Encodes 'length' octets of data located at 'from' and * Encodes 'length' octets of data located at 'from' and
* writes one or more COBS code blocks at 'to', removing any * writes one or more COBS code blocks at 'to', removing any
* 'mask' octets that may present be in the encoded data. * 'mask' octets that may present be in the encoded data.
* Returns the length of the encoded data. * Returns the length of the encoded data.
*/ */
size_t size_t
cobs_encode (uint8_t *to, const uint8_t *from, size_t length, cobs_encode (uint8_t *to, const uint8_t *from, size_t length,
uint8_t mask) uint8_t mask)
skipping to change at page 18, line 18 skipping to change at page 18, line 4
* this exception is handled above (and returned length must be * this exception is handled above (and returned length must be
* adjusted). Otherwise, encode the last chunk normally, as if * adjusted). Otherwise, encode the last chunk normally, as if
* a "phantom zero" is appended to the data. * a "phantom zero" is appended to the data.
*/ */
if ((last_code == 255) && (code == 1)) if ((last_code == 255) && (code == 1))
write_index--; write_index--;
else else
to[code_index] = code ^ mask; to[code_index] = code ^ mask;
return write_index; return write_index;
} }
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#define CRC32K_INITIAL_VALUE (0xFFFFFFFF)
#define MSTP_PREAMBLE_X55 (0x55)
/* /*
* Decodes 'length' octets of data located at 'from' and * Decodes 'length' octets of data located at 'from' and
* writes the original client data at 'to', restoring any * writes the original client data at 'to', restoring any
* 'mask' octets that may present in the encoded data. * 'mask' octets that may present in the encoded data.
* Returns the length of the encoded data or zero if error. * Returns the length of the encoded data or zero if error.
*/ */
size_t size_t
cobs_decode (uint8_t *to, const uint8_t *from, size_t length, cobs_decode (uint8_t *to, const uint8_t *from, size_t length,
uint8_t mask) uint8_t mask)
{ {
skipping to change at page 21, line 18 skipping to change at page 20, line 18
#define CRC32K_INITIAL_VALUE (0xFFFFFFFF) #define CRC32K_INITIAL_VALUE (0xFFFFFFFF)
#define CRC32K_RESIDUE (0x0843323B) #define CRC32K_RESIDUE (0x0843323B)
/* CRC-32K polynomial, 1 + x**1 + ... + x**30 (+ x**32) */ /* CRC-32K polynomial, 1 + x**1 + ... + x**30 (+ x**32) */
#define CRC32K_POLY (0xEB31D82E) #define CRC32K_POLY (0xEB31D82E)
/* /*
* Accumulate 'data_value' into the CRC in 'crc_value'. * Accumulate 'data_value' into the CRC in 'crc_value'.
* Return updated CRC. * Return updated CRC.
* *
* Note: crcValue must be set to CRC32K_INITIAL_VALUE * Note: crc_value must be set to CRC32K_INITIAL_VALUE
* before initial call. * before initial call.
*/ */
uint32_t uint32_t
calc_crc32K (uint8_t data_value, uint32_t crc_value) calc_crc32K (uint8_t data_value, uint32_t crc_value)
{ {
int b; int b;
for (b = 0; b < 8; b++) { for (b = 0; b < 8; b++) {
if ((data_value & 1) ^ (crc_value & 1)) { if ((data_value & 1) ^ (crc_value & 1)) {
crc_value >>= 1; crc_value >>= 1;
skipping to change at page 22, line 9 skipping to change at page 21, line 9
} }
data_value >>= 1; data_value >>= 1;
} }
return crc_value; return crc_value;
} }
Appendix D. Example 6LoBAC Packet Decode Appendix D. Example 6LoBAC Packet Decode
This Appendix is informative and not part of the standard. This Appendix is informative and not part of the standard.
No. Time Source Destination
5161 8.816048 aaaa::1 aaaa::ff:fe00:1
Protocol Length Info
ICMPv6 547 Echo (ping) request id=0x2ee5, seq=2,
hop limit=63 (reply in 5165)
Frame 5161: 547 bytes on wire (4376 bits), 547 bytes captured
(4376 bits) on interface 0
Interface id: 0 (/tmp/pipe)
Encapsulation type: BACnet MS/TP (63)
Arrival Time: Sep 3, 2015 19:46:44.377881000 EDT
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1441324004.377881000 seconds
[Time delta from previous captured frame: 0.050715000 seconds]
[Time delta from previous displayed frame: 0.050715000 seconds]
[Time since reference or first frame: 8.816048000 seconds]
Frame Number: 5161
Frame Length: 547 bytes (4376 bits)
Capture Length: 547 bytes (4376 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: mstp:6lowpan:ipv6:ipv6.nxt:icmpv6:data]
[Coloring Rule Name: ICMP]
[Coloring Rule String: icmp || icmpv6]
BACnet MS/TP, Src (2), Dst (1), IPv6 Encapsulation BACnet MS/TP, Src (2), Dst (1), IPv6 Encapsulation
Preamble 55: 0x55 Preamble 55: 0x55
Preamble FF: 0xff Preamble FF: 0xff
Frame Type: IPv6 Encapsulation (34) Frame Type: IPv6 Encapsulation (34)
Destination Address: 1 Destination Address: 1
Source Address: 2 Source Address: 2
Length: 537 Length: 537
Header CRC: 0x1c [correct] Header CRC: 0x1c [correct]
[Good: True]
[Bad: False]
Extended Data CRC: 0x9e7259e2 [correct] Extended Data CRC: 0x9e7259e2 [correct]
6LoWPAN 6LoWPAN
IPHC Header IPHC Header
011. .... = Pattern: IP header compression (0x03) 011. .... = Pattern: IP header compression (0x03)
...1 1... .... .... = Traffic class and flow label: ...1 1... .... .... = Traffic class and flow label:
Version, traffic class, and flow label Version, traffic class, and flow label
compressed (0x0003) compressed (0x0003)
.... .0.. .... .... = Next header: Inline .... .0.. .... .... = Next header: Inline
.... ..00 .... .... = Hop limit: Inline (0x0000) .... ..00 .... .... = Hop limit: Inline (0x0000)
.... .... 1... .... = Context identifier extension: True .... .... 1... .... = Context identifier extension: True
 End of changes. 38 change blocks. 
100 lines changed or deleted 60 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/