Copy of MSL C6

  • Published on
    24-Dec-2015

  • View
    2

  • Download
    0

Embed Size (px)

DESCRIPTION

sadsd

Transcript

  • - Chng 6 -K thut truy nhp trong mng LANK thut truy nhp trong mng LAN

    1

  • 6.1. Tng quan v cc phng php truy nhpMedium Sharing TechniquesCc phng php iu

    Khi t h k h t StaticChannelization

    Dynamic MediumAccess Control

    Khin truy nhp knh truyn

    Scheduling Random Access

    (1) Static Channelization Knh truyn tnh(1) Static Channelization Knh truyn tnhTi nguyn truyn dn ca knh truyn c chia nh v cp pht cho mi ngi s dng g s d g

    u im: Khng xung t, tnh bnh ng Mi nt c n nh truyn dn tc R/N trong sut thi gian truyn thng

    Nhc im: ngi s dng ch c cp pht mt phn nh trong ti nguyn truyn dn ca knh truyn k c khi ngi dng khc khng truyn thng trn knh truyn

    2

  • Cc phng php iu khin truy nhp knh truyn

    (2) Dynamic Medium Access Truy nhp knh truyn ngu im: Khi truy nhp knh truyn, mi nt s dng ti a ti nguyn

    truyn dn, v hot ng tc ln nht c th

    Nhc im: Khng cho php ng thi nhiu ngi dng truy nhp knh truyn Khi c nhiu hn hai ngi dng truy nhp knh truyn xy ra xungtruyn. Khi c nhiu hn hai ngi dng truy nhp knh truyn xy ra xung t (collision). Xung t c th hn ch thng qua c ch iu hnh truy nhp hoc iu khin truy nhp ngu nhin

    Ring NetworkBus Network

    3

  • Cc phng php iu khin truy nhp knh truyn

    4

  • 6.2. iu khin truy nhp knh truyn ngALOHA Phng php truy nhp ngu nhin c pht trin sm nht (1970s) vn c s dng cho mng truyn dn khng dy, mng t ong do tnh cht n gin

    Mt trm pht khi c d liu cn truyn s thc hin truy nhp v pht d liu lns thc hin truy nhp v pht d liu ln knh truyn vi tr nh nht c th, v ch nhn d liu phn hi ACKN hi h h i t tNu c nhiu hn hai trm cng truy

    nhp knh truyn cng lc, tn hiu pht ln bi mi trm s giao thoa v gy ra li

    ACKdata

    d liu xy ra xung tNu mt trm khng nhn c ACK

    trong khong thi gian timeout (tng ng datavi 2 ln thi gian tr lan truyn tn hiu),Mt trm s thit lp khong thi gian ch ngu nhin - backoff time ( gim thiu g ( gkh nng xy ra xung t trong nhng ln truyn k tip)Trm pht s truyn li gi d liu b liTrm pht s truyn li gi d liu b li

    do xung t sau khong thi gian backofftime 5

  • 6.2.1. ALOHA

    Xung t d liu

    1.1 1.2

    TransmissionStation 1

    1.3

    TransmissionTime(F)

    2.1 2 2Station 2

    2.2

    R

    Station 33.1

    R3.2

    Xung t hon ton

    Xung t Mt phn

    Broadcastchannel

    6

  • ALOHA

    Chu k tn thng- Vulnerable Period-

    Gi thit kch thc khung l c nh v c gi tr l (L) v khong thi gian pht i cc bt ca mt khung lnh knh truyn- Vulnerable Period- khong thi gian pht i cc bt ca mt khung lnh knh truyn l (X=L/R)

    Ch nh mt khung bt u c pht i ti thi im Kh h h kh to Khung s c truyn thnh cng nu khng c xung

    t d liu xy ra, hay khng c mt trm khc pht i d liu trong khong thi gian [t0, t0+X], hoc trong khong g g g g gthi gian tng ng vi X trc khi trm gi d liu ln knh truyn (trong khong thi gian t [t0 -X, t0]

    Nu c mt trm khc gi d liu ln knh truyn trongNu c mt trm khc gi d liu ln knh truyn trong cc khong thi gian trn xy ra xung t

    Chu k tn thng = [ t0 X t0+ X ] (vi khung d liuChu k tn thng = [ t0 X, t0+ X ] (vi khung d liu c pht ln knh truyn t mt trm)

    Truyn li nuThi im bt u truyn

    tt0t0-X t0+X t0+X+2tprop t0+X+2tprop+B

    Backoff period BTruyn li nu cn thit

    y

    t0+X+2tprop t0 X 2tprop B

    Chu k tn thng Tr truyn dn7

  • ALOHA

    Gi G l s lng khung trung bnh (bao gm cc khung cn truyn i v cc khung truyn li) trong sut qu trnh truyn d liu ca mt trm

    S l s lng khung truyn thnh cng trong khong thi gian quan stP : xc sut truyn tt mt khung khi khng c xung t xy ra vi khung

    v cc khung truyn li) trong sut qu trnh truyn d liu ca mt trm

    P0: xc sut truyn tt mt khung khi khng c xung t xy ra vi khung c truyn. Nh vy

    S GP= 0S GP=Xt vi mi trm, xc sut cc trm khc truyn i k khung trong kh thi i t t i kh d li t t khong thi gian ang xt truyn i khung d liu ca mt trm c xc nh theo phn b Poisson nh sau:

    ( )k TT [ ] ( )!

    k TT eP k

    k

    =

    Xc sut ny cho ta bit c s trung bnh khung c truyn i (do cc trm khc) xt trong khong thi gian mt trm truyn i khung d liu ca mnh. s lng khung ny s quyt nh xc sut xy ra g g y q y yxung t vi khung ang xt.

    8

  • ALOHA

    : S lng trung bnh khung d liu c pht i ti mt trm trong mt khong thi gian. = G / X

    Nh vy xt trong khong thi gian c th b tn thng vi khung d liu c pht i mt trm, tng ng vi T = 2X th xc sut ny c xc nh nh sau:

    g

    p , g g y

    [ ]2(2 )k GG eP k

    =[ ]!

    P kk

    Xc sut khng c khung no c truyn i trong khong thi c th b tnXc sut khng c khung no c truyn i trong khong thi c th b tn thng s l :

    [ ]0 2

    2(2 )0G

    GG eP P P e

    = = = =[ ] 00 0!succP P P e= = = =

    S 2GS G P G Khi G 0 5Suy ra 20GS G P Ge= = Khi G = 0.5

    C ngha l ti a 18% knh truyn dnh cho qu trnh ca 1 trm d liu g y q truyn i khng b tc ng bi vic xung t d liu vi cc trm khc

    9

  • Slotted ALOHA - ALOHA Phn chia theo thi gian

    T h h kh thi i hi th h Trong phng php ny cc khong thi gian c chia thnh cc khe c chiu di tng ng vi khong thi gian pht i mt khung L/R.

    Qu trnh truyn mi trm ch bt u ti thi im bt u ca mtQu trnh truyn mi trm ch bt u ti thi im bt u ca mt khe thi gian.

    Nguyn tc x l ca phng php ny cng ging nh phngNguyn tc x l ca phng php ny cng ging nh phng php ALOHA thun tu ch khc im l cc mc thi gian c ch nh trong cc khe.

    10

  • Slotted ALOHA

    Chu k tn thng vi mi khung d liu c truyn i :g g yXt qu trnh truyn i d liu ca mt trm ti thi im t0. Gii thitkhung d liu chun b truyn sn sng ti thi im trong khe thi giang y g g g[k , k + 1]

    Vi phng php sloted ALOHA, mt gi d liu c truyn i thnhp g p p g ycng nu khng c khung d liu no khc n (hay i qua) trm angchun b pht khung d liu ca mnh trong khong thi gian t [t0 + X, t0]

    Khong thi gian c th b tn thng vi khung d liu s l [t0 - X, t0]

    11

  • Slotted ALOHA

    0( ) G GG e[ ]k GG e

    0( )

    0!GG eP e= =[ ]

    !G eP k

    k=Nh vy Suy ra

    GS G P G 0GS G P Ge= =

    Smax = 0.36 khi G = 0.5. Nh vy s lng khung truyn i thnh cng vi phng php ny cao hn ALOHA thun tuphng php ny cao hn ALOHA thun tu.

    Slotted ALOHA gim thiu kh t hnng gy ra xung t nhng

    lm tng khong thi gian tr trong qu trnh truyn

    12

  • 6.2.2. CSMA

    Vi phng php truy nhp ALOHA, Mi nt quyt nhtruyn c lp vi nt mng khc trn knh truyn chia s

    Nhc im ca ALOHA truyn c lp vi nt mng khc trn knh truyn chia s

    1 Nt khng quan tm n cc nt khc c thc hintruyn d liu ln knh truyn hay khng.

    ca ALOHA

    1 nt s khng dng qu trnh truyn nu c xung txy ra, khng c kh nng pht hin c xung t

    CSMA Gin thiu xc sut xy ra xung t bng c ch xc nh trngthi knh truyn trc khi pht d liu:

    Cm nhn sng mang - carrier sensing: Nt s lng nghe(listens) knh truyn trc khi truyn, nu cm nhn knhtruyn ri thc hin truyn i khung d liutruyn ri thc hin truyn i khung d liu

    Nu cm nhn knh truyn knh truyn bn Ch saukhong thi gian ngu nhin s thc hin qu trnh cm nhn

    h t h t h t h t

    khong thi gian ngu nhin s thc hin qu trnh cm nhnknh truyn i d liu

    host host host host

    13

  • Truy nhp knh truyn cm nhn sng mng - CSMA

    Chu k tn thng vulnerable period = tpropCh : Nu tprop > tframe, CSMA khng hiu qu bng phng php truy nhp knh truyn ALOHA phn chia theo thi gian.

    Cc kiu CSMA Cc ch nh x l vi CSMA khi knh truyn ybn:

    Non-Persistent CMSA: Ch sau khong thi gian back-off, thc hin cm nhn knh truyn truyn li Tr ln

    1-Persistent CMSA: Bt u truyn ngay lp tc sau khi knh truyn chuyn sang trng thi ri tr thp

    P-Persistent CMSA : Ch n khi knh truyn ri, quyt nh truyn vi xc sut p

    14

  • 1-persistent CSMA

    Thut ton x l ca 1-persisten CSMA Thut ton x l ca 1 persisten CSMA

    15

  • nonpersistent CSMA

    - Trc khi truyn i mt khung, trm s cm nhn trng thi ca gknh truyn. Nu khng c d liu no ang c truyn trn knh truyn tc l knh truyn ri th thtruyn tc l knh truyn ri th th trm s ngay lp tc truyn i d liu ca mnh

    - Nu knh truyn ang c dng, th trm s ch mt khong thi gian ngu nhin v thc hinthi gian ngu nhin v thc hin li bc trn c th truyn i d liu ca mnh

    Nh vy khc vi giao thc 1 persident CSMA th phng thc ny khng thc hin truyn ngay d liu i m vn tin hnh xc nh trng thi ri ca ng g gtruyn trc khi gi i gi d liu ca mnh sau mt khong thi gian ngu nhin backoff.

    Xc sut xy ra xung t s thp hn phng php trc, tuy vy thi gian truyn d liu ca trm s di hn.

    16

  • p-persistent CSMA

    P l mt s nm gia 0 v 1

    Pha pht truyn i khung d liu ca h i t l h k hmnh vi xc sut l p nu nh knh

    truyn ri gim xc sut xy ra xung t vi trng hp c 2 trm u xc nh k h i i d li knh truyn ri v truyn i d liu ca mnh ti mt thi im.

    Thi gian cng c chia thnh cc khe v ch nh cc trm ch c truyn i d liu ti thi im bt u ca mt khung.

    Xc sut xy ra xung t vi phng php ny ph thuc vo gi tr p, tuy vy hiu sut ca phng php ny c th cao hn so vi cc phng php CSMA va cp

    17

  • CSMA/CD

    CSMA with Collision Detection CSMA/CD

    CSMA/CD l phng php iu khin truy nhp cm nhn sng mang v xc nh xung t. g

    Pha pht s lun lng nghe knh truyn xc nh xung t trong sut qu trnh truyn i d liu ca mnh. (c ch xc nh xung t)

    Qu trnh s b hu ngay khi xc nh c xung t xy ra.

    CSMA/CD c p dng tt cho mng LAN s dng dy dn kt ni gia cc nt mng Khi vic xc nhcc nt mng. Khi vic xc nh xung t c th thc hin d dng bng cch so snh mc tn hiu pht i v tn hiu nhn c ti mt trmi v tn hiu nhn c ti mt trm

    Vi mng LAN khng dy th c ch xc nh xung t tng i phc tp

    18

  • CSMA/CD

    Nguyn tc x l ca CSMA/CDTrc khi truyn i mt khung d liu th mt trm s xc nh xem knh

    truyn c ri hay khng. Nu knh truyn ri th trm s ngay lp tc truyn i d liu ca mnh.