数学建模社区-数学中国

标题: 高酬matlab编程救助(能做的高手请与我联系QQ 346719984) [打印本页]

作者: cherrielee18    时间: 2008-5-6 07:42
标题: 高酬matlab编程救助(能做的高手请与我联系QQ 346719984)
在network 中 如何用token bucket to control packet transmission rate.
编程序后做图表分析
能做的高手请与我联系QQ 346719984

内容如下
1 U9 i. `# e/ G- |

The risk of congestion collapse on the Internet is becoming a reality ; n2 o0 r9 o+ b' F$ C. [given the increasing number

4 j6 J* Z4 l2 f2 b4 p- X7 }

of audio/video applications that use UDP as their main transport% ?: K/ w7 K4 }& z protocol. Unlike TCP, these

9 s+ z2 d2 z! k9 B# @

traffic do not respond to congestion signal; i.e., a packet loss. As a 4 `" i, [+ D+ F8 gresult, audio/video

, p" s* ]% H$ |, s3 S) R

applications may take an unfair share of the network bandwidth and) B4 n8 D4 i; s6 A also cause persistent

) g$ Q W% P6 m: L8 Q

congestion. To avoid congestion collapse, the IETF has proposed that 2 Y" P; F8 z+ c% X2 a. W5 ]& H9 Eaudio/video applications

; I8 [, E7 a0 {; s' W$ u

use equation based congestion control (see Lecture‐7 and the reference$ B' g2 O" X) N' \& E given on the next

$ Z: ^; i1 O$ T6 Q

page).

2 d) a! M1 U& E

In this assignment, you will simulate n $ t* ? d, W+ n" t1 u2 B( ssources that uses3 e+ M3 \- R# ~1 `: P2 i equation based congestion control to

/ R. v/ r* T4 p- W& |3 H

set their transmission rate. From your simulation, you will determine 6 ?, [6 i9 ]$ Cwhether equation based

4 N- ^ R$ n% g6 v, J

congestion9 }" R) T$ O; K control is effective in reducing packet loss, and hence congestion.

5 P( A$ Z* E! o) I0 a


8 u% f, c, @/ w# |" e% I b, m5 K

The above network can then be simulated as follows:

% P6 O8 J6 ~' _( Z( S0 [) `

Initialization

/ w5 R5 M9 s9 t0 C5 P: Y% ?

Set the router’s queue size to N, meaning it can hold up to N packets.

0 p$ E% w4 b' x8 V: K; z( e

For each sender, set an initial transmission rate, and determine the # n' ~: ?; R+ Gtime when the first packet is

, B3 b6 F; q0 M; d2 ~7 Q

to be generated.

( I# u0 q0 E( B' }" s) N

Body

) {% [& [% p u! v7 j3 e9 ?

FOR t=1 to SIM_TIME DO

) T }3 y# {: B0 V

{

8 Q8 ^3 I E4 A/ ^. Y) d* |9 a. X: ?

1. IF the router’s queue is not empty then dequeue a packet, and . b- F" s' |: |- e3 u qenqueue that packet in

- o& ?0 N: s. U9 ]# O8 ~7 b* {4 l

the corresponding receiver’s queue.

9 R4 E1 i/ V9 K7 S3 W) K, t3 S1 v

2. IF a sender has a packet to send THEN

; f: b" @) e% L7 e+ ^3 r

‐ Check if the router’s queue is full. If not, enqueue the sender’s2 t5 d8 o: g* L, E V. E5 y packet. Otherwise,

6 D P/ G [ C7 y6 Z1 j E7 q

discard the packet.

/ D) o0 A) H. v" ^" a$ s8 H4 O, B

3. Determine whether any packet loss rate messages are generated by% E( f3 \5 z& y# S receivers. If yes,

0 l4 R4 b* x$ U3 F' d

then re‐compute the sender’s transmission rate. Determine the new time& i5 d/ G9 ^. c& w8 X' C when the

1 k2 h5 D F3 Y/ W% _

next packet will be generated. I.e, t+k, where k is the time interval + f/ \1 b$ ^$ L& j8 Duntil the next packet

4 P! N; |; E7 ]7 `' Z

arrives.

8 Q* `* t$ u; }' ]4 B

