thamkhao 5 mac

Upload: ngdnam

Post on 29-May-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Thamkhao 5 MAC

    1/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Tham khoiu khin truy nhp ng truyn

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Cc giao thc a truy nhp Gii quyt cc vn lin quan n mi

    trng dng chung

    Mt s loi: Contention protocols: gii quyt vn xung t

    sau khi n xy ra.

    Collision-free protocols (v d: bit-map protocol vbinary countdown) m bo xung t khng bao

    gi xy ra

  • 8/9/2019 Thamkhao 5 MAC

    2/30

  • 8/9/2019 Thamkhao 5 MAC

    3/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Contention Protocols

    Pure ALOHA Pht trin nm 1970 bi Hawaii University. Xc nhn vic truyn thnh cng qua nhn

    c ACK ca pha nhn

    Slotted ALOHA Ci tin: Thi gian c chia thnh nhiu

    khe v khung ch c truyn ti thi imbt u ca mi khe

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA (Carrier Sense Multiple Access)

    Ci tin: Bt u truyn khi khng thy node no angtruyn

    CSMA/CD (CSMA with Collision Detection)

    Ci tin: Dng vic truyn nu xung t xy ra

    CSMA/CA (CSMA with Collision Avoidance)

    Ci tin:i khong thi gian ngu nhin v th li khing truyn khng bn (carrier is quiet). Nu vn vy th

    truyn d liu CSMA/CA with ACK

    CSMA/CA with RTS/CTS

    Contention Protocols

  • 8/9/2019 Thamkhao 5 MAC

    4/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Pure ALOHA

    Trong pure ALOHA, khung c truyn ti cc thi im tu

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Khi khung sn sng truyn, my phi i n thi im btu ca mt slot

    Slotted ALOHA

  • 8/9/2019 Thamkhao 5 MAC

    5/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    So snh thng lng

    ALOHA

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA

    Thng lng ti a ca slotted ALOHA l0.368.

    CSMA c nhiu ci tin so vi ALOHAbng cch lng nghe ung truyn trckhi truyn

  • 8/9/2019 Thamkhao 5 MAC

    6/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    C ch xung t trong CSMA

    1 2 3Time

    Collision

    4

    Node 4 sense

    Delay

    5

    Node 5 sense

    Delay

    Node 1 Packet

    Node 2 Packet

    Node 3 Packet

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Cc loi CSMA

    CSMA

    Nonpersistent CSMA

    Persistent CSMA

    Unslotted Nonpersistent CSMA

    Unslotted persistent CSMA

    Slotted Nonpersistent CSMA

    Slotted persistent CSMA

    1-persistent CSMA

    p-persistent CSMA

  • 8/9/2019 Thamkhao 5 MAC

    7/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Nonpersistent/x-persistent CSMA Giao thc Nonpersistent CSMA:

    Bc 1: Nu ng truyn ri, truyn ngay lp tcBc 2: Nu ng truyn bn, i mt khong thi gian

    ngu nhin v lp li bc 1 Gi tr backoff ngu nhin lm gim xc xut xung t Nu backoffqu lp s lng ph thi gian ri

    Giao thc1-persistent CSMA:

    Bc 1: Nu ng truyn ri, truyn ngay lp tcBc 2 : Nu ng truyn bn, tip tc lng nghe n khi

    ng truyn ri th mi truyn S xy ra hin tng xung t nu 2 node mun truyn li

    (thng s dng vic truyn sau vi ln th)

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Giao thc p-persistent CSMA :Bc 1: Nu ng truyn ri, truyn vi xc sut p v ch

    truyn trong khe thi gian tip theo (thi gian tr ng truynln nht cho mt gi tin) vi xc xut (1-p)

    Bc 2: Nu ng truyn bn, tip tc lng nghe n khi ngtruyn ri th quay li bc 1

    - Mt cch tho hip gia nonpersistent and 1-persistent CSMA

    Nonpersistent/x-persistent CSMA

  • 8/9/2019 Thamkhao 5 MAC

    8/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    La chn gi tr p nh th no

    ? Gi s N node mun gi tin v ng

    truyn ang bn

    Np c xem l s Node th truyn khing truyn bt u ri

    Nu Np > 1, xung t c th xy ra

    V vy phi m bo Np < 1 trnhxung t, trong N l s node hot ng

    ln nht ti mt thi im

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Throughput

    0 1 2 3 4 5 6 7 8 9

    G

    1.0

    0.9

    0.8

    0.7

    0.6

    0.5

    0.4

    0.3

    0.2

    0.1

    0

    S

    Aloha

    Slotted Aloha

    1-persistent CSMA

    0.5-persistent CSMA

    0.1-persistent CSMA

    0.01-persistent CSMA

    Nonpersistent CSMA

  • 8/9/2019 Thamkhao 5 MAC

    9/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CD (CSMA with Collision Detection)

    Trong CSMA, nu 2 node bt u gi khung ti cngthi im, mi node s vn truyn ton b khung mcd c xung t xy ra. >Lng ph thi gian cho vic truyn c khung tin.

    CSMA/CD

    Bc 1: Nu ng truyn ri, truyn khungtin

    Bc 2: Nu ng truyn bn, tip tc lngnghe n khi ng truyn ri th truynBc 3: Nu xung t c pht hin trong

    qu trnh truyn, ngng ngay vic truynBc 4: i mt khong thi gian ngu nhinv thc hin li thut ton trn

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CD

    A B

    ( is the propagation time)

    T0 A begins transmission

    A B

    B begins transmission

    Time

    T0+-

    A B

    B detects collisionT0+

    A B

    A detects collision just

    before end of transmission

    T0+2 -

  • 8/9/2019 Thamkhao 5 MAC

    10/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CA (CSMA with collision Avoidance)

    Tt c cc node lng nghe ng truyn ging nh trongCSMA/CD. Node sn sng truyn s pht sng cm ng. Nu ng truyn bn, i n khi kt thc qu trnh vic truyn

    hin ti N s tip tc i mt khong thi gian xc nh trc DIFS

    (Distributed inter frame Space).

    Nhn ly mt gi tr ngu nhin ca khe thi gian (gi tr khi uca b m backoff) trong mt contention window ch trc khitruyn 1 khung.

    Nu hin ang c mt qu trnh truyn tin bi mt node khc trongchu k thi gian ny (backoff time), node s gi nguyn gi tr bm.

    Tip tc m li sau khi node khc kt thc vic truyn + DIFS.Node c th bt u vic truyn khi b m n 0

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CA

    Time

    Node As frame

    Nodes B & C sense

    the medium

    Nodes B resenses the medium

    and transmits its frame.

    Node C freezes its counter.

    Node Bs frame

    Nodes C starts

    transmitting.

    Delay: BDelay: C

    Nodes C resenses the

    medium and starts

    decrementing its counter.

    Node Cs frame

  • 8/9/2019 Thamkhao 5 MAC

    11/30

  • 8/9/2019 Thamkhao 5 MAC

    12/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08 CSMA/CA/ACK

    DIFS

    Next Frame

    ACK

    Data

    Other

    Source

    Destination

    DIFS

    SIFS

    Contention window

    Defer access Backoff after defer

    SIFS Short Inter Frame Spacing

    Time

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CA with RTS/CTS Pha gi s gi bn tin RTS (request to send) sau

    khi ng truyn ri sau khong thi gian ln hnDIFS.

    Pha nhn tr li bng bn tin CTS (clear to send)sau khi ng truyn ri mt khong thi gian SIFS.

    Sau d liu c truyn. RTS/CTS c s dng cho vic t ch ung

    truyn v vy xung t chxy r a vi cc bn tin iukhin.

  • 8/9/2019 Thamkhao 5 MAC

    13/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CA with RTS/CTSDIFS

    Next Frame

    CTS

    RTS

    Other

    Source

    Destination

    DIFS

    SIFS

    Contention window

    Defer accessBackoff after defer

    SIFS

    Data

    SIFS

    ACK

    Time

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    RTS/CTS

    RTS

    CTS

    Data

    ACK

    Node A Node B

    Tr truyn lan

  • 8/9/2019 Thamkhao 5 MAC

    14/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Wireless LAN Protocols

    A wireless LAN. (a) A transmitting. (b) B transmitting.

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    The MACA protocol.

    (a) A sending an RTS to B.

    (b) B responding with a CTS to A.

    Wireless LAN Protocols

  • 8/9/2019 Thamkhao 5 MAC

    15/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Ethernet Ethernet Cabling

    Manchester Encoding

    Lp con MAC Ethernet Hiu sut ca mng Ethernet Fast Ethernet

    Gigabit Ethernet

    IEEE 802.2: Logical Link Control

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Ethernet Cabling

    Cc loi cp ph bin s dng trong cng ngh Ethernet

  • 8/9/2019 Thamkhao 5 MAC

    16/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    (a) 10Base5, (b) 10Base2, (c) 10Base-T.

    Ethernet Cabling

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    (a) Binary encoding, (b) Manchester encoding,(c) Differential Manchester encoding.

    Ethernet Cabling

  • 8/9/2019 Thamkhao 5 MAC

    17/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Lp con MAC

    nh dng khung (a) DIX Ethernet, (b) IEEE 802.3.

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Ethernet MAC Sublayer Protocol

    Xung t c pht hin sau khong thi gian 2

    Lp con MAC

  • 8/9/2019 Thamkhao 5 MAC

    18/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Hiu sut mng Ethernet

    Hiu sut mng Ethernet tc 10 Mbps vi 512-bitslot times.

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Fast Ethernet

    Mt s loi cp dng trong mng Fast Ethernet

  • 8/9/2019 Thamkhao 5 MAC

    19/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    multi-level transmit-3 levels

    100BASE-TX (like 100BASE-FX) uses 4B/5B encoding which is thenscrambled and converted to multi-level transmit-3 levels or MLT-3.

    Any Transition = binary 1.

    No transition = binary 0.

    Long strings of zeros

    would give a DCcomponent but because ofthe 4B/5B encoding this

    can never happen.

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    100BASE-FX (like 100BASE-TX) uses 4B/5B encoding which is thenscrambled and converted to Non Return to Zero, Inverted.

    Non Return to Zero, Inverted

    Any Transition = binary 1.

    No transition = binary 0.

    Long strings of zeros

    would give a DCcomponent but because ofthe 4B/5B encoding this

    can never happen.

    Fiber cannot use the 3 level MLT3 because thelight source has only two levels, ON and OFF.

  • 8/9/2019 Thamkhao 5 MAC

    20/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Gigabit Ethernet

    (a) A two-station Ethernet. (b) A multistation Ethernet.

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Mt s loi cp dng trong mng Gigabit Ethernet

    Gigabit Ethernet

  • 8/9/2019 Thamkhao 5 MAC

    21/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    IEEE 802.2: Logical Link Control

    (a) V tr lp con LLC. (b) nh dng giao thc

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Wireless LANs

    Protocol Stack 802.11

    Lp vt l ca 802.11 Lp con MAC Cu trc khung 802.11

  • 8/9/2019 Thamkhao 5 MAC

    22/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    802.11 Protocol Stack

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Lp con MAC trong 802.11

    (a) Hidden station problem.

    (b) Exposed station problem.

  • 8/9/2019 Thamkhao 5 MAC

    23/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    B C DA BA C D

    - A ang truyn d liu sang B

    - C nm ngoi tm sng ca trm A

    - C cng mun truyn d liu sang B

    - C a ra kt lun sai v trm B

    - C vn truyn d liu sang trm B

    - B ang truyn d liu sang A

    - C nm trong tm sng ca trm B

    - C mun truyn d liu sang D

    - C a ra kt lun sai v mi trng

    truyn thng- C khng truyn d liu sang D

    S 1 S 2

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    CSMA/CA.

    The 802.11 MAC Sublayer ProtocolLp con MAC trong 802.11

  • 8/9/2019 Thamkhao 5 MAC

    24/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Mt cm mnh

    Lp con MAC trong 802.11

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Khong cch lin frame trong 802.11

    Lp con MAC trong 802.11

  • 8/9/2019 Thamkhao 5 MAC

    25/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Cu trc khung 802.11

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Broadband Wireless

    So snh 802.11 and 802.16

    802.16 Protocol Stack

    Lp vt l trong 802.16

    Cu trc khung 802.16

  • 8/9/2019 Thamkhao 5 MAC

    26/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    802.16 Protocol Stack

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Lp vt l 802.16

  • 8/9/2019 Thamkhao 5 MAC

    27/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Khung tin v cc khe thi gian

    Lp vt l 802.16

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Cu trc khung 802.16

    (a) generic frame. (b) bandwidth request frame.

  • 8/9/2019 Thamkhao 5 MAC

    28/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Bluetooth

    ng dng ca Bluetooth

    Bluetooth Protocol Stack

    Cu trc khung Bluetooth

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    ng dng ca Bluetooth

  • 8/9/2019 Thamkhao 5 MAC

    29/302

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Bluetooth Protocol Stack

    The 802.15 version of the Bluetooth protocolarchitecture.

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    Cu trc khung Bluetooth

    Khung d liu Bluetooth

  • 8/9/2019 Thamkhao 5 MAC

    30/30

    Hanoi University of Technology Faculty of Electronics and Telecommunications

    07/08

    - Nguyn Vn Hong T8

    - Chu c dng DT8

    - Nguyn c ThnhT8