wlan-chutil-load

来自「对IEEE 802.11e里的分布式信道接入算法EDCA进行改进」· 代码 · 共 60 行

TXT
60
字号
#!/bin/tcsh## Channel utilization:# works on a trace file produced by ns# outputs idle time and the collision time on the channel between# the first and the (possibly unfinished) last transmission# for now: assumes that all MACs are on a single channelif ( $#argv != 1 ) then  echo usage:  echo "      " $0 \<scenario\> \<flow id\>  exit 1endifset scenario = $1set tracefile = $scenario.trset outfile = $scenario.channelrm -f $outfile##############################lamia###########egrep "\-Nl MAC " $tracefile | gawk -v busy=0 -v outf=$outfile '\/^s/ {								\	if (busy == 0) {					\		if  (last_eot != 0) {				\			idle += ($3 - last_eot);		\		} else {					\			first_send = $3;			\		}						\	}							\	if (busy == 1) {					\		start_collision = $3;				\		++collisions;					\	}							\	print $3, busy >> outf;					\	++busy;							\	print $3, busy >> outf;					\}								\/^x/ {								\	print $3, busy >> outf;					\	--busy;							\	print $3, busy >> outf;					\	if (busy < 0) {						\		print "Fatal Error: EOT without send";		\	}							\	if (busy == 1) {					\		collision += ($3 - start_collision);		\	}							\	if (busy == 0) {					\		last_eot = $3;					\		++total;					\	}							\}								\END {								\	if (busy > 1) {						\		collision += ($3 - start_collision);		\	}							\	printf "%13.9f\t %13.9f \n", (($3 - first_send)-idle-collision)/($3-first_send)*100, collisions/($3-first_send);	\}'

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?