Skip to content

boulouk/priodex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrioDeX

PrioDeX is a cross-layer middleware that facilitates timely and effective exchange of data for coordinating emergency response activities. Emergency scenarios may challenge/congest the network infrastructure. PrioDeX addresses these situations by prioritizing event delivery and by dropping some low priority events. It adopts a publish-subscribe data exchange paradigm with brokers at the network edge to manage prioritized delivery of mission-critical data from IoT sources to relevant subscribers.

See [1, 2] for more details on the PrioDeX middleware.

Getting started

These instructions will get you a copy of the PrioDeX project up and running on your local machine.

Prerequisites

Install VirtualBox.
Install Ubuntu 14.04.

Installing

These steps will walk you trough the installation of the PrioDeX project from scratch (clean Ubuntu Virtual Machine).

To install:

  • Java
  • Git
  • Mininet
  • Modified version of OVS
  • PyCharm and Eclipse
  • Get the PrioDeX source code

Java

To install Java type the following commands on your terminal.

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Git

To install Git type the following command on your terminal.

sudo apt-get install git

Mininet

To install Mininet type the following commands on your terminal.

git clone git://github.com/mininet/mininet
sudo mininet/util/install.sh -nfv

OVS

To install the modified version of OVS take the following steps:

  • remove the OVS version installed with Mininet
sudo apt-get remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch
  • download the new OVS version
sudo wget http://openvswitch.org/releases/openvswitch-2.1.0.tar.gz
sudo tar zxfv openvswitch-2.1.0.tar.gz
cd openvswitch-2.1.0/
  • make minimal changes to OVS_HOME/ofproto/ofproto-dpif-xlate.c as follows [3]:

    • add headers
    #include <stdlib.h>
    #include <time.h>
    
    • add global variable
    static bool is_srand_initialized = false;
    
    • modify functions
    static void
    xlate_select_group(struct xlate_ctx *ctx, struct group_dpif *group)
    {
        struct flow_wildcards *wc = &ctx->xout->wc;
        const struct ofputil_bucket *bucket;
        uint32_t basis;
    
        // The following tells the caching code that every packet in
        // the flow in question must go to the userspace "slow path".
        ctx->xout->slow |= SLOW_CONTROLLER;
    
        basis = hash_bytes(ctx->xin->flow.dl_dst, sizeof ctx->xin->flow.dl_dst, 0);
        bucket = group_best_live_bucket(ctx, group, basis);
        if (bucket) {
            memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst);
            xlate_group_bucket(ctx, bucket);
        }
    }
    
    static const struct ofputil_bucket *
    group_best_live_bucket(const struct xlate_ctx *ctx,
                       const struct group_dpif *group,
                       uint32_t basis) // basis in not being used
    {
        uint32_t rand_num = 0, sum = 0;
        const struct ofputil_bucket *bucket = NULL;
        const struct list *buckets;
    
        // initialize random seed once
        if (!is_srand_initialized) {
            srand(time(NULL));
            is_srand_initialized = true;
        }
    
        // generate a random number in [1, 100]
        rand_num = (rand() % 100) + 1;
    
        group_dpif_get_buckets(group, &buckets);
        LIST_FOR_EACH (bucket, list_node, buckets) {
            if (bucket_is_alive(ctx, bucket, 0)) {
                sum += bucket->weight;
                if (rand_num <= sum) {
                    return bucket; // return this bucket
                }
            }
        }
    
        return bucket; // return NULL
    }
    
  • compile the OVS source code

sudo apt-get install build-essential fakeroot
sudo apt-get install debhelper autoconf automake libssl-dev pkg-config bzip2 openssl python-all procps python-qt4 python-zopeinterface python-twisted-conch dh-autoreconf
`DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary`
  • install OVS
cd ..
sudo dpkg -i openvswitch-common*.deb openvswitch-pki*.deb openvswitch-switch*.deb

PyCharm and Eclipse

Install PyCharm and Eclipse.

Get the PrioDeX source code

Download the PrioDeX repository.

git clone https://github.com/boulouk/priodex.git

Finishing up

Finally you need to import the project dependencies (make sure that you are using Python 2.7).

PrioDeX static dependencies

Run PyCharm (file PY_CHARM_HOME/bin/pycharm.sh) as root (sudo) and open the following projects in the priodex-static directory:

  • experimental-framework
  • sdn-controller
  • priodex-coordinator-service

