01) Implement three nodes point – to – point network with duplex links between them | ns2 |(18CSL57)

Описание к видео 01) Implement three nodes point – to – point network with duplex links between them | ns2 |(18CSL57)

VTU 5th CSE/ISE - Computer Networks Laboratory Programs(18CSL57)

Program 01 - Implement three nodes point-to-point network with duplex links between them. Set the queue size, vary the bandwidth and find the number of packets dropped

0) First install nam(network animator) to visualize it using the below command
//Similar to netanim on ns3
$ sudo apt install nam

1) Open nsg2 either using command line or graphical interface

2) Goto Scenario menu and select New wired scenario(OR use the shortcut Ctrl+W )

3) Select Node tab and create 3 nodes just by clicking the plane

4) Make a duplex link between them in Link tab by selecting Link type as duplex-link and click on the nodes to connect
Vary the Capacity(bandwidth) and Queue Size among the nodes and connect other nodes also
//Here I keep the Capacity = 10Mbps and Queue Size as 5

5) Goto Agent tab and connect n0 to tcp0 by selecting TCP as Agent type
connect n2 to sink1 by selecting TCPSink as Agent type
connect tcp0 to sink1 just by clicking on them
//You can change the packet size. Here I will default to Packet size = 1500bytes

6) Goto Application tab and connect ftp0 to tcp0 by selecting FTP as Application type
We can change the Start time and Stop time
//Here I keep Start time = 0.1 and Stop time = 5

7) Goto Parameters tab and we can change Simulation Time, Trace file name and Nam file name
//Here I leave default name and change Simulatation Time = 5.0
Click on Done

8) Goto TCL, where we can see automatically generated code for our network design
Save the file with .tcl extension
//Here I am giving test.tcl as file name

9) Open a terminal and run the file you created using nsg2 inside the directory where you saved your file
$ cd Desktop
$ ns test.tcl
//If you installed nam you can see nam opened automatically or else you won't get anything
//Now you can simulate nam by pause, play, forward or rewinding

10) We can find the dropped packets in out.tr trace file where d represents packets dropped
//We can also use grep command to find the packets dropped
$ grep -c "d" out.tr
//grep command searches for a patter in a file
//-c used to count the number of times pattern found
//"d" is our pattern to be searched and out.tr is the file


//We can alter the bandwidth and queue size among the nodes in tcl file and play around it

Done :)

LinkedIn:   / karthik-n-karthik  

Комментарии

Информация по комментариям в разработке