数学建模社区-数学中国

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

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

内容如下
. G1 u8 P4 g% I# o0 I% D7 F

The risk of congestion collapse on the Internet is becoming a reality ( a5 g- m: `; O+ E8 D* Ggiven the increasing number

4 ^ i+ c4 y5 P

of audio/video applications that use UDP as their main transport2 U) n# x$ ?8 P8 r7 G protocol. Unlike TCP, these

6 Q, A& R2 L- V6 ^

traffic do not respond to congestion signal; i.e., a packet loss. As a 0 H/ n$ T; I4 H! Xresult, audio/video

' M& A( L& d$ H' A

applications may take an unfair share of the network bandwidth and2 {# }1 m6 v/ ` also cause persistent

; W- }6 Y& z2 {

congestion. To avoid congestion collapse, the IETF has proposed that 0 H4 @' e; `$ A0 caudio/video applications

, q; |% e/ }+ o; u2 E6 K8 g$ C6 R

use equation based congestion control (see Lecture‐7 and the reference0 [0 `4 ?1 [" Q" X9 Y v given on the next

7 D0 ~6 W+ v! i$ T

page).

* `5 K4 b; i: p% R' o* _9 G7 {

In this assignment, you will simulate n1 z l5 b: Q0 k- H# u! V$ z w sources that uses# L9 i! M% [) [6 N equation based congestion control to

7 _% @" D' y2 a* ]# U6 r

set their transmission rate. From your simulation, you will determine , l: f; W) l$ I) P( Cwhether equation based

+ Z. L0 k2 {7 V5 H5 ?

congestion/ q ^0 M/ \: b" ? control is effective in reducing packet loss, and hence congestion.

; V2 ?9 g# G! F9 X) b


4 P; B6 x( L2 D$ |& Q( [

The above network can then be simulated as follows:

" R; \+ I9 q3 T. X9 b. g

Initialization

. r e! B, ?" G6 Z/ ~& F s" S

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

/ S" x3 C3 W$ [: d x1 L

For each sender, set an initial transmission rate, and determine the * L/ U& Y5 K4 b5 G! B) k3 Etime when the first packet is

& E2 w% c$ J+ K! @! ?' P

to be generated.

. {& q. ` `9 L6 E! ^; W; ^% E

Body

. R7 D% `; f- O ^

FOR t=1 to SIM_TIME DO

0 }% Y; R$ U5 x6 k r( G

{

9 p: t* p3 M8 e/ D

1. IF the router’s queue is not empty then dequeue a packet, and , }4 ?) z: y3 t7 _/ }8 e; genqueue that packet in

2 B/ p8 q( x7 I! N$ t6 S0 w

the corresponding receiver’s queue.

9 z0 F% r' P z0 T5 d, x

2. IF a sender has a packet to send THEN

. h) q4 b- o `

‐ Check if the router’s queue is full. If not, enqueue the sender’s ^, y$ a- j; m- F4 dpacket. Otherwise,

7 j2 T @% I8 H+ g9 L

discard the packet.

. V, X. T1 A# c$ t9 y8 R$ h; g2 Q( ^

3. Determine whether any packet loss rate messages are generated by5 u: D6 m' F; Q" Q$ ^$ Y! Y; n receivers. If yes,

9 i" o% ?( J7 v6 E

then re‐compute the sender’s transmission rate. Determine the new time# l+ c( N, x0 I0 X+ Y/ T( L when the

! x% p: L+ O/ Y+ a9 M$ q C

next packet will be generated. I.e, t+k, where k is the time interval `4 t+ J: T( o* L& f until the next packet

6 c9 p# J- R0 Q5 z

arrives.

* z' |0 x' m- B( z! x U

4. Collect all required statistics.

1 b8 v1 ^$ _$ a' z3 h8 d# F

}

1 L n2 c+ g9 O) i4 z/ v6 h3 l

In your simulation, collect the (a) queue length over time, (b): Z6 T: e* v2 H& k+ C) I3 Y average queue length, (c) average

* d) @3 R& m2 ], z

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the : O: X; a3 ^% P; w: seffect of the following

$ v8 S+ C" L+ C

factors: (i) increasing source and receiver pairs, (ii) varying N) D. J n7 [- r values, (iii) different packet loss

6 U# \8 v: X% Z0 }' {2 ]( y

reporting periods, (iv) loss calculation methods, (v) load p, (vi), i+ g' K- `7 Q) i8 A/ s router’s transmission rate;

" O" Q# v+ ?% q1 |$ s& g, D

instead of one packet per‐tic, try k packets, and (vii) z ) G- x* k1 R! p. v) hnumber of new flows3 Z: P( [: [4 B9 f" ` arriving at time t .

& b" j5 U+ g' q' j# T& p

' n6 E3 Z7 o$ v& z0 X$ {

$ u7 U/ |' x w9 `

$ J( p$ i7 ?6 d4 j( o+ h5 B, P8 e Do with sources# ^$ B" V2 D! Q using a token/leaky bucket to control their transmission rate.

2 H3 Q* A; W3 E; c

Another difference is that each source has an application that : _, k G! b9 I1 u2 p$ ~8 x+ mgenerates bursty traffic, where

* X/ x/ T9 K6 U9 L6 Z( Z4 ? k4 n6 N

multiple packets arrive in consecutive time intervals.

" a7 T/ s% ]3 T# t. Q

To generate bursty traffic, use the following method:

$ K- e4 M, j, Q1 a$ T

( R: g/ k' P$ t, L( R% A) ]

! z+ }* _! r) |0 U+ b1 ]/ z/ d

In the diagram above, an application generates a packet when it is in 0 [, |. V$ N2 s8 w4 B, C! Y6 b1 xthe ON state. With

+ s$ C% R; D/ P# N

probability k, it will transition to the OFF state where it will remain idle. In) L- _4 b9 J z* c this state, it has

! |7 J# Y+ D$ {; G

probability z of moving back to the ON state.

2 I) p+ p* _% D: P* b

The pseudo‐code is as follows:

8 x4 r0 K2 f3 q( H" o

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

, t- x; O$ r8 s. g

2. At every simulation tic, do

% Q; @) R! B# p0 @& I! c

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

% h) J3 Q3 s- ^

b. If in state=ON/ `& t, P6 |9 v+ q, A AND R>=k, set state=OFF.

' z- j8 l0 C( b+ ?( a! e; B

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

F7 C _( c9 E5 N8 }* P/ ?9 ?. z q

d. If state equals ON, generate a packet.

/ u6 U! d% G# |: [+ w# A

Design an algorithm to control the token/leaky‐bucket rate of each $ W0 M/ Y0 ?- L: osource (or all sources

: g; [+ @' u' X; `2 L5 H3 |

simultaneously) such that congestion does not happen. Note, you must' k- P G1 R8 t1 v experiment with

* ^' Q) p2 l8 e

different k ) C0 q- B" K# Q6 }3 a6 N) sand z " ~- k+ V! Q5 I* Uvalues and determine9 }' `, \0 U- `# Z* E2 E! B8 K. u* E$ l their impact on congestion.

" Z! c# z( ^# v2 T% O

Reference

3 N9 \( }$ {" k8 h( G+ |2 J

S. Floyd, M. Handley, J. Padhye, , {& R9 J3 {/ Z8 w/ F0 b# Qand J. Widmer (2000) Equation-based Congestion Control for Unicast

9 C9 ]- |3 K0 [3 P0 B5 o

Applications, ACM SIGCOMM, May, $ |4 S) u1 i; |% g# S4 E8 k* l2000.

. N2 d2 h. K+ g. M) k

3 k& q6 V8 o+ P2 J6 o

; O( ?' }; s, i4 ?










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