Week 10,12 1
Week 10,12 1
10) Implement TCP and UDP on different pairs of systems using NS2 Simulation
Tool.
set ns [new Simulator]
$ns color 0 blue
$ns color 1 red
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
4) In server, click on the services and turn off all the protocols except FTP protocol.
Assign username and password and add to it.
5) Now open the command prompt of any PC and type “ftp 10.10.10.0 (server’s IP
address).
6) Then server is connected and we can use different commands.
HTTP PROTOCOL:
1) Open packet tracer and place a server, a switch and two devices (Ex: PCs) from
the workspace
2) Assign IP addresses to the server and both the PCs and connect all the devices
with straight cable.
3) In server, click on the services and turn off all the protocols except HTTP
protocol. Then edit one html in file in http window and save it.
4) Then go to any PC’s web browser and type the server URL, then you get the text
written in html file of server.
EXPERIMENT-12
12) Implementation of wireless networks using NS2 Simulation Tool.
set ns [new Simulator]
set tracefile [open wireless.tr w]
$ns trace-all $tracefile
set namfile [open wireless.nam w]
$ns namtrace-all-wireless $namfile 500 500
set topo [new Topography]
$topo load_flatgrid 500 500
create-god 6
set val(chan) Channel/WirelessChannel
$ns node-config -adhocRouting AODV \
-llType LL \
-macType Mac/802_11 \
-ifqType Queue/DropTail/PriQueue \
-ifqLen 50 -antType Antenna/OmniAntenna \
-propType Propagation/TwoRayGround \
-phyType Phy/WirelessPhy \
-channel [new $val(chan)] \
-topoInstance $topo \
-agentTrace ON -routerTrace OFF \
-macTrace ON \
-movementTrace OFF
OUTPUT:
srinu@ubuntu:~/CN$ ns wireless.tcl
num_nodes is set 6
INITIALIZE THE LIST xListHead
Starting Simulation
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!