数学建模社区-数学中国

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

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

内容如下
( l4 y2 I0 d8 |& L) B i9 x5 u

The risk of congestion collapse on the Internet is becoming a reality 2 p# M$ y4 T, l1 `' j( Y& Y& qgiven the increasing number

% ^# Q- p+ Z7 G Z) U& H0 C1 a1 N

of audio/video applications that use UDP as their main transport! E4 M* b1 {/ q/ R protocol. Unlike TCP, these

; m' V7 J2 I1 m! |( Q f

traffic do not respond to congestion signal; i.e., a packet loss. As a : B( b. ^# i; z2 Nresult, audio/video

# ?1 z6 j. ~) E; O z" P, I

applications may take an unfair share of the network bandwidth and : V8 E& n4 \3 W0 d2 Z% M9 \7 Ealso cause persistent

7 T2 [4 B/ A: h) U9 a4 ^

congestion. To avoid congestion collapse, the IETF has proposed that9 Z6 ]/ G2 u$ Y2 Z( _4 C& v7 Z audio/video applications

# x8 S4 E/ K" V7 e

use equation based congestion control (see Lecture‐7 and the reference 4 [/ u6 x% [! F2 U$ L8 bgiven on the next

: g! W$ k: g \$ X

page).

- o6 V% G% L! f

In this assignment, you will simulate n 4 ?2 g9 o i! v/ D7 E$ isources that uses + ~7 R8 Y7 V) a- g( J* Hequation based congestion control to

; k2 s/ M. L5 ~' O- F1 v% w. |, J% N

set their transmission rate. From your simulation, you will determine ! [) e$ U, t9 s/ M7 w, Ewhether equation based

. V5 Y% y3 g7 }6 S: u

congestion ( u8 C9 S7 A" ~, ]; ]: d% Tcontrol is effective in reducing packet loss, and hence congestion.

& F& Y n1 m7 U0 p3 t- V) ?


: t' y! ]4 _) [9 i6 ^6 C1 H

The above network can then be simulated as follows:

; x+ F+ r \$ j0 b* w

Initialization

/ r9 @$ P3 m% |* O1 t- z$ p

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

/ w$ ?- R* h0 @9 I

For each sender, set an initial transmission rate, and determine the9 ~' T$ t! q& F0 k7 [- _ G time when the first packet is

/ w+ Q7 l) ~6 X/ x

to be generated.

9 s: D; @# k8 k: u; g- D

Body

( ^. ~) i6 x5 b- u

FOR t=1 to SIM_TIME DO

3 b3 {$ i5 `- q; l. {; R2 }1 r* @/ C/ ?

{

1 L' w: P# o6 K* A

1. IF the router’s queue is not empty then dequeue a packet, and 2 O! ]. a* w9 B! senqueue that packet in

; Z: G1 H B" D# O! n! T2 D! F

the corresponding receiver’s queue.

/ e1 V: b9 k% H2 u) \

2. IF a sender has a packet to send THEN

- K: B X9 C2 P# a2 t9 y

‐ Check if the router’s queue is full. If not, enqueue the sender’s ' r3 x( g7 l# z1 [- Z* hpacket. Otherwise,

& }! h$ H" u+ G* D$ I# \& t

discard the packet.

( }2 C" z. e! q& V: Z/ P

3. Determine whether any packet loss rate messages are generated by! P l* T# a& a) g- y1 d3 y receivers. If yes,

* c: U' g; s4 x) U

then re‐compute the sender’s transmission rate. Determine the new time / _. w) u- D: ?2 A0 _5 n$ u$ gwhen the

/ R' l& q5 t5 m! v

next packet will be generated. I.e, t+k, where k is the time interval & @* o+ U/ R8 R: cuntil the next packet

5 `' P* V2 |' y" W

arrives.

8 _6 o; ~ S, T: N

4. Collect all required statistics.

# b; z# V! w* ^

}

) d2 G; Q$ l- g8 R) b& I

