User Tools

Site Tools


proposal_for_cloud_interface_in_iotivity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
proposal_for_cloud_interface_in_iotivity [2015/09/04 07:19]
jihwan seo
proposal_for_cloud_interface_in_iotivity [2017/01/03 01:46] (current)
Phil Coval [Cloud Interface in IoTivity]
Line 1: Line 1:
 =========== Cloud Interface in IoTivity =========== =========== Cloud Interface in IoTivity ===========
 This is a contribution proposal about cloud/​server interface of OIC devices. 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.+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. So, this feature enriches the OIC device functionality and extends the coverage of OIC device interoprability.
  
Line 11: Line 11:
 =====Scenario and sequences===== =====Scenario and sequences=====
 Initially, following two scenarios are considered. Initially, following two scenarios are considered.
- 
-{{:​Scenario-CoAP_over_TCP.png|}} 
  
 1. OIC device send event notification to the Cloud service. 1. OIC device send event notification to the Cloud service.
Line 48: Line 46:
  
 {{:​sequence.png|}} {{:​sequence.png|}}
- 
  
 <Device control> <Device control>
Line 60: Line 57:
  
 =====Contribution approach===== =====Contribution approach=====
-  * Cloud CI(Cloud Interface) server side +====Cloud CI(Cloud Interface) server side==== 
-     ​* Use Netty framework ( http://​netty.io ) +  * Use Netty framework ( http://​netty.io ) 
-     ​* Contribution ‘CoAP over TCP codec’ part only +  * Contribution ‘CoAP over TCP codec’ part only 
-     ​* User wants to enable cloud interface, he/she should setup the Netty framework.+  * User wants to enable cloud interface, he/she should setup the Netty framework.
  
-  * Device side +====Device side==== 
-    * Some enumerations represent TCP transport type will be added in RI layer( octypes.h ) +  * Some enumerations represent TCP transport type will be added in RI layer( octypes.h ) 
-      * OCTransportFlags::​OC_IP_USE_V4_TCP +  * OCTransportFlags::​OC_IP_USE_V4_TCP 
-      * OCConnectivityType::​CT_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 (RegisterResourceToCloud(..),​ UnregisterResourceToClould(..))+  ​* 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 (RegisterResourceToCloud(..),​ UnregisterResourceToClould(..))
       * IP, Port parameter for Connection/​Disconnection       * IP, Port parameter for Connection/​Disconnection
         * 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. ​         * 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. ​
Line 89: Line 86:
         * To store the CI server list, u_arraylist_t will be added.         * To store the CI server list, u_arraylist_t will be added.
       * This logic will be implemented in other adapter.(catcpadapter - ci(cloud interface))       * This logic will be implemented in other adapter.(catcpadapter - ci(cloud interface))
-       {{:​ca_interface_strcuture.png|}} + 
-       + 
 +  typedef enum 
 +      ​CA_DEFAULT_ADAPTER ​        = 0, 
 +      CA_ADAPTER_IP ​             = (1 << 0), 
 +      CA_ADAPTER_GATT_BTLE ​      ​= (1 << 1), 
 +      CA_ADAPTER_RFCOMM_BTEDR ​   = (1 << 2), 
 +  #ifdef RA_ADAPTER 
 +      CA_ADAPTER_REMOTE_ACCESS ​  = (1 << 3), 
 +  #endif 
 +      CA_ADAPTER_TCP ​            = (1 << 4), // CoAP over TCP 
 +      CA_ALL_ADAPTERS ​           = 0xffffffff 
 +  } CATransportAdapter_t;​ 
     * To handle different header for TCP, we are going to change libcoap interface.     * 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       * Add parameter to all APIs using coap_hdr_t to decide which header should be constructed
Line 96: Line 105:
       * coap_hdr_t will be changed.       * coap_hdr_t will be changed.
       * As coap header is changed, some API in libcoap will be also changed as per transport type.       * As coap header is changed, some API in libcoap will be also changed as per transport type.
 +
 +====KeepAlive====
 +In order to ensure that the connection between an OIC Devices, when using CoAP over TCP, 
 +OIC Device should send application layer KeepAlive messages. (Please refer the Core Specification Project B documents ( 12.6. CoAP serialization over TCP )) 
 +
 +  * The reason to support application layer KeepAlive are as follows :
 +    * TCP KeepAlive only guarantees that a connection is alive at the network layer, but not at the application layer.
 +    * Interval of TCP KeepAlive is configurable only using kernel parameters and is OS dependent. ( eg. 2 hours by default in Linux )
 +
 +  * Detailed Features{{ :​ex1_keepalive_for_coap_over_tcp.png?​300|}}
 +    * Use Fixed Ping resource
 +      * URI: /oic/ping, Type ID: oic.wk.ping,​ Interfaces: oic.if.rw
 +    * Fixed Interval Time
 +      * Start from 2 minutes and increases in multiples of 2 up to  64 minutes.
 +    * Disconnect logic
 +      * OIC Client does not receive the response with 1 minutes.
 +      * OIC Server does not receive a PUT request within interval time.
 +      * 
 +  * Base Layer Changes
 +    * Support a resource of type oic.wk.ping
 +    * Maintain the OIC Device Information connected by CoAP over TCP to send KeepAlive message.
 +      * New API be added in RI & CA Layer (to pass the change of connection state from CA to RI)
 +{{ :​ex2_keepalive_for_coap_over_tcp.png |}}
  
 =====References===== =====References=====
proposal_for_cloud_interface_in_iotivity.1441351160.txt.gz · Last modified: 2015/09/04 07:19 by jihwan seo