Hi Khaled,

I?d need to dive deeper into the 6LowPAN (Arduino 101 + Zephyr + 
iotivity-constrained) stack to understand how it works but I don?t believe that 
that one does any resource hosting so any OIC/OCF client will really talk to 
the device. The Gateway in our case is simply the ?BLE endpoint? (not sure that 
terminology is appropriate) that the OCF server connects to using Bluetooth. It 
happens to be our home gateway in our set-up but it likely does not have to be. 
I?m also assuming that you could have many of these endpoints throughout your 
network as long as they?re all part of the same subnet. These ?BLE endpoint? 
would be connected over a network (e.g. Ethernet, WiFi, ?) to your Gateway. I 
say ?likely? and ?assuming? because I have not tested this and I really don?t 
know enough yet about IPv6 to understand how this all plays out.

For our sensors using BLE GATT, it?s a little different and yes, it?s really 
the small app running on the BLE endpoint that turns it into an OIC/OCF device. 
But similar to what I describe above, you could most likely have many of these 
around. In your diagram below, the BLE connections (GATT) would be established 
between your sensor and what I call here a BLE endpoint and all you?d need to 
have is a network connection (same subnet) between that endpoint and your 
gateway. That connection could be Ethernet or WiFi for example.

My understanding is also that things will be slightly different (for the 
better) when Bluetooth 5.0 (that introduces mesh) gets into the picture. But I 
think that?s still a few months away at least.

To all networking experts out there, please chime him if I?m talking rubbish at 
any point ;)

Geoffroy

From: khaled at ieee.org [mailto:[email protected]] On Behalf Of Khaled Elsayed
Sent: Tuesday, June 6, 2017 5:11 PM
To: VanCutsem, Geoffroy <geoffroy.vancutsem at intel.com>
Cc: iotivity-dev <iotivity-dev at lists.iotivity.org>
Subject: Re: [dev] Several Architectural Questions on Iotivity

Thanks Geoffroy for the info.

So, as far as I could understand from your replies and the initial reading of 
the readme file is that your BLE devices whether OCF/OIC (e.g. the sensor 
running zephyr with iotivity constrained) or GATT-based non-OIC, they are 
handled by the gateway device. The gateway will provide some "resource hosting" 
for the BLE devices to connect them with the rest of the system. All entities 
will talk with the gateway not to the BLE node itself even if BLE node is 
OCF/OIC. Is this correct?

I think this will make things a bit easier though not as flexible as in the 
case the gateway will route between the different transports.

Also, the usage of simple node.js scripts instead of full-fledged resource 
container/bundle simplifies the handling of non-OIC devices. I will have a look 
at these.

Best regards,

Khaled


On Tue, Jun 6, 2017 at 3:41 PM, VanCutsem, Geoffroy <geoffroy.vancutsem at 
intel.com<mailto:geoffroy.vancutsem at intel.com>> wrote:
Hi Khaled,

You will find some input to some of your questions embedded below.

From: iotivity-dev-bounces at lists.iotivity.org<mailto:iotivity-dev-bounces at 
lists.iotivity.org> [mailto:iotivity-dev-bounces at 
lists.iotivity.org<mailto:[email protected]>] On Behalf 
Of Khaled Elsayed
Sent: Tuesday, June 6, 2017 9:59 AM
To: iotivity-dev <iotivity-dev at lists.iotivity.org<mailto:iotivity-dev at 
lists.iotivity.org>>
Subject: [dev] Several Architectural Questions on Iotivity

??
Dear all,

We are working on a research project called campie http://campie.cu.edu.eg/ and 
have chosen iotivity/OIC as our base connectivity and service discovery layer. 
I have several questions on iotivity as I am trying to draft our platform 
architecture. Looking forward to an exciting discussion.

i) RD
Is Iotivity RD fully compliant with the IETF RD 
https://datatracker.ietf.org/doc/draft-ietf-core-resource-directory/. The 
documentation is somewhat confusing. According to this 
https://wiki.iotivity.org/resource_directory_-_programming_guide, it looks more 
like IETF RD. However, according to this 
https://wiki.iotivity.org/resource-directory_rd, iotivity RD  is used to 
provide "resource hosting" to support constrained devices with long duty-cycle. 
I am inclined to think it can be used for both IETF-style RD and then to host 
resources for those devices that need to save energy. It is up to what is 
included in the code. Is this a correct conclusion?


