数学建模社区-数学中国

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

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

内容如下
1 a& e! G- g0 E* D6 A

The risk of congestion collapse on the Internet is becoming a reality, E2 K3 @, O3 l4 A7 _7 N* q2 z given the increasing number

/ C) o* M/ S1 c1 [( b

of audio/video applications that use UDP as their main transport " A! K8 X! N; d( _+ yprotocol. Unlike TCP, these

9 u9 G& _$ m& A7 b+ X/ [# P

traffic do not respond to congestion signal; i.e., a packet loss. As a 2 f8 B7 k; q" j0 [result, audio/video

6 P) r1 v( W' h( w0 s& f7 k

applications may take an unfair share of the network bandwidth and( i& O' f# }0 D1 }9 x, V8 A also cause persistent

; ^' y! q- J) ^: O

congestion. To avoid congestion collapse, the IETF has proposed that. k0 D) v/ i, b# R, k5 k/ P j audio/video applications

6 ]+ C: q3 P- i# Q* C! u5 [: B0 @

use equation based congestion control (see Lecture‐7 and the reference & j% E }* |3 }* G9 Ngiven on the next

3 i8 [5 ]5 C2 K, G- g2 W

page).

! y" ^7 m. m7 |: ?8 A/ q9 _4 C

In this assignment, you will simulate n' N3 @* b. V) Y# I sources that uses1 M3 q" Q ]$ F3 ?' } equation based congestion control to

, N# v" p/ w& ~; U( T2 n

set their transmission rate. From your simulation, you will determine' d# u0 \; {5 V/ r' F whether equation based

+ [/ ]8 o4 q) m8 m* B

congestion / l' i! u* E! @control is effective in reducing packet loss, and hence congestion.

' i2 \) c; e( Q! X' {


" \- Z% [, v$ |: \1 H' c; F

The above network can then be simulated as follows:

8 H6 V8 D$ g0 d

Initialization

; r7 x. I2 t( G3 g

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

& A8 \: J- R+ t' [

For each sender, set an initial transmission rate, and determine the ' L0 r. W) U3 ?# F! `) `time when the first packet is

g* |2 i z- q$ ]# O0 r) _

to be generated.

# v, i; {* H8 q- M% f O1 Q+ f

Body

/ m; K5 }5 o$ g( G9 g

FOR t=1 to SIM_TIME DO

- ]0 l: ~; l6 r* w$ J9 i2 K

{

6 [$ T* w$ |7 u* J2 ^

1. IF the router’s queue is not empty then dequeue a packet, and % E1 R6 y0 W* ]; Y. }enqueue that packet in

' H' z- |& z* U- W& g' U r+ `

the corresponding receiver’s queue.

( z: [1 D& M6 q+ k6 e

2. IF a sender has a packet to send THEN

! U ]" i; p, O9 r9 Q! M

‐ Check if the router’s queue is full. If not, enqueue the sender’s$ Z6 \' j7 W# ~, N( O: V; d$ U packet. Otherwise,

0 P9 w1 B6 b. I1 i# D! F2 y

discard the packet.

. B& E1 e3 \4 k1 E4 u

3. Determine whether any packet loss rate messages are generated by % S; P0 m, r3 [+ E$ F/ n; Q1 Y0 wreceivers. If yes,

& e6 J, X& k }, E) M. Z5 ~- d3 C

then re‐compute the sender’s transmission rate. Determine the new time 5 @% x2 s4 A+ L" G& _+ o) K3 D: xwhen the

! T: u! `9 `' b$ R

next packet will be generated. I.e, t+k, where k is the time interval $ s" \+ j8 A, U4 c6 T! Auntil the next packet

