AWN Week-8

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 56

Medium access control protocols for

WSN
Dr. Rahim Khan
Assistant Professor
Department of Computer Science
Abdul Wali Khan University Mardan
Operations in WSN
•When to send
•When to listen
•Processing
Principal options and difficulties
· Medium access in wireless networks is difficult mainly
because of
· Impossible (or very difficult) to sende and receive at the same time
· Interference situation at receiver is what counts for transmission
success, but can be very different from what sender can observe
· High error rates (for signaling packets) compound the issues

· Requirement
· As usual: high throughput, low overhead, low error rates, …
· Additionally: energy-efficient, handle switched off devices!
Requirements for energy-efficient MAC
protocols
Recall
◦ Transmissions are costly
◦ Receiving about as expensive as transmitting
◦ Idling can be cheaper but is still expensive

Energy problems
◦ Collisions – wasted effort when two packets collide
◦ Overhearing – waste effort in receiving a packet destined for another node
◦ Idle listening – sitting idly and trying to receive when nobody is sending
◦ Protocol overhead

Always nice: Low complexity solution


Main options
Classes of MAC Protocols
Fixed Assignment
1. TDMA
2. FDMA
3. CDMA
4. SDMA
Demand Assignment
5. Centralized (polling)
6. Distributed (token passing)
Random Access
7. Aloha
8. CSMA
9. Busy tone selection
RANDOM ACCESS

In random access methods, no station is superior to another station and none is assigned
the control over another. No station permits, or does not permit, another station to send.
At each instance, a station that has data to send uses a procedure defined by the protocol
to make a decision on whether or not to send.
Two Rules:
1. No transmission schedule
2. Which station should send
Main Problem: Collison
• When the station access the medium
• If busy then what
• If idle then what
• Success or failure????
• Conflict???
Pure ALOHA

Send whenever a station has data


Share medium, hence, possibility of collision
Relies on ACK ( time out period)
Collision may involve two or more stations
Before resending, wait for back-off time
Postpone or wait longer in scenarios when maximum retransmissions are
performed (15)
time out period is equal to the maximum round trip delay, which two the
amount of time required to send a frame between the two most widely
separated devices.
Frames in a pure ALOHA network
Procedure for pure ALOHA protocol
Example 1

The stations on a wireless ALOHA network are a maximum of 600 km apart. If we assume that
8
signals propagate at 3 × 10 m/s, we find
5 8
Tp = (600 × 10 ) / (3 × 10 ) = 2 ms.

Now we can find the value of TB for different values of

K.

a. For K = 1, the range is {0, 1}. The station needs to

generate a random number with a value of 0 or 1. This

means that TB is either 0 ms (0 × 2) or 2 ms (1 × 2),

based on the outcome of the random variable.


Example 1 (continued)

b. For K = 2, the range is {0, 1, 2, 3}. This means that TB

can be 0, 2, 4, or 6 ms, based on the outcome of the

random variable.

c. For K = 3, the range is {0, 1, 2, 3, 4, 5, 6, 7}. This

means that TB can be 0, 2, 4, . . . , 14 ms, based on the

outcome of the random variable.

d. We need to mention that if K > 10, it is normally set to

10.
Figure 5 Vulnerable time for pure ALOHA protocol
Example 2

A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is the

requirement to make this frame collision-free?

Solution

Average frame transmission time Tfr is 200 bits/200 kbps or 1 ms. The vulnerable time is 2 × 1 ms =

2 ms. This means no station should send later than 1 ms before this station starts transmission and

no station should start sending during the one 1-ms period that this station is sending.
Slotted ALOHA
Time is divided into slots
Each device is bounded to transmit at the beginning
Misses (wait for next slot)
Collisions: only when two stations send simultaneously
Figure 6 Frames in a slotted ALOHA network
Note

The throughput for slotted ALOHA is


−G
S=G×e .

The maximum throughput

Smax = 0.368 when G = 1.


Figure 7 Vulnerable time for slotted ALOHA protocol
Example 4

A slotted ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is the

throughput if the system (all stations together) produces

a. 1000 frames per second b. 500 frames per second

c. 250 frames per second.

Solution

The frame transmission time is 200/200 kbps or 1 ms.

a. If the system creates 1000 frames per second, this is 1

frame per millisecond. The load is 1. In this case


−G
S = G× e or S = 0.368 (36.8 percent). This means

that the throughput is 1000 × 0.0368 = 368 frames.

Only 386 frames out of 1000 will probably survive.


Example 4 (continued)

b. If the system creates 500 frames per second, this is

(1/2) frame per millisecond. The load is (1/2). In this


−G
case S = G × e or S = 0.303 (30.3 percent). This

means that the throughput is 500 × 0.0303 = 151.

Only 151 frames out of 500 will probably survive.

c. If the system creates 250 frames per second, this is (1/4)

frame per millisecond. The load is (1/4). In this case


−G
S = G × e or S = 0.195 (19.5 percent). This means

that the throughput is 250 × 0.195 = 49. Only 49

frames out of 250 will probably survive.


Figure 1
Carrier Sense Multiple Access (CSMA)

To minimize chances of collisions


Sense before transmit
Listen before talk
Collisions still exist
When a station sends a frame it take some time for the bit to reach
every station (although very short).
Figure 8 Space/time model of the collision in CSMA
Propagation time

The time needed for a signal to propagate from one end of the
medium to the other (represented by Tp)
Figure 9 Vulnerable time in CSMA
Persistence methods

• When the station access the medium


• If busy then what
• If idle then what
• Success or failure????
• Conflict???
Figure 10 Behavior of three persistence methods
Figure 11 Flow diagram for three persistence methods
Figure 12 Collision of the first bit in CSMA/CD
Figure 13 Collision and abortion in CSMA/CD
Example 5

