qualnet 3.6 product tour - department of electrical engineering

93
QualNet 3.6 Product Tour QualNet 3.6 Product Tour For Windows and UNIX Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc.

Upload: others

Post on 12-Sep-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

QualNet 3.6 Product Tour

For Windows and UNIX

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc.

Page 2: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Table of Contents Introduction .......................................................................................................................2 1 QualNet Animator......................................................................................................2

1.1 BUTTONS AND CONTROLS ...................................................................................3 1.1.1 Runtime Controls.......................................................................................3 1.1.2 Manual Configuration Tools.......................................................................4 1.1.3 Animation Filters........................................................................................4 1.1.4 Time Controls ............................................................................................5

1.2 BASIC ANIMATOR EXPERIMENTS ..........................................................................5 1.2.1 Modify An Existing Experiment..................................................................5 1.2.2 Semi-automated Node Placement.............................................................7 1.2.3 Manual Node Placement ...........................................................................9 1.2.4 Exploring more of QualNet Animator.......................................................11

1.3 ANTENNA ANIMATION/PROPAGATION EFFECTS...................................................12 1.4 BATCH EXECUTION............................................................................................16 1.5 DYNAMIC STATISTICS COLLECTION ....................................................................18 1.6 QUEUE ANIMATION............................................................................................19

1.6.1 Creating a Wired Model...........................................................................19 1.6.2 Simulating a Wired Model........................................................................21 1.6.3 Comparing Queue Disciplines .................................................................24 1.6.4 Queuing with FTP/Generic ......................................................................26

1.7 HIERARCHICAL DESIGN/BGP.............................................................................28 1.7.1 Creating a Hierarchical Network..............................................................29 1.7.2 Setting up BGP........................................................................................32

1.8 MIXED (WIRED AND WIRELESS) NETWORKS .......................................................34 2 QualNet Analyzer ....................................................................................................39

2.1 STATISTICS FROM A SINGLE EXPERIMENT ..........................................................41 2.2 STATISTICS FROM MULTIPLE EXPERIMENTS .......................................................43 2.3 STATISTICS BY IP ADDRESS ..............................................................................47

3 QualNet Designer....................................................................................................47 3.1 SETTING UP THE PROTOCOL WITH THE GRAPHICAL USER INTERFACE..................50

3.1.1 Designer Toolbar .....................................................................................50 3.1.2 VBR Overview .........................................................................................52 3.1.3 Application Parameters ...........................................................................52 3.1.4 Building a Skeleton Diagram ...................................................................55 3.1.5 Creating the VBR Statistics Variables .....................................................61 3.1.6 Creating VBR Local Variable...................................................................64

3.2 ENTERING SOURCE CODE .................................................................................64 3.2.1 Initial State...............................................................................................65 3.2.2 Final State ...............................................................................................67 3.2.3 Client State ..............................................................................................68 3.2.4 Server State.............................................................................................68

3.3 INCORPORATING VBR INTO QUALNET SIMULATOR .............................................69 3.3.1 Header File ..............................................................................................71 3.3.2 Body File..................................................................................................72 3.3.3 Adding VBR to the QualNet Simulator.....................................................73 3.3.4 Using the New Protocol in QualNet Animator..........................................74

4 QualNet Tracer........................................................................................................78 4.1 TCP TRACE......................................................................................................78

5 QualNet Scalability ..................................................................................................80

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc.

Page 3: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 5.1 RUN TIME COMPARISON....................................................................................80

Table of Figures ..............................................................................................................89

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc.

Page 4: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Introduction The QualNet 3.6 Product Tour is designed to quickly cover the basic features of QualNet for experienced network modelers. We start with installation and move on to navigate through the product. Parts of this tour ask you to modify and recompile source code; a C/C++ compiler is required for these portions. QualNet runs on both Windows and Unix. The following is a list of software you must have to use QualNet:

1. Java 1.3 JRE or SDK 2. QualNet (filename “qualnet-3.6-binary-windowsnt.exe”, …) 3. QualNet license file (filename ends in “.lic”) 4. *For Windows users, Visual Studio 6.0 (any edition) with Service Pack 5 5. *For UNIX users, gcc 2.x or Sun compilers (cc and CC)

* On Windows, Visual Studio 6.0 is not required to evaluate QualNet; if you wish to compile new source code, however, you will need this compiler. On UNIX, users must have gcc or the Sun compilers in order to use QualNet at all. gcc 3.x is not currently supported. QualNet installation is described in the Installation Guide for Windows and the Installation Guide for Solaris SPARC / Linux. These are available from the Documentation section of the Download page: http://www.scalable-networks.com/distributions/documentation/3.6/

1 QualNet Animator Now that you’ve got QualNet installed, each part of the Product Tour assumes that you already have QualNet Animator running. In Windows, to start QualNet Animator,

1. Click on the QualNet 3.6 Animator icon on your Windows desktop Alternatively, you may create a DOS command prompt and type RunQualnet. Note: The default QualNet home directory (hereafter referred to as [QualNet_home]) for QualNet 3.6 is c:\qualnet\3.6, or the directory in which you installed QualNet. In UNIX, to start QualNet Animator:

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 2 -

Page 5: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 2. Type the following command:

cd ~/qualnet/3.6/gui/bin

3. Type the following command:

./RunQualnet

Note: If the directory is in the PATH, simply type RunQualnet. 4. QualNet Animator should load up and look like the following image.

Figure 1: QualNet Animator

1.1 Buttons and Controls Let’s start by familiarizing ourselves with the controls.

1.1.1 Runtime Controls The runtime control buttons are, from left to right:

• Setup QualNet Parameters

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 3 -

Page 6: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour • Run QualNet / Action! • Play • Pause • Stop • Step • Resume Design

Each button has a rollover caption that explains what it is.

Figure 2: Runtime Control Toolbar

1.1.2 Manual Configuration Tools The Manual Configuration tools are (left to right, top to bottom):

• Move Tool • Node Placement Tool • Application Setup Tool • Link Setup Tool • Wired Network Tool (Hub/Switch) • Wireless Network Tool (Cloud) • BGP Link Tool • Hierarchy Tool • Satellite Tool

Figure 3: Manual Configuration Toolbar

1.1.3 Animation Filters The Animation Filters and animation associated with each filter are shown in the table below. Animation Filter Type of Animation in QualNet Channel none Physical / Radio broadcast MAC wired links, wired broadcast

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 4 -

Page 7: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour Network packet reception (green arrows), queues Transport none Application none, except VBR Routing none

Figure 4: Animation Filters Toolbar

1.1.4 Time Controls There are three main controls for time in the QualNet Animator.

• Sliding speed control allows you to slow down or speed up the animation.

• Sim Time shows you how far along in the simulation period you are. • Real Time shows how long the simulator has been running to produce the

data you’re watching. It’s useful to see Simulation (Sim) Time and Real Time together, to gauge how efficient your particular experiment is. However, since QualNet runs much faster from the command line and in batch mode, many QualNet users opt not to see Sim Time vs. Real Time when running their experiments.

Figure 5: Time Controls

1.2 Basic Animator Experiments There are three basic experiments to illustrate how to place nodes to set up a simulation. They are as follows: Modify an Existing Experiment Semi-automated Node Placement Manual Node Placement

1.2.1 Modify An Existing Experiment First, there’s the “blind” experiment where we just change the settings.

1. Press the Setup QualNet Parameters button.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 5 -

Page 8: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 2. Select the Traffic and Status tab. 3. Press Browse… to locate the application configuration file. 4. Navigate to [QualNet_home]\qualnet\3.6\gui\bin. 5. Select one of the following files: heavy36.app, light36.app, med36.app, or

one36.app. These files specify the application traffic for the experiment. 6. Press Open.

Figure 6: Opening the application file in QualNet Animator

7. Press the Save button 8. Press the Close button at the bottom of the Settings window.

Note: While the Settings window is open, you can see all the experiment setup options, but we won’t change them now.

9. Press the Action! button (looks like a clapper). 10. Press the Play button (forward arrow) on the main window to run the

model. Note: If QualNet prompts you to Select QualNet Binary, browse for it in [QualNet_home]/bin. You may have to go up a directory to find it. If QualNet is asking you for this, you may not have compiled QualNet for UNIX. For additional information on QualNet compiling in UNIX, refer to the README file also in the [QualNet_home]/bin directory. If QualNet has successfully started running, the following will be displayed:

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 6 -

Page 9: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour Blue circles are radio broadcasts. The size of the circle represents the

transmission range. Green arrows mean successful data packet transmission at the network

layer.

Figure 7: QualNet simulation showing radio broadcasts as blue circles and green arrows as successful data packet transmission

1.2.2 Semi-automated Node Placement 1. Clear the experiment by selecting File → New.

Note: It is not necessary to save changes from the previous experiments. 2. Follow the steps from the previous experiment, but before step 1, from the

Main Menu Bar select Experiment → Automatic Node Placement 3. In the Number of Nodes field, type 36. 4. In the Placement Strategy pull-down menu, Uniform should be selected.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 7 -

Page 10: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 8: Automatic Node Placement

5. Open the Setup QualNet Parameters window. 6. Click Browse. 7. Select an application file like in the previous experiment.

Note: The application file chosen may cause the animation displayed to vary from the examples shown.

8. Select Open. Note: A message screen may be displayed. Click OK and continue.

9. Press the Save button 10. Press the Close button at the bottom of the Settings window. 11. Press the Action! button (looks like a clapper). 12. Press the Play button (forward arrow) on the main window to run the

model. This time, the application links are shown on the screen, allowing us to see who’s trying to send data to whom, and even change those settings if necessary.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 8 -

