NEmu

Network Emulator for Mobile Universes

Documentation - Sessions

A session represents a network topology laying on a single physical machine. A virtual network can be composed of several distributed sessions. A session consists by a directory in the file system of the physical machine. This directory contains the whole configuration of the session.

InitNemu(session, workspace, hdcopy, color, quiet)

This is the function which initializes the session directory and global configuration. A symbolic link which points to the session is also created in the current directory. The name of the symbolic link is symlink.{session name}.
InitNemu has to be called before configuring anything!
session is the name of the session. If it is not indicated, the session will be set automatically as nemu.session.{random value}.
workspace is the parent directory where will be stored the session directory (default: /tmp).
hdcopy is a boolean which indicates if file systems of virtual nodes have to be copied in the session directory (default: True).
color is a boolean which indicates if NEmu messages have to be colorized (default: True).
quiet is a boolean which indicates if NEmu messages have to be disable on the standard output (default: False).

If InitNemu is called on a session which already exists, NEmu will check it and merge the previous one in the new on. A session writes its events in the log file {workspace}/{session name}/nemu.log.

DelNemu()

This function deletes the current session directory and resets the configuration to blank.

StartNemu()

This function launches virtual elements of the NEmu session.

StopNemu()

This function stops virtual elements of the NEmu session.

$ nemu
Welcome to the Network Emulator for Mobile Universes [NEmu]
[nemu]~> InitNemu()
Init session in
/tmp/nemu.session.ffLjVF
Init log in
/tmp/nemu.session.ffLjVF/nemu.log
Link point is
symlink.nemu.session.ffLjVF
[nemu]~> quit()

$ ls . /tmp
.:
symlink.nemu.session.ffLjVF
/tmp:
nemu.session.ffLjVF

$ nemu
Welcome to the Network Emulator for Mobile Universes [NEmu]
[nemu]~> InitNemu(session="nemu.session.ffLjVF")
Init session in
/tmp/nemu.session.ffLjVF
Init log in
/tmp/nemu.session.ffLjVF/nemu.log
Link point is
symlink.nemu.session.ffLjVF
[nemu]~> DelNemu()
Removing current session
Done.
[nemu]~> quit()

$ ls . /tmp
.:
/tmp:

GetVar(*largs)

This function displays several NEmu core properties and returns the result in a list. Those properties are located in the class NemuVar from the file nemu.d/nemu/var.py

SetVar(**kargs)

This function sets several NEmu core properties. Please be very careful when using this function.

[nemu]~> GetVar('nemud', 'session', 'workspace', 'arch', 'color')
nemud='/opt/local/nemu/nemu.d'
session='nemu.session.AknrD2'
workspace='/tmp'
arch='Linux-x86_64'
color=True
[nemu]~> SetVar(color=False)
color=False