ii) Heterogeneous Networks
Suppose we have the following network consisting of OIC servers on BLE 
transport and 6owPAN/802.15.4, with an OIC client connected via the gateway 
over Ethernet.

[Inline image 1]

[Geoffroy] We have a similar set-up in our IoT to Cloud Smart Home demo 
(https://01.org/smarthome (*) and https://github.com/01org/SmartHome-Demo). 
More specifically, we have a Gateway that connects to BLE devices (both 6LowPAN 
and GATT) and a separate Ethernet router that also acts as a WiFi AP. So we 
have a mix of OCF servers that are connected via Ethernet, WiFi and BLE (both 
6LowPAN and GATT).

(*) a little warning: our code base found in the Github repo has evolved 
significantly since we wrote the tutorial so for accurate information, I?d 
recommend reading the README.md files in our Github repository. We are in the 
process of updating the tutorial but I do not have a firm schedule yet

How can the Ethernet client discover:
1) 802.15.4: these are running IPv6 over 6LowPAN, routing between the Ethernet 
and 15.4 can be achieved via the gateway. Should the gateway forward the 
multicast requests between the two networks? What else is needed?

[Geoffroy] As part of our demo, we use Arduino 101 devices running the Zephyr 
Project<https://www.zephyrproject.org/> and 
iotivity-constrained<https://github.com/iotivity/iotivity-constrained>. These 
are native OIC/OCF devices that communicate with the gateway over BLE 
(6LowPAN). There is nothing specific in terms of routing that we do there. We 
have two examples of such devices at the moment:

1.       A temperature sensor (native OIC/OCF server): 
https://github.com/01org/SmartHome-Demo/tree/master/sensors/ocf_temperature_sensor

2.       A multisensor device: temperature, light, motion and LED . The code is 
available here: 
https://github.com/01org/SmartHome-Demo/tree/master/sensors/ocf_multi_sensors

2) BLE:

  *   If the OIC servers on BLE are using GATT-based OIC transport, what does 
the gateway need to do enable the Ethernet OIC client to discover those BLE 
devices?
[Geoffroy] We have two examples of devices using BLE GATT to communicate in our 
repo.

1.       An environmental sensors [1] that communicates with our gateway over 
BLE using GATT (Environmental Sensing 
Profile<https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=294796>).
 There is no OIC/OCF stack running on the device itself and but instead we run 
a small app on the gateway (it is available here [2]) that exposes the data 
transmitted over BLE GATT as if the device was an OIC/OCF server. This small 
app is written in JavaScript (node.js) and its main dependencies are ?noble? 
and ?iotivity-node?. It?s a very simple mechanism that works rather well for us.

2.       A Power Meter [3] that works very much the same way than the 
environmental sensor except it uses a custom profile. Similarly, a simple JS 
app [4] running on the gateway exposes that sensor as an OIC/OCF server to the 
rest of the system.
[1] 
https://github.com/01org/SmartHome-Demo/tree/master/sensors/environmental-sensors
[2] 
https://github.com/01org/SmartHome-Demo/blob/master/ocf-servers/js-servers/environmental_sensor.js
[3] https://github.com/01org/SmartHome-Demo/tree/master/sensors/DC_power_meter
[4] 
https://github.com/01org/SmartHome-Demo/blob/master/ocf-servers/js-servers/power-uart.js

  *   If the BLE nodes are also supporting IP service profile/6LowPAN, is 
GATT-based OIC still needed or coap/udp over 6lowpan would be the way to go?
Also if these 802.15.4 or BLE devices want to discover and register with an RD 
server on the Ethernet segment, what needs to be done?


Finally, this one on non-OIC
iii) Non-OIC Devices: According to the documentation of the resource container  
https://wiki.iotivity.org/resource_container_-_programming_guide, sample 
application and bundles are available in the examples folder. However, I cannot 
find them. I can only find same plugins etc in the bridging folder. How can one 
build a full example with implementation of resource container, bundle/plugins 
and configuration xml?

Best regards

Khaled


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170606/90312611/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 31693 bytes
Desc: image001.png
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170606/90312611/attachment.png>

Reply via email to