QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 2930|回复: 0
打印 上一主题 下一主题

高酬matlab编程救助(能做的高手请与我联系QQ 346719984)

[复制链接]
字体大小: 正常 放大

1

主题

0

听众

2

积分

升级  40%

该用户从未签到

跳转到指定楼层
1#
发表于 2008-5-6 07:42 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
在network 中 如何用token bucket to control packet transmission rate.
编程序后做图表分析
能做的高手请与我联系QQ 346719984

内容如下
8 P, m" @ V, Z h" A: A

The risk of congestion collapse on the Internet is becoming a reality ; a- e3 r; t, d2 M; E7 Hgiven the increasing number

+ A w0 v/ Q- w; [$ e) {

of audio/video applications that use UDP as their main transport 3 B% P- o3 s2 Q* C( }protocol. Unlike TCP, these

3 a2 ?3 h) }, o2 z

traffic do not respond to congestion signal; i.e., a packet loss. As a 2 _; L, W0 D% Q$ C" @9 g. w/ P' W) ~' oresult, audio/video

( H7 l% J0 A4 X+ w: I

applications may take an unfair share of the network bandwidth and - b& u1 U& z, d$ f salso cause persistent

- }5 ~( Z" J& a' X2 z8 Z2 q

congestion. To avoid congestion collapse, the IETF has proposed that # n o, X( o- j, V5 p7 v" H# r% |audio/video applications

8 Q+ f& z6 O4 d j

use equation based congestion control (see Lecture‐7 and the reference % y% d6 m# b2 z6 U7 p) ]9 |given on the next

$ M, z; W, ?7 \6 ^! d0 y. f# U

page).

- H8 V) ~! w$ m) T1 N8 |

In this assignment, you will simulate n * U8 S6 y' n% T. v6 r3 S# tsources that uses. c+ x. Z6 r; i, L equation based congestion control to

' b" M, S/ U+ O* @. q4 @) I

set their transmission rate. From your simulation, you will determine % S" u0 u! @7 |) `6 V( x+ lwhether equation based

. V2 q8 r+ B) s; t