Page 11: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 9: Application links for Constant Bit Rate (using light36.app) shown between specific wireless nodes

1.2.3 Manual Node Placement 1. Clear the current experiment by selecting File → New.

Note: It is not necessary to save changes from the previous experiments. 2. Select the Create Node button (looks like a computer).

3. Choose the default node type 4. Click on the canvas to place 6 nodes.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 9 -

Page 12: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 5. Choose the Add Applications Type tool.

6. Select an application, such as CBR or FTP. 7. Click on a source node and drag the mouse to a destination node.

Figure 10: Designation of Application links between nodes

8. Accept the default settings by clicking OK. 9. Press the Run QualNet (Action!) button. 10. Press Play to start the simulation.

Note: Because of how fast this experiment can run in QualNet, users may want to slow down the speed of the simulation on the Time Control Bar to better see the detailed animation of the experiment.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 10 -

Page 13: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 11: CBR and FTP application traffic flowing between nodes

1.2.4 Exploring more of QualNet Animator There are many other things that you can see without running a specific experiment. For example:

• Pop up help: Move the mouse over a variable name or button for helpful information about the variable.

• Coordinates: Click on Setup QualNet Parameters, then on the General tab. Switch between Cartesian and LatLonAlt coordinates and press Save to show the effect on the canvas. Changing coordinates must be done before placing nodes.

Note: It is not possible to switch between Cartesian and LatLonAlt coordinates while an experiment is loaded and/or running.

• Background and rulers: Enable and disable this feature by selecting View → Background → Choose Background. One sample background included in [QualNet_home]\gui\icons is mammoth.jpg.

• Output Files: Select View → output files. You can see the files that will be generated.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 11 -

Page 14: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour • Animation Controls: While running any experiment, you can

enable or disable specific animation with the Animation Filters Toolbar, or from the View menu. You can also use play, step, pause, etc. The default step size is 1 second of simulation time.

• Node Specific Settings: To modify these settings, users should enter design mode by clicking the Resume Design Mode (Painter’s Palette) button. In design mode, right click on any node on the canvas. Select “node properties” from the popup. You get a miniature Settings menu, allowing you to change the characteristics of the node.

Figure 12: Node Properties menu showing the parameters a modeler can set for each device or node in the model. Here, the modeler is selecting from a list of routers by manufacturer and model number.

1.3 Antenna Animation/Propagation Effects

1. Choose File → New to clear the screen. Note: It is not necessary to save changes from the previous experiments.

2. Open the Setup QualNet Parameters window by clicking the button just to the left of the clapper.

3. Go to the Wireless Settings tab. 4. Scroll down to Radio/Physical Layer. 5. Set Antenna model to Switched Beam 6. Click Browse to find an Azimuth Pattern File and choose

default.antenna-azimuth (from the [QualNet_home]\qualnet\3.6\bin directory).

7. Click Open.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 12 -

Page 15: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 13: Opening the switched beam antenna azimuth file

8. Under MAC Protocol section, under Directional Antenna Mode select Yes. 9. Click Save. 10. Click Close. 11. From the Main Menu bar, select Experiment → Automatic Node

Placement to uniformly place 16 nodes. Note: You must change the antenna model before placing the nodes. Additionally, some randomly placed nodes may occasionally land outside each other's range and may not react to the transmissions.

12. Click on the Application Setup Tool button (that has 3 CD’s ) to manually set up an application connection.

13. Select CBR. 14. Click and drag the connection between two nodes. 15. Accept the default CBR settings by clicking OK.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 13 -

Page 16: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 14: Making a CBR application connection between nodes

16. Save this experiment for later by selecting File → Save As from the Main Menu Bar.

17. Name it antenna.xml and save it in the [QualNet_Home]\3.6\gui\scenarios directory.

18. Prepare the simulator to run by pressing the Run QualNet (Action!) button.

19. From the View menu, choose Animation Filter → By Event and enable Antenna. You should see red circles around all the nodes. The red circles indicate the direction of each node’s antenna for reception.

20. Press Play. 21. To see the action more clearly, press Pause, then from the Main Menu

Bar select Edit → Set Step Size → By Animation Command. 22. Set the value to 1. 23. Click OK. 24. Press Step repeatedly.

Users should see the following:

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 14 -

Page 17: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour a. A node broadcast, drawing a blue circle b. One by one, from closest to farthest, each node within the blue

circle (and perhaps a couple just outside the blue circle) will change its pattern to maximize the gain in the direction of the broadcaster.

25. As an alternative to changing step size, simply use the speed control, which is the horizontal sliding scale to the left of Sim Time. At full speed, not all the antenna pattern changes are displayed. At slow speeds, most are.

Figure 15: Nodes adjusting their directional antennas for reception of a signal

26. What’s going on: a. Red circles around the nodes represent the current reception

pattern. b. In this model, receivers receive omnidirectionally when idle. c. Each node transmits omnidirectionally. d. Blue transmission circles represent the transmission range if both

the sender and the receiver are omnidirectional. e. When a receiver hears a signal, it switches its antenna pattern so

that the maximum gain is in the direction of the signal.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 15 -

Page 18: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour f. Each antenna has eight identical patterns focused in eight

directions. (N, NE, E, SE, S, SW, W, NW assuming the antenna is facing north). The maximum gain in the forward direction is 15.5db.

1.4 Batch Execution This feature can be run with any of the pre-built experiments. It is a good idea to follow up a batch execution by launching QualNet Analyzer and viewing the statistics you just produced.

1. If a model is still running in the Animator, keep it loaded up. 2. Choose Experiment → Batch Experiment Setup. 3. Choose General → Experiment → Seed. 4. Enter the following values in each field:

Start Value: 1 End Value: 5 Increment Value: 1

5. Press the Calculate No. of Runs button.

Figure 16: Batch Experiment Setup tool with start, end and increment values

6. Highlight all five entries that appear in the upper right by holding down the shift key and selecting each number.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 16 -

Page 19: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 17: Selection of seed values for batch experiments

Note: As an alternative to changing the seed for wireless experiments, vary the Network Protocols → Routing Protocol → Routing Policy → Dynamic → Routing Protocol and choose AODV, DSR, and LAR1. 7. Press Run. 8. When prompted to Specify a Directory for Batch, select No. They should

run now.

Figure 18: QualNet message window showing the status of batch experiments in execution

9. If there is a second question, answer No to it. By answering no, you are telling QualNet to create stat files in the current directory named Seedt1.stat, Seed2.stat, etc.

10. A completion window will be displayed. Select OK. You can run Analyzer now (QualNet Analyzer).

11. From the Statistics menu, you will be able to identify the stat files based on this naming scheme.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 17 -

Page 20: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

1.5 Dynamic Statistics Collection This experiment requires application traffic to produce dynamic statistics. Dynamic statistics tend to use a lot of memory, so you should start QualNet Animator fresh both before and after such an experiment.

1. Stop previous model. Or, if you have nothing loaded, load antenna.xml (from Antenna Animation/Propagation Effects) by selecting File → Open.

2. Start again by pressing the Action! button (picture of a clapper). 3. We’re going to disable some of the animation to speed things up. Check

antenna animation by selecting View → Animation Filter → By Event → Antenna and deselect it if it’s already selected.

4. Disable radio broadcasts by making sure the top right button in the Animation Filters Toolbar is darkened (see Section 1.1.3 Animation Filters). Disabling radio broadcast animation is not necessary; we’re just doing it to speed the experiment up.

5. Press Pause. 6. Choose Statistics → Dynamic → System Wide Metrics. 7. Choose IP InReceives and type 100 and select milli-second for the units

to indicate how often statistics are updated.

Figure 19: Dynamic statistics selection for system wide data

8. A popup with a graph should appear. Size the graph and position it so that the dynamic statistics can be seen alongside the QualNet Animator window.

9. Press Play (the forward arrow). The related statistics will be displayed on the graph.

10. If you want to show a graph for just one node: a. Pause the animation b. Right-click the node and select Metrics. c. Choose a metric to display, such as IPInReceives with 100 milli-

second update.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 18 -

Page 21: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour Note: The graphs shown below may not match the graphs you produce with QualNet. This is because QualNet randomly distributes nodes on the canvas in the experiment antenna.xml.

Figure 20: Dynamic statistics graphs for the system as a whole and node 6

1.6 Queue Animation These experiments highlight some of QualNet’s queuing functionality and the animation that illustrates the behavior of those protocols.

1.6.1 Creating a Wired Model 1. Start a new experiment by selecting File → New. 2. Place four default nodes (the squares) in a Y shape (or a divining rod

shape). See Figure 23 to see an example of the Y configuration. a. Click on the Create Nodes button (top right in the Manual

Configuration Toolbar). b. Place the nodes in the desired configuration. c. Activate the Link Setup Tool (right below the Create Nodes

button). d. Create links between the center node and each other node by

clicking on one node and dragging the mouse to the other node. Accept the default point-to-point link settings for the top of the Y.

e. The link on the lonely side (the bottom of the Y) should be made very slow. Trim two zeroes off the bandwidth value.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 19 -

Page 22: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 21: Link on the lonely side of the Y being set up for a bottleneck

3. Activate the Application Setup Tool (click the button with 3 CD’s). 4. Choose Constant Bit Rate (CBR). (FTP/Generic also works, but it isn’t as

good at illustrating queuing.) 5. Create an application link from one of the two nodes at the top of the Y to

the node at the bottom of the Y. a. Change the Items to Send (number of packets) to 1000. b. Change the interval (for CBR) to 10MS (milliseconds).

Note: The default unit for a time interval is seconds, not milliseconds.

