6LoWPAN Working Group J. Nieminen, Ed. Internet-Draft B. Patil Intended status: Standards Track T. Savolainen Expires: July 13, 2012 M. Isomaki Nokia Z. Shelby Sensinode C. Gomez Universitat Politecnica de Catalunya/i2CAT January 10, 2012 Transmission of IPv6 Packets over Bluetooth Low Energy draft-ietf-6lowpan-btle-05 Abstract Bluetooth Low Energy is a low power air interface technology defined by the Bluetooth Special Interest Group (BT SIG). The standard Bluetooth radio has been widely implemented and available in mobile phones, notebook computers, audio headsets and many other devices. The low power version of Bluetooth is a new specification and enables the use of this air interface with devices such as sensors, smart meters, appliances, etc. The low power variant of Bluetooth is commonly specified in revision 4.0 of the Bluetooth specifications and commonly refered to as Bluetooth 4.0. This document describes how IPv6 is transported over Bluetooth Low Energy using 6LoWPAN techniques. Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on July 13, 2012. Copyright Notice Nieminen, et al. Expires July 13, 2012 [Page 1] Internet-Draft IPv6 over BT-LE January 2012 Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 2. Bluetooth Low Energy . . . . . . . . . . . . . . . . . . . . . 4 2.1. Bluetooth Low Energy stack . . . . . . . . . . . . . . . . 4 2.2. Link layer roles and topology . . . . . . . . . . . . . . 5 2.3. BT-LE device addressing . . . . . . . . . . . . . . . . . 5 2.4. BT-LE packets sizes and MTU . . . . . . . . . . . . . . . 5 3. Specification of IPv6 over Bluetooth Low Energy . . . . . . . 6 3.1. Protocol stack . . . . . . . . . . . . . . . . . . . . . . 6 3.2. Link model . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2.1. IPv6 Address configuration . . . . . . . . . . . . . . 7 3.2.2. Header compression . . . . . . . . . . . . . . . . . . 8 3.2.3. Unicast and Multicast address mapping . . . . . . . . 9 3.3. Internet connectivity scenarios . . . . . . . . . . . . . 9 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 5. Security Considerations . . . . . . . . . . . . . . . . . . . 10 6. Additional contributors . . . . . . . . . . . . . . . . . . . 10 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 10 8. Normative References . . . . . . . . . . . . . . . . . . . . . 10 Appendix A. Bluetooth Low Energy fragmentation and L2CAP Modes . 11 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 12 Nieminen, et al. Expires July 13, 2012 [Page 2] Internet-Draft IPv6 over BT-LE January 2012 1. Introduction Bluetooth Low Energy (BT-LE) is a radio technology targeted for devices that operate with coin cell batteries or minimalistic power sources, which means that low power consumption is essential. BT-LE is an especially attractive technology for the Internet of Things applications, such as health monitors, environmental sensing, proximity applications and many others. Considering the potential for the exponential growth in the number of sensors and Internet connected devices and things, IPv6 is an ideal protocol due to the large address space it provides. In addition, IPv6 provides tools for autoconfiguration, which is particularly suitable for sensor network applications and nodes which have very limited processing power or a full-fledged operating system. [RFC4944] specifies the transmission of IPv6 over IEEE 802.15.4. The Bluetooth Low Energy link in many respects has similar characteristics to that of IEEE 802.15.4. Many of the mechanisms defined in [RFC4944] can be applied to the transmission of IPv6 on Bluetooth Low Energy links. This document specifies the details of IPv6 transmission over Bluetooth Low Energy links. 1.1. Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. 1.2. Terminology Bluetooth Low Energy Bluetooth Low Energy is a low power air interface technology specified by the Bluetooth Special Interest Group (SIG). BT-LE is specified in Revision 4.0 of the Bluetooth specifications (BT 4.0). Gateway Network element connecting the BT-LE sensors to the Internet. Can be e.g a home gateway or a mobile device. 6LR and 6LBR These terms correspond to those defined in [I-D.ietf-6lowpan-nd] Nieminen, et al. Expires July 13, 2012 [Page 3] Internet-Draft IPv6 over BT-LE January 2012 2. Bluetooth Low Energy BT-LE is designed for transferring small amounts of data infrequently at modest data rates at a very low cost per bit. BT-LE is an integral part of the BT 4.0 specification [BTCorev4.0]. Devices such as mobile phones, notebooks, tablets and other handheld computing devices which include BT 4.0 chipsets also have the low- energy functionality of Bluetooth. BT-LE is also included in many different types of accessories that collaborate with mobile devices such as phones, tablets and notebook computers. An example of a use case for a BT-LE accessory is a heart rate monitor that sends data via the mobile phone to a server on the Internet. 2.1. Bluetooth Low Energy stack The lower layer of the BT-LE stack consists of the Physical (PHY) and the Link Layer (LL). The Physical Layer transmits and receives the actual packets. The Link Layer is responsible for providing medium access, connection establishment, error control and flow control. The upper layer consists of the Logical Link Control and Adaptation Protocol (L2CAP), Generic Attribute protocol (GATT) and Generic Access Profile (GAP) as shown in Figure 1. GATT and BT-LE profiles together enable the creation of applications in a standardized way without using IP. L2CAP provides multiplexing capability by multiplexing the data channels from the above layers. L2CAP also provides fragmentation and reassembly for large data packets. +----------------------------------------+------------------+ | Applications | +----------------------------------------+------------------+ | Generic Attribute Profile | Generic Access | +----------------------------------------+ Profile | | Attribute Protocol |Security Manager | | +--------------------+-------------------+------------------+ | Logical Link Control and Adaptation | +--------------------+-------------------+------------------+ | Host Controller Interface | +--------------------+-------------------+------------------+ | Link Layer | Direct Test Mode | +--------------------+-------------------+------------------+ | Physical Layer | +--------------------+-------------------+------------------+ Figure 1: BT-LE Protocol Stack Nieminen, et al. Expires July 13, 2012 [Page 4] Internet-Draft IPv6 over BT-LE January 2012 2.2. Link layer roles and topology BT-LE defines two Link Layer roles: the Master Role and the Slave Role. A device in the Master Role, which is called master, can manage multiple simultaneous connections with a number of devices in the Slave Role, called slaves. A slave can only be connected to a single master. Hence, a BT-LE network (i.e. a BT-LE piconet) follows a star topology. [BTLE-Slave]-----\ /-----[BTLE-Slave] \ / [BTLE-Slave]-----/[BTLE-Master]/-----[BTLE-Slave] / \ [BTLE-Slave]-----/ \-----[BTLE-Slave] Figure 2: BT-LE Star Topology A master is assumed to be less constrained than a slave. Hence, master and slave can correspond with 6LoWPAN Border Router (6LBR) and host, respectively. In BT-LE, communication only takes place between a master and a slave. Hence, in a BT-LE network using IP, a radio hop is equivalent to an IP link and vice versa. 2.3. BT-LE device addressing Every BT-LE device is identified by a unique 48 bit Bluetooth Device Address (BD_ADDR). An BT-LE-only device such as a sensor may use a public (obtained from IEEE Registration Authority) or a random device address (generated internally). The public address is created according to the IEEE 802-2001 standard and using a valid Organizationally Unique Identifier (OUI) obtained from the IEEE Registration Authority. This specification mandates that the Bluetooth Device Address MUST be a public address. 2.4. BT-LE packets sizes and MTU Maximum size of the payload in a BT-LE data channel PDU is 27 bytes. Depending on the L2CAP mode in use, the amount of data available for transporting IP bytes in a single BT-LE data channel PDU ranges between 19 and 27 octets. For power efficient communication between two BT-LE devices, data and its header should fit in a single BT-LE data channel PDU. MTU larger than the above mentioned values can be supported by the L2CAP specification. The Basic L2CAP Mode allows a Nieminen, et al. Expires July 13, 2012 [Page 5] Internet-Draft IPv6 over BT-LE January 2012 maximum payload size (i.e. IP datagram size) of 65535 bytes per L2CAP PDU. The rest of L2CAP modes allow a maximum payload size that ranges between 65527 and 65533 bytes per L2CAP PDU. 3. Specification of IPv6 over Bluetooth Low Energy BT-LE technology sets strict requirements for low power consumption and thus limits the allowed protocol overhead. 6LoWPAN standard [RFC4944], [I-D.ietf-6lowpan-nd] and [RFC6282] provides useful generic functionality like header compression, link-local IPv6 addresses, Neighbor Discovery and stateless IP-address autoconfiguration for reducing the overhead in 802.15.4 networks. This functionality can be partly applied to BT-LE. A significant difference between IEEE 802.15.4 and BT-LE is that the former supports the mesh topology (and requires a routing protocol), whereas BT-LE does not currently support the formation of multihop networks. In consequence, the mesh header defined in [RFC4944] for mesh under routing MUST NOT be used in BT-LE networks. On the other hand, a BT-LE device MUST NOT play the role of a 6LoWPAN Router (6LR). The maximum payload size of a BT-LE data channel PDU is 27 bytes, from which L2CAP headers may consume additional bytes. However, IP data packets may be much larger and IPv6 requires support for an MTU of 1280 bytes. Fragmentation and Recombination (FAR) functionality is an inherent function of the BT-LE L2CAP layer. Larger L2CAP packets can be transferred with the assistance of the FAR functionality. Appendix A describes FAR operation and five L2CAP Modes. This specification requires that FAR functionality MUST be provided in the L2CAP layer up to the IPv6 minimum MTU of 1280 bytes. The corresponding L2CAP Mode MUST be Basic Mode. Since FAR in BT-LE is a function of the L2CAP layer, fragmentation functionality as defined in [RFC4944] MUST NOT be used in BT-LE networks. 3.1. Protocol stack In order to enable transmission of IPv6 packets over BT-LE, a new fixed L2CAP channel ID MUST be reserved for IPv6 traffic by the BT- SIG. A request for allocation of a new fixed channel ID for IPv6 traffic by the BT-SIG should be submitted through the liaison process or formal communique from the 6lowpan chairs and respective area directors. This specification defines the use of channel ID 0x0007 for this purpose. Figure 3 illustrates IPv6 over BT-LE stack. Nieminen, et al. Expires July 13, 2012 [Page 6] Internet-Draft IPv6 over BT-LE January 2012 +-------------------+ | UDP/TCP | +-------------------+ | IPv6 | +-------------------+ | 6LoWPAN adapted | | to BT-LE | +-------------------+ | BT-LE L2CAP | +-------------------+ | BT-LE Link Layer | +-------------------+ | BT-LE Physical | +-------------------+ Figure 3: IPv6 over BT-LE Stack 3.2. Link model The concept of IP link (layer 3) and the physical link (combination of PHY and MAC) needs to be clear and the relationship has to be well understood in order to specify the addressing scheme for transmitting IPv6 packets over the BT-LE link. [RFC4861] defines a link as "a communication facility or medium over which nodes can communicate at the link layer, i.e., the layer immediately below IP." In the case of BT-LE, L2CAP is an adaptation layer that supports the transmission of IPv6 packets. L2CAP also provides multiplexing capability in addition to FAR functionality. The BT-LE link between two communicating nodes can be considered to be a point-to-point or point-to-multipoint link. When one of the communicating nodes is in the role of a master, then the link can be viewed as a point-to-multipoint link. When a host connects to another BT-LE device the link is up and IP address configuration and transmission can occur. 3.2.1. IPv6 Address configuration The Interface Identifier (IID) for a BT-LE interface MUST be formed from the 48-bit public device Bluetooth address as per the "IPv6 over Ethernet" specification [RFC2464]. An IPv6 prefix used for stateless autoconfiguration [RFC4862] of a BT-LE interface MUST have a length of 64 bits. Thus, this prefix is EUI-64 compliant. The IPv6 link-local address [RFC4291] for a BT-LE interface is formed Nieminen, et al. Expires July 13, 2012 [Page 7] Internet-Draft IPv6 over BT-LE January 2012 by appending the IID, as defined above, to the prefix FE80::/64, as depicted in Figure 4. 10 bits 54 bits 64 bits +----------+-----------------+----------------------+ |1111111010| zeros | Interface Identifier | +----------+-----------------+----------------------+ Figure 4: IPv6 link-local address in BT-LE 3.2.2. Header compression This document assumes [RFC6282], which specifies the compression format for IPv6 datagrams on top of IEEE 802.15.4, as the basis for IPv6 header compression on top of BT-LE. It is required that all headers MUST be compressed according to HC base encoding. The following text describes the principles of IPv6 address compression on top of BT-LE. In a link-local communication, both the IPv6 source and destination addresses MUST be elided. In this type of communication, a node that receives a data channel PDU containing an IPv6 packet (or a part of it) can infer that the IPv6 destination address of the packet is its own IPv6 address. On the other hand, a node SHALL learn the IID of the other endpoint of each L2CAP connection it participates in. By exploiting this information, a node that receives a data channel PDU containing an IPv6 packet (or a part of it) can infer the corresponding IPv6 source address. A device MAY learn the IID of the other endpoint of an L2CAP connection e.g. from the RS/RA/NS/NA Neighbor Discovery (ND) message exchange [I-D.ietf-6lowpan-nd]. A device MAY also derive the IID of the other endpoint of a L2CAP connection from the Link Layer connection establishment messages. The device MUST maintain a Neighbor Cache, in which the entries include both the IID of the neighbor and the Device Address that identifies the neighbor. When a BT-LE slave transmits an IPv6 packet to a remote destination using global IPv6 addresses, the slave MUST elide the IPv6 source address. The 6LBR/master can infer the elided IPv6 source address since 1) the master/6LBR has previously assigned the prefix to the slaves; and 2) the master/6LBR maintains a Neighbor Cache that relates the Device Address and the IID of the corresponding slave. If a context is defined for the IPv6 destination address, the slave MUST also elide the prefix of the destination IPv6 address. In that Nieminen, et al. Expires July 13, 2012 [Page 8] Internet-Draft IPv6 over BT-LE January 2012 case, the 6LBR/master can infer the elided destination prefix by using the context. When a master/6LBR receives an IPv6 packet sent by a remote node outside the BT-LE network, and the destination of the packet is a slave, the master/6LBR MUST elide the IPv6 destination address of the packet before forwarding it to the slave. The slave can infer that the IPv6 destination address of the packet is its own IPv6 address. If a context is defined for the prefix of the IPv6 source address, the master/6LBR MUST elide that prefix as well. 3.2.3. Unicast and Multicast address mapping The BT-LE link layer does not support multicast. Hence traffic is always unicast between two BT-LE devices. Even in the case where a master is attached to multiple slave BT-LE devices, the master device cannot do a multicast to all the connected slave devices. If the master device needs to send a multicast packet to all its slave devices, it has to replicate the packet and unicast it on each link. However, this may not be energy-efficient and particular care must be taken if the master is battery-powered. In the opposite direction, a slave can only transmit data to a single destination (i.e. the master). Hence, if a slave transmits an IPv6 multicast packet, the slave can unicast the corresponding BT-LE packet to the master. It is required that the master MUST provide a table for mapping different types of multicast addresses (all-nodes, all-routers and solicited-node multicast addresses) to the corresponding IIDs and Device Addresses. 3.3. Internet connectivity scenarios In a typical scenario, BT-LE network is connected to the Internet. h ____________ \ / \ h ---- 6LBR --- | Internet | / \____________/ h h: host <-- BT-LE --> 6LBR: 6LoWPAN Border Router Figure 5: BT-LE network connected to the Internet In some scenarios, the BT-LE network may transiently or permanently be an isolated network. Nieminen, et al. Expires July 13, 2012 [Page 9] Internet-Draft IPv6 over BT-LE January 2012 h h h: host \ / 6LBR: 6LoWPAN Border Router h --- 6LBR -- h / \ h h Figure 6: Isolated BT-LE network 4. IANA Considerations While there are no actions for IANA, we do expect BT SIG to allocate an L2CAP channel ID. 5. Security Considerations The transmission of IPv6 over BT-LE links has similar requirements and concerns for security as for IEEE 802.15.4. IPv6 over BT-LE SHOULD be protected by using BT-LE Link Layer security. BT-LE Link Layer supports encryption and authentication by using the Counter with CBC-MAC (CCM) mechanism [RFC3610] and a 128-bit AES block cipher. Upper layer security mechanisms may exploit this functionality when it is available. (Note: CCM does not consume bytes from the maximum per-packet L2CAP data size, since the link layer data unit has a specific field for them when they are used.) Key management in BT-LE is provided by the Security Manager Protocol (SMP). 6. Additional contributors Kanji Kerai, Jari Mutikainen, David Canfeng-Chen and Minjun Xi from Nokia have contributed significantly to this document. 7. Acknowledgements Samita Chakrabarti and Erik Nordmark have provided valuable feedback for this draft. 8. Normative References [BTCorev4.0] Nieminen, et al. Expires July 13, 2012 [Page 10] Internet-Draft IPv6 over BT-LE January 2012 "Bluetooth Core Specification v4.0, http:// www.bluetooth.org/Technical/Specifications/adopted.htm". [I-D.ietf-6lowpan-nd] Shelby, Z., Chakrabarti, S., and E. Nordmark, "Neighbor Discovery Optimization for Low Power and Lossy Networks (6LoWPAN)", draft-ietf-6lowpan-nd-18 (work in progress), October 2011. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2464] Crawford, M., "Transmission of IPv6 Packets over Ethernet Networks", RFC 2464, December 1998. [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, February 2006. [RFC4862] Thomson, S., Narten, T., and T. Jinmei, "IPv6 Stateless Address Autoconfiguration", RFC 4862, September 2007. [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, "Transmission of IPv6 Packets over IEEE 802.15.4 Networks", RFC 4944, September 2007. [RFC6282] Hui, J. and P. Thubert, "Compression Format for IPv6 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, September 2011. Appendix A. Bluetooth Low Energy fragmentation and L2CAP Modes This section provides an overview of Fragmentation and Recombination (FAR) method and L2CAP modes in Bluetooth Low Energy. FAR is an L2CAP mechanism, in which an L2CAP entity can take the (large) upper layer PDU, prepend the L2CAP header (4 bytes in the Basic L2CAP mode) and break the resulting L2CAP PDU into fragments which can then be directly encapsulated into Data channel PDUs. There are bits in the Data channel PDUs which identify whether the payload is a complete L2CAP PDU or the first of a set of fragments, or one of the rest of the fragments. There are five L2CAP modes defined in the BT 4.0 spec. These modes are: Retransmission Mode (a Go-Back-N mechanism is used), Enhanced Retransmission Mode (includes selective NAK among others), Flow Control Mode (PDUs are numbered, but there are no retransmissions), Streaming Mode (PDUs are numbered, but there are no ACKs of any kind) and Basic L2CAP Mode. Nieminen, et al. Expires July 13, 2012 [Page 11] Internet-Draft IPv6 over BT-LE January 2012 Authors' Addresses Johanna Nieminen (editor) Nokia Itaemerenkatu 11-13 FI-00180 Helsinki Finland Email: johanna.1.nieminen@nokia.com Basavaraj Patil Nokia 6021 Connection drive Irving, TX 75039 USA Email: basavaraj.patil@nokia.com Teemu Savolainen Nokia Hermiankatu 12 D FI-33720 Tampere Finland Email: teemu.savolainen@nokia.com Markus Isomaki Nokia Keilalahdentie 2-4 FI-02150 Espoo Finland Email: markus.isomaki@nokia.com Zach Shelby Sensinode Hallituskatu 13-17D FI-90100 Oulu Finland Email: zach.shelby@sensinode.com Nieminen, et al. Expires July 13, 2012 [Page 12] Internet-Draft IPv6 over BT-LE January 2012 Carles Gomez Universitat Politecnica de Catalunya/i2CAT C/Esteve Terradas, 7 Castelldefels 08860 Spain Email: carlesgo@entel.upc.edu Nieminen, et al. Expires July 13, 2012 [Page 13]