[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Regarding Bandwidth



I use a dynaschedule {} procedure as follows to do this.

proc dynschedule {qmon1 qmon2 link1 link2} {
	global ns n0 n1 n2 

	set integ1 [$qmon1 get-pkts-integrator]
	set integ2 [$qmon2 get-pkts-integrator]

	set now [$ns now]
	set time 0.01
	if { [$integ1 set sum_]>=100 } {
	puts "[$integ1 set sum_] [$integ2 set sum_]"
	$ns at $now "[$link1 link] set bandwidth_ [expr [[$link1 link] set \
bandwidth_]+[$integ1 set sum_]*8*53*100]" 
	$ns at $now "[$link2 link] set bandwidth_ [expr \
[[$link2 link] set bandwidth_]-[$integ1 set sum_]*8*53*100]"
	 $ns at [expr $now+0.01] "[$link1 link] set bandwidth_ 1Mb; [$link2 \
link] set bandwidth_ 250kb" 	
	set now [$ns now]
	} else {}
	$ns at [expr $now+$time] "dynschedule $qmon1 $qmon2 $link1 $link2 "
}

first construct queuemonitor to respective link
set qmon1 [$ns monitor-queue $n0 $n1 ""]
set qmon2 [$ns monitor-queue $n1 $n0 ""]

then 
$ns at 0.0 "dynschedule $qmon1 $qmon2 [$ns link $n0 $n1] [$ns link $n1 $n0]"
this script seems to work well to adjust bandwidth dynamically according to the
congestion of link0.

You may want to try it.

Regards,

Pang Kun

On Tue, 04 Apr 2000, Vijay Chellappa wrote:
> Hi 
> 
> 		I took a simple configuration of two nodes.
> 
> 			n0----------n1
> 
> 	Then I declared both n0 and n1 to be sources transmitting data at 
> the same time. Suppose I increase the rate of source at n0, then the 
> bandwidth allocated for the uplink remains the same and packets are 
> dropped. Is it not possible to allocate greater bandwidth for the case 
> when the rate is higher for the source at n0 and simultaneously decrease 
> the bandwidth at n1 so that the overall packet drops are lowered? I want 
> to know if this is possible? Secondly, can I use the information provided 
> to me by the packets dropped from n1 to n0 to possibly estimate the 
> congestion level of n0-n1? Thanks a lot,
> 
> 		Vijay Chellappa.