Import the following dependencies:

  • experimental-framework -> numpy, requests, matplotlib, pandas (add the Mininet project as a dependency)
  • sdn-controller -> ryu, decorator (mark the application directory as Sources Root, add the NetworkX project as a dependency)
  • priodex-coordinator-service -> flask, numpy, requests

PrioDeX dynamic dependencies

Run PyCharm (file PY_CHARM_HOME/bin/pycharm.sh) as root (sudo) and open the following projects in the priodex-dynamic directory:

  • experimental-framework
  • sdn-controller
  • priodex-coordinator-service

Import the following dependencies:

  • experimental-framework -> numpy, requests (add the Mininet project as a dependency)
  • sdn-controller -> ryu, decorator (mark the application directory as Sources Root, add the NetworkX project as a dependency)
  • priodex-coordinator-service -> flask, numpy, cvxpy, requests

Running - PrioDeX static

Run PyCharm (file PY_CHARM_HOME/bin/pycharm.sh) as root (sudo) and open the following projects in the priodex-static directory:

  • experimental-framework
  • sdn-controller
  • priodex-coordinator-service

The configuration parameters are in the scenario directory of the experimental-framework project:

  • experiment_scenario.py
    • RUN defines the type of experiment to run (analytical model, Mininet simulation, both)
  • priodex_scenario.py
    • EXPERIMENT_DURATION sets the duration of the experiment
    • NETWORK_FLOWS and PRIORITIES allow to set respectively the number of network flows and the number of priorities
    • NETWORK_FLOW_ALGORITHM, PRIORITY_ALGORITHM and DROP_RATE_ALGORITHM apply the various PrioDeX algorithms
    • TOLERANCE represents the percentage of bandwidth reserved for temporary traffic peaks
  • network_scenario.py
    • BANDWIDTH defines the available bandwidth between broker and subscribers
  • topology_scenario.py
    • SUBSCRIBER allows to modify the number of subscribers and their subscriptions (topic and utility function)
    • PUBLISHER allows to modify the number of publishers and their publications (topic, publication rate and message size)

Note: run the applications in the following order:

  • priodex-coordinator-service (file to run: priodex_middleware.py)
  • sdn-controller (file to run: sdn_controller.py)
  • experimental-framework (file to run: experimental_framework.py - to plot the results: analysis_framework.py)

The default configuration runs 10 subscribers with ρ = 1.5 (network load).

The following images show the performance of the system (response time and success rate) of the default configuration.

Response time

Success rate

Running - PrioDeX dynamic

Run PyCharm (file PY_CHARM_HOME/bin/pycharm.sh) as root (sudo) and open the following projects in the priodex-dynamic directory:

  • experimental-framework
  • sdn-controller
  • priodex-coordinator-service

The configuration parameters are in the scenario directory of the experimental-framework project:

  • experiment_scenario.py
    • EXPERIMENT_DURATION sets the duration of the experiment
    • SUBSCRIBER allows to modify the number of subscribers and their subscriptions (topic and utility function)
    • PUBLISHER allows to modify the number of publishers and their publications (topic, publication rate and message size)
  • priodex_scenario.py
    • NETWORK_FLOWS and PRIORITIES allow to set respectively the number of network flows and the number of priorities
    • NETWORK_FLOW_ALGORITHM, PRIORITY_ALGORITHM and DROP_RATE_ALGORITHM apply the various PrioDeX algorithms
    • RHO_TOLERANCE represents the percentage of bandwidth reserved for temporary traffic peaks
  • network_scenario.py
    • BANDWIDTH defines the available bandwidth between broker and subscribers

Note: run the applications in the following order:

  • priodex-coordinator-service (file to run: priodex_middleware.py)
  • sdn-controller (file to run: sdn_controller.py)
  • experimental-framework (file to run: experimental_framework.py - to plot the results use the dashboard)

The default configuration runs 5 subscribers with ρ = 1.2 (network load).

The following images show the performance experienced by subscriptions with different importance (high importance/priority vs. low importance/priority).

Subscriptions with different priorities

References

[1] https://hal.inria.fr/hal-01877555
[2] https://hal.inria.fr/hal-01895274
[3] https://github.com/saeenali/openvswitch/wiki/Stochastic-Switching-using-Open-vSwitch-in-Mininet

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published