GithubHelp home page GithubHelp logo

mbaddeley / usdn Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 8.0 72.91 MB

µSDN: A low-overhead SDN stack and embedded SDN controller for Contiki.

License: Other

C 80.13% C++ 4.99% HTML 0.02% JavaScript 0.07% CSS 0.03% Makefile 0.35% Assembly 0.62% Objective-C 0.01% Awk 0.01% XSLT 0.02% Gnuplot 0.01% Python 1.78% Perl 0.35% Shell 0.05% Java 11.57% Batchfile 0.01% Dockerfile 0.01% Asymptote 0.01%
contiki sdn sdn-controller wsn sensor-network 802-15-4 low-power evolving-sdn iot usdn

usdn's Introduction

μSDN - Low-Power Wireless SDN for Contiki.

Intro

This repo hosts the source code of μSDN, which we published in the NetSoft 2018 conference (paper, slides). μSDN is also in the process of being ported to Contiki-NG (which will supersede this version), you can check out the μSDN-NG repo progess here.

Publications

M. Baddeley, R. Nejabati, G. Oikonomou, M. Sooriyabandara, and D. Simeonidou, “Evolving SDN for Low-Power IoT Networks,” in 2018 IEEE Conference on Network Softwarization (NetSoft), June 2018.

M. Baddeley, R. Nejabati, G. Oikonomou, S. Gormus, M. Sooriyabandara and D. Simeonidou, "Isolating SDN control traffic with layer-2 slicing in 6TiSCH industrial IoT networks," 2017 IEEE Conference on Network Function Virtualization and Software Defined Networks (NFV-SDN), Berlin, 2017, pp. 247-251.

About

μSDN is has been developed to provide an open source platform to deliver SDN on 6LoWPAN IEEE 802.15.4-2012 networks. The version here is currently not compatible with TSCH, though we have previously tried it out with our own 6TiSCH implementation for contiki (check out the NFV-SDN 2017 paper here).

Alongside μSDN itself, we provide an embedded SDN controller, Atom, as well as a flow generator for testing purposes, Multiflow.

Please note, this is an academic exercise and a fairly large codebase, so there are many things in μSDN which may not have been done as cleanly or transparently as I may have liked (though I have tried to clean it up somewhat). I've tried to give a brief overview of all the features and modules here, and you can find the paper and slides within at the top level, but if you find yourself getting lost then I'm happy to answer any questions you may have.

Getting Started

IMPORTANT You'll also need to install the 20-bit mspgcc compiler.

For instructions on how to compile this please click here

For a pre-compiled version for Ubuntu-64 please click here

Some people have had issues trying to install this compiler, so if you're new to Contiki or Linux in general then I'd recommend doing the following:

  • Use a clean Ubuntu64 installation, don't use Instant Contiki. Contiki is included as part of uSDN and it's not necessary to have a separate Contiki repo.
  • Use the precompiled msp430-gcc version above. You literally just need to extract it to a folder of your choice and then add it to your path export PATH=$PATH:<uri-to-your-mspgcc>. Once you have done this your path should look something like this:
echo $PATH
/home/mike/Compilers/mspgcc-.7.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
  • NB There is only ONE msp430-gcc compiler in the path. If there are two you need to remove the old one.
  • Check the mspgcc version (msp430-gcc --version) it should be 4.7.3.
msp430-gcc (GCC) 4.7.3 20130411 (mspgcc dev 20120911)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You are now ready move on to the next stage! If you haven't properly set it up to use the 20-bit mspgcc then it will not compile!!!

Because of the size of the stack, if you're testing in Cooja you'll need to compile for exp5438 motes (there is a Makefile.target which should handle this for you). Please note that you'll need to run make in both sdn/controller and sdn/node as I haven't set it up to do both in the higher level directory.

  cd usdn/examples/sdn/controller/
  make clean & make
  cd ..
  cd node/
  make clean & make

To get you going you can find some Cooja examples in:

usdn/examples/sdn/..

There is a handy compile script in there that can be used to compile both the controller and node:

./compile.sh MULTIFLOW=1 NUM_APPS=1 FLOWIDS=1 TXNODES=8 RXNODES=10 DELAY=0 BRMIN=5 BRMAX=5 NSUFREQ=600 FTLIFETIME=300 FTREFRESH=1 FORCENSU=1 LOG_LEVEL_SDN=LOG_LEVEL_DBG LOG_LEVEL_ATOM=LOG_LEVEL_DBG

