数学建模社区-数学中国

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

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

内容如下
. Q5 ~% x6 \* |' T0 W/ y# V8 {

The risk of congestion collapse on the Internet is becoming a reality* H* T/ @) j( K2 }, E+ I7 @6 s given the increasing number

B- S4 S8 |0 l7 B, H4 \; S

of audio/video applications that use UDP as their main transport 6 D& Y7 p) {9 h% U [1 N+ xprotocol. Unlike TCP, these

1 Y7 T5 }; m3 g, e; o

traffic do not respond to congestion signal; i.e., a packet loss. As a 2 I5 v- b; d5 h: F& ^0 O3 Kresult, audio/video

4 @7 y9 L% g3 \. j3 D3 u y8 w

applications may take an unfair share of the network bandwidth and# d3 d% x" K1 ?9 z1 e) x also cause persistent

) E/ N; r) {2 _( O- v+ n

congestion. To avoid congestion collapse, the IETF has proposed that 0 H j# |5 t6 p0 f6 ?5 |# Aaudio/video applications

4 y/ k. G) G# d4 H1 X( g

use equation based congestion control (see Lecture‐7 and the reference ' i' o) a: N; sgiven on the next

' K$ x' U* z- ]4 P8 z

page).

9 B* _0 l, {' |- j d U

In this assignment, you will simulate n & W1 P7 c; r; h4 j* \. q8 |sources that uses 2 P8 u% s* C% o) {, a. qequation based congestion control to

* r0 j* c3 H# U

set their transmission rate. From your simulation, you will determine8 ?. c+ j4 K5 |" g9 j+ C' v whether equation based

" R/ h( ^3 O, s* a% o& \9 b

congestion! F; j f9 R b6 `/ q+ X0 X. M control is effective in reducing packet loss, and hence congestion.

. e+ ?/ s: j2 \; A4 O


6 J$ J, _6 m5 [+ w' F. Y8 n

The above network can then be simulated as follows:

% }8 r; x% c" u# z

Initialization

8 n* w) n& Y4 ^. s% i/ L$ _

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

. f5 s; h$ z+ I

For each sender, set an initial transmission rate, and determine the 5 k3 E* y0 f2 n/ btime when the first packet is

3 N P3 {2 F* f, o4 W0 i& Y

to be generated.

" P5 }; N' u2 C$ ]1 j: w4 v: I

Body

8 A2 @3 x% u$ o$ U

FOR t=1 to SIM_TIME DO

/ x! Q1 Q: H7 u3 t/ A0 j. J

{

N9 g9 y" x7 ]0 ?& v/ v2 Y

1. IF the router’s queue is not empty then dequeue a packet, and % {) H) |1 @5 g `: H8 V/ _7 Venqueue that packet in

; P( |. t) |& e7 w1 ~4 |1 i2 H

the corresponding receiver’s queue.

- N) {# `( r7 M, Z. O& S

2. IF a sender has a packet to send THEN

. d: E! A( R) g* b$ w$ W; z7 n

‐ Check if the router’s queue is full. If not, enqueue the sender’s 3 H8 ?$ \2 C! {packet. Otherwise,

, M8 S1 r3 B, _, h% L& j

discard the packet.

- y8 E2 F2 A' D& M$ f; Y: t. ^( d

3. Determine whether any packet loss rate messages are generated by4 o, L) I5 [1 T" C- q( U receivers. If yes,

- s! E; e$ d' q: ]

then re‐compute the sender’s transmission rate. Determine the new time : O) y ]9 k" H. f- M* k# bwhen the

* S" ^& E. d, m, f' c4 Z4 A' N( ^! `

