Queue/Green set greenForcedDrops_ 0 Queue/Green set greenAllDrops_ 0 Queue/Green set greenEarlyDrops_ 0 Queue/Green set greenArrivals_ 0 Queue/Green set greenDepartures_ 0 Queue/Green set mss_ 8000 Queue/Green set c_ 1.31 Queue/Green set bw_ 0.0 Queue/Green set idmaps_ 0
void TcpAgent::output(int seqno, int reason) { int force_set_rtx_timer = 0; Packet* p = allocpkt(); hdr_tcp *tcph = hdr_tcp::access(p); hdr_flags* hf = hdr_flags::access(p); hdr_ip *iph = hdr_ip::access(p); int databytes = hdr_cmn::access(p)->size(); tcph->seqno() = seqno; tcph->ts() = Scheduler::instance().clock(); // GREEN addition iph->prio() = (int) t_srtt_; // end GREEN addition ...
set greenq [[$ns link $n1 $n2] queue] $greenq set bw_ [expr $bneck_bw_mbps*1000000] //Use appropriate constant based on TCP implementation. We assume TCP-Reno $greenq set c_ 1.31 //To use the IDMaps estimation method set $idmaps to 1, otherwise 0 (default, embedded RTT method) $greenq set idmaps_ $idmaps
$greenq set-rtt $fid $rttGREEN will randomize $rtt to be between 0.5 and 2 times the supplied value
ns green.tcl Green 155 200 0 0This will simulate 200 sender/receiver pairs using a bottleneck link of 155 Mbps. IDMaps is set to 0 (estimation is based on embedded RTTs in the header). Background pareto traffic is set to 0. This simulation will show verbose output. This can be suppressed by commenting out the appropriate printf's from green.cc.
After the simulation, you will find two files: statsGreen200.out, tcp_sentGreen200.out. The first file provides overall statistics for fairness, utilization, etc. The second file shows the packets sent by each TCP flow. Here is sample output for statsGreen200.out under ns-2.27:
green forced drops 5069 green early drops 7567 link_packet_loss 0.0050671795557475459 avg_queue_size 174.76868571428571 queue_size_std 164.08240432169117 util 95.952037161290335 fairness 0.95901644962302945