uSDN Make Args:

  • NSUFREQ - Frequency of node state updates to the controller (seconds)
  • FTLIFETIME - Lifetime of flowtable entries (seconds)
  • FTREFRESH - Refresh flowtable entries on a match (0/1)
  • FORCENSU - Immediately send a NSU to the controller on join (0/1)
  • LOG_LEVEL_SDN - Set the uSDN log level (0 - 5)
  • LOG_LEVEL_ATOM - Set the Atom controller log level (0 - 5)

Multiflow Make Args:

  • MULTIFLOW - Turn on multiflow (0/1)
  • NUM_APPS - Number of flows (N)
  • FLOWIDS - Id for each flow ([0,1,2...])
  • TXNODES - Transmission nodes ([18,12...] 0 is ALL)
  • RXNODES - Receiving nodes ([1,2...])
  • DELAY - Delay each transmission (seconds)
  • BRMIN - Minimum bitrate (seconds)
  • BRMAX - Maximum bitrate (seconds)

Further Development

Future μSDN development will merge with μSDN-NG, based on the newer (and maintained) Contiki-NG.

Where is everything?

  • Core: /core/net/sdn/
  • Stack: /core/net/sdn/usdn/
  • Atom: /apps/atom/
  • Multiflow: /apps/multiflow/

Overview of optimization features

  • Fragmentation elimination.
  • Configurable controller update frequency.
  • Configurable flowtable lifetimes.
  • Flowtable matches on packet index + byte array.
  • Source routed control packets.
  • Throttling of repeated control packets.
  • Refreshing of regularly used flowtable entries.
  • SDN node configuration.
  • Control packet buffer.

Core

  • sdn.c

    Main SDN process.

  • sdn-cd.c

    Controller discovery and join services.

  • sdn-conf.c

    SDN node configuration.

  • sdn-ft.c

    SDN flowtable(s).

  • sdn-ext-header.c

    Extension headers for source routing.

  • sdn-packetbuf.c

    Buffer to allow storing of packets whilst nodes query the controller.

  • sdn-timer.h

    Timer configuration and macros.

  • sdn-stats.c

    SDN statistics. This also replaces the powertrace application from Contiki.

Stack

  • usdn-driver.c

    The driver interfaces with the flowtable to provide a basic API to allow specific functions, such as fowarding packets based on source/destination, aggregating packets, dropping packets, etc.

  • usdn-engine.c

    The engine handles incomming and outgoing SDN messages, using the API provided by the driver.

  • usdn-adapter.c

    The adapter provides a connection interface to the controller for a specific protocol. Currently this is for the μSDN protocol.

ATOM Controller

  • atom.c

    Main process for atom.

  • atom-buffer.c

    Buffer for incomming and outgoing packets.

  • atom-net.c

    Keeps tracks of and abstracts the network state for the contrller. My original idea for this was that the controller should be able to configure the network so that nodes update the view with the required metric, rather than all metrics, in order to keep the memory requirements down.

  • atom-sb-xx.c

    Atom allows you to create multiple southbound connectors. Currently we have a μSDN and RPL connector implemented.

  • atom-app-net-xx.c

    Network applications.

  • atom-app-route-xx.c

    Routing applications.

  • atom-app-join-xx.c

    Join/association applications.

Still to be Implemented...

  • Perform multiple flowtable entries on packets
  • Port to Contiki-NG (waiting for exp5438 motes to be supported)

Known Issues

  • Shortest Path Routing doesn't work well with larger network sizes (30+), use RPL-NS routing in this case! This is because it takes too long to compute all the possible paths on the central atom controller, and there are no checks to queue additional requests while it's computing.
  • Lots ;) Just ask if you have problems and I'll try to help as best I can.

[usdn_v1.2] - 19/03/19

  • Added compilation script so you can compile in one command: ./compile.sh ADD_MAKEFILE_ARGS_HERE*
  • Added a redirect example: usdn-redirect.csc
  • Modified uip6.c and usdn-driver.c so that RPL source routing packets are no longer automatically ignored by the SDN.
  • Changed Atom controller to use shortest path routing by default rather than RPL-NS routing!

[usdn_v1.1] - 17/07/18

  • Turned on default FT lifetimes.
  • Fixed issue where SDN was turned off in the Makefile (oops!).
  • Added hopcount to Atom ingress messages.
  • Added the NetSoft 2018 paper and slides.
  • Added Makefile.target so you don't need to type in target each time.
  • Fixes for automatic simulation through ContikiPy.

[usdn_v1.0] - 28/06/18

  • Initial commit.

usdn's People

Contributors

adamdunkels avatar alignan avatar atiselsts avatar bkozak-scanimetrics avatar bthebaudeau avatar cmorty avatar dak664 avatar darconeous avatar enricmcalvo avatar errordeveloper avatar fros4943 avatar g-oikonomou avatar herjulf avatar hexluthor avatar idelamer avatar jdede avatar jelmert avatar jimparis avatar kkrentz avatar laurentderu avatar malvira avatar mdlemay avatar mgrella avatar mmuman avatar nfi avatar oliverschmidt avatar remyleone avatar simonduq avatar thomas-ha avatar yatch avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