c. Change the Endtime of the CBR load to 2.3 seconds. d. Type of Service should equal 1 (the default).

6. Create an application link from the other of the two nodes at the top of the Y to the node at the bottom of the Y.

a. Change the Items to Send (number of packets) to 1000. b. Change the interval (for CBR) to 10MS (milliseconds).

Note: The default unit for a time interval is seconds, not milliseconds.

c. Change the Endtime of the CBR load to 2.3 seconds. d. Change the type of service to 2 (2 indicates non real time).

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 20 -

Page 23: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 22: Specifying the second CBR application traffic between remote nodes in the Y configuration

1.6.2 Simulating a Wired Model 1. Press Action! (Run QualNet). 2. Right-click on the center node of the Y and choose Node Animation

Filter → By Event, and select Queue animation. a. It should display three rows of three tall skinny empty rectangles. b. The center node has three interfaces, and for each interface there

are three queues. c. If you enabled queue animation for a node besides the center node,

you would only see three queues, because the other nodes have only one interface.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 21 -

Page 24: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 23: Adding queue node animation to the center node

3. Press Play. 4. Two of the queues should begin filling up.

a. This is because the application traffic generated by the two nodes at the top of the Y is too much for the slow bandwidth link at the bottom of the Y.

b. The two applications were configured to use two different types of service (priorities), so they fill up two different queues.

5. Eventually, the two queues should begin to overflow. One queue will have higher priority and should fill up less quickly, and also empty more quickly when the application traffic ends.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 22 -

Page 25: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 24: Queues at a bottleneck filling at different speeds because of different priorities

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 23 -

Page 26: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 25: Two queues overflowing at a bottleneck. The queue that fills up first will take the longest to empty

1.6.3 Comparing Queue Disciplines 1. Press the Setup QualNet Parameters button. 2. Go to Network Protocols. 3. Change IP Queue Scheduler to Round Robin. 4. Press Save. 5. Press Close.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 24 -

Page 27: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 26: Selecting Round Robin IP Queue Scheduler

6. Run the experiment again by pressing the Action! button (the clapper) to show the different queue discipline. You will need to reselect the Queue Node Animation filter. In the case of Round Robin queuing, you can see that the queues fill up at roughly the same rate. Unlike in Strict Priority queuing, the higher priority queues are served at the same rate as the lower priority queues.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 25 -

Page 28: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 27: Round Robin queuing serves high and low priority queues at roughly the same rate

1.6.4 Queuing with FTP/Generic The behavior in Section 1.6.3 Comparing Queue Disciplines occurs if you use CBR as the application. If you use FTP/Generic as one of the two applications, that queue never overflows because FTP is a TCP application and TCP figures out the bandwidth of the slow link and slows down the transmissions to fit. Let’s see QualNet in action.

1. Click the Resume to Design Mode button (painter’s palette) on the top right of the main toolbar.

2. Right-click on one of the two CBR application links. 3. Select Cut. 4. Switch to Add Application Type and select FTP/Generic. 5. Drag an FTP/Generic application between the nodes that used to have a

CBR application connection. Accept the default values.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 26 -

Page 29: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 28: Replacing one of the two CBR links with FTP/Generic

6. Click on the Run QualNet (Action!) button, enable queue animation for the center node (see Figure 23), and press Play (the forward arrow).

7. In this case, what you see is that the higher priority queue (whichever one you left as CBR) will stay more full than the lower priority queue. This is because CBR (a UDP application) sends packets as fast as it is scheduled to, regardless of the behavior at the packet destination. FTP (a TCP application) sees a growing queue size at the destination end and slows down packet transmission rates.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 27 -

Page 30: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 29: FTP/Generic traffic has a shorter queue (middle top bar) compared with CBR (right top bar) because TCP adjusts packet rates according to the capacity of the connection.

1.7 Hierarchical Design/BGP This exercise shows you how to design a hierarchical network. There is no simulation in this exercise because the network must exchange routes to stabilize itself for a while before application traffic can be sent across it. For this reason, the setup is all we show you. To watch traffic going through the network, use QualNet Animator and leave the animation running in the background. Some of the protocols, including OSPF and BGP require 30 minutes of simulation time to exchange routes. However, if the hierarchy consists of all Bellman Ford networks, routes should establish themselves much sooner. Also, application connections within a subnet should work right away. With QualNet, when the Animator runs slower than realtime, it may not reflect the fastest speed at which the simulation can run. Executed from the command line, the Simulator produces simulation data usually faster than real-time. In QualNet

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 28 -

Page 31: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 3.6, you can only start “watching” a simulation in the QualNet Animator at the beginning of the simulation time.

1.7.1 Creating a Hierarchical Network 1. Start with a clean slate by selecting File → New. 2. Select the Create Hierarchy button (the second to bottom right button) in

the Manual Configuration toolbar. 3. Place one Hierarchical Component (HC) by clicking on the canvas. 4. Open the HC by moving the mouse over it and pressing the letter ‘o’ key.

(The letter ‘o’ is for “open.”) The HC should expand to cover most of the screen. Rulers and grid lines are expanded.

5. Once inside the HC, select the Create Wired Subnet button (third from the top on the left in the Manual Configuration toolbar), and place a switch by clicking on the canvas.

6. Select the Create Nodes button (top right button in Manual Configuration toolbar) and place a few default nodes.

Figure 30: Selection of a node for a hierarchical network

7. Select the Create Link button (second from top on right).

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 29 -

Page 32: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 8. Connect each node to the switch by clicking on the node and dragging the

mouse to the switch (or vice versa).

Figure 31: Connecting computers to a switch in a subnet

9. Press ‘c’ to close the HC. 10. Right-click on the HC icon and choose Copy.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 30 -

Page 33: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 32: Copying of a Hierarchical Component

11. Then right click on the canvas and choose paste. This should paste a duplicate of the entire original HC. Now you have two HCs.

12. Open one HC with the ‘o’ key as before. 13. Select the Create Link button again. 14. Click on a node and drag the mouse to create a link. 15. While holding down the mouse, close the HC with the ‘c’ key. Make sure

the cursor is still within the grid of the HC. Next, move the mouse over the other HC, and open it with the ‘o’ key.

16. Drag the mouse to a node in this other HC and release. Essentially, we have just connected two networks through two gateway routers.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 31 -

Page 34: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 33: Connecting one subnet to another using hierarchical tools

17. If you want, copy another HC inside an existing HC. With QualNet, you can nest HCs inside other HCs.

1.7.2 Setting up BGP BGP requires that you designate HCs as autonomous systems, and then make a BGP link between the systems.

1. Close the HCs from the previous exercise and return to the top level. 2. Right click on an HC, and enable the Autonomous System checkbox. 3. Right click another HC and enable the Autonomous System checkbox.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 32 -

Page 35: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 34: Assigning Autonomous System status to a subnet

4. Open one of these HCs. 5. Select the BGP Link button (second from bottom left button in the Manual

Configuration toolbar). 6. Click on the same node that has a link to the node in the other HC. 7. Repeat the process of making a link between this node and the one in the

other HC. Note: If you have trouble opening and closing HCs, make sure your cursor is inside the grid that contains the HC.

8. On the resulting popup menu for BGP settings, designate both nodes as neighbors and enter a large number (e.g. 4000) as weights, and then click OK. Now there is a BGP connection between the two autonomous systems.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 33 -

Page 36: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 35: Assigning parameter values to the BGP speakers in Autonomous Systems

To watch traffic flowing between Autonomous Systems, press the Run QualNet (Action!) button, then press Play.

1.8 Mixed (Wired and Wireless) Networks Let’s set up a mixed network scenario. In mixed networks, the routing protocol must be the same throughout. That means we choose between OSPF and Bellman Ford from the current QualNet protocol library. Since OSPF takes a longer time to set up, we’re going to use Bellman Ford for this exercise.

1. Start with a clean slate by selecting File → New. 2. Set the global routing protocol by clicking on the Setup QualNet

Parameters button (looks like a computer with software next to it). 3. Select Network Protocols → Routing. Scroll down to find the Routing

section and select Bellman Ford as the routing protocol.

Figure 36: Selection of Bellman Ford as the network-wide routing protocol

4. Press Save and then Close.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 34 -

Page 37: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 5. Click on the button labeled Create Wired Subnet. It looks like a blue

switch. 6. Click on the canvas. You have created a wired switch. 7. Add five nodes around it by clicking on the Create Nodes button (looks

like a computer), selecting the default node icon, and clicking on the canvas.

8. Connect the nodes to the switch by selecting the Create Link button (looks like 2 nodes with an elbow connection between them). Each node should connect directly to the blue switch.

9. Create a wireless subnet by clicking on the Create Wireless Subnet button (looks like a cloud), and then click on the canvas.

10. Right-click on the cloud on the canvas and select Subnet Properties. Select Bellman Ford as the routing protocol. Click OK.

Figure 37: Selection of Bellman Ford for the wireless subnet

11. Add five nodes around the wireless subnet (the cloud) by clicking on the Create Nodes button (looks like a computer), selecting the default node icon, and clicking on the canvas.

12. Connect the nodes to the wireless subnet (the cloud) by selecting the Create Link button (looks like 2 nodes with an elbow connection between them). Each node should connect directly to the wireless subnet.

13. Now, we need to link the wireless and wired subnets together. Click the Create Link button. Connect a node from the wireless network to a node of the wired network.

14. A box will pop up and ask you to specify the point-to-point link parameters. Press OK.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 35 -

Page 38: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 38: Point to Point link specifications for the connection between the wireless and wired subnets

