Flow Control Efficiency Calculator {title: ""}, {title: "Efficiency [%]", viewWindowMode: "explicit", viewWindow: {max: 100}, viewWindow: {min: 0}}
Calculates the efficiency of stop-and-wait (W=1) and sliding-window (W>1) flow control algorithms for given link and traffic characteristics.
= $total_delay) { $efficiency=100*(($traffic_payload * 8) / ($linkab_datarate*1000000) * $system_timemultiplier) / ($data_trans + ($proca_before / 1000000 * $system_timemultiplier)); $throughput=$efficiency * $linkab_datarate * 1000000 / 100; } else { $throughput=($window_max * $traffic_payload * 8) / ($total_delay / $system_timemultiplier); $efficiency=100*$throughput / ($linkab_datarate*1000000); } return $efficiency; } $data_trans=($traffic_header + $traffic_payload + $traffic_trailer) * 8 / ($linkab_datarate*1000000) * $system_timemultiplier; $linkab_prop=($linkab_distance * 1000) / $linkab_speed * $system_timemultiplier; $ack_trans=($traffic_ack) * 8 / ($linkba_datarate*1000000) * $system_timemultiplier; $linkba_prop=($linkba_distance * 1000) / $linkba_speed * $system_timemultiplier; $other_delay=($proca_before + $proca_after + $procb_after + $procb_before) / 1000000 *$system_timemultiplier; $total_delay=$data_trans + $linkab_prop + $ack_trans + $linkba_prop + $other_delay; if ($window_max * ($proca_before / 1000000 * $system_timemultiplier + $data_trans) >= $total_delay) { $efficiency=100*(($traffic_payload * 8) / ($linkab_datarate*1000000) * $system_timemultiplier) / ($data_trans + ($proca_before / 1000000 * $system_timemultiplier)); $throughput=$efficiency * $linkab_datarate * 1000000 / 100; } else { $throughput=($window_max * $traffic_payload * 8) / ($total_delay / $system_timemultiplier); $efficiency=100*$throughput / ($linkab_datarate*1000000); } ?> $plot_value1) { $min_value=$plot_value1; $max_value=$init_value; } else { $min_value=$init_value; $max_value=$plot_value1; } $j=0; for ($i=$min_value; $i<=$max_value+($max_value-$min_value)/$plot_steps; $i=$i+($max_value-$min_value)/$plot_steps) { $x[$j]=round($i,0); $y[$j]=calculateEfficiency($linkab_datarate, $linkab_distance, $linkab_speed, $linkab_datarate, $linkab_distance, $linkab_speed, $proca_before, $proca_after, $procb_before, $procb_after, $traffic_header, $traffic_payload, $traffic_trailer, $traffic_ack, round($i,0), $system_timemultiplier); $j++; } } if ($plot_parameter1=="link_datarate_2") { $htitle1="Link Data Rate [Mb/s]"; $init_value=$linkab_datarate; if ($init_value > $plot_value1) { $min_value=$plot_value1; $max_value=$init_value; } else { $min_value=$init_value; $max_value=$plot_value1; } $j=0; for ($i=$min_value; $i<=$max_value+($max_value-$min_value)/$plot_steps; $i=$i+($max_value-$min_value)/$plot_steps) { $x[$j]=$i; $y[$j]=calculateEfficiency($i, $linkab_distance, $linkab_speed, $i, $linkab_distance, $linkab_speed, $proca_before, $proca_after, $procb_before, $procb_after, $traffic_header, $traffic_payload, $traffic_trailer, $traffic_ack, $window_max, $system_timemultiplier); $j++; } } if ($plot_parameter1=="link_distance_2") { $htitle1="Link Distance [km]"; $init_value=$linkab_distance; if ($init_value > $plot_value1) { $min_value=$plot_value1; $max_value=$init_value; } else { $min_value=$init_value; $max_value=$plot_value1; } $j=0; for ($i=$min_value; $i<=$max_value+($max_value-$min_value)/$plot_steps; $i=$i+($max_value-$min_value)/$plot_steps) { $x[$j]=$i; $y[$j]=calculateEfficiency($linkab_datarate, $i, $linkab_speed, $linkab_datarate, $i, $linkab_speed, $proca_before, $proca_after, $procb_before, $procb_after, $traffic_header, $traffic_payload, $traffic_trailer, $traffic_ack, $window_max, $system_timemultiplier); $j++; } } if ($plot_parameter1=="traffic_header_2") { $htitle1="DATA Header [Bytes]"; $init_value=$traffic_header; if ($init_value > $plot_value1) { $min_value=$plot_value1; $max_value=$init_value; } else { $min_value=$init_value; $max_value=$plot_value1; } $j=0; for ($i=$min_value; $i<=$max_value+($max_value-$min_value)/$plot_steps; $i=$i+($max_value-$min_value)/$plot_steps) { $x[$j]=$i; $y[$j]=calculateEfficiency($linkab_datarate, $linkab_distance, $linkab_speed, $linkab_datarate, $linkab_distance, $linkab_speed, $proca_before, $proca_after, $procb_before, $procb_after, $i, $traffic_payload, $traffic_trailer, $window_max, $traffic_ack, $system_timemultiplier); $j++; } } if ($plot_parameter1=="traffic_payload_2") { $htitle1="DATA Payload [Bytes]"; $init_value=$traffic_payload; if ($init_value > $plot_value1) { $min_value=$plot_value1; $max_value=$init_value; } else { $min_value=$init_value; $max_value=$plot_value1; } $j=0; for ($i=$min_value; $i<=$max_value+($max_value-$min_value)/$plot_steps; $i=$i+($max_value-$min_value)/$plot_steps) { $x[$j]=$i; $y[$j]=calculateEfficiency($linkab_datarate, $linkab_distance, $linkab_speed, $linkab_datarate, $linkab_distance, $linkab_speed, $proca_before, $proca_after, $procb_before, $procb_after, $traffic_header, $i, $traffic_trailer, $traffic_ack, $window_max, $system_timemultiplier); $j++; } } if ($plot_parameter1=="traffic_ack_2") { $htitle1="ACK Header [Bytes]"; $init_value=$traffic_ack; if ($init_value > $plot_value1) { $min_value=$plot_value1; $max_value=$init_value; } else { $min_value=$init_value; $max_value=$plot_value1; } $j=0; for ($i=$min_value; $i<=$max_value+($max_value-$min_value)/$plot_steps; $i=$i+($max_value-$min_value)/$plot_steps) { $x[$j]=$i; $y[$j]=calculateEfficiency($linkab_datarate, $linkab_distance, $linkab_speed, $linkab_datarate, $linkab_distance, $linkab_speed, $proca_before, $proca_after, $procb_before, $procb_after, $traffic_header, $traffic_payload, $traffic_trailer, $i, $window_max, $system_timemultiplier); $j++; } } } ?>Created on Fri, 31 Aug 2012, 6:10pm
Last changed on Wed, 07 Aug 2013, 12:07pm