usdn's Issues

A question about routing

When the controller receives FTQ, how does it calculate the path? Is it the Dijkstra algorithm?

Compile error

When I switched to the directory _/examples / SDN / conttoller_ and executed the make instruction, an error occurred.
s j 44rr 7 4cysc slxc7

Doubt

Does this project have anything to do with μSDN mentioned in this article?
Santos L F D S , Mendonca F F D , Dias K L . μSDN: An SDN-Based Routing Architecture for Wireless Sensor Networks[C]// 2017 VII Brazilian Symposium on Computing Systems Engineering (SBESC). IEEE Computer Society, 2017

The green lines in cooja

Hi,
Do the green lines specify the control flow and blue lines the data flow?
The problem is that the green lines are always pointed to node 1. Can't we have multiple controllers? Can the controller be any node other than node 1?

Doubt about this repository and uSDN-NG repo

Hello!

I had a question as I have been consulting both repositories about uSDN, and it is not clear to me. It would be great if you could give me some guidance on this 😄

From what I've been seeing there are two uSDN repositories:

  • This one, which has the uSDN source code base and has Contiki support.
  • This other one, which is being progressively ported from the uSDN source code base to Contiki-NG.

Is this correct? Thank you!

When I turned to the directory '/examples / SDN / conttollers or nodes_ and executed the `make` instruction, an error. Furthermore, i did the both instructions but version msp430-gcc (GCC) 4.7.0 20120322 (mspgcc dev 20120716) not update it yet to 4.7.3

