Coder Social home page Coder Social logo

dps-for-iot's Introduction

DISCONTINUATION OF PROJECT

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.

Contact: [email protected]

Distributed Publish & Subscribe for IoT

Build Status

Distributed Publish & Subscribe for IoT (DPS) is a new protocol that implements the publish/subscribe (pub/sub) communication pattern.

Devices or applications running the protocol form a dynamic multiply-connected mesh where each node functions as a message router. The protocol is light-weight and amenable to implementation on very small devices such as sensors that primarily publish data. The architecture is well suited for applications that leverage edge computing in combination with cloud-based analytics.

dps-for-iot's People

Contributors

aalon avatar cmarcelo avatar malsbat avatar rdower avatar steveoss avatar wzhen12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dps-for-iot's Issues

Node discovery does not work with publications supporting wildcards

The test case is something along the lines of (to exercise wildcards and multiple subscriptions):

  1. ./build/test/bin/discover -s A -p B -s C
  2. ./build/test/bin/discover -p A -s B -s D
    Node 1 should receive pub A and node 2 should receive pub B, but they do not.

The root cause is the removal of the needs from discovery in bdd8141.

Add a minimal size release variant

Currently, the build variants supported are debug and release, the latter implies -O3.

It would be useful to add a min-size-release option (analogue to CMake's MinSizeRel) to better fit resource-constrained environments.

At the very least it should specify -Os. Additional relevant options might be -s, -fdata-sections -ffunction-sections, -flto, -Wl,--gc-sections, -Wl,--strip-all.

RTOS Support

Is there any plan in progress to support DPS on an RTOS?

How to guarantee Subscription messages are delivered

When running DPS over UDP there is no guarantee a Subscription message will be delivered to all nodes from the network. If a Subscription message is lost, the network 'interests' might not converge so publications may be dropped even if there is a node interested in it.

The following example shows the case:

A---B---C---D

'A' sends a Subscription on topic "/foo/bar" to 'B'. 'B' sends the Subscription to 'C' but for some reason it is lost. Later on, D publishes a message on topic "/foo/bar". Since 'C' has never received the Subscription from 'B', it believes the network has no interest in that Publication and drops it.

Maybe this issue could be fixed with an Acknowledgement message between hops.

RPC

On the ROS forum you mentioned "Built-in support for RPC". I don't see anything obvious specifically supporting this in the code, please could you explain this point further?

Notify user in case something goes wrong with Publication transmission

DPS_Publish() API returns DPS_OK in case the publication was successfully scheduled to be transmitted. However, it is possible something goes wrong during the transmission itself (DPS_OnPubSendComplete() is called with 'status' != 0). In that case, we should probably notify the user application so it is able to handle it.

Minimum compiler and (runtime) library versions, static linking?

Not too familiar with SCons, so perhaps this is glaringly obvious for someone who is, but I could not find any statements regarding minimum versions of compilers, C standards, versions of libraries and/or runtime platforms. Could you list that somewhere?

The building and running page only states gcc or clang as a compiler requirement. Which C version are you targeting?

Additionally: would this be suitable to build fully statically linked applications? Yocto is mentioned as a deployment tool, but one of my candidate platforms is not compatible with that. I do have a cross-compiler for it that can generate binaries and the platform has some support for dynamic linking, but going fully static would simplify things significantly.

Does not build on ubuntu 20.04

I tried building this on a standard x86_64 ubuntu 20.04 machine, and it seems to choke when linking to libuv. I installed libuv1 and libuv1-dev through apt, then ran

scons -Q variant=debug transport=tcp bindings=none

It failed at the linking step, so I figured it was because libuv gets installed in /usr/lib/x86_64-linux-gnu. I'm not very familiar with scons, so I just did a quick & dirty change to SConstruct:

@@ -267,7 +267,7 @@ elif env['PLATFORM'] == 'posix':
     # Data relocation and protection (RELRO):
     env.Append(LINKFLAGS = ['-z', 'relro', '-z', 'now'])
 
-env.Append(LIBPATH=['./ext'])
+env.Append(LIBPATH=['./ext','/usr/lib/x86_64-linux-gnu'])

It still failed, and it appears to be because of the linking order, so I also changed:

@@ -125,7 +125,7 @@ elif env['PLATFORM'] == 'posix':
             env['PY_CPPPATH'] = [inc[2:] for inc in py_cpppath]
             env['PY_LIBPATH'] = []
 
-    env['DPS_LIBS'] = ['pthread', 'dl']
+    env['DPS_LIBS'] = ['uv', 'pthread', 'dl']

Definitely not the right way to fix it, but it builds now.

Not compiling on arm64

I tried to compile it on an arm64 arch (raspberry pi4) but it's failing.
/usr/bin/ld: ext/intel-ipsec-mb/lib/sse/sha512_one_block_sse.os: Relocations in generic ELF (EM: 62) /usr/bin/ld: ext/intel-ipsec-mb/lib/sse/sha512_one_block_sse.os: Relocations in generic ELF (EM: 62) /usr/bin/ld: ext/intel-ipsec-mb/lib/sse/sha512_one_block_sse.os: Relocations in generic ELF (EM: 62) /usr/bin/ld: ext/intel-ipsec-mb/lib/sse/sha512_one_block_sse.os: Relocations in generic ELF (EM: 62) /usr/bin/ld: ext/intel-ipsec-mb/lib/sse/sha512_one_block_sse.os: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status scons: *** [build/obj/lib/libdps_ns3.so] Error 1 scons: building terminated because of errors.
I've tried with different compilers and even tried cross-compile with arm-linux-gnueabi-gcc and aarch64-linux-gnu-gcc but also having the same issue.

Running with python, help needed

I could install this project with python bindings, and run the example pub/sub scripts, but pub and sub are not exchanging messages.

The output of pub:

/dps-for-iot/py_scripts# PYTHONPATH=../build/dist/py python simple_pub.py 
Publisher is listening on [::]:57575
Pub UUID f4d1c799-8bcb-2574-6155-f11c9e9f8074(1)
Pub UUID f4d1c799-8bcb-2574-6155-f11c9e9f8074(2)
Traceback (most recent call last):
  File "simple_pub.py", line 185, in <module>
    dps.destroy_publication(pub)
TypeError: destroy_publication expected 2 arguments, got 1

The output of sub:

/dps-for-iot/py_scripts# PYTHONPATH=../build/dist/py python simple_sub.py 
Subscriber is listening on [::]:48070

I did start the subscriber before the publisher and I think i'm missing some network options.
What do I need to do to get this work?




And another question, I would like to use it with python3 instead of python2, but in this case i get following error:

Traceback (most recent call last):
  File "simple_sub.py", line 2, in <module>
    import dps
  File "/dps-for-iot/build/dist/py/dps.py", line 24, in <module>
    _dps = swig_import_helper()
  File "/dps-for-iot/build/dist/py/dps.py", line 23, in swig_import_helper
    return importlib.import_module('_dps')
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /dps-for-iot/build/dist/py/_dps.so: undefined symbol: PyInstance_Type

Is python3 supported or do you plan to support it?

dps-micro tries to free a static variable when destroying a node

The dps-micro DPS_CreateKeyStore() method is called by DPS_CreateNode(). DPS_CreateKeyStore() creates a static variable for the keystore and returns a pointer to it. Then, when we destroy the node, we call DPS_DestroyKeyStore() and try to free various parts of the static keystore. This can (will?) segfault on some (all?) systems.

We could allocate the keystore on the heap instead, or if it needs to be static, we can reinitialize the keystore to zero when destroying it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.