NS-2
Es un software libre que es un simulador de redes, empleado principalmente para investigación y aprendizaje, que permite al usuario simular diferentes tipos de protocolos.
Demostración
Para esta demostración lo que se hará es una topología con cuatros nodos, enlazados en forma de estrella, donde también veremos el comportamiento de una cola en un nodo.
Básico:
Creamos le objeto simulador, definimos los diferentes colores de flujo de información y abrimos NAM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set ns [new Simulator] | |
$ns color 1 Blue | |
$ns color 2 Red | |
set nf [open out.nam w] | |
$ns namtrace-all $nf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc finish {} { | |
global ns nf | |
$ns flush-trace | |
close $nf | |
exec nam out.nam & | |
exit 0 | |
} |
Definimos nuestra topología que en nuestro caso será de cuatro nodos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set n0 [$ns node] | |
set n1 [$ns node] | |
set n2 [$ns node] | |
set n3 [$ns node] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ns duplex-link $n0 $n2 2Mb 10ms DropTail | |
$ns duplex-link $n1 $n2 2Mb 10ms DropTail | |
$ns duplex-link $n2 $n3 1.7Mb 20ms DropTail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ns duplex-link-op $n0 $n2 orient right-down | |
$ns duplex-link-op $n1 $n2 orient right-up | |
$ns duplex-link-op $n2 $n3 orient right |
Creamos trea agentes uno TCP asigando a n0, otro FTP y otra en UDP a n1 y uno nulo que será el n3, asignando también el tamaño del paquete y el tiempo de intervalo que se estará mandando.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set tcp [new Agent/TCP] | |
$tcp set class_ 2 | |
$ns attach-agent $n0 $tcp | |
set sink [new Agent/TCPSink] | |
$ns attach-agent $n3 $sink | |
$ns connect $tcp $sink | |
$tcp set fid_ 1 | |
set ftp [new Application/FTP] | |
$ftp attach-agent $tcp | |
$ftp set type_ FTP | |
set udp [new Agent/UDP] | |
$ns attach-agent $n1 $udp | |
set null [new Agent/Null] | |
$ns attach-agent $n3 $null | |
$ns connect $udp $null | |
$udp set fid_ 2 | |
set cbr [new Application/Traffic/CBR] | |
$cbr attach-agent $udp | |
$cbr set type_ CBR | |
$cbr set packet_size_ 1000 | |
$cbr set rate_ 1mb | |
$cbr set random_ false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ns at 0.1 "$cbr start" | |
$ns at 1.0 "$ftp start" | |
$ns at 4.0 "$ftp stop" | |
$ns at 4.5 "$cbr stop" |
Video:
http://nile.wpi.edu/NS/
http://www.isi.edu/nsnam/ns/ns-build.html
Pues, yo andaba con ganas de ver la medición de alguna cosa de desempeño y alguna grafiquita o conclusión o algo sobre eso. 6 pts.
ResponderEliminar