数学建模社区-数学中国

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

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

内容如下
. O( ~# T- ?+ L2 n' g( U% n

The risk of congestion collapse on the Internet is becoming a reality : G! [5 X4 C7 t# f5 N. Xgiven the increasing number

* X9 X0 C$ B# `& e* T+ U

of audio/video applications that use UDP as their main transport ; b0 E/ W) k) x3 oprotocol. Unlike TCP, these

6 w- H2 [0 F: h# |5 K

traffic do not respond to congestion signal; i.e., a packet loss. As a * \9 E( U7 g1 g, I5 k3 E) O& G J! P8 presult, audio/video

4 c! f6 N8 w/ B& j* f+ x

applications may take an unfair share of the network bandwidth and : F( B7 ?) t R2 Balso cause persistent

. T; @# ]2 ^' S! c q

congestion. To avoid congestion collapse, the IETF has proposed that ' S' L3 _, ?, i$ _/ K0 w6 K Waudio/video applications

8 Y- ]$ q" W* h0 f8 {" Y/ y; y

use equation based congestion control (see Lecture‐7 and the reference# k4 B0 e8 O' M8 d- q! q given on the next

$ W7 m& \& c0 C

page).

( j! \) `! _; K. z

In this assignment, you will simulate n ; O( H1 P: X( T4 E% Q6 lsources that uses+ |- F3 l3 A( ]* w7 y. t; v3 } equation based congestion control to

9 i" _5 h) R4 g2 ^! O G

set their transmission rate. From your simulation, you will determine& Q3 Q- e0 r) ?6 P whether equation based

% P. q O/ h/ e* c$ ~

congestion ! j5 x0 U! A) Z$ g8 H$ l9 J" Ncontrol is effective in reducing packet loss, and hence congestion.

2 E [. d9 e5 n5 P4 `


& m7 L) C" b- K' L% @0 b

The above network can then be simulated as follows:

& p9 O3 H# q) R

Initialization

# ~9 K2 W% ~( u5 k$ S5 b- \4 e

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

: e1 @3 j7 i( ^ J7 W

For each sender, set an initial transmission rate, and determine the* T* G" g/ r0 W2 c: i h4 [7 G time when the first packet is

W* F/ I, o. {+ J2 Z1 }" p2 y

to be generated.

# H2 j% @8 M& b. ^! b- a+ n- }

Body

: R" ?; i9 A7 B4 @

FOR t=1 to SIM_TIME DO

! ~1 `6 | [6 W8 A6 w+ Q

{

- f( S3 Y+ U( I; a6 v+ u3 f1 }

1. IF the router’s queue is not empty then dequeue a packet, and ! L% \+ U. d* I [$ z8 s( eenqueue that packet in

+ R3 |. l' ? W; E1 }

the corresponding receiver’s queue.

- ]6 W+ w% i8 Y0 h, y( P5 i X0 M

2. IF a sender has a packet to send THEN

M. J4 `- L0 e

‐ Check if the router’s queue is full. If not, enqueue the sender’s x+ {! k6 n4 Tpacket. Otherwise,

- z# ?4 k, K' ]2 m7 x

discard the packet.

8 y9 K: w% \' o/ A0 M5 L

3. Determine whether any packet loss rate messages are generated by 8 O, q7 C F3 N; y) O: mreceivers. If yes,

! R: s/ |9 `1 A2 L8 K

then re‐compute the sender’s transmission rate. Determine the new time o( m. _! N$ k, }+ {; \- J( N when the

\( C1 Q; X3 m( ]2 |

next packet will be generated. I.e, t+k, where k is the time interval- Z0 ^' Z: |8 I9 A, u3 E1 x# Q until the next packet

& X2 D; u1 S9 _" K8 n

arrives.

$ O! h: e4 b h- W

4. Collect all required statistics.

0 t3 Q7 E; ~1 s

}

) Q3 r# v( Z+ y8 J2 S" x

In your simulation, collect the (a) queue length over time, (b)% z3 q5 d8 w+ v* j2 G& Q0 |" c1 e- _ average queue length, (c) average

; D! Q% w: i3 _# |2 `9 k( L

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the9 ?! }7 G4 x4 x' B" m7 n7 P effect of the following

4 C, w& }8 T5 {6 J7 y1 k6 P

factors: (i) increasing source and receiver pairs, (ii) varying N6 J4 @2 r% |$ a6 h& X values, (iii) different packet loss

; C6 V; W4 r& c- K- K) Y( `/ Z

reporting periods, (iv) loss calculation methods, (v) load p, (vi) & \5 Z* K) y) T" b0 grouter’s transmission rate;

0 Y1 s4 F! |. B1 D: o1 X

instead of one packet per‐tic, try k packets, and (vii) z + y5 O+ |. f f8 @number of new flows* t* G3 N) S- ? C; H. d arriving at time t .

. `5 ^3 Y2 y) d' t# g+ ?