15. Add some application traffic by clicking the Add Application Type button (has three CDs on it).

16. Select FTP/Generic or CBR as the application type. Make sure to connect at least one wired node to a wireless node. The purpose of this exercise is to move traffic across a mixed network. Make sure the traffic is going in both directions (i.e., from the wired subnet to the wireless, and also from the wireless subnet to the wired).

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 36 -

Page 39: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 39: A mixed network with application traffic in design mode

17. Press Action! (the clapper). 18. If everything has been set up correctly, traffic should be flowing through

the network. Green arrows indicate packets being delivered. Blue rings indicate wireless signals being transmitted.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 37 -

Page 40: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 40: A mixed network transmitting packets

19. If you have any trouble, select View → Output Files → qualnet.config. In this main configuration file, you’ll see each part of the network listed by node and the corresponding network parameters. If your network isn’t running, there’s a good chance that some part of your network is not running Bellman Ford. Look for the ROUTING PROTOCOL tag to verify.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 38 -

Page 41: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 41: qualnet.config file for verification of routing protocols and other network parameters

2 QualNet Analyzer These experiments compare routing disciplines in wired networks. There’s a bit of preparation to create the statistics to view with QualNet Analyzer, but they’re very nice for illustrating QualNet’s ability to graph high fidelity simulations.

1. Select File → New. 2. Select File → Open and browse to the [QualNet_home]\gui \scenarios

directory to find and load the bottleneck-TCP.xml file. a. This is a wired network, running Bellman Ford routing, with the

topology shown in cyan. Traffic is flowing from left to right. There are high-speed links connecting the outside nodes to their neighboring center node, and a bottleneck link between the two center nodes (3 and 4).

b. The bottleneck link between nodes 3 and 4 has one-tenth the bandwidth, and ten times the propagation delay as the segments on either side.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 39 -

Page 42: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour c. “FTP/GENERIC” traffic is flowing from left to right. Specifically,

node 1 is sending TCP packets to node 5 and node 2 is doing the same with node 6. Nodes 1 and 5 start talking at 1.001 seconds, and continue until the end of the simulation. Nodes 2 and 6 start communicating at 1.005 seconds, and also continue until the end of the simulation. In all cases, packets go through the bottleneck to their respective destinations.

Right-click on any links or application connections or nodes to see the properties.

Figure 42: Bottleneck.xml set up showing the application properties between nodes 1 and 5

3. Click Experiment → Batch Experiment Setup to configure the experiments:

a. Click on the icon to select Network Protocols → Network

Protocol → Network Protocol → IP to expand the menu selections in this area.

b. Click on the entry Specify Priority wise IP Queue Type? and select No → IP Queue Type. The IP queue types should be displayed on the right side of the window (FIFO, RED, etc).

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 40 -

Page 43: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour c. Select FIFO and RED by holding down the control key and

selecting them.

Figure 43: Batch setup of a bottleneck traffic situation using FIFO and RED queuing types

4. Click the Run button in the bottom right corner of the Batch Experiment Setup window.

5. Click No to choose the default folder where your results will be stored. 6. Click OK once the batch files have run.

2.1 Statistics from a Single Experiment

1. While still running Animator, choose Statistics → Run Analyzer. Note: You can also click the ε button in the bottom right corner of QualNet Animator.

2. Analyzer automatically opens all the stat files in the current directory. It’s sometimes hard to tell which files are from the most recent experiment, unless you just did a local batch experiment. Local batch experiment stat files are named Qualnet_IPFIFO.stat, Qualnet_IPRED.stat, for our experiments where we varied IP queue types.

3. If the files you just created don’t automatically appear in the left window, you’ll want to open the data files you just created. Choose File → Open.

4. Find the prepared stat files you just made. 5. Click on an experiment file name in the left window to display the list of

metrics.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 41 -

Page 44: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 6. Click any metric to pop up a per-node graph, such as FIFO Packets

Dequeued. The configuration has three queues at each out interfaces with priority values 0, 1, and 2, with 0 being the highest priority. The X-axis has the node IDs of the 6 nodes. This particular scenario has traffic with priorities 0 and 1 (0 used by the routing protocol control packets, 1 by the application). The 0 priority dequeued packets (in blue) are fewer and can be viewed better if enlarged (select the lower portion of the graph with a marquee). The 0,1 values on the side of the graph represents these packet priorities.

Figure 44: QualNet Analyzer showing a single data set displayed in bar chart format

7. Select Option → Chart Type and choose 2D Histogram. 8. Click any metric, such as the MAC tab → Link → Destination, to pop up

a histogram. Here, the "0, 1, 2" legend represents interface index at a node.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 42 -

Page 45: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 45: Histogram of MAC layer Link Destination by node ID

9. Set the chart type back to 2D bar chart by selecting Option → Chart Type → 2D Bar Chart.

2.2 Statistics from Multiple Experiments

1. Click on Option → Graph Visibility and select Multiple Graph. 2. Highlight more than one statistic file (e.g., “IPFIFO.stat” and “IPRED.stat”)

by holding down the shift key while selecting the file names. 3. Select the Application tab, then Gen/FTP Server → Throughput (bits/s)

and note the slight throughput penalty with RED as opposed to FIFO.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 43 -

Page 46: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 46: QualNet Analyzer showing Server Throughput in bits/second for FIFO (left) and RED (right)

4. Select the Network tab, then select RED → Average Queue Length (bytes). Next, select Average Time in Queue.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 44 -

Page 47: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 47: RED Average Time in Queue (seconds) and Average Queue Length (bytes)

5. Select FIFO → Average Queue Length (bytes). Next, select Average Time in Queue.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 45 -

Page 48: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 48: FIFO Average Time in Queue (seconds) and Average Queue Length (bytes) Notice that the RED statistics graphs in Figure 47 show that average queue delays (~1 milliseconds) and queue sizes (~400 bytes) are dramatically lower than their FIFO counterparts in Figure 48 (~5.5 milliseconds and ~800 bytes), even though their throughputs remain almost similar, as shown in Figure 46.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 46 -

Page 49: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

2.3 Statistics by IP Address

1. Load a new experiment in QualNet Analyzer by selecting queuedrop3.stat in the [QualNet_home]/gui/sample directory.

2. In the Option menu, select Compare by IP Address. All metrics but FIFO should disappear.

3. Click on one of the remaining metrics (Packets Queued works). The graph will compare statistics by IP address rather than node ID. This allows for comparison of each interface of a wired node with more than one connection.

Figure 49: Statistics by IP address

3 QualNet Designer It takes about an hour to actually build a working protocol. In this section, we will walk you through the compile and add steps to incorporate new code into QualNet. IMPORTANT NOTE: If you go beyond this exercise and add other code on your own and actually go so far as to “add to qualnet” and “compile,” you should at least “remove from qualnet” before doing anything else, and possibly go so far as to reinstall QualNet. This precaution will allow you to continue through the Product Tour without experiencing trouble with bad code. Included with QualNet are a few sample protocol models that end in the extension .xml (Aloha.xml, vbrudp.xml). QualNet 3.1 Designer supported the

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 47 -

Page 50: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour .QPD file format. The current 3.6 Designer supports an import feature that converts from .QPD models to the current .xml format. The Variable Bit Rate (VBR) protocol is included as an example of an application layer protocol model and is the model we will build from scratch in this tutorial. The ALOHA (simple) model at the MAC layer is also included as a sample Designer model. All the Designer sample models can be found in the [QualNet_home]/gui/models directory. This exercise will walk you through the creation of an application layer protocol called VBR (Variable Bit Rate). We will start by setting up the protocol states and initialization elements using the graphical user interface, then we’ll continue on to cut and paste source code into each of the states, and then we’ll finish with the compilation of the appended simulator.

1. Start QualNet Designer by clicking on the D button at the bottom right corner of QualNet Animator. Note: Alternatively, you can run Designer from the [QualNet_home]/gui/bin directory by typing RunDesigner.bat, so long as you’ve set the path correctly.

Figure 50: Start up QualNet Designer

2. In the QualNet Protocol Designer window (which can be opened by selecting File New), select the New tab.

3. For the Protocol Name field, type VBR. 4. For the Layer, select the Application checkbox. 5. Click OK. 6. In the Application Type Selection window, select UDP from the pull-down

menu. Note: The current VBR model is written using UDP (version 3.1 was written with TCP).

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 48 -

Page 51: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 51: Create a new protocol in QualNet Designer

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 49 -

Page 52: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 52: QualNet Designer

3.1 Setting up the protocol with the Graphical User Interface

3.1.1 Designer Toolbar The QualNet Designer Toolbar buttons are pictured and described from top to bottom below.

Figure 53: QualNet Designer Toolbar

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 50 -

Page 53: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour Move State/Transition—Moves the state to a new position or shifts a transition to distinguish. Add a New State—Creates a new state in the model. Click on this button and then click on the canvas to create and name a state. Add a New Transition—Creates a transition between two states. Click the button, and then click on a source state and drag the mouse to a destination state. A pop up window will then ask for properties for the newly created transition. Add Configuration Parameters—Configuration parameters are the variables associated with a protocol that must be written to the qualnet.config file used as input to the Simulator. Add Data Definitions—Allows the user to define data structures that can be used to declare state variables and local variables in the protocol code. For example, #define, #include, typedef, data structure, and enumeration definition and statements are automatically generated at the top of the header file of the protocol. Add Variable Declarations—Writes code to declare variables, along with some automatically generated variables. Add Utility Functions—These functions are defined in the protocol code file, and can be used within the state’s entry code. Add Statistics Variables—Allows users to declare statistics variables for the protocol. These statistics can be accessed and modified from the state entry and utility function code. Add User Defined Event—When designing a custom protocol, not all events come included with QualNet. This tool exists to allow the model to invent new events for the protocol. Set Application Parameters—Similar to configuration parameters, these are the variables that appear in the application description file used as input to the Simulator. Parameters defined here pass values to application protocols in the qualnet.app file.