congestion - S* V6 _7 f/ k( ?, Pcontrol is effective in reducing packet loss, and hence congestion.

) h8 J6 v* Y: [4 N


% [6 n" W; l4 v7 v( U

The above network can then be simulated as follows:

! n0 k9 S x& E- V; ~. @; [

Initialization

# l0 m f3 c' N5 a; K

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

; \, n, A3 \ `# m P4 Y

For each sender, set an initial transmission rate, and determine the & U# W% D! |0 x+ p) |time when the first packet is

u- u8 z7 F( b* _, ~+ l

to be generated.

# v& G$ f* N: J) x* V3 \

Body

' m) o' g& C8 L/ Q" `

FOR t=1 to SIM_TIME DO

* R9 r# M) P0 J

{

! M- E2 L9 D A2 n; d

1. IF the router’s queue is not empty then dequeue a packet, and% l5 Z, O' y% ?8 a! M6 k( Z enqueue that packet in

2 J$ @; g* M# A$ Z

the corresponding receiver’s queue.

$ ~. D1 N; r) D

2. IF a sender has a packet to send THEN

: F. K& z- o. v, A* s% ^" ~& t) ^

‐ Check if the router’s queue is full. If not, enqueue the sender’s 0 V7 R( [6 b/ r: Bpacket. Otherwise,

4 Y4 |& _: y# V9 t. G; e9 C: H

discard the packet.

: O4 s( R2 R: G ]5 z( d8 U

3. Determine whether any packet loss rate messages are generated by : d. F. }1 T+ p; m; P: U2 Rreceivers. If yes,

- L& P1 R& S. O, f) {

then re‐compute the sender’s transmission rate. Determine the new time7 T# h+ O, \0 d2 Q6 Z2 T when the

y# b4 g# E" M" @3 k$ x

next packet will be generated. I.e, t+k, where k is the time interval ' [0 W# g3 L/ I, J6 [% E; funtil the next packet

. Y x$ m( J8 b

arrives.

" e/ o, l' k8 Z, {! ]; c. ?

4. Collect all required statistics.

* j5 k+ V4 r$ J( T$ B l" @( c

}

/ _( z X) d5 X/ [+ [9 i, H

In your simulation, collect the (a) queue length over time, (b) |6 y" v$ s4 _average queue length, (c) average

2 i: o# G) G' M8 |" l

end‐to‐end packet delay, and (d) Jain’s fairness index. Determine the4 r# X( B3 U- ^: C' m: A effect of the following

+ d5 d) U/ h. b6 @# N

factors: (i) increasing source and receiver pairs, (ii) varying N, L( N) C, j3 r values, (iii) different packet loss

* {; t3 _* p& g" {

reporting periods, (iv) loss calculation methods, (v) load p, (vi)3 e b/ n% d% E6 `7 } M5 F) \" w8 d, G% f router’s transmission rate;

3 o5 I; C5 a, ?5 y9 Z+ X

instead of one packet per‐tic, try k packets, and (vii) z- m5 X1 F+ X% g0 d% C. B) H number of new flows 5 B: P. C" ]% w! [* ]arriving at time t .

F% Z, B2 _9 U- z* v

8 p5 I! R _1 Q

2 ]4 ^- J/ B8 p/ Z, C7 p

6 i3 Z: c C M6 A' t9 o \' i' R Do with sources N8 k& g9 h6 o% Z using a token/leaky bucket to control their transmission rate.

# r) ?; i( X! c! p8 C

Another difference is that each source has an application that 2 C* v, }2 e1 Q& \8 F# xgenerates bursty traffic, where

r0 W; a/ O5 r8 p# ~

multiple packets arrive in consecutive time intervals.

- p% ` ~; e6 x- D* ^

To generate bursty traffic, use the following method:

, a! k- K7 j) W; S/ T

5 M+ i/ o+ A) {3 v1 \% Y$ `

e0 n! ?& X) Q$ I* S, o( W

In the diagram above, an application generates a packet when it is in 4 F- N7 Z8 p6 y, ]1 y* B4 ]. mthe ON state. With

2 w" g4 u- o; _6 B

probability k, it will transition to the OFF state where it will remain idle. In ; O& ?2 U9 d( i t6 W! ythis state, it has

8 a" [( @0 S* w% Z( {7 s5 J

probability z of moving back to the ON state.

s! [/ c' R, k, V, T0 d$ q

The pseudo‐code is as follows:

+ N" ?6 |/ g9 G3 |6 m6 s

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

1 C0 m2 Y4 f% B, n; {/ Z f) }/ b

2. At every simulation tic, do

, ]" o8 M0 }1 W q; [4 z

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

% y) E5 P' n; h0 d4 ^( a. V

b. If in state=ON4 _/ F3 A. R$ }% G! v( I3 x( M AND R>=k, set state=OFF.

! W5 p0 q$ t4 ^" S4 f, {/ L6 S- B

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

) L0 x6 q: E1 s% e" R

d. If state equals ON, generate a packet.

; T. E9 Q0 ~, H* V4 i

Design an algorithm to control the token/leaky‐bucket rate of each ' T' M5 [. N, q v& s/ k# \source (or all sources

" o2 u. {2 G+ ? R' s

simultaneously) such that congestion does not happen. Note, you must6 e2 H# s Q2 \ experiment with

" |1 `" D ]8 d% W, ]

different k8 P' D5 n4 H( \ o and z4 X( q3 \9 b( ~; s values and determine/ ` P9 P/ _4 V4 _9 `/ w their impact on congestion.

! @& H/ M# k$ C; p

Reference

; j7 X0 C, ?, {

S. Floyd, M. Handley, J. Padhye,: o! v* j* {% x/ a; ] and J. Widmer (2000) Equation-based Congestion Control for Unicast

8 Y6 }& H. L4 k1 D* I5 b

Applications, ACM SIGCOMM, May, . F1 q% A5 e4 E/ H, S/ d8 j2000.

/ A N( u8 {9 y4 j( @# I& k

* u6 }, V9 e- |! w' E2 H9 ?/ o$ f

M; C6 Y8 y C5 s) }9 K; C





zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
您需要登录后才可以回帖 登录 | 注册地址

qq
收缩
  • 电话咨询

  • 04714969085
fastpost

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2026-4-10 14:57 , Processed in 0.380124 second(s), 57 queries .

回顶部