ns-Bench FAQ
Q. How does NS-Gui, NS and NAM relate to each other?
A. NS GUI is a software that lets you create the network topology that you
want to simulate graphically. Without this,
you would have to create TCL scripts yourself. NS GUI creates the TCL
script along with the NAM file automatically. NS is the simulation software.
The input that it uses is the TCL scripts that was produced by NS GUI.
NAM is a software that lets you view the simulation graphically. The input
to NAM is the .nam file produced by NS GUI.
Q. NS GUI (NS-2 Workbench) does not output the NAM file. How do I make NS GUI(NS-2 Workbench) output the NAM file?
A. Go to Configuration -> Trace and then make sure that the NAM FIle radio button is checked.
Q. When simulating a web server and a web client, Why am I not seeing any packets in the trace file?
A. Make sure that the Poisson Request Sequence in the Web client setting is lower than the simulation time.
Q. What is the unit for Poisson Request Sequence?
A. By default, it is in seconds. If you need it in milliseconds just put ms after the number (i.e 500 ms).
Q.The assignment does not specify what type of TCP implementation to use. What type of TCP should I use?
A. TCP Tahoe.
Q. What is the unit when setting up the rate for CBR?
A. Kilobits per second (Kbps)
Q. What is the unit when specifying packet size?
A. Bytes
Q. Do I need FTP traffic for each tcp transport?
A. Yes, One FTP and one tcp transport (tahoe or reno or vegas). Same thing for the sink.
Q. If each TCP session must has its own TCP client and sink, is it the same case with Web Traffic?
A. No, web server already has TCP build in. You just need 1 web server traffic for server node. However, each web client node must have its own web client traffic.
Q. If I want to create a web traffic by using web server and client, do I need to start web server traffic in the scenario? (Web server doesn’t show up in scenario.)
A. No, you need only to start web client scenario because web client who makes a request and initiate the traffic.
Q. Can one node (host) connect to more than one type of traffics?
A. Yes, a host can be client of FTP (connected to sink) and client of web traffic (connected to web client).
Q. If I have started many traffics in my (configuration) scenario and they all should stop at the same time, do I need to explicitly declare it to stop or will it stop when simulation time finish?
A. You do not need to explicitly declare a stop in scenario for each. It will stop when it reaches simulation finish time. (it will have the same effect if you do declare them).
Q. Where is my trace file (.tr) when I generate the script?
A. You can specify the file name for trace file, tcl script file, and nam file by going to configuration – trace.
For old version, after generate (script – generate) all files will be located on your desktop.
For new version, it will in the same directory that you put the ns bench.
Q. For web server properties page (both math and compmath) what are the unit of page size generator and page age generator?
A. All units in web server properties, web client, as well as TCP transport and sink and CBR transport are in byte and second.
Q. How can I view and edit my tcl file?
A. You can use any text editor to view and modify your tcl file.
Q How can I extract information from my trace file? What program can I choose?
A. You can use many of them i.e. awk program, grep, or MS excel.Q. What should I use for audio traffic?
A. You can use CBR (constant bit rate) to initiate the traffic with null at the receiver.
Q. Can I run ns (network simulation) program on my windows PC?
A. Yes, you have to download and install cygwin. (google it).
Q. Where do can I find the newest ns bench file?
A. On the course website or Canvas.
Q. Do I need to have one to one mapping of TCP services and sink?
A. Yes, it is a one to one mapping.
Q. I don't see the new TCP or UDP sources/ Sink or Null added.
A. Try disabling the link and box located at the top of the GUI.
Q. Do I need to add a WebTraffic when using web server and web client.
A. No. Web traffic is used for a different purpose. It is used to simulate web traffic without a web server and client.Q. Can I change the file name created while creating the tcl file when clicking the generate button ?
A. Yes. These are available under the configuration / trace option in the NSBench GUI. You can change the filename using this, but the extensions shouldn't be changed.
Q. How do I set up the exponential traffic in NSBench?
A. For setting up exponential traffic, first you need to calculate the burst and idle time. For calculating the burst and idle time, use the message size and the time within which is message will be sent.
Q. Can I use fractional values like .5 in NSBench.
A. Yes, it is possible to use fractional values.
Q. How do I add delays to the applications, for e.g. like CBR ?
A. For adding delay to the application, you need to add a link and add the delay there as the application will not allow to add delay.
Q. Can I use the awk scripts to generate a .csv file so that it can be opened in excel ?
A. Yes. Tweak the awk script print format to contain a "," instead of a ":".
Q. When I click on the generate after creating a network in NSBench, I am getting an error. How to troubleshoot?
A. Create the network with fewer elements and then see whether the error is seen. Take a step by step approach if you get an error while generating the tcl script.
Q. I do not receive any TCP packet on WEB client side.
A. ACK packets are actuall TCP packets with the ACK piggy-packed. You should count these packets as if they are TCP packets.
Q. My WEB traffic generates after 5 Sec. eventhough that I have configured it to start at time sec 1.
A. You're using 500 as the time in the Web Client. The time units is seconds unless otherwise metioned. So you need to set it to 0.5
Q. TCP port numbers are not included in the out.tr file then is there any other way to distinguish between different TCP traffic types.
A. Yes, this is a shortcoming of NS.
You distringuish between traffic flows via the node id (fields 9 and 10 in the trace file). So for each type of traffic you need to create a separate node, even if all of them are physically existing on one host.
Q. I am getting the error when I try to use group for WEB client.
A. There is a bug in using Web with groups. Please use single node with Web Client/Server
Q. How do I need to connect the WEB server and WEB client to the node; if it needs to be directly connected with the node? because I tried to use it on top of TCP but unable to connect it to TCP.
A. Web server has already tcp integrated. You do not need tcp for web
Q. I have downloaded the nsbench-1.0b1.zip file and extracted the files, now which file do I need to compile; I cant find the main file; How should I proceed from here.
A. RENAME nsbench-1.0b1.zip == to ==> nsbench-1.0b1.jar. Then double click the file. You should see nsBench main window.
Q. How do you differenciate the web traffic and FTP traffic since they are both TCP traffic?
A. you can always distinguish by looking at the destination (traffic received by web client is web traffic) because you should use different machines for each.
Q. How many tcp-agane do you need to create if there are multiple ftp seesion between server subnet and student subnet?
A. For each ftp session you need one tcp-agane (Taho) and one sink agent of course in addition to the ftp application, between the client and server.
Q. In NSBench, for Web server/page pool generator/configure, is the page size generator in bytes and the page age in seconds?
A. Yes, the default value of the page size generator is 1000 bytes.
Q. What is the useful site for "awk" tutorial
A. http://www.vectorsite.net/tsawk1.html,
http://robert.wsi.edu.pl/awk/start.html
Q. Do we need create web server on top of TCP?
A. Web server has already tcp integrated. You do not need tcp for web.
Q.How do we analyze the file use grep and wc ?
A. For example to count how many times the word TDC562 appeared in a file test.txt you will do (grep with piping):
cat test.txt | grep TDC562 | wc -l
Q: How do I open a .jar file in WinXP?
A. The nsBench.jar is a executable compressed file and it will open and run automatically under WinXP.
Q: Why can’t I produce a trace.out file using a ‘ns’ program on the sim.tcl?
A. The sim.tcl and ‘ns’ must be in the same directory. Running command: ns sim.tcl will produce a trace.out file if the sim.tcl is stored in the same directory as ‘ns’ program.
Q: Do I need a tcp for a web server?
A. Web server has already tcp integrated.
Q: Do I need a sink for a Web server?
A. The web client is required only. No tcp sink is needed. Sink is required only for a TCP transport for ftp application. Null is required for each UDP.
Q. Do I need a regular node for every application on the subnet?
Ans: Yes, each node supports only one application i.e. udp, tcp, Web client, etc.
Q. How do I set a web client link with exponential distribution?
A. Double click on the Web Client to get its properties. Select Poisson Request Sequence to Exponential. Other available options are Pareto, Constant, CBR, Trace and Compound
Q. How do I specify two-way CBR traffic?
A. You have to set up and CBR/UDP source and a UDP sink each way.
Q: What is a “group”?
A. Groups are used exactly like hosts, but must establish sessions to other groups with the exact same number of hosts. For example you for setting up 5 clients to talk to a single FTP server, you cannot use a group of 5 clients, because you are not using a group of 5 FTP servers.
Q: In FTP, which way does the data flow?
A. The data is a download, from the server to the client.
Q: In a WebClient object, how do I specify Poisson Request Sequence times of less than one second? A. You can use decimal notation. For example, for 500ms, you can use 0.5.
Q. What unit is the TCP window size in?
A. TCP units are expressed in Kbytes. For example, a 16Kbyte window is expressed as 16.
Q. After creating the network, only out.tr(trace file) gets generated and not the out.nam file, what's the problem?
A. The NAM file must be configured to be generated.To do this go to "Configuration" and click on "Trace".Check the box next to "NAM File Name"
Q. Sometimes, when data is entered in KBytes/MBytes and time in ms with all the units appended, NSWorkbench still considers the data to be in bytes and time in seconds?
A.The default unit for data is bytes and for time is seconds.Appending KBytes/MBytes for data or ms to time does not change the default unit.All data must be entered in bytes and time in seconds.
Q. After creating the network and generating the trace file, when i try to run out.tr with ns i get errors.
A. This could be due to missing links in your nsbench file.For example, if you have an application using TCP, check if there's a link between the TCP agent and receiver sink.
Q. I have a web server and a web client in my network but no traffic is generated between the two?
A. This may happen if you choose a verylow value for poisson request sequence.
Q.Can i change the name of my trace file?
A.Yes, you can change the name of your trace file. You need to go to "Configuration" and click on "Trace" and make the necessary changes.
Q. If i upgrade my NSBench to a newer version, will i be able to load my .nsb files created on an older version of NSBench?
A. No, you may not be able to open a .nsb file (created on an older version of NSBench) in the newer version of NSBench.
Q. In a network containing a web server and a web client, is it neccessary to have a web cache between the web server and the client?
A. No, its not neccessary to have a web cache between the web server and the client unless required, the webserver and the client can be connected directly.
Q. Should i have the same packet size for my application as well as my agent?
A. The size of the data you want to see in your network should be the packet size in both the agent and the application.
Q. Why there are no output in the file out.tr when I put the tcl file created by nsbench to ns.exe to simulate ?
A.: in configuration-->scrnario, you should add simulate item.
Q. Can more than one web client connect to same web server?
A. yes, a web server can connect to many web client.
Q. Can I connect more than one udp to one Null?
A. no, only one dup is connect to one null.
Q. Can cbr connect to tcp ?
A.Yes, it can.
Q. Where can I set TCP window size?
A. click the tcp node, a property window will pop up, select window tag, block "win" is for window size,the unit is tcp packet size.
Q. How to generate the trace file ?
A. You can click the Script, and from the pull down menu click RUN
OR
Go into the folder where the .jar ( NS workbench application is ) for eg: C:NSNAM> ns sim.tcl. The sim.tcl is the script file. Both the script file name and the trace file name can me named as per your choice under Configuration pull down menu. Trace file and the script file will be created in the directory where the application file (.jar) is resides.
Q. Do I need use the UNIX machine if I want to use grep or awk command?
A. You can down any windows to UNIX emulator e.g. CYGWIN. Go into the directory where the out.tr file is located.
Q. Can I create script using same tool?
A. I had no success doing so?
Q. How to attach the application like FTP ? Just dose not happen.
A. Read the resource pages and examples. Click the agent ( select ) and then from the pull down menu click the application. The application icon will be connected to the agent you have selected. Two agents ( TCP, UDP ) connect to each other not the application. ( think transport layer )
Q. I am not able to connect the TCP ( vegas ) and TCP sink ?
A. The connection is only one way from TCP (vegas ) to TCP sink. If you try other way around it will not work.
Q. I have a duplex link, sending data in both the direction ?
A. As you may have though correctly, you need agent, sink and application on both the sides.
e.g. node 1 has TCP1, FTP 1 and SINK 2, node 2 has TCP2, FTP2 and SINK 1. TCP1 and SINK 1 are connected and TCP2 and SINK 2 are connected.
This also hold true for UDP ( CBR ).
Q. How about rate? Application changes rate ( data rate ) after certain time, then what ?
A.You will have to create new agent, new application and new rate besides the existing one and add it into scenario.
Q. In exponential the time is second? How can I put ms
A. Time is in seconds. To put ms say 500ms.
Q. How can I change output file names (e.g. TCL/Trace/Nam)?
A. Go to "Configuration" tab and select "Trace".
Q. What is the unit of parameters? For example, pcktsize has input box but I don't see any units.
A. If it is not specified, the default unit is either "byte" for size or "second" for time.
Q. Which TCP agent do I need to use?
A. Use "TCP Tahoe" for sender. For receiver, it doesn't really matter. You can use "TCP Sink" for receiver.
Q. In TCP Tahoe Properties, the default Window size is 20. What is the unit for this? 20 packets, bytes, or KBytes?
A. 20 packets
Q. How can I generate trace file?
A. There are two ways to do it. One is to select "run" in "Script" tab in NS2-Workbench. The other way is to run the following in the Dos Command line: C:\>ns [TCL filename]
e.g. C:\>ns test.tcl
Q. How can I match node name and the number in the trace file?
A. When you generate trace file in the Dos Command line, you can see node name and its corresponding number which is used in the trace file.
e.g.
C:\courseXYZ>ns test.tcl
n0: 0
n1: 1
n2: 2
n3: 3
n4: 4
n5: 5
Simulation completed.
Q. How can I run NAM (Network Animater) from NS-bench?
A. You have to check the nam file checkbox in Configuration tab -> Trace. After generating code and trace file, You can run nam file in Dos Command line.
e.g. (in windows xp) C:\cocaul\tdc562\> nam-xp test.nam
Q. How can I configure the page size in Web Traffic?
A. Double click webserver icon, and then click configure button. You can set page size as well as the page age.
Q. How can I connect two LANs (beta-3) ?
A. You can connect two nodes that belong to each LAN. In this case, these connecting nodes are acting as router.
Q. What is the scale of Page Size Generator and Page Age Generator under WebServer Math Properties window?
A.Page Size Generator: byte, Page Age Generator: second
Q. What is the scale of Poisson Request Sequeuce under WebClient Porperties window?
A. Poisson Request Sequeuce: second
Q. How to create a full-duplex UDP connection?
A. Create an upd and a null connection on each node. Connect the upd from one node to the null on the other node.
Q. Why I don’t have the .nam file after simulating the script generated by nsBench?
A. Open nsBench, choose Configuration -> Trace. In the Code Configuration window, select the NAM File Name checkbox. It is unchecked by default.
Q. Why TCP can’t be used to connect between node and Web Server/ Web Client?
A. TCP is already integrated in Web Server and Web Client. Just connect the Web Server/ Web Client directly to the node.
Q. Where can I specify the time that a service start?
A. Open nsBench, choose Configuration -> Scenario. Click Add Row button to add rows to specify the service and time it starts and stops. Enter the simulation time in the textbox of Simulation finish at time. Click OK button to finish.
Q. Can a node within a LAN group connect to nodes in other LANS directly?
A. No. To connect a node within a LAN to a node within another LAN traffic needs to flow between the LAN groups and not directly between the nodes.
Q. Where do UDP applications on nodes terminate?
A. 1-way UDP connections terminate at NULL points.
Q. Where do TCP applications on nodes terminate?
A. TCP connections end at TCP Sink points. And the connections need to be manually between a valid TCP application on a node and a TCP Sink destination on another node.
Q. How come my tcl script has multiple start entries for a node?
A. During the creation of the network schema, the user might have entered and then deleted nodes in some specific order. You can either redo the schema by being careful on what is deleted and added OR you can just delete the duplicate entry in the tcl script. If this is not done then the generated outcome could crash.
Q. How do I use Groups?
A. First select a Group node. Then add single Nodes and connect the nodes you want associated with that group to the Group node. Then continue with the rest of your network schema. During the configuration of the scenario, you need to identify a node with its Group ID. Make sure you do this in order for the generator to recognize the fact the node is associated to a certain group.
Q. Can I connect multiple nodes to one another?
A. No, nodes cannot communicate with one another except with a network application on the node (TCP, UDP, etc). If you want to connect two nodes the nodes need to have compatible network applications.
Q. What is the unit when setting up the rate for cbr in nsBench? Kilobits per second or Kilobytes per second?
A. Kilobit per second
Q. In the trace file, what unit is the size in?
A. Bytes. We have to convert the bytes to bits and then to Mbits. i.e. multiply the size by 8 and then divide by 10^6.
Q. What type of TCP do we use in our simulation?
A. TCP Tahoe
Q. Is it normal not to see any dropped packets in the trace file? i.e. no lines starting with 'd'
A. Yes. This means the network is not congested and no collisions are taking place resulting in dropped packets
Q. For the assignment, the trace file ends up coming out to several MB in size. Is this normal?
Ans: Yes.
Q. Does the web server need to connect to TCP?
A. No, TCP is integrated into the web server.
Q. What does the following mean? 40% of the users use FTP, 40% of the users use WWW and 20% use UDP audio.
A. 40% means 4 machines, 20% means 2 machines, etc.
Q. I don’t see the application when I double click the nsBench-1.0b3.jar file; instead I see all class files.
A. This happens when you associate nsBench-1.0b3.jar with WinZip or WinRar. You will need to open it using javaw.exe. For windows, right click the file and select “open with” and click on “Select Program” and then “Browse” and give the path of javaw.exe. For a default installation of Java1.4 or later, it will be in "C:\Program Files\Java\jdk1.5.0\bin".
Select javaw.exe & click Open and then OK.
Q. I cannot add TCP to Web Server?
A. You do not have to add TCP to Web Server, it comes integrated with TCP.
Q. I don’t see TCP packets going from web server to the web client, instead I see all ACK
A. Yes, that’s how NS workbench is designed. Actually, the web page data is been sent in the ACK’s sent from the server to the client. Remember the piggy backs of ACK’s
Q. Can I have more than one ftp client download from one ftp server simultaneously?
A. No, for every ftp client, you will need to create a new instance of ftp server and create a single connection.
Q. I cannot generate the nam file.
A. In order for you to generate the nam file you will have to put a check mark next to the Nam File Name check box, which you will find by clicking on Configuration > Trace in the NS-2 Workbench menu.
Q. Trace file generated is 0 bytes.
A. Before you generate the TCL script & Trace file, you should create the scenario.
Q. When creating the scenario do you need a stop command for every start command?
A. No as long as you as you set the simulation finish time.
Q. Do you need a web server for each web client?
A. No, just one unless otherwise called for.
Q. When analyizing your tracewith awk or grep, how do you import your out.tr file to URANUS?
A. by using a FTP command.
Q. Do you start your simuation at 1 or 0?
A. Zero, unless other wise specified.
Q. Do you use one TCP agent per node?
A. No, each session requires its own TCP agent.