⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 script.tcl

📁 R. Lo Cigno, P. Larcheri 802.11e closed-loop scheduling Description: ns-2 package for 802.11e clo
💻 TCL
📖 第 1 页 / 共 2 页
字号:
#                                                                    ##           * rapresents the packet type                             ##                                                                    #######################################################################proc BS_queue {n limit q_arrv q_size rcv_tcp rcv_ack rcv_message rcv_ARP rcv_udp rcv_voip \                drop_tcp drop_ack drop_message drop_ARP drop_udp drop_voip \                tout_tcp tout_ack tout_message tout_ARP tout_udp tout_voip} {        global stat num_bs_queue        incr num_bs_queue        set stat(bs_q_size,$n) $q_size        set stat(bs_q_arrv,$n) $q_arrv        set stat(bs_q_limit,$n) $limit        foreach tip {rcv drop tout} {                foreach typ {ARP message ack tcp udp voip} {                        set stat(bs_ifq,$tip,$n,$typ) [set $tip\_$typ]                }        }}#######################################################################                                                                    ## errmo: called by errmodel.cc to dump Error Model statistics        ##                                                                    ##                 n: error model identifier                          ##               src: MAC source address                              ##               dst: MAC destination address                         ##        send_chn_*: packets sent to the MAC                         ##         rcv_mac_*: packets received from the Network Interface     ##          corrup_*: packets corrupted                               ##            num_**: number of occurrence of the state **            ##            val_**: average duration of the state **                ##                                                                    ##        * rapresents the packet type                                ##                                                                    #######################################################################proc errmo {n src dst send_chn_tcp rcv_mac_tcp corrup_tcp rcv_mac_my_tcp corrup_my_tcp \                send_chn_udp rcv_mac_udp corrup_udp rcv_mac_my_udp corrup_my_udp \                send_chn_voip rcv_mac_voip corrup_voip rcv_mac_my_voip corrup_my_voip \                send_chn_ack rcv_mac_ack corrup_ack rcv_mac_my_ack corrup_my_ack \                send_chn_mac_rts rcv_mac_mac_rts corrup_mac_rts rcv_mac_my_mac_rts corrup_my_mac_rts \                send_chn_mac_cts rcv_mac_mac_cts corrup_mac_cts rcv_mac_my_mac_cts corrup_my_mac_cts \                send_chn_mac_ack rcv_mac_mac_ack corrup_mac_ack rcv_mac_my_mac_ack corrup_my_mac_ack \                num_badG val_badG num_badB val_badB num_good val_good} {        global stat        set stat(errmo_src,$n) $src        set stat(errmo_dst,$n) $dst        set stat(errmo,$n,n_good)  $num_good        set stat(errmo,$n,av_good) $val_good        set stat(errmo,$n,n_badG)   $num_badG        set stat(errmo,$n,av_badG)  $val_badG        set stat(errmo,$n,n_badB)   $num_badB        set stat(errmo,$n,av_badB)  $val_badB        foreach tip {rcv_mac rcv_mac_my send_chn corrup corrup_my} {                foreach typ {ack tcp udp voip mac_rts mac_cts mac_ack} {                        set stat(errmo,$n,$tip,$typ) [set $tip\_$typ]                }        }}set num_mac_tc 0#######################################################################                                                                    ## 802_11e_tc: called by mac-802_11.cc to dump MAC statistics         ##                                                                    ##                   n: mac identifier                                ##           rcv_ifq_*: frames received from the Interface Queue      ##          send_erm_*: frames sent to the Network Interface          ##           rcv_chn_*: frames received from the Error Model          ##        rcv_chn_my_*: frames destined to this node                  ##     rcv_chn_other_*: frames destined to others nodes               ##       rcv_chn_err_*: frames corrupted                              ##       rcv_chn_col_*: frames that have collided                     ##                col_: number of real collisions                     ##           virt_col_: per-AC virtual collisions                     ##           virtcoll_: number of virtual collisions                  ##              busy_*: frames discarded due to MAC busy              ##           max_rtx_*: frames discarded for reaching the max. number ##                      of retransmissions                            ##               rtx_*: frames retransmitted                          ##           send_ll_*: frames sent to the LLC                        ##              dupl_*: frames duplicated                             ##               cfb_*: frames/duration TXOP statistics               ##                                                                    ##        * rapresents the packet type                                ##                                                                    #######################################################################proc 802_11e_tc {n rcv_ifq_tcp rcv_ifq_ack rcv_ifq_message rcv_ifq_ARP rcv_ifq_udp rcv_ifq_voip rcv_ifq_mac_cts rcv_ifq_mac_rts rcv_ifq_mac_ack \                 send_erm_tcp send_erm_ack send_erm_message send_erm_ARP send_erm_udp send_erm_voip send_erm_mac_cts send_erm_mac_rts send_erm_mac_ack \                 rcv_chn_tcp rcv_chn_ack rcv_chn_message rcv_chn_ARP rcv_chn_udp rcv_chn_voip rcv_chn_mac_cts rcv_chn_mac_rts rcv_chn_mac_ack \                 rcv_chn_my_tcp rcv_chn_my_ack rcv_chn_my_message rcv_chn_my_ARP rcv_chn_my_udp rcv_chn_my_voip rcv_chn_my_mac_cts rcv_chn_my_mac_rts rcv_chn_my_mac_ack \                 rcv_chn_other_tcp rcv_chn_other_ack rcv_chn_other_message rcv_chn_other_ARP rcv_chn_other_udp rcv_chn_other_voip rcv_chn_other_mac_cts rcv_chn_other_mac_rts rcv_chn_other_mac_ack \                 rcv_chn_err_tcp rcv_chn_err_ack rcv_chn_err_message rcv_chn_err_ARP rcv_chn_err_udp rcv_chn_err_voip rcv_chn_err_mac_cts rcv_chn_err_mac_rts rcv_chn_err_mac_ack \                 rcv_chn_col_tcp rcv_chn_col_ack rcv_chn_col_message rcv_chn_col_ARP rcv_chn_col_udp rcv_chn_col_voip rcv_chn_col_mac_cts rcv_chn_col_mac_rts rcv_chn_col_mac_ack \                 col virt_col virtcoll busy_tcp busy_ack busy_message busy_ARP busy_udp busy_voip busy_mac_cts busy_mac_rts busy_mac_ack \                 max_rtx_tcp max_rtx_ack max_rtx_message max_rtx_ARP max_rtx_udp max_rtx_voip max_rtx_mac_cts max_rtx_mac_rts max_rtx_mac_ack \                 rtx_tcp rtx_ack rtx_message rtx_ARP rtx_udp rtx_voip rtx_mac_cts rtx_mac_rts rtx_mac_ack \                 send_ll_tcp send_ll_ack send_ll_message send_ll_ARP send_ll_udp send_ll_voip send_ll_mac_cts send_ll_mac_rts send_ll_mac_ack \                 dupl_tcp dupl_ack dupl_message dupl_ARP dupl_udp dupl_voip dupl_mac_cts dupl_mac_rts dupl_mac_ack \		 cfb_avg_time cfb_num cfb_num_bad_end cfb_data_fast_recv cfb_data_slow_recv cfb_voice_fast_recv cfb_voice_slow_recv cfb_noDataToSend} {        global stat num_mac_tc        incr num_mac_tc        set stat(mac,col,$n) $col        set stat(mac,virt_col,$n) $virt_col        set stat(mac,virtcoll) $virtcoll        foreach tip {rcv_ifq send_erm rcv_chn rcv_chn_my rcv_chn_other rcv_chn_err rcv_chn_col busy max_rtx rtx send_ll dupl} {                foreach typ {ARP message ack tcp udp voip mac_rts mac_cts mac_ack} {                        set stat(mac,$tip,$n,$typ) [set $tip\_$typ]                }        }	foreach ext {avg_time num num_bad_end data_fast_recv data_slow_recv voice_fast_recv voice_slow_recv noDataToSend} {		set stat(mac,$n,cfb_$ext) [set cfb_$ext]	}}#######################################################################                                                                    ## 802_11eHC_tc: called by mac-802_11.cc to dump MAC statistics       ##               for the Hybrid Coordinator                           ##                                                                    ##           cap_percent_tot: CAP occupancy percentage over tot time  ##              cap_avg_time: average CAP duration                    ##                   cap_num: number of CAPs                          ##           cfp_percent_max: CFP occupancy percentage over max time  ##           cfp_percent_tot: CFP occupancy percentage over tot time  ##              cfp_avg_time: average CFP duration                    ##                   cfp_num: number of CFPs                          ##                                                                    #######################################################################proc 802_11eHC_tc {cap_percent_tot cap_avg_time cap_num cfp_percent_max cfp_percent_tot cfp_avg_time cfp_num} {	global stat	set stat(mac,cap_percent_tot) [set cap_percent_tot]	set stat(mac,cap_avg_time) [set cap_avg_time]	set stat(mac,cap_num) [set cap_num]	set stat(mac,cfp_percent_max) [set cfp_percent_max]	set stat(mac,cfp_percent_tot) [set cfp_percent_tot]	set stat(mac,cfp_avg_time) [set cfp_avg_time]	set stat(mac,cfp_num) [set cfp_num]}#######################################################################                                                                    ## finish_HTTP_flow: called by tcp.cc when a TCP flow ends, only if   ##                   the TCP on/off model is used. It is responsible  ##                   of dumping and collecting per-flow statistics    ##                                                                    ##             fid: the TCP flow identifier                           ##                                                                    #######################################################################proc finish_HTTP_flow {fid} {        global web obj stat opt ns_ fl file        set web($fid,pkt_tx)            [$obj(tcp,$fid)         set ndatapack_]        set web($fid,ack_rcv)           [$obj(tcp,$fid)         set nackpack_]        set web($fid,pkt_rcv)           [$obj(tcp_sink,$fid)    set npackrecv]        set web($fid,ack_tx)            [$obj(tcp_sink,$fid)    set nacksent]        set web($fid,win_avg)           [$obj(tcp,$fid)         set win_avg]        set web($fid,win_max)           [$obj(tcp,$fid)         set win_max]        set web($fid,timeout)   [expr $stat(tcp,timeout,$fid) - $stat(tcp,old_timeout,$fid)]        set web($fid,fast_rec)  [expr $stat(tcp,fast_rec,$fid) - $stat(tcp,old_fast_rec,$fid)]        set web($fid,goodput)   [expr $web($fid,p2s) * 8 * $opt(tcp_size) / [expr [$ns_ now] - $web($fid,start)]]        set web($fid,thruput)   [expr $web($fid,pkt_tx) * 8 * $opt(tcp_size) / [expr [$ns_ now] - $web($fid,start)]]        set web($fid,delay)  [expr [$obj(tcp_sink,$fid) set time12] - $stat(tcp,old_delay,$fid)]        set web($fid,var)  [$obj(tcp_sink,$fid) set vartime12]        puts $file(web) [format "%8s %12s %12d %12d %12d %12d %12d %10d %9d %12.0f %12.0f %8.3f %8d %10g %10g" \                tcp_$fid $fl($fid) $web($fid,p2s) $web($fid,pkt_tx) $web($fid,pkt_rcv) $web($fid,ack_tx) \                $web($fid,ack_rcv) $web($fid,fast_rec) $web($fid,timeout) $web($fid,thruput) $web($fid,goodput) \                $web($fid,win_avg) $web($fid,win_max) [expr $web($fid,delay) / $web($fid,pkt_tx).0] \                $web($fid,var)]        incr stat(tcp,pkt_tx,$fid)      $web($fid,pkt_tx)        incr stat(tcp,pkt_to_send,$fid) $web($fid,p2s)        incr stat(tcp,ack_rcv,$fid)     $web($fid,ack_rcv)        incr stat(tcp,pkt_rcv,$fid)     $web($fid,pkt_rcv)        incr stat(tcp,ack_tx,$fid)      $web($fid,ack_tx)        set  stat(tcp,win_avg,$fid)     [expr $web($fid,win_avg) + $stat(tcp,win_avg,$fid)]        set  stat(tcp,win_max,$fid)     [expr $web($fid,win_max) + $stat(tcp,win_max,$fid)]        incr stat(tcp,win_count,$fid)        set stat(tcp,old_timeout,$fid)  $stat(tcp,timeout,$fid)        set stat(tcp,old_fast_rec,$fid) $stat(tcp,fast_rec,$fid)        set stat(tcp,old_delay,$fid) [expr $stat(tcp,old_delay,$fid) + $web($fid,delay)]        if {$opt(onoff) == 1} {                start_HTTP_flows $fid    ;# since this flow is ended, we start the next one        } elseif {$opt(onoff) == 2} {                start_CS_flows $fid        }}

⌨️ 快捷键说明

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