(Special Paper) 21 3, 2016 5 (JBE Vol. 21, No. 3, May 2016) http://dx.doi.org/10.5909/jbe.2016.21.3.298 ISSN 2287-9137 (Online) ISSN 1226-7953 (Print) BLE CoAP 6LoWPAN a), a), a), a) Implementation of CoAP/6LoWPAN over BLE Networks for IoT Services Cheol-Min Kim a), Hyung-Woo Kang a), Sang-Il Choi a), and Seok-Joo Koh a). Machine to Machine (M2M) ZigBee Personal Area Network (PAN), PAN. M2M Bluetooth Low Energy (BLE) IPv6 over Low Power Wireless Personal Area Networks (6LoWPAN). Constrained Application Protocol (CoAP). Hypertext Transfer Protocol (HTTP), CoAP HTTP 2, 21% 22%. Abstract With the advent of Internet of Things (IoT) technology that allows the communications between things and devices over the Internet, a lot of researches on the IoT services, such as smart home or healthcare, have been progressed. In the existing machine-to-machine (M2M) communications, however, since the underlying link-layer technologies, such as Bluetooth or ZigBee, do not use the Internet Protocol (IP) communication, those technologies are not suitable to provide the IoT services. Accordingly, this paper discusses how to provide the Internet services in the M2M communication, and propose an implementation of the Constrained Application Protocol (CoAP) over 6LoWPAN for providing IoT services in the BLE networks. Based on the implementation, we compared the performance between HTTP and CoAP for IoT communications. From the experimental results, we can see that the CoAP protocol gives better performance than the HTTP protocol with two times higher throughput, 21% faster transmission time, and 22% smaller amount of generated packets. Keyword : IoT, Bluetooth Low Energy, 6LoWPAN, CoAP a) (School of Computer Science and Engineering, Kyungpook National University) Corresponding Author : (Seok-Joo Koh) E-mail: sjkoh@knu.ac.kr Tel: +82 53-950-7356 ORCID: http://orcid.org/0000-0003-3429-2040 SW. IWAIT 2016. Manuscript received March 3, 2016; Revised April 11, 2016; Accepted April 22, 2016.
3 : BLE CoAP 6LoWPAN (Cheol-Min Kim et al.: Implementation of CoAP/6LoWPAN over BLE Networks for IoT Services).,, [1]. [2], (Wireless Sensor Network, WSN) (Car Area Network, CAN) [3], [4].,,, (Nest Labs),,, LG., (Google Glass) (Nike) (Fuel Band) (wearable device). (Internet Protocol, IP) ZigBee. M2M PAN PAN,. M2M BLE 6LoWPAN CoAP. 6LoWPAN IP [5]., HTTP, HTTP Transmission Control Protocol (TCP).. IETF (Internet Engineering Task Force) CoRE (Constrained RESTful Environments) CoAP. CoAP HTTP, HTTP [6].. 2 6LoWPAN CoAP. 3 BLE 6LoWPAN CoAP. 4 BLE 6LoWPAN CoAP HTTP. 5. 1. 6LoWPAN. 6LoWPAN IEEE 802.15.4 PHY/MAC (Wireless Personal Area Network, WPAN) IPv6 IP [7]. IETF 6LoWPAN,. 1. 6LoWPAN Fig. 1. 6LoWPAN protocol stack
6LoWPAN, 250Kbps IPv6. 1 6LoWPAN. 6LoWPAN 1 IEEE 802.15.4,. 6LoWPAN IEEE 802.15.4. 6LoWPAN (context) (global address) IPv6 User Datagram Protocol (UDP) (compact multicast address). 2. CoAP CoAP CPU RAM ROM [8]. CoAP IETF CoRE 6LoWPAN. CoAP HTTP. UDP 6LoWPAN HTTP [9][10]. CoAP - (Server Client). (resource),. 2 HTTP CoAP. CoAP (messaging) /. (reliability). conformable (CON). CON acknowledgement (ACK). CON ACK,. Non-conformable (NON) NON ACK. NON. / piggy-backed response separate response non-conformable response. CoAP Representational State Transfer (REST) [11]. REST GET, POST, PUT, DELETE (method).,,,. coap:// /. GET coap:// /temperature. CoAP. HTTP. 2.xx, 4.xx, 5.xx. 2. HTTP CoAP Fig. 2. Protocol stack of HTTP and CoAP
3 : BLE CoAP 6LoWPAN (Cheol-Min Kim et al.: Implementation of CoAP/6LoWPAN over BLE Networks for IoT Services) CoAP C libcoap, JAVA Californium Node.js node-coap., CoAP.. CoAP / 6LoWPAN / BLE IP Internet Protocol Support Profile (IPSP) [12]. 4.1, 6LoWPAN 3.18. 3 6LoWPAN 6LoWPAN (gateway) CoAP 6LoWPAN, IP.. 1. 4. A 6LoWPAN BLE. CoAP 6LoWPAN. Arduino Uno., (Universal Asynchronous Receiver/Transmitter, UART) CoAP. CoAP CoAP. CoAP,. 6LoWPAN BLE 6LoWPAN IPv6. CoAP 6LoWPAN Raspbian OS. B IPv6 (Ethernet) CoAP. CoAP Windows OS PC, IPv6. CoAP, JAVA Californium CoAP Framework. 3. CoAP 6LoWPAN Fig. 3. The process to communicating 6LoWPAN gateway and CoAP Server
4. Fig. 4. Testbed architecture 2. 3. A CoAP 6LoWPAN, B CoAP A CoAP. B CoAP A CoAP CoAP. BLE 6LoWPAN CoAP HTTP. A CoAP 6LoWPAN Internet Control Message Protocol version 6 (ICMPv6)., A CoAP B CoAP ICMPv6. 6LoWPAN 6LoWPAN. CoAP CoAP. CoAP UART,. CoAP 6LoWPAN. A CoAP HTTP. CoAP 6LoWPAN HTTP CoAP. 3. 5 A 6LoWPAN CoAP ICMPv6. 64 5. 6LoWPAN CoAP ICMPv6 Fig. 5. Packet transmission between 6LoWPAN gateway and CoAP Server
김철민 외 3인: BLE 네트워크 상에서 사물인터넷 서비스 제공을 위한 CoAP과 6LoWPAN 구현 (Cheol-Min Kim et al.: Implementation of CoAP/6LoWPAN over BLE Networks for IoT Services) 303 그림 6. 6LoWPAN 패킷을 인터넷망 패킷으로 변환된 결과 Fig. 6. The packet transition result from 6LoWPAN to Internet 그림 7. 온도 센서의 측정값을 요청하는 패킷 Fig. 7. The request packet to get the value of temperature sensor 페이로드 (Payload)를 서로 송수신하고 있으며 통신 이 원활하게 이루어짐을 알 수 있다. 그림 6은 네트워크 A의 CoAP 서버가 설치된 장치가 네 트워크 B의 CoAP 클라이언트로 ICMPv6 메시지를 주고받 는 패킷을 6LoWPAN 게이트웨이에서 캡처한 화면이다. CoAP 서버가 CoAP 클라이언트로 ICMPv6 패킷을 보내면 이트의 6LoWPAN 게이트웨이에서 이 패킷을 수신한다. 이때 팅 테이블을 참고하여 자신 6LoWPAN 게이트웨이는 라우 망 패킷으로 변환하고 포워딩한다. CoAP 클라이언트에서 이 패킷을 수신하면 응답 패킷을 CoAP 서버로 전송한다. 이때 도 역시 6LoWPAN 게이트웨이에서 패킷을 수신하고 라우 팅 테이블을 참고하여 자신이 담당하고 있는 네트워크로 전송되는 패킷이면 6LoWPAN 패킷으로 변환하여 포워딩 에게 연결된 인터넷 으로 나가는 패킷일 경우 그에 맞는 한다. 림 7은 CoAP 클라이언트에서 CoAP 서버로 온도 센서 그 측정한 값을 요청하는 메시지를 보여준다. 해당 메시 지는 CON 메시지를 활용하였으며, 그림에서 CoAP 헤더에 포함된 메시지 타입 (Type), 길이, 메소드 코드 등의 다양한 정보를 확인할 수 있다. 그림 8은 요청된 CON 메시지에 대한 응답 메시지를 보 여준다. CoAP 서버가 클라이언트로부터 CON 메시지를 전 송받았기 때문에 그에 대한 응답으로 ACK 메시지를 보냄 을 확인할 수 있다. 또한, piggy-backed response 방식을 활 용하여 ACK 메시지에 요청에 대한 응답 메시지에 대한 정 보인 온도 정보가 패킷에 포함되어 있음을 확인할 수 있다. 그림 9는 BLE 네트워크에 구현한 6LoWPAN 환경에서 0바이트의 페이로드 (Payload)를 가지는 메시지를 100회 에서 전송할 때 HTTP와 CoAP의 평균 전송시간을 비교한 결과 했 이다. 같은 응용을 구현 을 때 CoAP을 이용한 구현이 HTTP보다 약 21% 빠른 전송시간을 보이는 것을 알 수 있 다.
8. Fig. 8. The response packet contains the value of temperature sensor 9. 6LoWPAN CoAP HTTP Fig. 9. The comparison of average transmission time between CoAP and HTTP using 6LoWPAN 10. 100 Fig. 10. The cumulative packet sequence number between CoAP and HTTP
3 : BLE CoAP 6LoWPAN (Cheol-Min Kim et al.: Implementation of CoAP/6LoWPAN over BLE Networks for IoT Services) 10 100. CoAP HTTP 22%. HTTP TCP, HTTP. CoAP UDP TCP CoAP. 11 CoAP HTTP. CoAP HTTP 2.04 CoAP., 6LoWPAN CoAP HTTP. CoAP HTTP 2 21%. CoAP HTTP 22%.. DMB,.,,,. (References) 11. CoAP HTTP Fig. 11. The comparison of throughput between CoAP and HTTP. BLE CoAP 6LoWPAN. PAN BLE,, 6LoWPAN IP. [1] W. Andrew and A. Anurag, The Internet of Things A survey of topics and trends, Information Systems Frontiers, Volume 17, Issue 2, pp. 261-274, April, 2015 [2] A. Aamir, S. Mohamed, S. Neelam and T. Anurag, An Internet of Things approach for motion detection using Raspberry pi, Intelligent Computing and Internet of Things (ICIT), 2014 International Conference on, pp 131-134, Jan. 2015. [3] W. Jiafu, L. Di, Z. Caifeng and Z. Keliang, M2M Communications for Smart City: An Event-Based Architecture, Computer and Information Technology (CIT), 2012 IEEE 12th International Conference on, pp. 895-900, Oct. 2012. [4] H. Stephan, S. Alexandru, B. Martin and C. Francois, A Domain Model for the Internet of Things, Green Computing and Communications (GreenCom), 2013 IEEE and Internet of Things (ithings/cpscom), IEEE International Conference on and IEEE Cyber, Physical and Social Computing. pp. 411-417, Aug. 2013. [5] M. Geoff, The 6LoWPAN Architecture, EmNets 07 Proceedings of the 4th workshop on Embedded networked sensors, pp. 78-82, June, 2007 [6] K. Seok-gap, P. Il-kyun, S. Seung-cheol and L. Byeong-tak, Trends of IETF CoAP Based Sensor Connection Protocol Technology, 2013 Electronics and Telecommunications Trends, ETRI, pp. 133-140, Dec. 2013 [7] N. Kushalnagar, G. Montenegro and C. Schumacher, IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs): Overview, Assumptions, Problem Statement, And Goals, Internet Engineering Task Force (IETF) Request for Comments: 4919, Oct. 2015
[8] Z. Shelby, K. Hartke and C. Bormann, The Constrained Application Protocol, Internet Engineering Task Force (IETF) Request for Comments: 7252, June, 2014 [9] M. Kovatsch, S. Duquennoy and A. Dunkels, A Low-Power CoAP for Contiki, Mobile Adhoc and Sensor Systems (MASS), 2011 IEEE 8th International Conference on, pp. 855 860, Oct. 2011 [10] L. Alessandro, M. Pol and Anna Calveras, TinyCoAP: A Novel Constrained Application Protocol (CoAP) Implementation for Embedding RESTful Web Services in Wireless Sensor Networks Based on TinyOS, Journal of Sensor and Actuator Networks, pp. 288 315, 2013 [11] T. Fielding, T. Richard, Principled Design of the Modern Web Architecture, ACM Transactions on Internet Technology (TOIT), Vol. 2, Issue 2, pp. 115-150, May, 2002 [12] S. Teemu, K. kanji, B. Frank, D. Joe and H. Robin et al., Internet Protocol Support Profile, Bluetooth Specification, Dec. 2014-2015 : - 2015 ~ : - ORCID : http://orcid.org/0000-0002-5121-440x - : - 2011 : - 2013 : - 2013 ~ : - ORCID : http://orcid.org/0000-0003-2430-4570 - :,, - 2010 : - 2012 : - 2012 ~ : - ORCID : http://orcid.org/0000-0003-3473-6131 - :, - 1992 : KAIST - 1994 : KAIST - 1998 : KAIST - 1998 ~ 2004 : ETRI - 2004 ~ : - ORCID : http://orcid.org/0000-0003-3429-2040 - :,, IP Mobility,