A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum propagation time

(including the delays in the devices and ignoring the time needed to send a jamming signal, as we

see later) is 25.6 μs, what is the minimum size of the frame?

Solution

The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in the worst case, a station

needs to transmit for a period of 51.2 μs to detect the collision. The minimum size of the frame is 10

Mbps × 51.2 μs = 512 bits or 64 bytes. This is actually the minimum size of the frame for Standard

Ethernet.

12.31
Figure 14 Flow diagram for the CSMA/CD

12.32
Figure 15 Energy level during transmission, idleness, or collision

12.33
Figure 16 Timing in CSMA/CA

12.34
Note

In CSMA/CA, the IFS can also be used to define the priority of a

station or a frame.

12.35
Note

In CSMA/CA, if the station finds the channel busy, it does not restart

the timer of the contention window;

it stops the timer and restarts it when the channel becomes idle.

12.36
Figure 17 Flow diagram for CSMA/CA

12.37
CONTROLLED ACCESS

In controlled access, the stations consult one another


to find which station has the right to send. A station
cannot send unless it has been authorized by other
stations. We discuss three popular controlled-access
methods.

Topics discussed in this section:

Reservation

Polling

Token Passing

12.38
Figure 18 Reservation access method

12.39
Figure 19 Select and poll functions in polling access method

12.40
Figure 20 Logical ring and physical topology in token-passing access method

12.41
CHANNELIZATION

Channelization is a multiple-access method in which


the available bandwidth of a link is shared in time,
frequency, or through code, between different stations.
In this section, we discuss three channelization
protocols.

Topics discussed in this section:

Frequency-Division Multiple Access (FDMA)

Time-Division Multiple Access (TDMA)

Code-Division Multiple Access (CDMA)

12.42
Note

We see the application of all these methods in Chapter 16 when

we discuss cellular phone systems.

12.43
Figure 21 Frequency-division multiple access (FDMA)

12.44
Note

In FDMA, the available bandwidth

of the common channel is divided into bands that are separated by

guard bands.

12.45
Figure 22 Time-division multiple access (TDMA)

12.46
Note

In TDMA, the bandwidth is just one channel that is timeshared

between different stations.

12.47
Note

In CDMA, one channel carries all transmissions simultaneously.

12.48
Figure 23 Simple idea of communication with code

12.49
Centralized medium access
Idea: Have a central station control when a node may access the medium
◦ Example: Polling, centralized computation of TDMA schedules
◦ Advantage: Simple, quite efficient (e.g., no collisions), burdens the central station

Not directly feasible for non-trivial wireless network sizes


But: Can be quite useful when network is somehow divided into smaller groups
◦ Clusters, in each cluster medium access can be controlled centrally – compare
Bluetooth piconets, for example
! Usually, distributed medium access is considered
Schedule- vs. contention-based MACs
Schedule-based MAC
◦ A schedule exists, regulating which participant may use which resource at which time (TDMA component)
◦ Typical resource: frequency band in a given physical space (with a given code, CDMA)
◦ Schedule can be fixed or computed on demand
◦ Usually: mixed – difference fixed/on demand is one of time scales
◦ Usually, collisions, overhearing, idle listening no issues
◦ Needed: time synchronization!

Contention-based protocols
◦ Risk of colliding packets is deliberately taken
◦ Hope: coordination overhead can be saved, resulting in overall improved efficiency
◦ Mechanisms to handle/reduce probability/impact of collisions required
◦ Usually, randomization used somehow
Distributed, contention-based MAC
Basic ideas for a distributed MAC
◦ ALOHA – not good in most cases
◦ Listen before talk (Carrier Sense Multiple Access, CSMA) – better, but suffers from sender not knowing
what is going on at receiver, might destroy packets despite first listening for a

! Receiver additionally needs some possibility to inform possible senders in its vicinity about
impending transmission (to “shut them up” for this duration)

Hidden Also: recall


terminal exposed
scenario: terminal
scenario
Main options to shut up senders
Receiver informs potential interferers while a reception is on-going
◦ By sending out a signal indicating just that
◦ Problem: Cannot use same channel on which actual reception takes place
! Use separate channel for signaling
◦ Busy tone protocol

Receiver informs potential interferers before a reception is on-going


◦ Can use same channel
◦ Receiver itself needs to be informed, by sender, about impending transmission
◦ Potential interferers need to be aware of such information, need to store it
Receiver informs interferers before
transmission – MACA
Sender B asks receiver C whether C is able to A B C D

receive a transmission
Request to Send (RTS) RTS

Receiver C agrees, sends out a Clear to Send CTS


(CTS)
Potential interferers overhear either RTS or Data

CTS and know about impending transmission NAV indicates


and for how long it will last busy medium

NAV indicates
◦ Store this information in a Network Allocation busy medium

Vector Ack

B sends, C acks
! MACA protocol (used e.g. in IEEE 802.11)
RTS/CTS
RTS/CTS improve, but do not solve A B C D A B C D
hidden/exposed terminal problems
RTS RTS

RTS
CTS CTS
RTS

Data RTS Data CTS

CTS Data

Ack
MACA Problem: Idle listening
Need to sense carrier for RTS or CTS packets
◦ In some form shared by many CSMA variants; but e.g. not by busy tones
◦ Simple sleeping will break the protocol

IEEE 802.11 solution: ATIM windows & sleeping


◦ Basic idea: Nodes that have data buffered for receivers send traffic indicators at pre-arranged points in
time
◦ Receivers need to wake up at these points, but can sleep otherwise

Parameters to adjust in MACA


◦ Random delays – how long to wait between listen/transmission attempts?
◦ Number of RTS/CTS/ACK re-trials?

You might also like