GSoC2018 DCE Upgrade: Difference between revisions
Sourabhjain (talk | contribs) |
Sourabhjain (talk | contribs) No edit summary |
||
Line 14: | Line 14: | ||
* '''About me:''' I am a master student at National Institute of Technology, Karnataka India. Currently, I am building a framework over ns-3-dce that automates the testing of TCP and AQM by using standard tools like netperf and iperf. | * '''About me:''' I am a master student at National Institute of Technology, Karnataka India. Currently, I am building a framework over ns-3-dce that automates the testing of TCP and AQM by using standard tools like netperf and iperf. | ||
= Technical Approach = | |||
In general, LKL offers userspace applications to use different kernel subsystems like the virtual file system, network stack, and scheduling. The plan is to adapt network stack functionality using LKL system call API. At the time of binary deployment over a node, DCE will load the LKL compiled binary. It then searches for sim_init function and tells to LKL the required set of function for a node. In return, LKL will give a structure of pointer to those functions so that DCE can use it later. | |||
In order to make DCE compatible with LKL, we need to adapt the host related function from LKL. There are approximately 35-40 host-related functions which are declared as structure lkl_host_operations in LKL. The objective is to redefine lkl_host_operation in the DCE environment. In addition to redefining those functions for DCE, we need to add glue to code to map LKL host functions to redefined DCE functions. | |||
== Steps to Recreate Working Environment on Ubuntu == | |||
'''Note:''' Tools needed to download the source code of DCE and LKL are mercurial and git. | |||
=== Install Direct Code Execution === | |||
* '''Required packages for DCE:''' This is a set of packages needed to install and run ns-3-dce. | |||
sudo apt install cmake cvs git bzr unrar p7zip-full autoconf build-essential bison flex g++ libc6 | |||
sudo apt install libc6-amd64 libdb-dev libexpat1-dev libpcap-dev libssl-dev python-dev python-pygraphviz | |||
sudo apt install python-pygoocanvas python-setuptools qt4-dev-tools | |||
* '''Clone the Bake:''' Software utility used to download and build ns-3-dce. | |||
hg clone http://code.nsnam.org/bake bake | |||
* '''Environment Variables:''' Following are the environment variables required to build the ns-3-dce | |||
export BAKE_HOME=`pwd`/bake | |||
export PATH=$PATH:$BAKE_HOME | |||
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME | |||
* '''Create a folder dce:''' This folder will contain ns-3-dce source code | |||
mkdir dce | |||
cd dce | |||
* ''' Configure DCE:''' This command will configure the ns-3-dce. Here -e indicates DCE version. | |||
bake.py configure -e dce-linux-dev | |||
* ''' Download and build ns-3-dce:''' Commands below will download and build the ns-3-dce and other dependent source code. Option -v is optional for debugging. | |||
bake.py download -v | |||
bake.py build -v | |||
The above steps are taken from https://www.nsnam.org/docs/bake/tutorial/html/bake-tutorial.html | |||
=== Install Linux Kernel library === | |||
* ''' Clone the LKL source code''' | |||
git clone https://github.com/sourabhjains/linux | |||
* ''' Switch to dce-support branch''' | |||
cd linux | |||
git checkout dce-support | |||
* ''' Build the LKL''' | |||
make -C tools/lkl | |||
* ''' Verify LKL shared library''' | |||
ls tools/lkl/lib/ | |||
'''Note:''' There should be a file called liblkl.so inside tools/lkl/lib | |||
* ''' More about LKL library''' | |||
readelf -h liblkl.so : reads the header | |||
readeld -d liblkl.so : read the dynamic section | |||
ldd liblkl.so : print the shared object dependencies. |
Revision as of 09:37, 17 May 2018
Main Page - Roadmap - Summer Projects - Project Ideas - Developer FAQ - Tools - Related Projects
HOWTOs - Installation - Troubleshooting - User FAQ - Samples - Models - Education - Contributed Code - Papers
Return to GSoC 2018 Accepted Projects page.
Project overview
- Project name: Direct Code Execution upgrade
- Student: Sourabh Jain
- Mentors: Matthieu Coudron, Natale Patriciello
- Abstract: Direct Code Execution is a framework for ns-3. It facilitates to execute Linux kernel and Linux userspace networking applications inside ns-3 without changing their code. In order to provide such functionality, DCE integrates network simulator with custom Linux kernels like net-next-sim or net-next-nuse (LibOs). But net-next-nuse has not kept pace with new versions of Linux kernel. This has been the major hindrance for DCE to use latest Linux kernel. An active alternate to LibOs is Linux Kernel Library (LKL) which provides similar features of LibOs and supports latest Linux kernel versions. In this project, DCE will extend to support the networking stack of LKL and embed real libc in LKL.
- About me: I am a master student at National Institute of Technology, Karnataka India. Currently, I am building a framework over ns-3-dce that automates the testing of TCP and AQM by using standard tools like netperf and iperf.
Technical Approach
In general, LKL offers userspace applications to use different kernel subsystems like the virtual file system, network stack, and scheduling. The plan is to adapt network stack functionality using LKL system call API. At the time of binary deployment over a node, DCE will load the LKL compiled binary. It then searches for sim_init function and tells to LKL the required set of function for a node. In return, LKL will give a structure of pointer to those functions so that DCE can use it later. In order to make DCE compatible with LKL, we need to adapt the host related function from LKL. There are approximately 35-40 host-related functions which are declared as structure lkl_host_operations in LKL. The objective is to redefine lkl_host_operation in the DCE environment. In addition to redefining those functions for DCE, we need to add glue to code to map LKL host functions to redefined DCE functions.
Steps to Recreate Working Environment on Ubuntu
Note: Tools needed to download the source code of DCE and LKL are mercurial and git.
Install Direct Code Execution
- Required packages for DCE: This is a set of packages needed to install and run ns-3-dce.
sudo apt install cmake cvs git bzr unrar p7zip-full autoconf build-essential bison flex g++ libc6 sudo apt install libc6-amd64 libdb-dev libexpat1-dev libpcap-dev libssl-dev python-dev python-pygraphviz sudo apt install python-pygoocanvas python-setuptools qt4-dev-tools
- Clone the Bake: Software utility used to download and build ns-3-dce.
hg clone http://code.nsnam.org/bake bake
- Environment Variables: Following are the environment variables required to build the ns-3-dce
export BAKE_HOME=`pwd`/bake export PATH=$PATH:$BAKE_HOME export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
- Create a folder dce: This folder will contain ns-3-dce source code
mkdir dce cd dce
- Configure DCE: This command will configure the ns-3-dce. Here -e indicates DCE version.
bake.py configure -e dce-linux-dev
- Download and build ns-3-dce: Commands below will download and build the ns-3-dce and other dependent source code. Option -v is optional for debugging.
bake.py download -v bake.py build -v
The above steps are taken from https://www.nsnam.org/docs/bake/tutorial/html/bake-tutorial.html
Install Linux Kernel library
- Clone the LKL source code
git clone https://github.com/sourabhjains/linux
- Switch to dce-support branch
cd linux git checkout dce-support
- Build the LKL
make -C tools/lkl
- Verify LKL shared library
ls tools/lkl/lib/
Note: There should be a file called liblkl.so inside tools/lkl/lib
- More about LKL library
readelf -h liblkl.so : reads the header readeld -d liblkl.so : read the dynamic section ldd liblkl.so : print the shared object dependencies.