In your simulation, collect the (a) queue length over time, (b) 2 w. X2 S( j w7 `/ Kaverage queue length, (c) average

) q. i1 F- u1 f

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the 9 o, R+ O+ t6 S/ X4 h) D+ Leffect of the following

: t8 Q4 ~% G4 `$ j+ h) `) ^9 ?

factors: (i) increasing source and receiver pairs, (ii) varying N6 n9 @3 A" k5 q, J' Z values, (iii) different packet loss

6 V0 ^+ r% l3 n% W2 R9 j8 v

reporting periods, (iv) loss calculation methods, (v) load p, (vi) . A8 y6 u6 ?( _" q4 yrouter’s transmission rate;

" Y: \' G5 S0 Y% w5 i

instead of one packet per‐tic, try k packets, and (vii) z + n, a4 ~- t$ Q5 Z2 x, }/ Q9 _number of new flows2 f7 r" O+ Q2 U. h$ f6 O* T8 { arriving at time t .

+ h z; A% h, n1 ]8 ~/ r

7 a* b- R: V- w

9 M/ g9 l' [5 ?* R

8 i; p! m' h/ k" h: | Do with sources $ A) w$ v- ?3 u* r musing a token/leaky bucket to control their transmission rate.

* b6 I6 J5 ? Q' [7 n

Another difference is that each source has an application that " o0 D# j% j1 k/ O7 q( q& J% {3 rgenerates bursty traffic, where

$ }/ o+ _8 R1 w6 W* q

multiple packets arrive in consecutive time intervals.

3 @: c. h+ Z* f# \: Z

To generate bursty traffic, use the following method:

) l3 O# w: ]3 }- Q3 R9 t7 K

6 D& r, Q+ ~: b. ~# ?/ }6 u& z! y

* v1 F# m5 M! Y$ e

In the diagram above, an application generates a packet when it is in 6 o( b+ K- |9 k( R3 V1 A" }the ON state. With

o, S- D! a. \

probability k, it will transition to the OFF state where it will remain idle. In6 }1 L/ S7 r, X! l5 j" A& S0 ` this state, it has

0 x8 D5 E; n# j0 T4 h; |

probability z of moving back to the ON state.

+ [) o% V3 ~* d9 E9 P7 p4 Y1 _: J

The pseudo‐code is as follows:

( ~( R: \/ l, Y1 A5 S5 q

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

; f' w( V9 K9 \: o& E

2. At every simulation tic, do

& O: R# @! U: G# E

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

( }, U5 y7 n! Y% m& \: B

b. If in state=ON: l, H" [/ P1 j$ {8 v2 W1 Q6 \6 A AND R>=k, set state=OFF.

4 ?1 ~# Q. W! Z, a

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

1 |6 a2 r9 d ]- d$ w

d. If state equals ON, generate a packet.

( f6 E8 ?9 F( ] X5 G- i) ^

Design an algorithm to control the token/leaky‐bucket rate of each / w' K8 e; R. y1 Isource (or all sources

6 \" @. o$ m+ q3 b) ^+ @

simultaneously) such that congestion does not happen. Note, you must . i1 ~/ f8 h, T# sexperiment with

$ \3 q& R6 f5 T" R

different k' T; w: [, H4 [8 h" r! [ and z& R: u4 \3 F4 J1 w6 a; C values and determine6 G' D- t/ I* P. C2 w8 |3 r their impact on congestion.

0 ]2 d j( I( j* S* t

Reference

- |9 o9 q# L7 @

S. Floyd, M. Handley, J. Padhye, ) m( r, }* U6 v/ Kand J. Widmer (2000) Equation-based Congestion Control for Unicast

7 d/ T4 S% M- W+ c9 e; o) i

Applications, ACM SIGCOMM, May, % |# p0 r2 B& u Z8 J+ q! v2000.

1 B) Z" P: F6 h

* G+ x& H2 u! @4 Q

6 {; [! w8 i! \6 N" ^" ?










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