Project Explorer Toolbar The right pane of Designer has a Project Explorer view, which lists the states. The Code View and the Design View buttons allow the user to switch between the code and design view. Note: To view the code view, the user must first select a state before using the Code View button.

Figure 54: Project Explorer Toolbar

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 51 -

Page 54: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 3.1.2 VBR Overview

The functionality of the VBR protocol is simple. Traffic, in the form of “items” with a specified size in bytes, is sent at a frequency that varies depending on an exponential distribution from the client to server node. The mean interval determines the variation. The amount of traffic received is counted by the server and reported as a statistic. It turns out that VBR code does not require data definitions such as structure definitions, enumerations, #defines, or #includes due to it’s simplicity. In contrast, code for more complex protocols call other C libraries and depend on various functionality outside of the protocol itself. Most of the work to build the VBR protocol lies in the design of the state diagram and the writing of the functionality that links states to one another. Specifically, we will write the functionality that defines how the protocol enters a particular state (state entry code). State entry code is the action that the protocol performs upon entering a state; state exit code is an action performed upon leaving a state. There is currently no support for state exit code in the Designer.

3.1.3 Application Parameters Application layer protocols in QualNet take in application parameters for initialization from the qualnet.app file and pass the values to the protocol function. VBR is a simple traffic generation protocol with the following parameters:

Name Type Default Description Source ID NodeID Traffic source (client) node ID

for VBR connection Destination ID NodeID Traffic destination (server)

node ID for VBR connection Item Size int The size of each data unit to be

sent in bytes. Mean Interval clocktype 1

Seconds Mean Interval used to determine delay between data transmissions.

Start Time clocktype 1 Seconds

Simulation time of when to start traffic.

End Time clocktype 1 Seconds

Simulation time of when to stop traffic.

Table 1: Initialization parameters for the VBR protocol

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 52 -

Page 55: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 1. To set the application parameters, click the bottom icon in the Designer

toolbar. A pop up window will request the parameters above. 2. In the Name field, type Item Size. 3. In the Type pull down menu, select int. 4. Leave the default and help fields empty, and click Add. 5. Add another parameter. In the Name field, type Mean Interval. 6. In the Type menu, select clocktype. 7. In the Default field, type 1 and select Seconds from the drop down menu. 8. Leave the help field empty, and then click Add.

Figure 55: Adding a default parameter value

9. Finish adding the rest of the parameters until you have all six VBR application parameters in the list, and then press Confirm All Changes.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 53 -

Page 56: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 56: All VBR parameters

10. To update the application parameters, select one of the names that show up in the list and update the required field.

11. Click Update and then Confirm All Changes.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 54 -

Page 57: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 3.1.4 Building a Skeleton Diagram Protocols are created in Designer using a finite state diagram. Users create and place states into the diagram and connect the states with transitions. States and transitions are represented as per the Unified Modeling Language (UML) state diagram notation, with some modifications to the terminology for simulation purposes.

1. Let’s create an idle state by clicking the State Tool, and then clicking on the canvas.

2. Give it the name Client Idle. To move the position of this state select Move State/Transition button and move the state to the desired location.

Figure 57: Creation of a new state called Client Idle

Most protocols are designed so that the initial state automatically transitions to an idle state. The idle state has many event-driven triggers that branch out to all the event states in the protocol. VBR has two idle states: Client Idle and Server Idle, for when the node is sending and receiving traffic, respectively. The reason why there are two idle states is that client and server nodes behave differently in VBR.

3. Create a second main state called Server Idle by repeating step 1.

The VBR protocol code must first include the functionality that checks if a node is a client node or a server node. To do this, we employ a guard, or Boolean statement, that checks what type of node it is before transitioning to idle state.

4. To specify the guard code, create a transition by clicking on the second

button from the top with an arrow on it. 5. Click on the Initial State in the top left corner and drag the line onto the

Client Idle state. 6. A pop up window will ask you for the guard code. Carefully type in the

following C code into the text box and click OK:

ip->interfaceInfo[DEFAULT_INTERFACE]->ipAddress == clientAddr

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 55 -

Page 58: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 58: Transition from Initial State to Client Idle state

7. Repeat steps 3 and 4 for the transition between for the Server Idle state. 8. A pop up window will ask you for the guard code. Carefully type the

following code into the text box and click ok:

ip->interfaceInfo[DEFAULT_INTERFACE]->ipAddress == serverAddr

Figure 59: Two VBR idle states with transitions There is only one state that stems from the Client Idle state in VBR. For this state that branches from the Client Idle sate, a trigger, rather than a guard is employed. The difference between a trigger and guard is that triggers invoke a

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 56 -

Page 59: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour state transition based on an event delivered to the protocol, whereas Boolean guards invoke a state transition based on the result of user-coded logic. The Client state has the following properties: State Name QualNet Event Trigger What this does ClientTimerExpires MSG_APP_TimerExpired This is an event that the

application sends to itself. This timer exists to notify the application to send more data when appropriate.

Table 2: State names and trigger source code for client events stemming from the Client Idle state Similarly, there is one state that stems from the Server Idle state: State Name QualNet Event Trigger What this does ServerReceives

MSG_APP_FromTransport This is an event from the transport layer that notifies the application protocol that there is data ready to be received.

Table 3: State names and trigger source code for server events stemming from the Server Idle state Let’s insert the states that stem from the Client Idle and Server Idle states.

9. Click the Add a New State button right below the 100% field. 10. Click on the canvas to make a new state in the upper right hand corner. 11. Name it ClientTimerExpires. Press OK. 12. Repeat steps 9-11 for the ServerReceives state.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 57 -

Page 60: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 60: Addition of new client server state

Next, we’ll add the transition for the client state that we’ve just created. 13. To create a new transition, click on the arrow button called Create a

New Transition below the Create a New State button. 14. Click on the Client Idle state and drag the mouse over to the state that

was just named ClientTimerExpires.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 58 -

Page 61: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 61: Dragging a transition from Client Idle to ClientTimerExpires

15. A pop up window will ask you to specify the transition properties. Click

the Trigger tab. 16. Scroll down the trigger options until you find the correct one for the

state. The transition from “Client Idle” to “ClientTimerExpires” is included in the list of triggers:

MSG_APP_TimerExpired

Figure 62: Selecting Trigger code for a transition

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 59 -

Page 62: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 17. Repeat steps 12 through 14 for the server state transition in Table 3.

Note: Be sure to drag the transition FROM the idle state to the new states you just created, as VBR requires special entry state code, as opposed to exit state code (for more information, go back to the VBR Overview section). Your QualNet Designer Finite State Diagram should now have 6 states and two transitions originating from two idle states and two transitions originating from the Initial State.

Next, we need to create automatic return transitions to return the protocol state back to idle once the entry state code has been executed. 18. Click the Add a New Transition button. 19. Drag from the ClientTimerExpires state to the Client Idle state. Do not

specify any values for the trigger or guard and just click OK, since this is an “automatic” transition.

20. Repeat steps 16-17 for the server state. The lines you’ve already drawn will now have arrows at both ends.

Note: To see the individual transitions better, click on the transition, hold down the right mouse button and drag the line away from the transition in the other direction.

21. Before we go any further, we need to save the work we’ve done. Select File → Save As.

22. Name you protocol model VBR_tour.xml. QualNet Designer will automatically want to save your file in [QualNet_Home]/gui/models.

23. Click OK. Note: You will see that QualNet Designer allows you to save the files as .xml, the tagged text Designer file format.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 60 -

Page 63: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 65: Completed skeleton diagram with states and transitions for VBR

3.1.5 Creating the VBR Statistics Variables The dynamic statistics for VBR are short and simple. VBR only keeps track of the total bytes sent and total bytes received. Variable Name Variable Type Metric Name Metric Type BytesSent int Total Bytes Sent Cumulative BytesReceived int Total Bytes

Received Cumulative

Table 4: Statistics variables for VBR protocol Variable Name means what the variable is called in the source code. For future reference, the source code syntax for a protocol statistic is as follows:

dataPtr->stats.<VariableName>

For instance, the statistic for total bytes sent is:

dataPtr->stats.BytesSent

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 61 -

Page 64: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

The Variable Type is integer for both variables in this case. Metric Name is the name of the statistic that will show up in QualNet’s statistics module, QualNet Analyzer. Let’s proceed with specifying to Designer what statistics it will collect for VBR.

1. Click on the Designer toolbar button with the Σ on it.

Figure 66: Clicking on the “Add Statistics Variables” button in the Designer toolbar

2. In the Variable Name field, type BytesSent. 3. In the Metric Name field, type Total Bytes Sent. 4. Leave the default Variable Type as INT and the default Metric Type as

CUMULATIVE. Click Add.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 62 -

Page 65: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 67: Typing in the BytesSent statistic using the Statistics Variables Table

5. Repeat steps 2 through 4 for the second statistic, BytesReceived, and then press Confirm All Changes.

Figure 68: Completed Statistics Variables Table

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 63 -

Page 66: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 3.1.6 Creating VBR Local Variable The VBR Server will need to be able to differentiate between a data packet that represents normal traffic, and one that represents the closing of the connection (final packet). We will need a variable in the data portion of the VBR structure to represent this data type.

1. Click on the Designer toolbar button with the filing cabinet icon.

