数学建模社区-数学中国

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

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

内容如下
5 Z5 ^! L( W3 ^7 _% C, [- d! H

The risk of congestion collapse on the Internet is becoming a reality ) j+ ^+ D) y5 N% E- F1 kgiven the increasing number

6 ^5 Z4 k1 f' u) }

of audio/video applications that use UDP as their main transport ) ^+ r/ N) ?/ @- r8 iprotocol. Unlike TCP, these

- x+ `% R b c, w. S3 x) F

traffic do not respond to congestion signal; i.e., a packet loss. As a 1 _) p0 y+ e. K! u# Gresult, audio/video

' d! @: ~: A- f, Z

applications may take an unfair share of the network bandwidth and 6 ^. D6 x* }; L: oalso cause persistent

! l4 o' T3 L2 u: P4 d/ j

congestion. To avoid congestion collapse, the IETF has proposed that7 z& _1 D3 O* }7 J$ K0 E audio/video applications

4 o0 B9 n/ y& B: r; L; }/ C+ e

use equation based congestion control (see Lecture‐7 and the reference * h$ V# f2 S2 S) l9 qgiven on the next

W; c7 Q) `, h& x* X3 ~/ k

page).

1 ?( t5 T) w. g3 }; \+ m5 c, z; o

In this assignment, you will simulate n. }- \6 s" c% B1 [1 S1 k7 s sources that uses/ a' D1 C: s' }# S equation based congestion control to

- K( Q- ]: I$ d- p. z% s& }. X

set their transmission rate. From your simulation, you will determine* @; C% [7 P; x: w whether equation based

, H4 H& q( b9 K4 f. i/ b5 V% W) {

congestion * |, }' G& |! U* c7 W9 Scontrol is effective in reducing packet loss, and hence congestion.

) R# y" b l: b$ [0 l


: c8 H/ m! Y2 Q v% G- i

The above network can then be simulated as follows:

" G1 r8 L. A2 @6 K, Q" u$ j

Initialization

0 Q2 }5 p, O6 k- C o* h& @

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

- Q u6 F. \# N& Y$ u* s

For each sender, set an initial transmission rate, and determine the" e7 f: G( h) ?( E1 T time when the first packet is

5 N: m/ t1 H7 Q& Y1 H0 S

to be generated.

/ _! B) b* l1 d: o% u& Y( J) K" P

Body

3 r( ?. n1 [, }# \0 Z1 N

FOR t=1 to SIM_TIME DO

8 q- x% l* o$ q* i

{

6 i, }: p* u% |, K1 @! _' g @9 o

1. IF the router’s queue is not empty then dequeue a packet, and ! E& o i6 i9 l" j+ d; lenqueue that packet in

& k0 w: v; O, d) E

the corresponding receiver’s queue.

# l1 I% |: B+ A3 l3 b

2. IF a sender has a packet to send THEN

; `, b8 j( Z% H y! s" y

‐ Check if the router’s queue is full. If not, enqueue the sender’s7 _3 t. h) y# b, O packet. Otherwise,

- Z9 u" d+ [* y* n& a

discard the packet.

; H( {8 D6 w/ W( @" O

3. Determine whether any packet loss rate messages are generated by ( i2 {0 i# g% ~1 mreceivers. If yes,

Z3 i) @5 X1 e2 O7 n

then re‐compute the sender’s transmission rate. Determine the new time % F4 D( @6 c5 j, }% n r' r+ L2 qwhen the

( E/ D) V, U" f: y% b# r

next packet will be generated. I.e, t+k, where k is the time interval3 P; D4 M2 {4 ^2 Y until the next packet

1 i$ X- }3 u1 c, z- Q+ i/ u

arrives.

7 J5 z `1 Z+ b, h

4. Collect all required statistics.

4 x" U; d2 G1 |& S) A

}

5 V. A5 f1 R& m+ I0 j