next packet will be generated. I.e, t+k, where k is the time interval 4 Z) V, Z- [+ M6 \# X( Wuntil the next packet

- Y6 b0 B! {8 n6 i7 Y; d

arrives.

4 x# `5 `9 K1 r

4. Collect all required statistics.

6 M5 k, C9 v2 h9 b

}

+ b* q' \& ? D, f# m3 T7 s

In your simulation, collect the (a) queue length over time, (b) ! F; h& B( d7 |; k8 c. Kaverage queue length, (c) average

8 x9 h& X- F, g( P+ b+ a+ O

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the % W$ j i6 a* @# V, O8 W. d3 \effect of the following

6 k$ Q% _9 p& L

factors: (i) increasing source and receiver pairs, (ii) varying N5 u1 I& p9 r5 g F& k$ y values, (iii) different packet loss

( j7 G$ ?+ W- W9 d

reporting periods, (iv) loss calculation methods, (v) load p, (vi)9 E0 b/ ~0 V4 @ E- L7 V+ z! P router’s transmission rate;

# }# C; S5 K, W4 u

instead of one packet per‐tic, try k packets, and (vii) z i9 |/ }3 J) b. F% t1 O) E7 [ number of new flows . _" x" M9 U/ V9 n: c- Oarriving at time t .

3 N+ k8 ^$ [) K/ P8 ^8 ~6 Q9 y

/ d' _) a3 M) H& ?0 a% q( d

) G" m- b& U3 `; B, q H% ^9 @

9 v' @$ K1 z9 F Do with sources" M2 v8 h e( w using a token/leaky bucket to control their transmission rate.

2 r4 n4 p, e: X7 e

Another difference is that each source has an application that 8 q$ c( U/ Y4 I6 X, M$ x& Ogenerates bursty traffic, where

& h; m0 i) B0 F0 J9 I9 \. j

multiple packets arrive in consecutive time intervals.

2 n+ A, G, r, o3 X" S

To generate bursty traffic, use the following method:

7 w7 C: h- K+ [

3 ], a: L7 r8 u0 l% [$ J

( _5 @' P) q" V6 m5 ~

In the diagram above, an application generates a packet when it is in 8 P* J8 t3 O h" G; S' q5 `/ dthe ON state. With

( F7 v( v; {. q

probability k, it will transition to the OFF state where it will remain idle. In9 z, ]8 _' p" ?# A" E4 c this state, it has

$ E4 f! t5 _9 o7 d% r

probability z of moving back to the ON state.

: p6 B6 }! _% j6 ]

The pseudo‐code is as follows:

4 t# |- S" H* V

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

# g' w. ~5 H6 p( u9 F: m

2. At every simulation tic, do

1 s% n& |9 N- b* W$ Q# r. B8 }

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

! u" j4 W0 O6 B* C( \

b. If in state=ON " Y: i; n9 R: J8 @AND R>=k, set state=OFF.

& ^; X6 R2 u" p$ G# D: k# [* F7 G

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

3 B6 e R0 T4 ~- {9 ^% i

d. If state equals ON, generate a packet.

* n2 b0 z/ {- Q

Design an algorithm to control the token/leaky‐bucket rate of each7 O! b) E" r6 f source (or all sources

2 _5 m+ V6 V5 i. C; F# y

simultaneously) such that congestion does not happen. Note, you must: t+ _" N7 o( i experiment with

% L0 u. ], Y w# G6 I

different k$ @, d, U6 d: r9 F/ W# C and z* X+ g3 I& P$ \# I/ M! j& H9 W2 c values and determine 1 z$ }7 {- J- Atheir impact on congestion.

! N% |6 B0 ~. Y% ]' y

Reference

# F7 K8 s0 _, @6 S

S. Floyd, M. Handley, J. Padhye, , x w d, A4 u7 land J. Widmer (2000) Equation-based Congestion Control for Unicast

0 t( }3 P' \5 }* z) B4 W

Applications, ACM SIGCOMM, May,! l+ b3 ^: p2 u 2000.

8 V3 O; t) E3 J6 u9 _3 }) f/ ~5 j

, W6 X4 i/ P f& g% ~+ g4 m

+ x- e4 [) B" D' Q0 w










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