
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions
Computer networks lab basic concepts
Generic script structure
1) Create stimulator object
*Set ns [new stimulator]
Insert immediately after scheduler
*Trace packets on all links
Set nf[open out.nam w]
2)Turn on tracing(Tracing)
r:reciver
+:enquee
-:deque
d:drop
Create topology(create
network)
1)Nodes
n0---àn2(Basic idea of two nodes)
*)set n0[$ns node]
*)set n1[$ns node]
2)Links and queing
$ns duplex-link $n0 $n1 1mb 110ms RED
2) To create a larger tpology
Use a for loop example
Setup packet
loss,link dynamics
Link failure
Hooks in routing module to reflect routing changes
Create routing agents(Create
udp(Existing in forth layer the transport layer of the network) connection)
Has to connect nodes cose there is so much nulls
Udp----n0------àn1---------null
Set udp[new Agent(Inheritedd)/UDP(base class)]
Create application
and or traffic sources(On top of the UDP)
CBR tcp also doing the same function
Set cbr[new Appliocation/Traffic/CBR]
$cbr set packetssize_500
Less number of intrevels means less number of packets.
Creating traffic(It is working on the top of TCP)
Using ftp or telnet
Post-processing
procedure(Nam, network animator)
Add a ‘finish’ procedure that closes the trace file and start nam
Procfinish{}{
Global ns nf
$ns flush-trace
Close $nf
Exec nam out.nam &
exit 0
}
Start stimulation
*Schedule events
$ns at
· Call finish
$ns at 5.0 “finish”
Run the stimulator
$ns run
Diffrence between switch and hub
Hub- it is a repeater
Switcher-layer three switch