In your simulation, collect the (a) queue length over time, (b)4 F% t1 q4 _- Z) w average queue length, (c) average

. j% e6 g! N' g& U ~9 t

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the1 r, \0 f, G. T" z; E( H effect of the following

4 B% c# P1 Y" j" W0 z9 @

factors: (i) increasing source and receiver pairs, (ii) varying N! T- v$ L; P& E" s& C values, (iii) different packet loss

3 Q, Q# T2 Z2 W) b- }

reporting periods, (iv) loss calculation methods, (v) load p, (vi) ; m1 ^& X/ {2 irouter’s transmission rate;

$ P+ j) G, o$ }) ~

instead of one packet per‐tic, try k packets, and (vii) z 5 k3 R" |9 P- O; [. `4 F: ynumber of new flows 0 L* f7 p' `9 [ ]arriving at time t .

9 ^' I# X! }+ G' T+ y% f* B

& k3 s {) M- q- {5 X

, I5 n/ u! q' o2 g

% u" J9 b6 N9 r- S: N c Do with sources! y% h8 b1 O) L using a token/leaky bucket to control their transmission rate.

) x0 H5 T) t( Y' O9 v

Another difference is that each source has an application that" }- R9 N' `8 e* S+ J generates bursty traffic, where

! A& ?$ e- \& q4 N% L3 Z7 k5 g

multiple packets arrive in consecutive time intervals.

. e2 f' [; e' l" P( S5 U

To generate bursty traffic, use the following method:

# W K9 `6 Z# a0 _

) M$ J0 a7 o. @" Q( U% u

( W! }/ U1 t& A5 A5 M

In the diagram above, an application generates a packet when it is in6 M4 V& s2 [- a/ M5 i$ n" r the ON state. With

' w3 X* G6 k, X' P2 Y, O. Q) I6 D

probability k, it will transition to the OFF state where it will remain idle. In " ^" r$ K4 d% O! Mthis state, it has

' _; i" {; {. ]7 p" J- @

probability z of moving back to the ON state.

, A) J0 ~% T8 N! \ ] P9 w

The pseudo‐code is as follows:

8 b! f) J) ]# F& C9 l/ C2 o

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

1 N; y5 c8 Q) D7 X

2. At every simulation tic, do

9 A9 l0 @$ ]6 _! c1 W/ q9 _

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

$ S; s1 x* W* t" i6 A

b. If in state=ON 4 [5 e4 t/ M6 g( L0 i4 eAND R>=k, set state=OFF.

4 @6 | s8 {1 m& Z1 O( P }' r

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

" P3 c+ ]* v* ?5 Z$ X

d. If state equals ON, generate a packet.

0 e& y/ n* \7 Z- n# F9 p0 N

Design an algorithm to control the token/leaky‐bucket rate of each 3 A# _4 J/ m4 _7 z7 p, L. N! Rsource (or all sources

+ S% z. f& z- Q3 S

simultaneously) such that congestion does not happen. Note, you must 5 `4 H9 W* v7 W8 u2 i0 zexperiment with

/ G# g3 W4 R1 t5 U7 r

different k/ K) ~8 l2 I3 E8 Z# s4 N h) u' j9 V and z ; t# s4 y, y D7 rvalues and determine 2 s. r% p/ j5 g9 stheir impact on congestion.

4 S9 }% v* m0 d* X( x/ }7 i

Reference

3 V F% r4 L6 a$ e

S. Floyd, M. Handley, J. Padhye, & \5 r9 j/ M& c7 J( S$ a9 iand J. Widmer (2000) Equation-based Congestion Control for Unicast

! x; I- T4 |: ?

Applications, ACM SIGCOMM, May,4 a, Y' h# O* W% J8 H1 d) x) T$ P 2000.

' J' n* G3 Q. N

. R1 L5 j C7 _! j% F8 ~- r

7 s1 E/ J' Z/ H* ]- ]4 X










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