2. In the Variable Name field, input type. 3. In the Variable Type field, input char. 4. Click Add to add the entry 5. Click Confirm All Changes to save the changes.

e Network Technologies Proprietary Information. rculate without express consent of SNT, Inc.

3.2 Entering Source Code Next, we’ll fill in the source code for VBR. Luckily, VBR is a relatively simple protocol, so the remainder of the tour is to specify state and utility code. We’ve supplied you with all the source code you’ll need in the file called source.txt.

1. Open up a text editor such as Notepad for Windows. To open Notepad in Windows, select Start → Programs → Accessories → Notepad. If you are on a UNIX machine or prefer to use something else for simple text editing, use any text editor you’d like.

ScalablDo not ci - 64 -

Page 67: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 2. Open this file by selecting File → Open and selecting source.txt in the

[QualNet_Home]/gui/models directory. You’re going to cut and paste from this file into the QualNet Designer text editor.

3.2.1 Initial State First, let’s take a look at the contents of the initialization source code file to learn what initialization is necessary for the VBR protocol. The init function has been separated into seven parts that are described below.

1. Using the Notepad text editor, select Edit → Find and type in the character string INIT 1 in the Find What box.

2. Beneath the comment INIT 1 FOLLOWS, you will see the code for the first section of the init function. Compare the source code with the explanation in Table 5.

3. Next, search for INIT 2 and compare the source code with the explanation in Table 5.

4. Repeat step 3 for each of the seven sections of the init function until you understand the code to initialize the VBR application protocol model.

Section of Init File

Explanation for this code

INIT 1 Each node has a copy of the “AppInfo” data structure to keep track of all the application protocols that are running in the particular model. The function will fill in the fields of this structure and append it to the node’s list. The minSize variable is a variable that represents the minimum size of a data unit. It is used for validation purposes.

INIT 2 All code blocks starting from the itemSize to the endTime statements are all validation code. They check that all the application parameters are within acceptable boundaries.

INIT 3 Memory allocation step. INIT 4 This is the initialization step for the server node. If the current

node is in fact the server, the protocol data structure is filled with some pertinent server information, and the application is registered with the node.

INIT 5 Same as “INIT 4,” but for the client node. After all initialization is complete for the client, an extra step is taken to start the traffic process with the first timer being setup for packet transmission

Table 5: Initial State source code with descriptions of functionality by section

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 65 -

Page 68: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour A tool called the Default Editor is used to insert the init source code. The Default Editor is accessible through QualNet Designer for the creation and editing of state function code. Most importantly, the Default Editor has a special feature called Assisted Code Development (ACD). You can speed up code development by using the Insert option in the Default Editor to access QualNet API calls. Note: QualNet supports only windowing editors, such as emacs and Sun's textedit. QualNet does not currently support editors with command line interfaces such as vi. If you choose to use a different editor than the Default Editor, please keep this in mind.

1. To launch the Default Editor, right click on the Initial State in the top left corner of the canvas. Choose Properties → Entry Code → Default Editor. (Alternatively you can double click on the top of the state, or double click on the state name from the right hand side navigator toolbar)

Figure 69: Invoking the Default Editor for the Initial State

2. A pop up window for source code will appear. Let’s take a look around the Default Editor. Select Insert → Layer API and view the API options for the application layer. Close any pop-up windows by clicking the X in the top right corner.

3. Select Insert → General API and view the universal QualNet API options. Close any pop up windows by clicking the X in the top right corner.

4. To paste the source code for the Init function, go to the Notepad window with the file source.txt.

5. Select all the text between the flag INIT FUNCTION and END OF INIT FUNCTION by clicking at the beginning and dragging the cursor over to the end of the code. If you have trouble selecting the right text, first click and drag to select a portion of the text you want. Holding down the shift key, press the arrow key to add individual lines to the highlighted text.

6. Type Control-c to copy the text. 7. Switch windows to the Default Editor for the Initial State. Type Control-v

to paste the text, replacing any auto-generated code that is already there.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 66 -

Page 69: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 70: Init function code pasted into the Default Editor window

8. To save changes in this part, click on the save icon at the top left hand side of the editor (Figure 71).

Figure 71: Editor Save Button 1 Note: The user can write code from scratch via a user-defined editor rather than the Designer’s Default Editor. To invoke your own editor, right click on the state you wish to edit and choose Properties → Entry Code → User’s Editor. A window will pop up requesting the executable file for the editor you want to use.

3.2.2 Final State The purpose of the Finalize function is to perform “clean up” when the protocol reaches the Final State. It closes any connections that were opened (in TCP applications) during the execution of the protocol, and processes and prints out

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 67 -

Page 70: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour the protocol’s statistics variables (this functionality is handled automatically by the Designer). In the previous version of VBR (TCP) in version 3.1, there was some coding involved with the finalize function. However, since the current version is written on top of the UDP transport layer, there is no code necessary for “session cleanup” associated with TCP. As mentioned previously, the Designer will generate all code necessary for statistics processing.

3.2.3 Client State Next, we’ll look at the source code the client state. Then we’ll copy and paste the code into state using the Default Editor.

1. To launch the Default Editor again, right click on the ClientTimerExpires state. Choose Properties → Entry Code → Default Editor. Note: See Figure 69 for a picture of what this looks like.

2. A pop up window for source code will appear. To paste the source code for the Finalize function, go to the Notepad window with the file source.txt.

3. In Notepad, select Edit → Find and type in the character string CLIENTTIMEREXPIRES in the Find What box.

4. Select all the text between the flag CLIENTOPENS START and CLIENTTIMEREXPIRES END by clicking at the beginning and dragging the cursor over to the end of the code.

5. Type Control-c to copy the text. 6. Switch windows to the Default Editor for the ClientOpens State. Type

Control-v to paste the code. State Name Explanation for this Entry Code ClientTimerExpires The ClientTimerExpires function is invoked when the

client is scheduled to send out traffic. If the current time is before the specified “end time”, the client sends out a packet to the server. After the packet transfer has been initiated, an event is setup for the next packet transmission. This process continues until the session is over (current time is past the “end time”), in which case the client sends a “last data transmission” unit, or a farewell handshake to the server.

Table 7: Client State Entry Functions with descriptions of their functionality

3.2.4 Server State Next, we’ll look at the source code for each of the server state. Then we’ll copy and paste the code state using the Default Editor.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 68 -

Page 71: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 1. To launch the Default Editor again, right-click on the state called

ServerReceivesData near the Server Idle state near the middle of the canvas. Choose Properties → Entry Code → Default Editor. Note: See Figure 69 for a picture of what this looks like.

2. A pop up window for source code will appear. To paste the source code, go to the Notepad window with the file source.txt.

3. In Notepad, select Edit → Find and type in the character string SERVERRECEIVESDATA in the Find What box.

4. Select all the text between the flag SERVERRECEIVESDATA START and SERVERRECEIVESDATA END by clicking at the beginning and dragging the cursor over to the end of the code.

5. Type Control-c to copy the text. 6. Switch windows to the Default Editor for the ServerReceivesData State.

Type Control-v to paste the code. 7. Save the file as vbr.xml.

State Name Explanation for this Entry Code ServerRecieves The receive function strips the payload out of message

and interprets it as the data unit that was transmitted. Statistics (dataPtr->stats) are updated along with other protocol data structure fields. If the data unit was specified as the last transmission, the connection is marked as finished

Table 8: Server State Entry Functions with descriptions of their functionality Note: If you have an old .qpd file you can open it by selecting File → Import and then browsing to the file. If you continue your work that you saved in old .qpd or .qpt format, select File → Save As and save the file with .xml extension.

3.3 Incorporating VBR into QualNet Simulator We’ve now finished all the work building the protocol model functionality. The bad news is we still have more to learn about how the new protocol gets incorporated into QualNet. The next step is to convert the Finite State Diagram, or the canvas of QualNet Designer, into header and body files. After that, there are a few more steps to enable the simulator to recognize the newly generated files.

1. If you don’t already have QualNet Designer displaying the VBR protocol model with all the functionality of Sections 3.1 and 3.2, do so now by selecting File → Open. It should open a File Dialog. Hopefully you saved your Designer file as an .xml file. Click on the filename you created and choose Open.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 69 -

Page 72: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 2. To generate the source code for this model, select Build → Generate

Code in the QualNet Designer window. A completion dialog will pop up once the designer is finished generating the code.

Figure 72: VBR Model showing Build Menu 3. To view the code that has been generated, select Build → View Code.

Two dialogs will pop up containing the source and header file for the protocol.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 70 -

Page 73: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 73: Header and Body files for VBR Note: Generating .h and .c files does not mean they have been automatically added to QualNet Simulator. In fact, the .c and .h files can be modified outside of QualNet Designer as an intermediate step before adding the protocol to QualNet Simulator. Changes made directly to the .c and .h files will not be visible in QualNet Designer, since Designer only reads .xml files and only generates .h and .c files.

3.3.1 Header File Let’s take a look at the contents of the header file. Using the java window that displays VBR.h, scroll down to recognize the functionality described in Table 9. It is useful to see how operations with the QualNet Designer GUI result in code generation. Note: An easy way to differentiate between user created code and auto-generated code is by looking for the following the following comment in the .h and .c files:

//user code//

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 71 -

Page 74: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour *.h Source Code Contents GUI operations to

produce this code VBR only

User defined data definitions. All #includes, enumerations, typedefs, and data structure definitions found here.

“Add Data Definitions” button

This section empty for VBR

Statistics structure contains variables required to gather statistics.

“Add Statistics Variables” button

− total bytes sent

− total bytes received

