nsBench Examples
3. Web Example
4. LAN Example
6. Differentiated Services Example
1) Start nsBench
by double clicking on the nsBench.jar file
2) Create 2 nodes by clicking
on the round icon and selecting nodes. (see figure 1a)
Figure 1a: two nodes
3) The node names can be
changed by double clicking each node. (see figure 1b)
Figure 1b: Node dialog window
4) To create a link between
two nodes simply click in the center of one of the nodes and drag the link to
the center of the other node. (see figure 1c)
Figure 1c: Adding link between two nodes
5) Now that you know how to
create nodes and links, let’s create a more interesting topology using the same
steps described above. (see figure 1d)
Figure 1d: Combination of nodes and links
6) Now that we have created
the topology that we were looking for, we need to add agent to the nodes. To do
click on the node that you want to add the agent to, and then select the agent
from the list that is generated when you select the sqare
icon from the menu. Repeat this step as many times as agents you want to add. (see figure 1e)
Figure 1e: Adding transport objects
7) Once the agents have been
added you need to create the logical connection between them. The logical
connection represents the flow of data (From/To). If we have a TCP agent and a
Sink agent the traffic needs to flow from the TCP to the Sink. To perform these
simply click on the middle of the sender agent and drag the link to the middle
of the receiving agent. Note that if the operation is invalid the link will not
be established. (See figure 1f). The transport agents can be configured by double
clicking on the agent icon.
Figure 1f: Logical link between transport agents
8) Now
that are agents and logical connection are setup, we can go ahead and add our
applications/traffic generators to the agents. To Perform
this operation click on the agent that needs an application and then select the
application from the diamond shape icon on the menu. (see
figure 1h). The applications can be configured by double clicking on the icon.
Figure 1h: Adding a telnet agent
9) The topology is now complete.
The only thing left is to configure the scenario. In the scenario the user will
be able to specify the way that the simulation will be run. To bring the
scenario window, click on the configuration menu and select scenario. (see figure 1i).
Figure 1i: Scenario drop down
10) The scenario window will
now appear. Click on the add row to insert a row and set the start time in the
Time column. Then select the application you want to start from the application
dropdown box, and then select the action you want to perform. By default the
actions are start and stop, but the user can type any other type of action. The
Group Num will only be used for multicast enabled configurations. Once you
finish adding all the rows, enter the simulation finish time and hit the OK
button (see figure 1j). We are now ready to generate the script.
Figure 1j: Simulation finish time in scenario window
11) To generate the script
select the script menu and click on generate. You are Done!
Now that we know how to
create simulations, let’s look at a simple traffic generator example and learn
a little more on how to configure the different pieces of the topology.
1) Let’s start by adding the nodes,
then the agents, then the traffic generators. All this was explained in the basic usage example. (See figure 2a) for our
sample layout.
Figure 2a: Layout for our traffic generator example
2) Now that we finished
adding all the agents and connections, we can start configuring the different
parts. We can configure each link between nodes by double clicking on the link.
The link window will pop-up. In our example we are
interested in configuring the link bandwidth, so we will change that parameter
and hit OK (see figure 2b)
Figure 2b:Setting up the
bandwidth for the link
3) Now that we finished
configuring our links, we can move forward and configure our agents. To
configure the agents, just double click on the icons. (See figures 2c, 2d).
Figure 2c: UDP properties window configuration
Figure 2d: UDP properties configuration
4) Now that we finished
configuring our agents we can configure our traffic generator. To do that just double click on the icon. In our case since we
select CBR for our simulation the CBR configuration window will pop-up (see
figure 2e). Make the desired changes and then click OK. You are now ready to setup the scenario and
then generate the code.
Figure 2e: CBR Dialog
5) Bring
the scenario window and configure the simulation (See figure 2f)
Figure 2f: Scenario window to start traffic
In this section we will
create a basic web example. Web is a special component of nsBecnh since
the agent and the application are on one icon. You do not need to create an
agent and then add the web related items, All the web related items will create
the agent at code generation time.
1) To create a simple topology create the nodes and links. After the
topology has been created select the node that you would like to act as a webclient and then select the web client item from the
application menu. Do the same for the nodes that you would like to act as
caches and servers. Now that we have the physical
connection we need to establish which clients are going to be connected to
which caches, and which caches will be connected to which servers. To establish
these connections, click on the middle of the client/cache/server and drag the
link to the other cache/server/client (See Figure 3a).
Figure 3a: Web layout
2) You can configure the clients by double clicking on
the icon (see figure 3b)
Figure 3b: WebClient dialog
3) You can configure the Server by Double clicking on
the server icon (See figure 3c).
Figure 3c: WebServer dialog
4) You can now configure the scenario by selection the
Scenario item under the configure menu (See figure 3d).
Figure 3d: Scenario
window
In this section we will
create a basic LAN example. LAN nodes can be found under the circle icon. The
LAN is represented by a round icon just like any other node. The node to LAN
links cannot be configured like any other link, this
is due to the fact that the node to LAN links will have the configuration
settings that are configured form the LAN configuration window.
1) Create the topology (see basic example for more info). To create a LAN icon simply click on the round icon and select LAN. Treat the LAN as you will treat any other node (See figure 4a).
Figure 4a: Topology for our LAN example
2) If we double click on the
LAN icon the LAN properties window will pop-up (See figure 4b)
. Here you can configure LAN specific parameters. The Bandwidth and
Delay item will be the same for all links directly connected to the LAN.
Figure 4b: LAN properties
3) To configure links that are not directly connected to the LAN just double click
on those links (See figure 4c)
Figure 4c: Link properties dialog
4) Now that everything has
been configured we can create the scenario and generate the code.
In
this section we will create a basic Multicast example.
1)
Start by creating the topology. Multicast requires the use of lossMonitor as the sync agent. (see figure 5a)
Figure 5a: Multicast layout
2) The first thing that is
required for multicast to work correctly is the activation of multicast by
selecting the routing option under the configuration menu. To
activate multicast click on the on/off checkmark and select the number of
groups (See figure 5b). You can also specify the type of routing that
will be used for multicast.
Figure 5b: Routing dialog enabling multicast
3) Now we need to configure
the UDP agent and specify the destination group that it will be sending traffic
to. You can do this be selecting from the Dest
Address combobox after double clicking on the UDP
node (See figure 5c).
Figure 5c: UDP dialog configuring the group to send
4) Now that we know where the
UDP agent will be sending the traffic we need to configure the scenario. Since
multicast has been enabled the Group Num column in the scenario will become
active. This column will indicate what group the nodes will be joining or
leaving (See figure 5d). Once the configuration has been completed click OK and
generate the code.
Note that only the nodes can join or leave groups
Figure 5d: Scenario showing nodes joining/leaving
multicast groups
Differentiated Services is probably the most complex
and long example that will show here.
To configure differentiated services follow this
steps
1) Create the topology that you want. In our case we
created a simple topology (See figure 6a).
Figure 6a: Differentiated services layout
2) As you can see we label
the node e1, r0 and e2. These represent our edges and core routers. We will
start by configuring the link between e1 and r0. To do this
double click on the link. Since traffic will be flowing from the server
to the sinks we will configure the queue going from e1 to r0 as dsRED/edge and the one coming back as Droptail.
To do this just select this items from the combo box in the queue section (see
Figure 6b)
Figure 6b: Link properties configuration dialog
3) So far we have only
indicated the type of queuing that will be using. Now we need to configure the
queues. To configure the queue click on the configure button that is on the
side of the queue that was selected. The Diffserv
Configuration window will pop-up (See figure 6c). This
window will allow you to configure the Queues (See figure 6d), Configure RED(See figure 6e), and configure the Policer
(See figure 6f).
Note: Since the Policer
depends on the RED Configuration, and the RED configuration depends on the
Queue configuration. The buttons will remain grayed out until each one of the
sections is configured.
Figure 6c: Configuring the number of Queues
Figure 6d: Configuring the queues
Figure 6e: Configuring the Scheduler
Figure 6f: Configuring the Policer
Now that we finished
configuring the edge, we can click OK on all the windows till we reach the main
screen.
4) We can now double click on
the link from r0 to e2 and start configuring the core. As in the section above
we will select the queuing mechanism first. In our case we will select dsRED/core from r0 to e2 and Droptail
coming back (See figure 6e).
Figure 6e: Configuring two simplex links
5) Now we need to configure the
queuing mechanism. We can do that by selecting the configure button located on
the side of the queuing mechanism.
When clicking on the
configure for dsRED/core the DiffServ
Configuration window will appear (See figure 6f) .
Here we will need to configure only the Queues (See figure 6g) and the RED
Parameters (See figure 6h) . There is no Policer configuration since this is a core.
Note: Since the RED configuration depends on the Queue
configuration. The buttons will remain grayed out until each one of the
sections is configured.
Figure 6f: Second simplex link configuration for dsRED/edge
Figure 6g: Configuring the Queues for the second link
Figure 6h: Configuring the Scheduler for the second
simplex link
6) You can now click OK on
all the windows and configure the scenario (See figure 6i)
Figure 6i: Configuration of the applications in
scenario
ncBench introduces
the concept of grouping. Grouping allows you to create large number of nodes with
the same configuration. You can create a group of FTP servers and a group of
TCP receivers. There are certain rules related to groups:
a) Groups must be symmetric.
If I want to connect two groups, both groups must have the same number of nodes
b) Groups cannot connect
directly to each other; They need to connect through a
node.
Now that we know the rules,
let’s jump into an example.
1) We can start by creating a
simple topology. To create a group just click on the round icon and select the
group option (See figure 7a).
Figure 7a: Grouping layout
2) You can configure the
number of nodes in a group by double clicking on the group icon (See figure 7b)
.
Figure 7b: Configuring group dialog
NOTE: The group should be
treated as a regular node.
3) You can now complete the
scenario and generate the code. At code generation time nsBench
will create as many nodes, links, Agents and applications as the Number of
Nodes textfield under the group configuration window
specified.