4. Collect all required statistics.

) @2 t+ T+ o* Q# e5 J

}

' Z- e* U, d$ n5 H/ V/ L6 P4 @

In your simulation, collect the (a) queue length over time, (b) % {* @) E, {, u2 }average queue length, (c) average

! Q* ~1 a7 k/ O1 l j

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the# E o ^9 t! _" H: Z: d! k effect of the following

$ B; y& [. d' T1 ^

factors: (i) increasing source and receiver pairs, (ii) varying N5 K4 W" q: J. a& W- x0 E# G( p values, (iii) different packet loss

0 ^3 N; L! J, l; B+ N# p

reporting periods, (iv) loss calculation methods, (v) load p, (vi)) w4 N0 j! b* o9 m) u router’s transmission rate;

& O7 d/ R4 a3 \3 v7 A

instead of one packet per‐tic, try k packets, and (vii) z : v0 a. u# u( f2 w3 onumber of new flows9 E8 t% T/ R8 W arriving at time t .

# @0 e; I& P# ]6 v! Q

7 {3 B0 V+ X7 X' O. H% f. [3 T

. ~: B1 u% F* X

$ B+ M$ i" Q4 B1 l' ^0 ^. [ Do with sources# s7 h- Q: U" m* B- H- L- x using a token/leaky bucket to control their transmission rate.

h5 F) B6 R4 R! P W0 _

Another difference is that each source has an application that. w; b' A& @3 B) b4 y) h! j generates bursty traffic, where

# W4 g# x, N `: g; ?. o

multiple packets arrive in consecutive time intervals.

3 T' @% h% O; t* R* Y1 P

To generate bursty traffic, use the following method:

5 ^/ J0 j& X1 X7 a

( R2 b& ^ i; j) ?9 d7 b: i3 Q9 f! F

5 s6 P% `3 f$ a# M4 i9 Q

In the diagram above, an application generates a packet when it is in) e8 \- ^" P1 H% e" E# W# A the ON state. With

5 i3 C' A6 |& U/ _/ r

probability k, it will transition to the OFF state where it will remain idle. In $ j7 o& m( @5 kthis state, it has

! Z! v( t1 C3 s

probability z of moving back to the ON state.

: i% _* s( w' D& \$ L. \6 F

The pseudo‐code is as follows:

( L2 J( [/ }. k4 E8 D) G( o7 ?

1. Start at a random state: ON/OFF.

+ t/ j4 m" ^: ?: J; f8 N4 F

2. At every simulation tic, do

- m+ M1 B' C+ V- [5 f; }5 Z U% I

a. Select a random number R in 0<= R <=1.

4 ^) E) ]; B( f7 I: r( q9 Y6 B

b. If in state=ON " _+ J# E0 u) d: Q/ I# oAND R>=k, set state=OFF.

: Q+ C' `- b8 I1 g: Q5 |9 ^

c. If in state=OFF AND R>z, set state=ON.

0 j0 P5 w# X' a2 B& W( s

d. If state equals ON, generate a packet.

! d6 [; L1 W% H' J2 E0 }

Design an algorithm to control the token/leaky‐bucket rate of each: F" u' C- O' _8 S source (or all sources

- \+ o0 R0 W! _2 E5 Z! A

simultaneously) such that congestion does not happen. Note, you must " N2 x- w& L) a( A7 B# ]; eexperiment with

! H* ^+ q! t% v' `2 h' c& g5 K

different k* ^' B! P5 g- R$ J and z. o5 G' U* N$ s7 L! k1 X' \ values and determine) b4 B3 d- Y: E5 k$ g their impact on congestion.

1 \8 G! S' u+ `0 C4 k: i4 U( h4 v

Reference

- H' E: _" ~1 d/ }0 X( Z9 \6 ^1 Q

S. Floyd, M. Handley, J. Padhye,- \' U9 S# A& J& P3 y0 V4 } and J. Widmer (2000) Equation-based Congestion Control for Unicast

2 \2 v" U3 y8 Q: |' b j

Applications, ACM SIGCOMM, May,) F' I7 `' E+ j) E3 W 2000.

' k& j3 u0 Z }

+ {+ r, y' u; E7 v; @) F

( E' D' o3 j6 A










欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5