Protocol data structure. This structure consists of the application parameters and user-defined variables local to the protocol.

“Add Variable Declaration” button plus some of this code is auto-generated by Designer

- char type;

Function Prototypes exist for Init, Finalize, Protocol Name and dynamic statistics functions.

auto-generated by Designer

N/A

Table 9: Header File (*.h) contents and how they are generated

3.3.2 Body File Next, let’s have a look at the body file. Using the java window that displays VBR.c, scroll down to recognize the functionality described in Table 10. *.c Source Code Contents GUI operations to

produce this code VBR only

User Defined Data Definitions All #defines and optional #includes specified by the user found here.

“Add Data Definitions” button

N/A

Protocol layer data Declaration contains #includes that provide standard library files used by the Simulator.

auto-generated by Designer

N/A

State enumeration lines for this layer go here.

“Add a New State” button

10 states we added manually

Function prototypes for the state functions. For each state in the Finite State Diagram, there is one function in the body file

“Add a New State” button

10 states we added manually

User-defined utility functions for subroutines that come up a lot in the protocol

“Add utility function” This section empty for VBR

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 72 -

Page 75: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour State entry functions Right click on state,

select Default Editor… 8 states for which we cut and pasted code

Internal functions required to collect statistics

“Add Statistics Variables” button

This section empty for VBR

Init Function Right click on Init State, select Default Editor…

We cut and pasted code

Final Function Right click on Final State, select Default Editor…

We cut and pasted code

ProcessEvent Function auto-generated by Designer

N/A

Table 10: Body File (*.c) contents and how they are generated

3.3.3 Adding VBR to the QualNet Simulator

1. To add this protocol to the QualNet simulator, select Build → Add to QualNet. Again, a pop-up verification window will appear once the designer is finished adding the protocol to QualNet.

The “Add to QualNet” command will copy the source and header files (generated in the previous section) into the appropriate directory for use by QualNet Simulator. The appropriate simulator files will be modified to recognize the new protocol, as well as the makefile. During the “Add to QualNet” process, a pop-up will appear asking if the application is single-host. A single host application is when there isn’t a distinct one-to-one application link between two distinct nodes. Since VBR is in fact an application link between two distinct nodes, choose the No option on the popup.

Figure 74 : Application Host Type Pop-Up

2. If you wish to compile QualNet (with VBR), select Build → Compile. A dialog will pop up and show the progress of the compilation ***.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 73 -

Page 76: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour A pop up window will report on the compilation process. A message will be displayed verifying that compilation is complete. If you receive errors, you can make changes to the designer model (.xml file) to rectify the complaints and start again from this section. The VBR protocol is now a part of your QualNet Simulator.

3.3.4 Using the New Protocol in QualNet Animator The VBR protocol is now visible and available for use in the QualNet Animator. We can make a simple two-node application using the VBR protocol:

1. Open the Animator by clicking the “A” on the bottom right toolbar (pictured below).

Figure 74: GUI Gateway Toolbar

2. In the top-right toolbar, click the Create Nodes icon.

Figure 75: "Create Nodes" icon is the top right button

3. The Nodes window is displayed with choices for node types. Click on the Default node type.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 74 -

Page 77: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 76: Node Pop up Window

4. Now click on the canvas and create two nodes (position does not matter).

Figure 77: Two default nodes residing on the canvas

5. Now go back to the top-right hand toolbar and click the Add Application Type button.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 75 -

Page 78: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 78: The "Application" icon is on the second row, first column (shaded)

6. The Applications window should be displayed, providing a choice of all applications available to Animator. Select VBR.

Figure 79: Applications Pop Up Window

7. Now create a link connecting the two nodes. A dialog should pop up asking for the values of the application parameters. Enter the inputs as shown in the following figure.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 76 -

Page 79: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 80: VBR Application Parameters

8. To disable animation by layer, select View → Animation Filter → By Layer and select the layers to disable.

9. Press the Run QualNet button (the clapper) to prepare the simulation.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 77 -

Page 80: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 81: Run QualNet is the second icon from the left

10. Press the Start / Continue Animation icon in the top toolbar to prepare the simulation for animation.

Figure 82: Start / Continue Animation is the third button from the left

11. As the simulation progresses you can see VBR at work between the two nodes!

Figure 83: VBR in action

4 QualNet Tracer 4.1 TCP Trace

1. Start by running QualNet Animator. 2. Load bottleneck-TCP.xml from [QualNet_home]\gui \scenarios by

selecting File → Open. 3. Press the Setup QualNet Parameters button.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 78 -

Page 81: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 4. With the General tab selected, set Simulation Time to 5 seconds. 5. Select the Traffic and Status tab. Under Tracing, set Packet Trace to Yes.

Note: Leave the default settings. Trace All: Yes Trace Direction: Both.

6. Save settings, then close. 7. Press Run QualNet (Action!) to run the experiment. It is a good idea to

disable animation, because writing the trace file slows down QualNet and the animation slows it down even more. To disable animation, select View Animation Filter → By Layer and deselect all the layers. Then, click on the forward arrow button to run the experiment.

Figure 84: Disabling animation in QualNet Animator

8. Activate QualNet Tracer by clicking on the T button in the bottom right corner of the QualNet Animator.

9. Open the file you just created by selecting File → Open in the Tracer window. The trace file you just created should be in the directory [QualNet_home]\bin and will be named QualNet.trace.

10. In the upper right window, select a row, which corresponds to a packet. 11. On the left, you can see the fields of the packet header. 12. Clicking on the fields in the left window should highlight the corresponding

hex code in the lower right window.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 79 -

Page 82: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 85: QualNet Tracer showing an individual packet with header and corresponding hex data

5 QualNet Scalability

5.1 Run Time Comparison In this experiment, we’re going to perform a basic QualNet Animator experiment from Section 1.2 Basic Animator Experiments, but this time we’re going to pay special attention to the relative runtimes for small, medium and larger networks. We’re going to perform four experiments with 36, 144, 252, and 360 nodes. QualNet has successfully simulated 100-node high fidelity wireless networks in real-time. That means that on average, one second of simulation data took one second to produce. Real-time simulations are extremely valuable when they interface with other applications that require interactivity. It is a good idea to follow up a batch execution by viewing the statistics you just produced in QualNet Analyzer.

1. Start by selecting File → New. 2. Select the Setup QualNet Parameters button and then select the Traffic

and Status tab.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 80 -

Page 83: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 3. Choose the Application Config file by browsing and finding

[QualNet_home]/gui/bin and selecting med36.app. This application traffic file specifies CBR connections between wireless nodes 1 through 36.

4. Press Save and then Close. 5. We will need to measure the time of execution. So open the Windows

clock by selecting Start → Settings → Control Panel → Date / Time.

Figure 86: Windows clock being opened to measure scalability of QualNet for successively larger data sets

6. Put the clock window on the desktop so that QualNet running on top will still display the clock with the hour, minutes, and seconds.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc.

7. Choose Experiment → Batch Experiment Setup.

- 81 -

Page 84: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 87: Selection of Batch Experiment Setup

8. Choose Node Positioning → Nodes → Number of Nodes. 9. Select the Non-Interactive radio button (below the configuration

parameters menu). 10. Set Start Value to 36. 11. Set End Value to 360. 12. Set Increment Value to 108. 13. Then press Calculate No. of Runs. 14. Hold down the control key and select all four runs in the box above the

settings you just filled in.

Figure 88: Batch runs based on a variable number of nodes, ranging from 36, 144, 252 to 360 for four experiments

12. Press Run.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 82 -

Page 85: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour 13. Have a pen handy to write down the start and stop times of trials 1 through

4. If we were running QualNet in interactive mode, we could use the Real Time clock to see how long the trials took. However, since we’re primarily concerned with having fast runtimes, we’re turning the animation off, which boosts QualNet’s performance considerably.

14. There should be another popup window asking you a question. Answer no. The experiments should run now.

Figure 89: QualNet running non-interactive batch experiments that were timed using the Windows clock

Below is a table that summarizes the run time for this wireless Ad Hoc Network simulation running AODV routing and with node mobility. The simulation time was 30 seconds and the simulations were run on a Pentium III processor running at 866 MHz with 196 M RAM. The Operation System was Windows 2000 with Service Pack 2. Other applications, such as Microsoft Word, were also running in the background, which slowed down the simulation speed. In general, the time it takes to run an experiment in QualNet varies tremendously with the experiment parameters, such as traffic load, spacing of nodes, and the networking protocols used.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 83 -

Page 86: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour Trial # Nodes Start Time End Time Run Time Simulation Time1 36 5:37:41 5:37:46 5 Seconds 30 Seconds 2 144 5:37:46 5:38:08 22 Seconds 30 Seconds 3 252 5:38:08 5:39:06 58 Seconds 30 Seconds 4 360 5:39:06 5:40:28 82 Seconds 30 Seconds Table 11: QualNet runtimes for experiments with varying number of nodes

15. Statistics files have now been created in the current directory named

Number36.stat, Number144.stat, Number255.stat and Number360.stat. 16. Run Analyzer now by selecting Statistics → Run Analyzer or the ε

button in the bottom right corner. 17. From the Statistics menu, you will be able to identify the stat files you just

created, as they are automatically called Number*.stat when you vary a number for batch runs.

18. Select number36.stat in the left window. This is the 36-node experiment. 19. Select 802.11b signals received and forwarded to MAC. Notice the x-

axis of the graph shows 36 nodes.

Figure 90: QualNet Analyzer showing 802.11b signals received and forwarded to the MAC layer for a 36-node experiment

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 84 -

Page 87: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

