Policy-based Resilience Simulator with OMNeT++/Building Distack

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Distack compiles successfully on 64-bit systems (or says so) but on trying to access the library, it gives an error (associated with libdistack.so). That is why I recommended to go for a 32-bit OS at the beginning.

Install Dependencies

[edit | edit source]

You need to install few dependencies before building distack:

libxerces-c-dev libboost-all-dev autotools-dev automake autoconf libpthread-workqueue-dev libpthread-stubs0-dev libltdl-dev libpcap-dev gnuplot

Download and Extract

[edit | edit source]

Download Distack Source tar ball from here (ID #7). Extract it to the omnetpp folder.

Patching ReaSE

[edit | edit source]

Now copy distack-1.2.3-dev/etc/patches/rease/distack_rease.patch to omnetpp folder in Home (parent directory of "ReaSE" folder) and navigate to that directory in terminal and to apply the patch, do the following:

patch -p0 < ./distack_rease.patch

You should see an output like this:

patching file ReaSE/src/applications/util/DistackRAOData.msg
patching file ReaSE/src/applications/util/DistackRemoteTCPPayload.msg
patching file ReaSE/src/networklayer/ipv4/IP_hack.cc
patching file ReaSE/src/networklayer/ipv4/IP_hack.h
patching file ReaSE/src/networklayer/ipv4/IP_hack.ned
patching file ReaSE/src/nodes/inet/DDoSZombie.ned
patching file ReaSE/src/nodes/inet/DistackOmnetIDS.ned
patching file ReaSE/src/nodes/inet/DistackOmnetModule.ned
patching file ReaSE/src/nodes/inet/NetworkLayer_hack.ned
patching file ReaSE/src/nodes/inet/TraceRouter.ned
patching file ReaSE/src/nodes/inet/WormHost.ned
patching file ReaSE/src/transport/contract/DistackTCPSocketMap.cc
patching file ReaSE/src/transport/contract/DistackTCPSocketMap.h

If, by any chance, the files are created in a temporary directory, for e.g., ReaSE_patched, make sure you copy these files into the ReaSE/src directory.

Rebuilding ReaSE

[edit | edit source]

Now go to OMNeT++ IDE, Right Click on ReaSE in Project Explorer, click "Clean Project" and then build it pressing Ctrl +B or Project > Build All.

Building Distack

[edit | edit source]

In terminal, navigate to distack folder and run:


In following command, replace <your_username> with your username:

./configure CPPFLAGS='-I/home/<your_user_name>/omnetpp-4.1/include -I/home/<your_username>/inet/src/networklayer/ipv4 -I/home/<your_username>/inet/src/base -I/home/<your_username>/inet/src/networklayer/contract -I/home/<your_username>/inet/src/networklayer/common -I/home/<your_username>/inet/src/linklayer/contract -I/home/<your_username>/inet/src/transport/tcp -I/home/<your_username>/inet/src/transport/udp -I/home/<your_username>/inet/src/transport/contract -I/home/<your_username>/inet/src/networklayer/arp -I/home/<your_username>/ReaSE/src/transport/contract -I/home/<your_username>/ReaSE/src/base -I/home/<your_username>/ReaSE/src/applications/util' --enable-simulation=yes

Then run


The Distack libraries will be in the directory: /distack/src/.libs/ Now you need to patch INET and ReaSE.

ReaSE and XML-RPC · Patching INET and ReaSE