( @* P/ Z5 [$ h+ |' Q/ [1 s

arrives.

8 k0 z% z( ~/ s! T. U0 M# e

4. Collect all required statistics.

8 H8 H, G# c4 ]7 ?' n# D3 K

}

" p/ P Q p1 m8 J2 d% a9 F

In your simulation, collect the (a) queue length over time, (b) 6 M+ j$ c. _4 F( |, H: z4 W# Waverage queue length, (c) average

0 N9 O; z- i( H6 }& b5 N3 ?

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the( f O# S( J$ Y! e1 M1 ? effect of the following

0 ]8 s+ t) ^2 K) n& k

factors: (i) increasing source and receiver pairs, (ii) varying N ) \. y0 `5 ]0 |* K q$ m, Zvalues, (iii) different packet loss

! l4 M. o! O. G6 \. C+ B' J' z

reporting periods, (iv) loss calculation methods, (v) load p, (vi) , V2 C( p0 T, y5 l4 U+ L; Trouter’s transmission rate;

8 }! d8 n# }5 R% x& d' ~

instead of one packet per‐tic, try k packets, and (vii) z - K+ E; `( B- R6 _0 q3 P d5 t: X3 i- d' [0 Jnumber of new flows % m, o ^) i2 B7 Y+ h4 t! V" n7 Qarriving at time t .

. P0 T$ E2 O3 h4 n

4 h( {$ Y' Z; H' }* f+ |

: M3 p1 N" y2 C, d

- L9 d2 s9 X* V0 d/ {, v, ] Do with sources 1 I& x" f" {+ w. U7 {/ {! Tusing a token/leaky bucket to control their transmission rate.

8 J0 H7 \) T) l) t; n: k, g' ^

Another difference is that each source has an application that( S# u( U% E `# a; R. C; \ generates bursty traffic, where

6 o, \0 c! U/ T: ]6 a7 {

multiple packets arrive in consecutive time intervals.

9 G- v, Q. H" e6 l8 R# P& m" z/ P

To generate bursty traffic, use the following method:

7 d/ E# |! ^' r& t5 ~

4 G& `' w' F/ i1 `) o& d# d

0 A7 C+ W5 u* ~ t, O

In the diagram above, an application generates a packet when it is in# |) s8 E( R ~) x the ON state. With

$ A9 z& Y9 P( y+ x/ {5 m

probability k, it will transition to the OFF state where it will remain idle. In, G1 h& _; l0 q& s# n+ k- u this state, it has

' ]% _6 ]7 o4 Y& s2 R2 c. z

probability z of moving back to the ON state.

, p; L/ G6 J4 Z# [& {! J/ z8 n: e! X3 w

The pseudo‐code is as follows:

0 x% F% ~& s7 n3 D( ^

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

N8 ^4 B4 n, ?* ^+ R& `' q1 m4 k

2. At every simulation tic, do

7 c4 I$ z9 m0 E4 n7 Y

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

& E( \5 s+ P3 F/ W$ y

b. If in state=ON 4 M6 y+ [5 [$ X5 |AND R>=k, set state=OFF.

3 b u7 ^7 M- B' Z& \3 @

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

% B' }) I- V. A- E5 Y6 [3 L

d. If state equals ON, generate a packet.

0 c: H" R* F* p5 ~3 _" D' v

Design an algorithm to control the token/leaky‐bucket rate of each, X. R5 d" w; Q source (or all sources

0 O3 c# y& W0 d) {: t$ p l

simultaneously) such that congestion does not happen. Note, you must; J! F" k. A! F! B2 _; ` experiment with

/ m/ h9 k% S/ {3 c3 h0 s9 ]8 ^

different k) [1 h6 r9 M* k- D; ]# M/ E- h and z6 `+ x% f! k: R% G# B values and determine & N( A5 q5 A1 d$ k5 Atheir impact on congestion.

) z3 \( Y- k* a, g: Z1 y

Reference

( i# m ?9 ^1 I4 b7 L

S. Floyd, M. Handley, J. Padhye,$ Y3 T# a9 q" L/ @% D( J and J. Widmer (2000) Equation-based Congestion Control for Unicast

1 O) o9 y ?( {( e" Z

Applications, ACM SIGCOMM, May, ( e1 @$ h5 E' @7 I2000.

+ e- I) S9 j/ ]

( W) [1 o- H8 p# L% p" L) [2 F9 a

7 H! ^% P0 Q& k+ V& N8 A8 V, n) L










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