20. Select number144.stat in the left window. 21. Select 802.11b signals received and forwarded to MAC. Notice the x-

axis of the graph shows 144 nodes.

Figure 91: QualNet Analyzer showing 802.11b signals received and forwarded to the MAC layer for a 144-node experiment

22. Select number252.stat in the left window. 23. Select the MAC layer tab, then 802.11MAC, then BROADCAST packets

received clearly. Notice the x-axis of the graph shows 252 nodes.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 85 -

Page 88: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 92: Broadcast packets received clearly for a 252-node experiment

24. Select number360.stat in the left window. 25. Select the any layer tab you wish. Notice in every case, the x-axis for the

stat file number360.stat shows 360 nodes.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 86 -

Page 89: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 93: QualNet Analyzer showing statistics for a 360-node experiment

26. To see more than one data set at once, hold down the Shift key and select all four stats files.

27. Select Option → Graph Visibility → Multiple Graph. 28. Select the Network tab, then AODV → Number of Hop Counts. You can

see that the 3rd bar corresponds to the 36-node trial. One would expect the most hops for the trial with the smallest number of nodes, as we did not change the size of the experiment area. In other words, with each successive trial, more nodes were crammed into the same area, increasing the density of nodes. Higher node density would lead to fewer hops under AODV.

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 87 -

Page 90: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Figure 94: AODV Number of Hops for all four trials

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 88 -

Page 91: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Table of Figures Figure 1: QualNet Animator ..................................................................................3 Figure 2: Runtime Control Toolbar........................................................................4 Figure 3: Manual Configuration Toolbar................................................................4 Figure 4: Animation Filters Toolbar .......................................................................5 Figure 5: Time Controls ........................................................................................5 Figure 6: Opening the application file in QualNet Animator ..................................6 Figure 7: QualNet simulation showing radio broadcasts as blue circles and green

arrows as successful data packet transmission .............................................7 Figure 8: Automatic Node Placement ...................................................................8 Figure 9: Application links for Constant Bit Rate (using light36.app) shown

between specific wireless nodes....................................................................9 Figure 10: Designation of Application links between nodes ................................10 Figure 11: CBR and FTP application traffic flowing between nodes ...................11 Figure 12: Node Properties menu showing the parameters a modeler can set for

each device or node in the model. Here, the modeler is selecting from a list of routers by manufacturer and model number. ...........................................12

Figure 13: Opening the switched beam antenna azimuth file .............................13 Figure 14: Making a CBR application connection between nodes ......................14 Figure 15: Nodes adjusting their directional antennas for reception of a signal ..15 Figure 16: Batch Experiment Setup tool with start, end and increment values ...16 Figure 17: Selection of seed values for batch experiments.................................17 Figure 18: QualNet message window showing the status of batch experiments in

execution .....................................................................................................17 Figure 19: Dynamic statistics selection for system wide data .............................18 Figure 20: Dynamic statistics graphs for the system as a whole and node 6......19 Figure 21: Link on the lonely side of the Y being set up for a bottleneck ............20 Figure 22: Specifying the second CBR application traffic between remote nodes

in the Y configuration ...................................................................................21 Figure 23: Adding queue node animation to the center node .............................22 Figure 24: Queues at a bottleneck filling at different speeds because of different

priorities .......................................................................................................23 Figure 25: Two queues overflowing at a bottleneck. The queue that fills up first

will take the longest to empty.......................................................................24 Figure 26: Selecting Round Robin IP Queue Scheduler .....................................25 Figure 27: Round Robin queuing serves high and low priority queues at roughly

the same rate...............................................................................................26 Figure 28: Replacing one of the two CBR links with FTP/Generic ......................27 Figure 29: FTP/Generic traffic has a shorter queue (middle top bar) compared

with CBR (right top bar) because TCP adjusts packet rates according to the capacity of the connection. ..........................................................................28

Figure 30: Selection of a node for a hierarchical network ...................................29 Figure 31: Connecting computers to a switch in a subnet...................................30 Figure 32: Copying of a Hierarchical Component ...............................................31 Figure 33: Connecting one subnet to another using hierarchical tools...............32

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 89 -

Page 92: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour Figure 34: Assigning Autonomous System status to a subnet ............................33 Figure 35: Assigning parameter values to the BGP speakers in Autonomous

Systems.......................................................................................................34 Figure 36: Selection of Bellman Ford as the network-wide routing protocol .......34 Figure 37: Selection of Bellman Ford for the wireless subnet .............................35 Figure 38: Point to Point link specifications for the connection between the

wireless and wired subnets..........................................................................36 Figure 39: A mixed network with application traffic in design mode....................37 Figure 40: A mixed network transmitting packets................................................38 Figure 41: qualnet.config file for verification of routing protocols and other

network parameters .....................................................................................39 Figure 42: Bottleneck.xml set up showing the application properties between

nodes 1 and 5 ..............................................................................................40 Figure 43: Batch setup of a bottleneck traffic situation using FIFO and RED

queuing types ..............................................................................................41 Figure 44: QualNet Analyzer showing a single data set displayed in bar chart

format ..........................................................................................................42 Figure 45: Histogram of MAC layer Link Destination by node ID ........................43 Figure 46: QualNet Analyzer showing Server Throughput in bits/second for FIFO

(left) and RED (right)....................................................................................44 Figure 47: RED Average Time in Queue (seconds) and Average Queue Length

(bytes)..........................................................................................................45 Figure 48: FIFO Average Time in Queue (seconds) and Average Queue Length

(bytes)..........................................................................................................46 Figure 49: Statistics by IP address......................................................................47 Figure 50: Start up QualNet Designer.................................................................48 Figure 51: Create a new protocol in QualNet Designer.......................................49 Figure 52: QualNet Designer ..............................................................................50 Figure 53: QualNet Designer Toolbar .................................................................50 Figure 54: Project Explorer Toolbar ....................................................................51 Table 1: Initialization parameters for the VBR protocol .......................................52 Figure 55: Adding a default parameter value ......................................................53 Figure 56: All VBR parameters ...........................................................................54 Figure 57: Creation of a new state called Client Idle...........................................55 Figure 58: Transition from Initial State to Client Idle state...................................56 Figure 59: Two VBR idle states with transitions..................................................56 Table 2: State names and trigger source code for client events stemming from

the Client Idle state ......................................................................................57 Table 3: State names and trigger source code for server events stemming from

the Server Idle state.....................................................................................57 Figure 60: Addition of new client server state ....................................................58 Figure 61: Dragging a transition from Client Idle to ClientTimerExpires..............59 Figure 62: Selecting Trigger code for a transition ...............................................59 Figure 65: Completed skeleton diagram with states and transitions for VBR......61 Table 4: Statistics variables for VBR protocol .....................................................61

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 90 -

Page 93: QualNet 3.6 Product Tour - Department of Electrical Engineering

QualNet 3.6 Product Tour

Scalable Network Technologies Proprietary Information. Do not circulate without express consent of SNT, Inc. - 91 -

Figure 66: Clicking on the “Add Statistics Variables” button in the Designer toolbar..........................................................................................................62

Figure 67: Typing in the BytesSent statistic using the Statistics Variables Table63 Figure 68: Completed Statistics Variables Table ................................................63 Table 5: Initial State source code with descriptions of functionality by section ...65 Figure 69: Invoking the Default Editor for the Initial State ...................................66 Figure 70: Init function code pasted into the Default Editor window....................67 Figure 71: Editor Save Button 1..........................................................................67 Table 7: Client State Entry Functions with descriptions of their functionality ......68 Table 8: Server State Entry Functions with descriptions of their functionality .....69 Figure 72: VBR Model showing Build Menu........................................................70 Figure 73: Header and Body files for VBR..........................................................71 Table 9: Header File (*.h) contents and how they are generated........................72 Table 10: Body File (*.c) contents and how they are generated .........................73 Figure 74 : Application Host Type Pop-Up..........................................................73 Figure 74: GUI Gateway Toolbar ........................................................................74 Figure 75: "Create Nodes" icon is the top right button ........................................74 Figure 76: Node Pop up Window ........................................................................75 Figure 77: Two default nodes residing on the canvas.........................................75 Figure 78: The "Application" icon is on the second row, first column (shaded)...76 Figure 79: Applications Pop Up Window.............................................................76 Figure 80: VBR Application Parameters .............................................................77 Figure 81: Run QualNet is the second icon from the left.....................................78 Figure 82: Start / Continue Animation is the third button from the left.................78 Figure 83: VBR in action .....................................................................................78 Figure 84: Disabling animation in QualNet Animator ..........................................79 Figure 85: QualNet Tracer showing an individual packet with header and

corresponding hex data ...............................................................................80 Figure 86: Windows clock being opened to measure scalability of QualNet for

successively larger data sets .......................................................................81 Figure 87: Selection of Batch Experiment Setup ................................................82 Figure 88: Batch runs based on a variable number of nodes, ranging from 36,

144, 252 to 360 for four experiments ...........................................................82 Figure 89: QualNet running non-interactive batch experiments that were timed

using the Windows clock .............................................................................83 Table 11: QualNet runtimes for experiments with varying number of nodes.......84 Figure 90: QualNet Analyzer showing 802.11b signals received and forwarded to

the MAC layer for a 36-node experiment .....................................................84 Figure 91: QualNet Analyzer showing 802.11b signals received and forwarded to

the MAC layer for a 144-node experiment ...................................................85 Figure 92: Broadcast packets received clearly for a 252-node experiment.........86 Figure 93: QualNet Analyzer showing statistics for a 360-node experiment .......87 Figure 94: AODV Number of Hops for all four trials ............................................88