wlan-goodput-normal
来自「对IEEE 802.11e里的分布式信道接入算法EDCA进行改进」· 代码 · 共 50 行
TXT
50 行
#!/bin/tcsh## works on a trace file produced by ns# outputs total goodput as a function of timeif ( $#argv != 2 ) then echo usage: echo " " $0 \<scenario\> \<interval size\> exit 1endifset scenario = $1set interval = $2# base analysis on the AGT layerset layer = AGTset tracefile = $scenario.trset outfile = $scenario.goodputrm -f $outfile# determine the time the first packet was sentset start = `egrep "^s .*\-Nl $layer " $tracefile | head -1 | gawk '{print $3;}'`# use number of bytes received over the last interval to calc# interval b/wegrep "^r .*\-Nl $layer " $tracefile | \ gawk -v start=$start -v base=$start -v step=$interval -v outfile=$outfile '{ \ time = $3; \ while (time > base) { \ bw = bytes/step; \ if (max < bw) max = bw; \ printf "%.9f %.9f\n", base, bw >> outfile; \ base += step; \ bytes = 0; \ } \ total_bytes += $39; \ bytes += $39; \ } END { \ step -= (base - time); \ bw = bytes/step; \ if (max < bw) max = bw; \ printf "%.9f %.9f\n", time, bw >> outfile; \ if (total_bytes) \ printf "%.3f", (total_bytes/1024.0)/(time-start); \ else \ printf "0.0"; \ #printf "Max Goodput = %.3fKB/s\n", (max/1024.0); \ }'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?