user@instant-contiki:~/usdn/examples/sdn/controller$ make
using saved target 'exp5438'
obj_exp5438/stats.d=
mkdir obj_exp5438
CC ../../../apps/multiflow/multiflow.c
CC ../../../apps/atom/atom.c
CC ../../../apps/atom/atom-buffer.c
CC ../../../apps/atom/atom-net.c
CC ../../../apps/atom/atom-sb-usdn.c
CC ../../../apps/atom/atom-sb-rpl.c
CC ../../../apps/atom/atom-app-route-sp.c
CC ../../../apps/atom/atom-app-route-rpl.c
CC ../../../apps/atom/atom-app-join-cfg.c
CC ../../../platform/exp5438/./msp430.c
CC ../../../core/dev/leds.c
CC ../../../platform/exp5438/./watchdog.c
CC ../../../platform/exp5438/./spix.c
CC ../../../dev/cc2420/cc2420.c
CC ../../../platform/exp5438/./cc2420-arch.c
CC ../../../platform/exp5438/./rtimer-arch.c
CC ../../../platform/exp5438/./node-id.c
CC ../../../platform/exp5438/./leds-arch.c
CC ../../../platform/exp5438/./uart1x.c
CC ../../../platform/exp5438/./lcd.c
CC ../../../platform/exp5438/./hal_lcd.c
CC ../../../platform/exp5438/./hal_lcd_fonts.c
CC ../../../platform/exp5438/./duty-cycle-scroller.c
CC ../../../core/cfs/cfs-ram.c
CC ../../../platform/exp5438/./uart1-putchar.c
CC ../../../core/lib/me.c
CC ../../../core/lib/me_tabs.c
CC ../../../core/dev/slip.c
CC ../../../core/lib/crc16.c
CC ../../../platform/exp5438/./flash.c
CC ../../../platform/exp5438/./clock.c
CC ../../../cpu/msp430/./lpm.c
CC ../../../core/loader/elfloader.c
CC ../../../core/loader/elfloader-msp430.c
CC ../../../core/loader/symtab.c
CC ../../../core/net/sdn/sdn.c
CC ../../../core/net/sdn/sdn-cd.c
CC ../../../core/net/sdn/sdn-conf.c
CC ../../../core/net/sdn/sdn-ext-header.c
CC ../../../core/net/sdn/sdn-ft.c
CC ../../../core/net/sdn/sdn-packetbuf.c
CC ../../../core/net/sdn/usdn/usdn-adapter.c
CC ../../../core/net/sdn/usdn/usdn-driver.c
CC ../../../core/net/sdn/usdn/usdn-engine.c
CC ../../../core/sys/arg.c
CC ../../../core/sys/autostart.c
CC ../../../core/sys/compower.c
CC ../../../core/sys/ctimer.c
CC ../../../core/sys/energest.c
CC ../../../core/sys/etimer.c
CC ../../../core/sys/log-ng.c
CC ../../../core/sys/mt.c
CC ../../../core/sys/process.c
CC ../../../core/sys/procinit.c
CC ../../../core/sys/rtimer.c
CC ../../../core/sys/stimer.c
CC ../../../core/sys/timer.c
CC ../../../core/dev/nullradio.c
CC ../../../core/dev/serial-line.c
CC ../../../core/lib/aes-128.c
CC ../../../core/lib/assert.c
CC ../../../core/lib/ccm-star.c
CC ../../../core/lib/gcr.c
CC ../../../core/lib/ifft.c
CC ../../../core/lib/list.c
CC ../../../core/lib/memb.c
CC ../../../core/lib/mmem.c
CC ../../../core/lib/petsciiconv.c
obj_exp5438/stats.o=
CC ../../../core/lib/random.c
CC ../../../core/lib/ringbuf.c
CC ../../../core/lib/ringbufindex.c
CC ../../../core/lib/sensors.c
CC ../../../core/lib/settings.c
CC ../../../core/lib/trickle-timer.c
CC ../../../core/net/ipv6/sicslowpan.c
CC ../../../core/net/ipv6/uip6.c
CC ../../../core/net/ipv6/uip-ds6.c
CC ../../../core/net/ipv6/uip-ds6-nbr.c
CC ../../../core/net/ipv6/uip-ds6-route.c
CC ../../../core/net/ipv6/uip-icmp6.c
CC ../../../core/net/ipv6/uip-nd6.c
CC ../../../core/net/ipv6/websocket.c
CC ../../../core/net/ipv6/websocket-http-client.c
CC ../../../core/net/ip/dhcpc.c
CC ../../../core/net/ip/ip64-addr.c
CC ../../../core/net/ip/psock.c
CC ../../../core/net/ip/resolv.c
CC ../../../core/net/ip/simple-udp.c
CC ../../../core/net/ip/slipdev.c
CC ../../../core/net/ip/tcpip.c
CC ../../../core/net/ip/tcp-socket.c
CC ../../../core/net/ip/udp-socket.c
CC ../../../core/net/ip/uip-debug.c
CC ../../../core/net/ip/uiplib.c
CC ../../../core/net/ip/uip-nameserver.c
CC ../../../core/net/ip/uip-packetqueue.c
CC ../../../core/net/ip/uip-split.c
CC ../../../core/net/ip/uip-udp-packet.c
CC ../../../core/net/rpl/rpl.c
CC ../../../core/net/rpl/rpl-dag.c
CC ../../../core/net/rpl/rpl-dag-root.c
CC ../../../core/net/rpl/rpl-ext-header.c
CC ../../../core/net/rpl/rpl-icmp6.c
CC ../../../core/net/rpl/rpl-mrhof.c
CC ../../../core/net/rpl/rpl-nbr-policy.c
CC ../../../core/net/rpl/rpl-ns.c
CC ../../../core/net/rpl/rpl-of0.c
CC ../../../core/net/rpl/rpl-sdn.c
CC ../../../core/net/rpl/rpl-timers.c
CC ../../../core/net/linkaddr.c
CC ../../../core/net/link-stats.c
CC ../../../core/net/nbr-table.c
CC ../../../core/net/net-debug.c
CC ../../../core/net/netstack.c
CC ../../../core/net/packetbuf.c
CC ../../../core/net/queuebuf.c
CC ../../../core/net/mac/csma.c
CC ../../../core/net/mac/frame802154.c
CC ../../../core/net/mac/frame802154e-ie.c
CC ../../../core/net/mac/framer-802154.c
CC ../../../core/net/mac/framer-nullmac.c
CC ../../../core/net/mac/mac.c
CC ../../../core/net/mac/mac-sequence.c
CC ../../../core/net/mac/nordc.c
CC ../../../core/net/mac/nullmac.c
CC ../../../core/net/mac/nullrdc.c
CC ../../../core/net/mac/nullrdc-noframer.c
CC ../../../core/net/mac/phase.c
CC ../../../core/net/mac/contikimac/contikimac.c
CC ../../../core/net/mac/contikimac/contikimac-framer.c
CC ../../../core/net/llsec/anti-replay.c
CC ../../../core/net/llsec/ccm-star-packetbuf.c
CC ../../../core/net/llsec/nullsec.c
cp ../../../tools/empty-symbols.c symbols.c
cp ../../../tools/empty-symbols.h symbols.h
CC symbols.c
CC ../../../core/net/sdn/sdn-stats.c
AR contiki-exp5438.a
msp430-ar: obj_exp5438/print-stats.o: No such file or directory
make: *** [contiki-exp5438.a] Error 1

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.