Multi Access

download Multi Access

of 18

Transcript of Multi Access

  • 7/28/2019 Multi Access

    1/18

    Multiple Access Protocols

    for Link Layer

    Multiple Access Protocols

    Single shared broadcast channel

    nodes: interference

    collision if node receives two or more signals atthe same time

    Multiple access protoco l

    distributed algorithm that determines how nodesshare channel, i.e., determine when node can

    communication about channel sharing must usechannel itself!

    Typically no out-of-band channel for coordination

  • 7/28/2019 Multi Access

    2/18

    Ideally what we want?

    Broadcast channel of rate R bps

    1. When one node wants to transmit, it cansend at rate R.

    2. When M nodes want to t ransmit, eachcan send at long-run average rate R/M

    3. Fully decentralized:

    transmissions

    no synchronization of clocks, slots

    Types of Mult iple Access Channelization

    Divide channel into smaller pieces (times o s, requency, co e e c.

    Allocate a piece to node for exclusive use

    Random Access

    channel not divided

    revent collisions, or allow and recover

    from collisions

    Taking turns

    Nodes take turns, but nodes with more tosend can take longer turns

  • 7/28/2019 Multi Access

    3/18

    Channelization

    Examples: Time-division mult iple access (TDMA)or requency- v s on mu p e acesss .

    Take TDMA example:

    .

    Inefficient when load is unbalanced or unknown.

    Random Access Protocols

    No a priori pieces (slots, frequency orco e .

    Packets are transmitted with li ttle or nocoordination. Collisions possible.

    Issue: how to prevent col lisions, orrecover from collisions?

    Aloha (slotted and unslotted)

    CSMA, CSMA/CD, CSMA/CA

  • 7/28/2019 Multi Access

    4/18

    Aloha Protocols

    Initially developed in 1970 for radio

    several terminals in Univ. of Hawai.

    Mother of all random access protocols,even though very inefficient.

    We present an idealized version for easy.

    Slotted AlohaAssumptions

    Al l f rames same sizeOperation

    Time is divided intoequal size slots, time to

    transmit 1 frame

    Nodes start to transmitframes only at

    beginning of slots

    frame to transmit, it

    transmits in the next slot

    If collision, noderetransmits frame in each

    subsequent slot with

    Slots are synchronized

    Collision = more thanone node transmit in a

    slot.

    .

  • 7/28/2019 Multi Access

    5/18

    Slotted ALOHA

    Pros

    single active node cancontinuously transmit

    Cons

    collisions, wastingslots

    a u ra e o c anne

    highly decentralized:only slots in nodes

    need to be in sync

    simple

    nodes may be able to

    detect colli sion in lessthan time to transmitpacket

    clock synchronization

    Slotted Aloha efficiency

    For max efficiencywith N nodes, find p*

    that maximizes

    Efficiency is the long-runfraction of successful slotswhen there are many nodes,

    Suppose N nodes withmany frames to send,

    each transmits in slot with

    probability p

    Np(1-p)N-1

    For many nodes, takelimit of Np*(1-p*)N-1as

    N goes to infinity,

    gives 1/e = .37

    each with many frames to send

    prob that node 1 hassuccess in a slot = p(1-p)N-1

    prob that any node has asuccess = Np(1-p)N-1

    At best:channelused for usefultransmissions 37%of time!

  • 7/28/2019 Multi Access

    6/18

    Pure (unslotted) ALOHA

    unslotted Aloha: simpler, no synchronization

    when frame first arrives

    transmit immediately

    collision probability increases:

    frame sent at t0 collides with other frames sent in [t0-1,t0+1]

    Pure Aloha efficiency

    P(success by given node) = P(node transmits) .

    P(no other node transmits in [p0-1,p0].

    P(no other node transmits in [p0-1,p0]

    = p . (1-p)N-1 . (1-p)N-1

    =p . (1-p)2(N-1)

    choosing opti mum p and then letting n -> infty ...

    = 1/(2e) = .18Even worse !

  • 7/28/2019 Multi Access

    7/18

    Carrier Sense Multiple Access

    (CSMA)

    In Aloha, nodes transmit immediatelyw en a new pac e arr ves.

    What if we are able to sense carrier andtell busy and idle periods apart?

    Busy carrier indicates ongoingtransmission. Wait until carrier id le.T icall needs a carrier sense intervalfor detecting the state of the carrier.

    Can be used in both s lotted and unslottedsystems.

    CSMA : Persistence

    New arrival senses busy carrier

    Continue sensing until idle (persistentCSMA).

    Retry after a random time interval (non-persistent CSMA). Retry again if still busy.

    Two types of persistent CSMA

    Transmit new arrival as soon as carrier

    - . Transmit new arrival after a random time

    interval after carrier becomes idle (p-persistent CSMA).

  • 7/28/2019 Multi Access

    8/18

    Note on Backoff

    Random backoff interval, b slots

    Tr in to transmit in subse uent slots with some

    Some event causes transmission to defer

    (e.g., medium busy, collision etc.)

    probabili ty p is equivalent to sending after arandom interval.

    Length of random interval in slots = b.

    Prob [b=k] = p(1-p)(k-1)

    Coll ision Detection

    Need to know whether t ransmission is.

    First idea: Detect col lision. Retransmitafter backoff (as in Aloha) if collision.

    CSMA/CD 1-persistent CSMA withcoll ision detection. Used in Ethernet. IEEE

    . .

    Listen while transmitting. If noticetransmission being garbled, flag collision.

  • 7/28/2019 Multi Access

    9/18

    Ethernet CSMA/CD

    Important parametera = max. signalpropagation delay in network / smallest

    packet transmission time.

    Packet transmission time = packet size /channel bandwidth.

    Parametera must be less than 0.5 so thatthe packet lasts long enough at the

    transmitter for it be able to detect collisionif it happens anywhere in the network.

    Coll ision Detection

    Another nodePropagation time

    TimeTransmitter

  • 7/28/2019 Multi Access

    10/18

    Coll ision Detection

    Another nodePropagation time

    TimeTransmitter

    Sender detects collision

    Coll ision Detection

    Another nodePropagation time

    To detect collis ion, min

    TimeTransmitter

    Some other node

    pac e ransm me >max propagation delay innetwork.

    Thus Ethernet has a max cable length and aminimum packet size.

    Collision at some

    node. Sender unable

    to detect.

  • 7/28/2019 Multi Access

    11/18

    Exponential Backoff In Ethernet

    Transmitter transmits a jam signal aftercoll ision is detected to make sure every

    transmitter aborts transmission.

    Then it enters an exponential backoffphase. Retransmits the coll iding packet

    after 512*K bit time.

    K is random from {0,1,2,3,,2m-1}, m =

    min(n,10). n = no. of collisions for this packet.

    Performance Metrics

    Throughput: Bits/sec or packets/secreceived correctl at the receiver.

    Offered load: Bits/sec or packets/secactually transmitted on the network.

    Normalized throughput or load: The abovenormalized with respect to bandwidth.

    Delay: Delay between when the first bit of

    t e pac et starts transm tt ng or t e rsttime and the when the last bit of thepacket correctly received.

  • 7/28/2019 Multi Access

    12/18

    Less Common Metrics

    Stability: Whether throughput decreases withincrease in load.

    Could happen in a random access scheme, ifcollision increases with increase in load.

    Ideally, the protocol should try to admit less load ifoverload (frequent collisions) is detected.

    Fairness: Whether all nodes with packets totransmit have e ual shots at transmittin . i.e. all

    contending nodes get equitable share of the

    bandwidth; nobody hogs the channel.

    CSMA/CD Performance Much harder to analyze analytically than Aloha.

    Max. throughput is very dependent on parameter a.

    With some conservative assumptions, max.normalized throughput = 1/(1+constant*a).

    Very small a close to zero -> almost idealthroughput. Large a means more waste beforecollision detect. Bad for CSMA/CD.

    constant 5 for Ethernet LAN. Find a from Ethernetspecs.

  • 7/28/2019 Multi Access

    13/18

    CSMA on Wireless

    Cannot depend on collision detectionabilit .

    Full duplex radios are complex andexpensive.

    Even if sender is able to detect collision, itmay so happen that sender senses nocollision but collision ha ens at thereceiver. This is due to path loss of wireless

    signals. Doesnt happen in Ethernet.

    Busy Tone Multiple Access(BTMA) Divide the available frequency band into two channels:

    message (data) channel and control channel.

    ,control channel. Any hidden terminal upon hearing this

    busy tone will refrain from transmitting .

    Carrier sense on the busy tone only. Solves both h iddenand exposed terminal problems.

    Problems:

    Use of two channels makes radios complex. Also, channels

    may nee o we -separa e . Propagation characteristics on two channels may be

    different.

  • 7/28/2019 Multi Access

    14/18

    CSMA/CA, IEEE 802.11 WLAN

    CSMA with coll ision avoidance. A form of p-persistent CSMA.

    se n s an ar . or re ess .

    Transmit after the channel is continuously sensedidle for an amount of time equal to or greater thanthe Distributed Inter Frame Space (DIFS).

    If channel is busy, defer until the channel issensed idle for DIFS duration. Then go through an

    .Transmit after the backoff timer expires.

    The timer counts down as long as the channel isidle, but stops counting during the time thechannel is busy.

    CSMA/CA Contd.

    Avoids collision by randomization, but . ,

    from receiver unlike CSMA/CD.

    Receiver sends a short ACK packet after aSIFS (Short Inter Frame Spacing) period

    after correctly receiving a packet.

    - ,value of backoff timer is now doubled

    much l ike Ethernet (exponential backoff).

  • 7/28/2019 Multi Access

    15/18

    CSMA/CA in 802.11

    DIFSDIFScontention window(randomized back-offmechanism)

    t

    medium busy Transmitted frame

    slot time

    direct access ifmedium is idle DIFS

    Ready for transmission

    ACK

    SIFS

    Backoff clock stops if medium is sensed busy. DIFS > SIFS

    Hidden Terminal Problem

    A and C cannot hear each other.

    A B

    ,transmission using carrier sense.

    If C transmits as well, packets collide at B.

    A and C are hidden from each other.

  • 7/28/2019 Multi Access

    16/18

    Hidden Terminal Problem

    Cannot happen in wired Ethernet. Peculiar

    Need to sense carrierat receiver, notsender!

    Solution: Do virtual carrier sensing . Askreceiver whether it can hear anything. If it

    , .

    Solving Hidden Terminal Problem:RTS-CTS Handshake

    When A wants to send a packet to B, node A fi rstsends a short Re uest-to-Send RTS acket to B.

    On receiving RTS, node B responds by sendingClear-to-Send (CTS).

    When a hidden node (e.g., C) overhears a CTS,it keeps quiet for the duration of the wholetransfer.

    Transfer duration is included in both RTS and

    CTS.

    A B C

    RTS

    CTS CTS

    DATA

    D

    RTS

    ACK

  • 7/28/2019 Multi Access

    17/18

    RTS-CTS Handshake Contd

    Note: Any node that hears RTS or CTSmust keep quiet for the duration of the

    .

    Note the RTS packets may collide.Probabili ty small as they are short.

    Retransmit RTS after backoff if no CTS.

    A B C

    RTS

    CTS CTS

    DATA

    D

    RTS

    ACK

    Timeline

    SIFS

    DIFS

    ACK

    senderdataRTS

    CTSSIFS SIFS

    t

    data

    defer access

    otherstations

    recever

    DIFS

    Contentionperiod

    NAV (RTS)NAV (CTS)

    Note Data > RTS/CTS/ACK > DIFS > SIFS. Timesnot to scale for clarity.

    NAV = network allocation vector. During the periodNAV is set the node must act as if medium busy.Thus a packet from them ready during th is timemust go through a contention period.

  • 7/28/2019 Multi Access

    18/18

    Exposed Terminal Problem

    In princ iple, A->B and C->D transmissions can go

    AC

    D

    .

    But A and C can hear each other. C will wait for A-

    >B to end before starting C->D. A and C are exposed terminals.

    Solutions??