Menu

HowTo: Create Scenario

HowTo (3)
nikanas

  ______ ___    ____  ______
 /_  __//   |  / __ \/ ____/ [T]estbed for
  / /  / /| | / /_/ / __/    [A]d-Hoc
 / /  / ___ |/ ____/ /___    [P]rotocol
/_/  /_/  |_/_/   /_____/    [E]valuation

Create scenario file

For creating a scenario file, you need to know the overall situation and objectives of the test.

Example:
A-->B--C

Situation:
The test required the node to be in network as the topology above. The test will include ping test from node A to node C.

From above, A can see B, B can see C and C can’t see A. We can emulate this situation by using filter function in test script (start_test/_cable). The ape_mac_disable() will drop the packet based on MAC address.

To make above situation happen, command for each nodes are (you need to write the code in scenario file):

For A=0, B=1, C=2
In node A: ape_mac_disable 2
In node C: ape_mac_disable 0

You can also make the topology always changing by disable the filter function using ape_mac_enable() periodically. Example, you want to let node A see node C use; ape_mac_enable 2.

This function useful if you want to add mobility (or available of the node) to the node, but you can’t move all the nodes physically, for example in a computer lab.

For ping test;
To test the connection between node A and C, you can use ape_ping_node(). This is same as normal ping. Example command is:

For A=0, B=1, C=2
In node A: ape_ping_node 2 50 56 (ping node C , for 50 packets and size of 56 bytes)

Full example for situation above:

// generic setup/teardown instructions --------------------

choreography.scenario.title=EXAMPLE1
// this name will appear at scenario selection in test script.
choreography.scenario.description=Block all connection at node A, and test the link with ping.
//this is the description.
choreography.total.nodes=3
//total nodes in this scenario.
choreography.startup.command.0=ape_startup
//this is important step, and all scenarios should include this.

choreography.shutdown.command.0=ape_copy_files
// this will copy file from /var/log/ to /mnt/hostfs/TAPE/log.
choreography.shutdown.command.1=ape_pack_files
// this will tar and gz the log in /mnt/hostfs/TAPE/log.

// node 0 --------------------------------------------------------------

node.0.ip=192.168.5.40 //the node IP number
node.0.ipmask=255.255.255.0 //the node mask
node.0.action.0.msg=Starting test, this is node A. //this is message for this action.0
node.0.action.0.duration=1 //this action.0 duration
node.0.action.1.msg=Blocking node C. //this is message for this action.1
node.0.action.1.command=ape_mac_disable 2 // this the command for action.1
node.0.action.1.duration=5 // this action.1 duration
node.0.action.2.msg=Now pinging node B for 15 second. // this is message for this action.2
node.0.action.2.command=ape_ping_node 2 50 65 // this the command for action.2
node.0.action.2.duration=55 // this action.2 duration
node.0.action.3.msg=Ping should be finished about now. // this is message for this action.3
node.0.action.3.duration=1 // this action.3 duration
node.0.action.3.command=exit // this the command for action.3

// node 1 --------------------------------------------------------------

node.1.ip=192.168.5.41
node.1.ipmask=255.255.255.0
node.1.action.0.msg=This is node B.
node.1.action.0.duration=1
node.1.action.1.msg=Wait for ping.
node.1.action.1.duration=60
node.1.action.2.msg=Ping should be finished about now.
node.1.action.2.duration=1
node.1.action.2.command=exit

// node 2 --------------------------------------------------------------

node.2.ip=192.168.5.42
node.2.ipmask=255.255.255.0
node.2.action.0.msg=This is node C.
node.2.action.0.duration=1
node.2.action.1.msg=Blocking node A.
node.2.action.1.command=ape_mac_disable 0
node.2.action.1.duration=5
node.2.action.2.msg=Wait for ping.
node.2.action.2.duration=55
node.2.action.3.msg=Ping should be finished about now.
node.2.action.3.duration=1
node.2.action.3.command=exit

// eof


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.