NSIS-ka
A free C++ implementation of NSIS protocols

Documentation of the Implementation

There are several READMEs and verbose comments throughout the code. so most doxygen documentation is in the code that can be conveniently browsed by using Doxygen here.

Basic infrastructure mechanisms such as threads, communication between threads, transport protocols, IPv4/IPv6 addressing, PDU construction and parsing are provided by the protlib library.

The implementation has a very verbose logging mechanism that tells you well what's going on.

Prerequisites

To build the programs/libraries, be sure to have the following packages installed (your favourite distribution's names may vary though):

  • g++
  • gcc
  • make
  • libtool
  • pkg-config
  • libnetfilter-queue-dev
  • iptables-dev
  • libssl-dev
  • automake
  • autoconf
  • libcppunit-dev
  • libsctp-dev (optional)

or for convenience:

sudo apt-get install g++ gcc make libtool pkg-config libnetfilter-queue-dev iptables-dev libssl-dev automake autoconf libcppunit-dev libsctp-dev

Quick Start Guide for running QoS NSLP

Hint: you need the autotools package for this to work, e.g., apt-get install automake autoconf, alternatively use the tarball .tar.gz distribution, it comes already with a configure script.

svn co https://svn.tm.kit.edu/nsis/dist/nsis-ka/trunk/ nsis-ka-trunk
cd nsis-ka-trunk
make -f Makefile.svn
./configure
make

... and test:

Open a shell on machine 1. Edit the configuration file and configure the local IP addresses of the machine. Start a QoS-NSLP instance:

nano etc/nsis-ka.conf
cd qos-nslp/src/
sudo ./start-qosnslp

Open two shells on machine 2. Edit the configuration file and configure the local IP addresses of the machine. Start a QoS-NSLP instance by executing:

nano etc/nsis-ka.conf
cd qos-nslp/src/
sudo ./start-qosnslp

Use the second shell on machine 2 to send a QoS-Reserve towards machine 1:

cd qos-nslp/src/
sudo ./client <IP-of-machine-2> <IP-of-machine-1>

Observe the log output on each machine to see whether everything works correctly.

Running/Building other NSLPs on top of NSIS-ka

Basically, we have a message-based interface that resembles the proposed GIST API with RecvMessage and SendMessage etc (see Appendix B of the GIST RFC).

https://svn.tm.kit.edu/nsis/ntlp/trunk/src/apimessage.cpp contains some further hints.

There are two different ways that you could use to connect an NSLP to our GIST implementation 1) create a thread and link it together with ntlp so that

you have one single process containing ntlp + the nslp

2) use the socket api that was provided for the FreeNSIS

implementation

For 1) you need to create a Thread having its own internal queue address.

Example code is in https://svn.tm.kit.edu/nsis/natfw-nslp/trunk/src/gistka_mapper.cpp:

ntlp::APIMsg *apimsg = new ntlp::APIMsg();
        apimsg->set_source(natfw_config::INPUT_QUEUE_ADDRESS);
        apimsg->set_sendmessage(data, msg_handle, nslp_id, sid, nslp_mri, sii_handle, attr, timeout, ip_ttl, ntlp_hop_count);

and then you have to actually send the message to the NTLP thread, e.g., apimsg->send_to(qaddr_coordinator_ext);

Another example can be found in QoS-NSLP: ProcessingModule::process_gist_api_msg(ntlp::APIMsg* apimsg) and ProcessingModule::SendMessage?() show how an internal GIST API message is received or sent.

In case you have a running NSLP in FreeNSIS maybe option 2) is easier: you could probably simply use the UNIX domain-based socket API, i.e., https://svn.tm.kit.edu/nsis/ntlp/trunk/src/apiwrapper.cpp contains code to receive/send messages from/to Uni Goettingen NSLPs via a Unix domain socket. This way you can compile the gistping application and use it together unmodified with our NTLP.

Option 1) is recommended in case you look for performance measurements...(please disable logging for measurements then, the speedup is dramatically).

Overview of the Implementation architecture

The architecture is composed of different modules that usually run one or more (POSIX) threads inside. Threads are communicating via internal message passing and message queues.

Last modified 6 years ago Last modified on Feb 2, 2012, 1:49:22 PM

Attachments (1)

Download all attachments as: .zip