4 Q+ b$ z5 f: V7 o8 X

5 n9 M% G1 N) `3 q+ J6 m4 B/ U

' A- b/ P0 A+ E. o$ o5 g Do with sources 2 r+ ~) o/ j) [using a token/leaky bucket to control their transmission rate.

( F+ n6 `9 S3 Q0 \7 ]- [5 x/ x

Another difference is that each source has an application that - J4 f4 f; g% ^( ?+ s4 U Xgenerates bursty traffic, where

8 k9 a& j j$ ^1 D; q5 x

multiple packets arrive in consecutive time intervals.

4 s( U# @7 F" e* |, E! b

To generate bursty traffic, use the following method:

" C2 X {, N# L Y2 f: Q/ m

0 T3 u' U& \- D; o, C5 b X! N9 O; C

" b& b# x1 j5 @( c( j: P4 g6 @: @

In the diagram above, an application generates a packet when it is in ' A9 o1 @) o9 Cthe ON state. With

Q S0 ?. I* H' C+ o+ Z- v( v

probability k, it will transition to the OFF state where it will remain idle. In ! G/ o+ {. z: x! p: q8 ~4 _this state, it has

0 y+ ?5 }/ @8 Q- I8 u

probability z of moving back to the ON state.

2 p- M' ], H# H9 c

The pseudo‐code is as follows:

! T2 _# @7 L/ ]4 X5 B$ z1 {

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

+ e# n9 N0 `7 \

2. At every simulation tic, do

* c5 d+ e: y9 P0 r% Q9 }

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

0 P, r/ j0 f; _ h+ F( R2 J

b. If in state=ON ?8 I! F! m3 ~8 B5 r AND R>=k, set state=OFF.

5 [1 a# c5 s! B. m9 m

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

$ }7 t2 ?, T5 O; y/ w: p

d. If state equals ON, generate a packet.

) i7 e( @3 {0 `# E& B

Design an algorithm to control the token/leaky‐bucket rate of each! a& p3 p# B! Q( B+ k source (or all sources

. a1 V& L* C" y! q" \

simultaneously) such that congestion does not happen. Note, you must ( \+ s0 x* S3 H9 d9 u8 m% F }experiment with

G/ I/ B$ ?; F4 g: g" R) Y- h

different k1 n7 W2 Q" o/ _& c% x and z" `9 s9 ?+ g) a$ e values and determine " ?- Q, S) |: ~' X/ z2 D5 w# W2 ]% |their impact on congestion.

5 V7 h5 F- o+ P( f( c6 q) x) R3 R

Reference

( o& H8 ]* d, t" n5 K* W

S. Floyd, M. Handley, J. Padhye,; O3 B( d3 S+ ^ and J. Widmer (2000) Equation-based Congestion Control for Unicast

2 N: J0 m9 B" s4 b

Applications, ACM SIGCOMM, May,. G9 A0 W8 g" W7 Z+ m D5 r 2000.

7 U* t/ a! ]3 b% b( s- V4 N" ?

7 A% E& o- V9 L0 b, f( Q+ t! L

! E0 A2 T2 h! Y9 n










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