Skip to content

Commit

Permalink
Update README of NC for transport app
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelorenz committed Dec 5, 2019
1 parent edb8021 commit 20beafc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 40 deletions.
45 changes: 21 additions & 24 deletions app/network_coding_for_transport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ Topology: Host 1 --- Host 2 --- Host 3 --- Host 4 --- .... --- Host N-2

This folder contains following files:

1. Dockerfile: The dockerfile to build encoder, recoder and decoder VNF containers.
1. Dockerfile: The dockerfile to build encoder, recoder and decoder VNF containers.

2. build_kodo_lib.sh: Script to build Kodo library on the system running the Testbed. Because Kodo requires
[Licence](http://steinwurf.com/license.html), the binaries can not be released. The dynamic library file kodo.so must
be built firstly and located in this directory to run the emulation. This script will build the library (source are
downloaded in "$HOME/kodo-python") and copy it to this directory.
2. build_kodo_lib.sh: Script to build Kodo library on the system running the Testbed. Because Kodo requires
[Licence](http://steinwurf.com/license.html), the binaries can not be released. The dynamic library file kodo.so must
be built firstly and located in this directory to run the emulation. This script will build the library (source are
downloaded in "$HOME/kodo-python") and copy it to this directory.

3. build_docker_images.sh: Script to build all coder containers.
3. build_docker_images.sh: Script to build all coder containers.

4. encoder.py recoder.py decoder.py common.py rawsock_helpers.py log.py: Python program for coders and helpers. Since
the VNF should work on network layer and handle Ethernet frames. [Linux Packet
Socket](http://man7.org/linux/man-pages/man7/packet.7.html) is used. These programs are copied into VNF containers
when run ./build_docker_images.sh
4. encoder.py recoder.py decoder.py common.py rawsock_helpers.py log.py: Python program for coders and helpers. Since
the VNF should work on network layer and handle Ethernet frames.
[Linux Packet Socket](http://man7.org/linux/man-pages/man7/packet.7.html) is used.
These programs are copied into VNF containers when run ./build_docker_images.sh

5. multihop_topo.py: The emulation program. Contains the process to create the topology, deploy coder VNFs and run
measurements (With [Iperf](https://iperf.fr/)).
5. multihop_topo.py: The emulation program. Contains the process to create the topology, deploy coder VNFs and run
measurements (With [Iperf](https://iperf.fr/)).

You can simple run the emulation with following commands (The container images in ../../test_containers/ should be
already built):
Expand All @@ -44,18 +44,15 @@ This application creates the chain topology with Docker hosts (require minimal 5
loss rates (currently all links have the same and fixed loss rates).

There are multiple main profiles(test setups/scenarios) implemented in multihop_topo.py. In all profiles, encoder and
decoder use [on-the-fly full vector
RLNC](https://github.com/steinwurf/kodo-python/blob/master/examples/encode_on_the_fly.py)(field size, generation size
and payload size are defined in [common.py](./common.py)). The recode can either store-and-forward or recode-and-forward
based on the configuration.
decoder use [on-the-fly full vector RLNC](https://github.com/steinwurf/kodo-python/blob/master/examples/encode_on_the_fly.py)
(field size, generation size and payload size are defined in [common.py](./common.py)).
The recode can either store-and-forward or recode-and-forward based on the configuration.

1. [FINISHED] mobile\_recoder\_deterministic: In this scenario, due to the latency/computation overhead. Only one recoder
can enable the recode-and-forward mode. Other recoders perform store-and-forward. For the deterministic scenario, the
recode function is enabled from left to right one by one.
1. mobile\_recoder\_deterministic: In this scenario, due to the latency/computation overhead. Only one recoder can
enable the recode-and-forward mode. Other recoders perform store-and-forward. For the deterministic scenario, the
recode function is enabled from left to right one by one.

2. [WIP] mobile\_recoder\_dynamic:
1. adaptive\_redundancy: All coders configure their redundancy based on the monitor statistics of the SDN controller.
Please read the guide [adaptive_redundancy.md](./adaptive_redundancy.md) to run this profile.

3. [WIP] adaptive\_redundancy: All coders configure their redundancy based on the monitor statistics of the SDN
controller.

For all profiles, UDP and TCP(WIP) traffic is generated from Client to Server with Iperf to measure packet losses.
For all profiles, UDP traffic is generated from Client to Server with Iperf to measure throughput and packet losses.
5 changes: 4 additions & 1 deletion app/network_coding_for_transport/adaptive_redundancy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Network Coding for Transport #

## Adaptive redundancy ##

### Motivation and Setup ###

This examples demonstrates how to leverage the SDN controller's knowledge about the network parameters to flexibly adapt
the redundancy created by Random Linear Network Coding (RLNC) to repair losses in the transmission.

Expand Down Expand Up @@ -34,4 +37,4 @@ The experiment can be run with:
$ sudo python3 adaptive_redundancy.py
```

Parameters can be found in [common.py](./common.py)
Parameters can be found in [common.py](./common.py)
24 changes: 9 additions & 15 deletions app/network_coding_for_transport/multihop_topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# vim:fenc=utf-8

"""
About: Example of using Network Coding (NC) for transport on a multi-hop topology
About: Example of using Network Coding (NC) for transport on a multi-hop topology.
"""


Expand All @@ -14,14 +14,11 @@

from common import SYMBOL_SIZE
from comnetsemu.net import Containernet, VNFManager
from mininet.link import TCLink
from mininet.log import error, info, setLogLevel
from mininet.node import Controller
from mininet.link import TCLink


# Just for prototyping...
# Should be replaced with SDN controller application
# ------------------------------------------------------------------------------
def get_ofport(ifce):
"""Get the openflow port based on iterface name
Expand Down Expand Up @@ -80,9 +77,6 @@ def dump_ovs_flows(switch_num):
print(ret.decode("utf-8"))


# ------------------------------------------------------------------------------


def disable_cksum_offload(switch_num):
"""Disable RX/TX checksum offloading"""
for i in range(switch_num):
Expand All @@ -91,10 +85,7 @@ def disable_cksum_offload(switch_num):


def save_hosts_info(hosts):
"""Save host's info (name, MAC, IP) in a CSV file
:param hosts:
"""
"""Save host's info (name, MAC, IP) in a CSV file."""
info = list()
for i, h in enumerate(hosts):
mac = str(h.MAC("h{}-s{}".format(i + 1, i + 1)))
Expand Down Expand Up @@ -205,7 +196,7 @@ def run_iperf_test(h_clt, h_srv, proto, time=10, print_clt_log=False):
"bw": "5K",
"time": time,
"interval": 1,
"length": str(SYMBOL_SIZE),
"length": str(SYMBOL_SIZE - 60),
"proto": "-u",
"suffix": "> /dev/null 2>&1 &",
}
Expand Down Expand Up @@ -252,12 +243,15 @@ def create_topology(net, host_num):
last_sw = None
# Connect hosts
for i in range(host_num):
# Each host gets 50%/n of system CPU
# Let kernel schedule all hosts based on their workload.
# The recoder needs more computational resources than en- and decoder.
# Hard-coded cfs quota can cause different results on machines with
# different performance.
host = net.addDockerHost(
"h%s" % (i + 1),
dimage="dev_test",
ip="10.0.0.%s" % (i + 1),
docker_args={"cpu_quota": int(50000 / host_num)},
docker_args={"hostname": "h%s" % (i + 1)},
)
hosts.append(host)
switch = net.addSwitch("s%s" % (i + 1))
Expand Down

0 comments on commit 20beafc

Please sign in to comment.