User Tools

Site Tools


This is an old revision of the document!

Cloud Interface in IoTivity

This is a contribution proposal about cloud/server interface of OIC devices. Currently, IoTivity doesn't have the capability to interact with internet service provided by cloud. So, this feature enriches the OIC device functionality and extends the coverage of OIC device interoprability.

We'd like to propose the CoAP over TCP as the cloud interface protocol. The CoAP over TCP specification describes the consistency with CoAP standard( RFC7252 ) except header construction. So, it can be the most suitable candidate for cloud interface for OIC device.

Scenario and sequences

Initially, following two scenarios are considered.

1. OIC device send event notification to the Cloud service. For example, log data can be sent from device to cloud server and the device can request appropriate service to cloud server ( eg, personalized ad, remote diagnosis, etc )

2. The Cloud service send device control command to the OIC device according to the rules defined by user.

For any kind of cloud service, OIC device should support cloud interface.


  • Basically, protocol follows by CoAP over TCP draft
  • The first nibble of initial byte is used 0~15(13~15 is special value) in the Header of CoAP over TCP.
  • Simple Header Format about 8-bit length(nibble is 13) is in below.
  • Only message type transported when using CoAP over TCP is the Non-Confirmable message (NON).
  • Message ID is meaningless and thus elided.
  • Use URI Scheme
    • “coap+tcp:” “” host [ “:” port ] path-abempty [ “?” query ] * “coaps+tcp:” “” host [ “:” port ] path-abempty [ “?” query ]
  • Use TLS ( RFC7301 ) to guarantee secure transmission ( 2nd phase )
  • Support keep alive ( 2nd phase )
  • Support auto-reconnection to recover abnormal disconnection ( 2nd phase )


<Event notification>

<Device control>

Contribution approach

  • Cloud CI(Cloud Interface) server side
    • Use Netty framework ( )
    • Contribution ‘CoAP over TCP codec’ part only
    • User wants to enable cloud interface, he/she should setup the Netty framework.
  • Device side
    • Some enumerations represent TCP transport type will be added in RI layer( octypes.h )
      • OCTransportFlags::OC_IP_USE_V4_TCP
      • OCConnectivityType::CT_IP_USE_V4_TCP
  • Some interface will be added in RI layer to get information from application, this should be required to connect and register device at cloud service
    • Connect
      • Even though the OIC device is resource server, the device should try to connect the Cloud service. Because the information of Cloud server depends on the application. the information of Cloud service should be passed from application. So, IoTivity should provide the interface for this.
    • Disconnect
      • To terminate the TCP connection, the new interface will be provided.
    • Register
      • To send device information( including device ID, type, resource uri, UID, access token, application it, etc ), new interface should be required.
  • Some interface will be added in CA layer.
    • CACreateTCPConnection( const CATCPServerInfo* serverinfo ) / CADestroyTCPConnection( const CATCPServerInfo* serverinfo )
      • To create and terminate dedicated TCP session with Cloud service, new interface will be added.
    • For the register, CA can use CoAP advertising flow. If the transport type is TCP, CA sends registration information to Cloud server, else CA sends multicast message according to the selected transport types.
  • Some data structures will be modified in CA layer
    • CATransportFlags_t::CA_IPV4_TCP ( 1 « 8 ) will be added
    • To store the CI server information, CATCPServerInfo_t will be added.
    • To store the CI server list, CATCPServerList_t will be added.

  * To handle different header for TCP, we are going to change libcoap interface.
    * Add parameter to all APIs using coap_hdr_t to decide which header should be constructed
      * typedef enum { coap_udp = 0, coap_tcp = 1 } coap_transport_type;
    * coap_hdr_t will be changed.

proposal_for_cloud_interface_in_iotivity.1439969342.txt.gz · Last modified: 2015/08/19 07:29 by Hyuna Jo