En este caso las medidas que evalue son:
- Throughput. Cantidad de bits que se transmite (exitosamente) por segundo.
- Latencia. Velocidad de transmición de la señal.
El código de la simulación es el siguiente.
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
# Empieza la simulacion | |
set ns [new Simulator] | |
# Se configura el rastreo/nam, se abren archivos | |
set tr [open voip.tr w] | |
set nf [open voip.nam w] | |
$ns trace-all $tr | |
$ns namtrace-all $nf | |
# Termina la funcion, se cierran los archivos de rastreo y se comienza nam | |
proc finish {} { | |
global ns nf tr | |
$ns flush-trace | |
close $nf | |
close $tr | |
exec nam voip.nam & | |
exit 0 | |
} | |
# Se crean los nodos | |
set node0 [$ns node] | |
$node0 label "A" | |
$node0 color blue | |
set node1 [$ns node] | |
$node1 label "B" | |
$node1 color yellow | |
set node2 [$ns node] | |
$node2 label "C" | |
$node2 color pink | |
# Se crean enlaces duplex | |
$ns duplex-link $node0 $node1 256Kb 50ms DropTail | |
$ns duplex-link-op $node0 $node1 orient right | |
$ns duplex-link $node0 $node2 256kb 50ms DropTail | |
$ns duplex-link-op $node0 $node2 orient up | |
# Se configuran los colores | |
$ns color 1 Red | |
$ns color 2 Green | |
# 2 maneras de conexion VoIP | |
# Se crea un agente UDP y se adjunta al nodo 0 | |
set udp0 [new Agent/UDP] | |
$ns attach-agent $node0 $udp0 | |
$udp0 set fid_ 1 | |
# Se crea trafico CBR y se adjunta al udp0 | |
set cbr0 [new Application/Traffic/CBR] | |
$cbr0 set packetSize_ 128 | |
$cbr0 set interval_ 0.020 | |
$cbr0 set class_ 1 | |
$cbr0 attach-agent $udp0 | |
# Agente nulo | |
set sinknode1 [new Agent/LossMonitor] | |
$ns attach-agent $node1 $sinknode1 | |
set sinknode2 [new Agent/LossMonitor] | |
$ns attach-agent $node1 $sinknode2 | |
# Se conecta el trafico UDP con el agente nulo | |
$ns connect $udp0 $sinknode1 | |
set udp1 [new Agent/UDP] | |
$ns attach-agent $node1 $udp1 | |
$udp1 set fid_ 2 | |
$ns connect $udp0 $sinknode2 | |
set udp2 [new Agent/UDP] | |
$ns attach-agent $node2 $udp2 | |
$udp2 set fid_ 2 | |
set cbr1 [new Application/Traffic/CBR] | |
$cbr1 set packetSize_ 128 | |
$cbr1 set interval_ 0.020 | |
$cbr1 set class_ 2 | |
$cbr1 attach-agent $udp1 | |
set cbr2 [new Application/Traffic/CBR] | |
$cbr2 set packetSize_ 128 | |
$cbr2 set interval_ 0.020 | |
$cbr2 set class_ 2 | |
$cbr2 attach-agent $udp2 | |
set sinknode0 [new Agent/LossMonitor] | |
$ns attach-agent $node0 $sinknode0 | |
$ns connect $udp1 $sinknode0 | |
$ns connect $udp2 $sinknode0 | |
# Comienza el trafico | |
$ns at 0.1 "$cbr0 start" | |
$ns at 0.1 "$cbr1 start" | |
$ns at 0.3 "$cbr2 start" | |
$ns at 15.0 "$cbr0 stop" | |
$ns at 15.0 "$cbr1 stop" | |
$ns at 13.0 "$cbr2 stop" | |
$ns at 15.5 "finish" | |
# Se ejecuta la simulacion | |
$ns run |
Con el código anterior se generan dos archivos de salida. Uno es el archivo .nam que es el que permite ver la simulación de nuestro código, y otro que es el archivo .tr "trace file", que se puede utilizar para analizar la salida de la simulación.
Este archivo contiene una serie de parámetros como el tiempo de llegada de paquetes, el tamaño del paquete, entre otras cosas.
Estos datos se utilizaron para realizar las gráficas utilizando unos scripts muy sencillos solamente para filtrar los datos de este archivo y los resultados de los filtros se guardaron en otros archivos, uno para el throughput y otro para la latencia.
Latencia. Se incluyó solo una parte ya que es un archivo muy largo.
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
0.000000 0.154000 | |
0.154000 0.154000 | |
0.308000 0.174000 | |
0.482000 0.174000 | |
0.656000 0.194000 | |
0.850000 0.194000 | |
1.044000 0.214000 | |
1.258000 0.214000 | |
1.472000 0.234000 | |
1.706000 0.234000 | |
1.940000 0.254000 | |
2.194000 0.254000 | |
2.448000 0.274000 | |
2.722000 0.274000 | |
2.996000 0.294000 | |
3.290000 0.294000 | |
3.584000 0.314000 | |
3.898000 0.314000 | |
4.212000 0.334000 | |
4.546000 0.334000 | |
4.880000 0.354000 | |
5.234000 0.354000 | |
5.588000 0.354000 | |
5.942000 0.374000 | |
6.316000 0.374000 | |
6.690000 0.374000 | |
7.064000 0.394000 | |
7.458000 0.394000 | |
7.852000 0.394000 | |
8.246000 0.414000 | |
8.660000 0.414000 | |
9.074000 0.414000 | |
9.488000 0.434000 | |
9.922000 0.434000 | |
10.356000 0.434000 | |
10.790000 0.454000 | |
11.244000 0.454000 | |
11.698000 0.454000 | |
12.152000 0.474000 | |
12.626000 0.474000 | |
13.100000 0.474000 | |
13.574000 0.494000 | |
14.068000 0.494000 | |
14.562000 0.494000 | |
15.056000 0.514000 | |
15.570000 0.514000 | |
16.084000 0.514000 | |
16.598000 0.534000 | |
17.132000 0.534000 | |
17.666000 0.534000 | |
18.200000 0.554000 | |
18.754000 0.554000 | |
19.308000 0.554000 | |
19.862000 0.574000 | |
20.436000 0.574000 | |
21.010000 0.574000 | |
21.584000 0.594000 | |
22.178000 0.594000 | |
22.772000 0.594000 | |
23.366000 0.614000 | |
23.980000 0.614000 | |
24.594000 0.614000 | |
25.208000 0.634000 | |
25.842000 0.634000 | |
26.476000 0.634000 | |
27.110000 0.654000 | |
27.764000 0.654000 | |
28.418000 0.654000 | |
29.072000 0.674000 | |
29.746000 0.674000 | |
30.420000 0.674000 | |
31.094000 0.694000 | |
31.788000 0.694000 | |
32.482000 0.694000 | |
33.176000 0.714000 | |
33.890000 0.714000 | |
34.604000 0.714000 | |
35.318000 0.734000 | |
36.052000 0.734000 | |
36.786000 0.734000 | |
37.520000 0.754000 | |
38.274000 0.754000 | |
39.028000 0.754000 | |
39.782000 0.774000 | |
40.556000 0.774000 | |
41.330000 0.774000 | |
42.104000 0.794000 | |
42.898000 0.794000 | |
43.692000 0.794000 | |
44.486000 0.814000 | |
45.300000 0.814000 | |
46.114000 0.814000 | |
46.928000 0.834000 | |
47.762000 0.834000 | |
48.596000 0.834000 | |
49.430000 0.854000 | |
50.284000 0.854000 | |
51.138000 0.854000 | |
51.992000 0.874000 | |
52.866000 0.874000 | |
53.740000 0.874000 | |
54.614000 0.894000 | |
55.508000 0.894000 | |
56.402000 0.894000 | |
57.296000 0.914000 |
Throughput.
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
0.100000 0.000000 | |
0.154000 0.000000 | |
0.214000 0.012800 | |
0.274000 0.025600 | |
0.334000 0.038400 | |
0.394000 0.055467 | |
0.454000 0.074667 | |
0.514000 0.093867 | |
0.574000 0.113067 | |
0.634000 0.132267 | |
0.694000 0.151467 | |
0.754000 0.170667 | |
0.814000 0.189867 | |
0.874000 0.209067 | |
0.934000 0.228267 | |
0.994000 0.247467 | |
1.054000 0.266667 | |
1.114000 0.285867 | |
1.174000 0.305067 | |
1.234000 0.324267 | |
1.294000 0.343467 | |
1.354000 0.362667 | |
1.414000 0.381867 | |
1.474000 0.401067 | |
1.534000 0.420267 | |
1.594000 0.439467 | |
1.654000 0.458667 | |
1.714000 0.477867 | |
1.774000 0.497067 | |
1.834000 0.516267 | |
1.894000 0.535467 | |
1.954000 0.554667 | |
2.014000 0.573867 | |
2.074000 0.593067 | |
2.134000 0.612267 | |
2.194000 0.631467 | |
2.254000 0.650667 | |
2.314000 0.669867 | |
2.374000 0.689067 | |
2.434000 0.708267 | |
2.494000 0.727467 | |
2.554000 0.746667 | |
2.614000 0.765867 | |
2.674000 0.785067 | |
2.734000 0.804267 | |
2.794000 0.823467 | |
2.854000 0.842667 | |
2.914000 0.861867 | |
2.974000 0.881067 | |
3.034000 0.900267 | |
3.094000 0.919467 | |
3.154000 0.938667 | |
3.214000 0.957867 | |
3.274000 0.977067 | |
3.334000 0.996267 | |
3.394000 1.015467 | |
3.454000 1.034667 | |
3.514000 1.053867 | |
3.574000 1.073067 | |
3.634000 1.092267 | |
3.694000 1.111467 | |
3.754000 1.130667 | |
3.814000 1.149867 | |
3.874000 1.169067 | |
3.934000 1.188267 | |
3.994000 1.207467 | |
4.054000 1.226667 | |
4.114000 1.245867 | |
4.174000 1.265067 | |
4.234000 1.284267 | |
4.294000 1.303467 | |
4.354000 1.322667 | |
4.414000 1.341867 | |
4.474000 1.361067 | |
4.534000 1.380267 | |
4.594000 1.399467 | |
4.654000 1.418667 | |
4.714000 1.437867 | |
4.774000 1.457067 | |
4.834000 1.476267 | |
4.894000 1.495467 | |
4.954000 1.514667 | |
5.014000 1.533867 | |
5.074000 1.553067 | |
5.134000 1.572267 | |
5.194000 1.591467 | |
5.254000 1.610667 | |
5.314000 1.629867 | |
5.374000 1.649067 | |
5.434000 1.668267 | |
5.494000 1.687467 | |
5.554000 1.706667 | |
5.614000 1.725867 | |
5.674000 1.745067 | |
5.734000 1.764267 | |
5.794000 1.783467 | |
5.854000 1.802667 | |
5.914000 1.821867 | |
5.974000 1.841067 | |
6.034000 1.860267 | |
6.094000 1.879467 | |
6.154000 1.898667 | |
6.214000 1.917867 | |
6.274000 1.937067 | |
6.334000 1.956267 | |
6.394000 1.975467 | |
6.454000 1.994667 | |
6.514000 2.013867 | |
6.574000 2.033067 | |
6.634000 2.052267 | |
6.694000 2.071467 | |
6.754000 2.090667 | |
6.814000 2.109867 | |
6.874000 2.129067 | |
6.934000 2.148267 | |
6.994000 2.167467 | |
7.054000 2.186667 | |
7.114000 2.205867 | |
7.174000 2.225067 | |
7.234000 2.244267 | |
7.294000 2.263467 | |
7.354000 2.282667 | |
7.414000 2.301867 | |
7.474000 2.321067 | |
7.534000 2.340267 | |
7.594000 2.359467 | |
7.654000 2.378667 | |
7.714000 2.397867 | |
7.774000 2.417067 | |
7.834000 2.436267 | |
7.894000 2.455467 | |
7.954000 2.474667 | |
8.014000 2.493867 | |
8.074000 2.513067 | |
8.134000 2.532267 | |
8.194000 2.551467 | |
8.254000 2.570667 | |
8.314000 2.589867 | |
8.374000 2.609067 | |
8.434000 2.628267 | |
8.494000 2.647467 | |
8.554000 2.666667 | |
8.614000 2.685867 | |
8.674000 2.705067 | |
8.734000 2.724267 | |
8.794000 2.743467 | |
8.854000 2.762667 | |
8.914000 2.781867 | |
8.974000 2.801067 | |
9.034000 2.820267 | |
9.094000 2.839467 | |
9.154000 2.858667 | |
9.214000 2.877867 | |
9.274000 2.897067 | |
9.334000 2.916267 | |
9.394000 2.935467 | |
9.454000 2.954667 | |
9.514000 2.973867 | |
9.574000 2.993067 | |
9.634000 3.012267 | |
9.694000 3.031467 | |
9.754000 3.050667 | |
9.814000 3.069867 | |
9.874000 3.089067 | |
9.934000 3.108267 | |
9.994000 3.127467 | |
10.054000 3.146667 | |
10.114000 3.165867 | |
10.174000 3.185067 | |
10.234000 3.204267 | |
10.294000 3.223467 | |
10.354000 3.242667 | |
10.414000 3.261867 | |
10.474000 3.281067 | |
10.534000 3.300267 | |
10.594000 3.319467 | |
10.654000 3.338667 | |
10.714000 3.357867 | |
10.774000 3.377067 | |
10.834000 3.396267 | |
10.894000 3.415467 | |
10.954000 3.434667 | |
11.014000 3.453867 | |
11.074000 3.473067 | |
11.134000 3.492267 | |
11.194000 3.511467 | |
11.254000 3.530667 | |
11.314000 3.549867 | |
11.374000 3.569067 | |
11.434000 3.588267 | |
11.494000 3.607467 | |
11.554000 3.626667 | |
11.614000 3.645867 | |
11.674000 3.665067 | |
11.734000 3.684267 | |
11.794000 3.703467 | |
11.854000 3.722667 | |
11.914000 3.741867 | |
11.974000 3.761067 | |
12.034000 3.780267 | |
12.094000 3.799467 | |
12.154000 3.818667 | |
12.214000 3.837867 | |
12.274000 3.857067 | |
12.334000 3.876267 | |
12.394000 3.895467 | |
12.454000 3.914667 | |
12.514000 3.933867 | |
12.574000 3.953067 | |
12.634000 3.972267 | |
12.694000 3.991467 | |
12.754000 4.010667 | |
12.814000 4.029867 | |
12.874000 4.049067 | |
12.934000 4.068267 | |
12.994000 4.087467 | |
13.054000 4.106667 | |
13.114000 4.121600 | |
13.174000 4.134400 | |
13.234000 4.147200 | |
13.294000 4.160000 | |
13.354000 4.172800 | |
13.414000 4.185600 | |
13.474000 4.198400 | |
13.534000 4.211200 | |
13.594000 4.224000 | |
13.654000 4.236800 | |
13.714000 4.249600 | |
13.774000 4.262400 | |
13.834000 4.275200 | |
13.894000 4.288000 | |
13.954000 4.300800 | |
14.014000 4.313600 | |
14.074000 4.326400 | |
14.134000 4.339200 | |
14.194000 4.352000 | |
14.254000 4.364800 | |
14.314000 4.377600 | |
14.374000 4.390400 | |
14.434000 4.403200 | |
14.494000 4.416000 | |
14.554000 4.428800 | |
14.614000 4.441600 | |
14.674000 4.454400 | |
14.734000 4.467200 | |
14.794000 4.480000 | |
14.854000 4.492800 | |
14.914000 4.505600 | |
14.974000 4.518400 | |
15.034000 4.531200 |
Para terminar se utiliza gnuplot con el comando plot y leyendo estos archivos. Los resultados son los siguientes:
Video:
Referencias:
http://elisa.dyndns-web.com/~elisa/teaching/comp/net/desemp.pdf
https://sites.google.com/site/networksprojectwiki/bit10/compnetworks/voip-performance-over-udp-and-sctp-in-ns2/simulating-voip/voip-over-udp
En realidad no discutes nada el aspecto de generación de tráfico. Infórmate bien sobre la tarea ya que no estás asistiendo a clase. 5 pts.
ResponderEliminar