NS网络模拟和协议仿真源代码 下载本文

内容发布更新时间 : 2024/11/14 14:33:49星期一 下面是文章的全部内容请认真阅读。

}

for(i=0; i<=highest_uid; i++ ) { }

avg_delay=total_delay/k;

printf(\

start = start_time[i]; end = end_time[i]; delay = end - start; if(delay > 0) { }

total_delay=total_delay+delay; k++;

get_perform

#!/bin/sh i=1

while [ \

ns w_w.tcl $i

gawk –f delay.awk rate=$i wired_wireless.tr >>delay gawk –f loss.awk rate=$i wired_wireless.tr >>loss_rate

gawk -f throughtput.awk rate=$i wired_wireless.tr >>throughtput if [\ fi

i=$(($i+20)) i=$(($i+5)) i=$(($i+2))

elif [\else

done exit 0

jitter.awk

BEGIN { } { } END {

id=1;

for(i=0; i<=highest_uid; i++ ) {

event = $1; time = $2; node = $3;

len = length(node); if(len == 3) { }

if(len==3) { }

if(highest_uid < uid)

highest_uid = uid;

if(event==\

start_time[uid] = time; node_ = substr(node,2,1); trace_type = $4; flag = $5; uid = $7; pkt_type = $8; pkt_size = $9; from_node = $3; to_node =$4; pkt_type = $5; pkt_size = $6; flag = $7; uid = $12; highest_uid=0;

} else {

} else {

if(event==\

end_time[uid] = time;

}

}

start = start_time[i]; end = end_time[i]; if(start < end) { }

delay[i]=end-start;

last_delay=0; last_seqno=0;

for(i=0; i<=highest_uid; i++) { }

if(delay[i]!=0) { }

if(last_delay==0) { }

printf(\last_delay=delay[i]; last_seqno=i;

jitter=0;

jitter=(delay[i]-last_delay)/(i-last_seqno);

} else {

loss.awk

BEGIN { } {

event = $1; time = $2; node = $3;

len = length(node); if(len == 3) {

node_ = substr(node,2,1); trace_type = $4; flag = $5; uid = $6; fsDrops=0; numfs2=0; numfs0=0;

}

}

pkt_type = $7; pkt_size = $8; from_node = $3; to_node =$4; pkt_type = $5; pkt_size = $6; flag = $7; uid = $12;

} else {

if(len==3) { }

if(event==\

numfs2++;

} else {

if(event==\

numfs0++;

END { }

loss_rate=0;

fsDrops=numfs2-numfs0; loss_rate=fsDrops/numfs2;

printf(\

plot_data

set multiplot set size 0.5,0.5 set origin 0.0,0.0 set xrange [225:250]

set xlabel \set ylabel \

plot \set origin 0.5,0.0

set ylabel \

plot \set origin 0.0,0.5

set ylabel \

plot \

throughtput.awk

BEGIN { } { } END {

event = $1; time = $2; node = $3;

len = length(node); if(len == 3) { }

if(len==1) { }

if(event==\ }

pkt_byte_sum[i+1]=pkt_byte_sum[i]+(pkt_size-20); if(init==0) { }

end_time[i]=time; i++;

start_time=time; init=1;

node_ = substr(node,2,1); trace_type = $4; flag = $5; uid = $6; pkt_type = $7; pkt_size = $8; from_node = $3; to_node =$4; pkt_type = $5; pkt_size = $6; flag = $7; uid = $12; init=0; i=0;

} else {