Wireless Application Protocol Random Assignment Protocols.

47
Wireless Application Protocol Random Assignment Protocols

Transcript of Wireless Application Protocol Random Assignment Protocols.

Page 1: Wireless Application Protocol Random Assignment Protocols.

Wireless Application Protocol

Random Assignment Protocols

Page 2: Wireless Application Protocol Random Assignment Protocols.

Random Assignment Protocols

In fixed-assignment schemes, each communicating node is assigned a frequency band in FDMA systems or a time slot in TDMA systems. This assignment is static, however, regardless of whether or not the node has data to transmit. These schemes may therefore be inefficient if the traffic source is bursty. In the absence of data to be transmitted, the node remains idle, thereby resulting in the allocated bandwidth to be wasted. Random assignment strategies attempt to address this shortcoming by eliminating preallocation of bandwidth to communicating nodes.

Page 3: Wireless Application Protocol Random Assignment Protocols.

Random Assignment Protocols

In a random access method, each station has the right to the medium without being controlled by any other station. However, if more than one station tries to send, there is an access conflict-collision-and the frames will be either destroyed or modified. To avoid access conflict or to resolve it when it happens, each station follows a procedure that answers the following questions:

o When can the station access the medium? o What can the station do if the medium is busy? o How can the station determine the success or failure of the

transmission? o What can the station do if there is an access conflict?

Page 4: Wireless Application Protocol Random Assignment Protocols.

Random Assignment Protocols

Random assignment strategies do not exercise any control to determine which communicating node can access the medium next. Furthermore, these strategies do not assign any predictable or scheduled time for any node to transmit. To deal with collisions,the protocol must include a mechanism to detect collisions and a scheme to schedule colliding packets for subsequent retransmissions.

ALOHA CSMA CSMA/CD

Page 5: Wireless Application Protocol Random Assignment Protocols.

Random Access

Random Access Methods– more efficient way of managing medium access for

communicating short bursty messages in contrast to fixed-access schemes, each user gains access to

medium only when needed -has some data to send drawback: users must compete to access the medium (‘random

access’) collision of contending transmissions

Random Access Methods in Wireless Networks– can be divided into two groups:

ALOHA based-no coordination between users carrier-sense based-indirect coordination -users sense

availability of medium before transmitting

Page 6: Wireless Application Protocol Random Assignment Protocols.

Random AccessCollision Period

User 1

User 2

User 3

User 4

Time

rescheduled

Page 7: Wireless Application Protocol Random Assignment Protocols.

ALOHA-based Random Access

user accesses medium as soon as it has a packet ready to transmit

– after transmission, user waits a length of time > round-trip delay in the network, for an ACK from the receiver

– if no ACK arrives, user waits a random interval of time (to avoid repeated collision) and retransmits

advantages: – simple, no synchronization among users required

disadvantages: – low throughput under heavy load conditions– probability of collision increases as number of users increases

max throughput = 18% of channel capacity

Page 8: Wireless Application Protocol Random Assignment Protocols.

Pure-ALOHA

Page 9: Wireless Application Protocol Random Assignment Protocols.

Pure-ALOHA

A collision involves two or more stations. If all these stations try to resend their frames after the time-out, the frames will collide again. Pure ALOHA dictates that when the time-out period passes, each station waits a random amount of time before resending its frame. The randomness will help avoid more collisions. We call this time the back-off time TB.

Pure ALOHA has a second method to prevent congesting the channel with retransmitted frames. After a maximum number of retransmission attempts Kmax' a station must give up and try later. Figure shows the procedure for pure ALOHA based on the above strategy.

Page 10: Wireless Application Protocol Random Assignment Protocols.

Pure-ALOHA

Page 11: Wireless Application Protocol Random Assignment Protocols.

Pure-ALOHA

The time-out period is equal to the maximum possible round-trip propagation delay,which is twice the amount of time required to send a frame between the two most widely separated stations (2 x Tp)' The back-off time TB is a random value that normally depends on K (the number of attempted unsuccessful transmissions).

The formula for TB depends on the implementation. One common formula is the binary exponential back-method,

In this method for each retransmission, a multiplier in the range 0 to 2powK - 1 is randomly chosen and multiplied by Tp (maximum propagation time) the average time required to send out a frame to find TB' Note that in this procedure, the range of the random numbers increases after each collision. The value of Kmax is usually chosen as 15.off. In this

Page 12: Wireless Application Protocol Random Assignment Protocols.

The stations on a wireless ALOHA network are a maximum of 600 km apart. If we assume that signals propagate at 3 × 108 m/s, we find Tp = (600 × 105 ) / (3 × 108 ) = 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

Page 13: Wireless Application Protocol Random Assignment Protocols.

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.

Example cont…

Page 14: Wireless Application Protocol Random Assignment Protocols.

Pure-ALOHA

Vulnerable time Let us find the length of time, the vulnerable time, in which there is a possibility of collision. We assume that the stations send fixed-length frames with each frame taking TfrS to send. Figure shows the vulnerable time for station A.

Page 15: Wireless Application Protocol Random Assignment Protocols.

Figure Vulnerable time for pure ALOHA protocol

Page 16: Wireless Application Protocol Random Assignment Protocols.

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?

Example

SolutionAverage 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.

Page 17: Wireless Application Protocol Random Assignment Protocols.

Throughput

To assess Pure ALOHA, we need to predict its throughput, the rate of (successful) transmission of frames. First, let's make a few simplifying assumptions:

All frames have the same length. Stations cannot generate a frame while transmitting or trying to transmit.

(That is, if a station keeps trying to send a frame, it cannot be allowed to generate more frames to send.)

The population of stations attempts to transmit (both new frames and old frames that collided) according to a Poisson distribution.

Let "T" refer to the time needed to transmit one frame on the channel, and let's define "frame-time" as a unit of time equal to T. Let "G" refer to the mean used in the Poisson distribution over transmission-attempt amounts: that is, on average, there are G transmission-attempts per frame-time.

Page 18: Wireless Application Protocol Random Assignment Protocols.

Throughput

Consider what needs to happen for a frame to be transmitted successfully. Let "t" refer to the time at which we want to send a frame. We want to use the channel for one frame-time beginning at t, and so we need all other stations to refrain from transmitting during this time. Moreover, we need the other stations to refrain from transmitting between t-T and t as well, because a frame sent during this interval would overlap with our frame.

For any frame-time, the probability of there being k transmission-attempts during that frame-time is:

Page 19: Wireless Application Protocol Random Assignment Protocols.

Throughput

The average amount of transmission-attempts for 2 consecutive frame-times is 2G. Hence, for any pair of consecutive frame-times, the probability of there being k transmission-attempts during those two frame-times is:

Page 20: Wireless Application Protocol Random Assignment Protocols.

Throughput

Therefore, the probability () of there being zero transmission-attempts between t- and t+T (and thus of a successful transmission for us) is:

Page 21: Wireless Application Protocol Random Assignment Protocols.

Throughput

The throughput can be calculated as the rate of transmission-attempts multiplied by the probability of success, and so we can conclude that the throughput () is:

Page 22: Wireless Application Protocol Random Assignment Protocols.

Throughput

Throughput Let us call G the average number of frames generated by the system during one frame transmission time. Then it can be proved that the average number of successful transmissions for pure ALOHA is

S = G × e −2G

The maximum throughput

Smax = 0.184 when G= (1/2)

Page 23: Wireless Application Protocol Random Assignment Protocols.

The throughput for pure ALOHA is S = G × e −2G .

The maximum throughputSmax = 0.184 when G= (1/2).

Note

Throughput

Page 24: Wireless Application Protocol Random Assignment Protocols.

A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is the throughput if the system (all stations together) producesa. 1000 frames per second b. 500 frames per secondc. 250 frames per second.

Example

SolutionThe 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 S = G× e−2 G or S = 0.135 (13.5 percent). This means that the throughput is 1000 × 0.135 = 135 frames. Only 135 frames out of 1000 will probably survive.

Page 25: Wireless Application Protocol Random Assignment Protocols.

Example(continued)

b. If the system creates 500 frames per second, this is (1/2) frame per millisecond. The load is (1/2). In this case S = G × e −2G or S = 0.184 (18.4 percent). This means that the throughput is 500 × 0.184 = 92 and that only 92 frames out of 500 will probably survive. Note that this is the maximum throughput case, percentage wise.

c. If the system creates 250 frames per second, this is (1/4) frame per millisecond. The load is (1/4). In this case S = G × e −2G or S = 0.152 (15.2 percent). This means that the throughput is 250 × 0.152 = 38. Only 38 frames out of 250 will probably survive.

Page 26: Wireless Application Protocol Random Assignment Protocols.

Slotted ALOHA

time is divided into equal time slots –when a user has a packet to transmit, the packet is buffered and transmitted at the start of the next time slot

– BS transmits a beacon signal for timing, all users must synchronize their clocks

advantages: – partial packet collision avoided

Disadvantages– throughput still quite low!– there is either no collision or a complete collision

max throughput = 36% of channel capacity

Page 27: Wireless Application Protocol Random Assignment Protocols.

Slotted ALOHA

Page 28: Wireless Application Protocol Random Assignment Protocols.

Slotted ALOHA: Throughput

The throughput for Slotted ALOHA is

S = G × e−G

where G is the average number of frames requested per frame-time

The maximum throughput– Smax = 0.368 when G= 1

Page 29: Wireless Application Protocol Random Assignment Protocols.

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) producesa. 1000 frames per second b. 500 frames per secondc. 250 frames per second.

Example

SolutionThe 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 S = G× e−G 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.

Page 30: Wireless Application Protocol Random Assignment Protocols.

Example (continued)

b. If the system creates 500 frames per second, this is (1/2) frame per millisecond. The load is (1/2). In this case S = G × e−G 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 S = G × e −G 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.

Page 31: Wireless Application Protocol Random Assignment Protocols.

Reservation ALOHA

Time slots are divided into reservation and transmission slots / periods

– during reservation period, stations can reserve future slots in transmission period

– reservation slot size << transmission slot size– collisions occur only in reservation slots

advantages: – higher throughput under heavy loads– max throughput up to 80% of channel capacity

disadvantages: – more demanding on users as they have to obtain / keep ‘reservation list’ up-

to-date R-Aloha is most commonly used in satellite systems satellite collects requests, complies ‘reservation list’ and finally sends

the list back to users

Page 32: Wireless Application Protocol Random Assignment Protocols.

R-ALOHA

Page 33: Wireless Application Protocol Random Assignment Protocols.

Carrier Sense Multiple Access with Collision Detect (CSMA/CD)

With CSMA/CD, when an Ethernet device attempts to access the network to send data, the network interface on the workstation or server checks to see if the network is quiet. When the network is clear, the network interface knows that transmission can begin. If it does not sense a carrier, the interface waits a random amount of time before retrying. If the network is quiet and two devices try sending data at the same time, their signals collide. When this collision is detected, both devices back off and wait a random amount of time before retrying,

Page 34: Wireless Application Protocol Random Assignment Protocols.

CSMA/CD Operation

Carrier sense— Each computer on the LAN is always listening for traffic on the wire to determine when gaps between frame transmissions occur.

Multiple access— Any computer can begin sending data whenever it detects that the network is quiet. (There is no traffic.)

Collision detect— If two or more computers in the same CSMA/CD network collision domain begin sending at the same time, the bit streams from each sending computer interfere, or collide, with each other, making each transmission unreadable. If this collision occurs, each sending computer must be able to detect that a collision has occurred before it has finished sending its frame.

Each computer must stop sending its traffic as soon as it has detected the collision and then wait some random length of time, called the back-off algorithm, before attempting to retransmit the frame.

Page 35: Wireless Application Protocol Random Assignment Protocols.

CSMA/CD: Flow Diagram

Page 36: Wireless Application Protocol Random Assignment Protocols.

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?

Example

SolutionThe 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.

Page 37: Wireless Application Protocol Random Assignment Protocols.

Carrier Sense Multiple Access (CSMA)

Disadvantages of ALOHA – users do not listen to the channel before (and while)

transmitting– suitable for networks with long propagation delays

Carrier Sense Multiple Access– polite version of ALOHA– Listen to the channel before transmitting

if sensed channel busy, back-off (defer transmission), and sense channel again after a random amount of time

if channel idle, transmit entire frame

Page 38: Wireless Application Protocol Random Assignment Protocols.

Versions of CSMA

Employs different node behaviour when channel found busy

– non-persistent CSMA– persistent CSMA– 1-persistent CSMA– p-persistent CSMA

Page 39: Wireless Application Protocol Random Assignment Protocols.

Persistence Methods

What should a station do if the channel is busy? What should a station do if the channel is idle? 4 methods have been devised to answer these questions: the I-persistent method, the nonpersistent method, and the p-persistent method. Figure shows the behavior of three persistence methods when a station finds a channel busy.

Persistent:- station sense the channel, if channel is ideal it transmits data. if there is already some traffic going on that it does not transmit the data. Keep sensing.

Page 40: Wireless Application Protocol Random Assignment Protocols.

CSMA: Persistence Methods

Behavior of 1-persistent, Nonpersistent, p-persistent method

Page 41: Wireless Application Protocol Random Assignment Protocols.

Persistence Methods

I-Persistent The I-persistent method is simple and straightforward. In this method,after the station finds the line idle, it sends its frame immediately (with probability I).This method has the highest chance of collision because two or more stations may find the line idle and send their frames immediately.

Nonpersistent:- In the nonpersistent method, a station that has a frame to send senses the line. If the line is idle, it sends immediately. If the line is not idle, it waits a random amount of time and then senses the line again. The nonpersistent approach reduces the chance of collision because it is unlikely that two or more stations will wait the same amount of time and retry to send simultaneously. However, this method reduces the efficiency of the network because the medium remains idle when there may be stations with frames to send.

Page 42: Wireless Application Protocol Random Assignment Protocols.

Persistence Methods

p-Persistent :- The p-persistent method is used if the channel has time slots with a slot duration equal to or greater than the maximum propagation time. The p-persistent approach combines the advantages of the other two strategies. It reduces the chance of collision and improves efficiency. In this method, after the station finds the line idle it follows these steps:

1. With probability p, the station sends its frame. 2. With probability q = 1 - p, the station waits for the beginning of the

next time slot and checks the line again. a. If the line is idle, it goes to step 1. b. If the line is busy, it acts as though a collision has occurred and uses

the backoff procedure

Page 43: Wireless Application Protocol Random Assignment Protocols.

Flow diagram for 1-persistent, Nonpersistent, p-persistent method

Page 44: Wireless Application Protocol Random Assignment Protocols.

CSMA/CA (Collision Avoidance)

Invented for wireless network where we cannot detect collisions Collision are avoided through the use of CSMA/CA’s three strategies: the interframe space, the contention windows, and acknowledgement

IFS can also be used to define the priority of a station or a frame 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

Page 45: Wireless Application Protocol Random Assignment Protocols.

CSMA / Collision Avoidance

Used where CSMA/CD cannot be used – e.g. in wireless medium collision cannot be easily detected as

power of transmitting overwhelms receiving antenna– CSMA/CA is designed to reduce collision probability at points

where collisions would most likely occur when medium has become idle after a busy state, as several users

could have been waiting for medium to become available– key elements of CSMA/CA:

IFS –interframe spacing –priority mechanism–the shorter the IFS the higher the priority for transmission

CW intervals –contention window –intervals used for contention and transmission of packet frames

Backoff counter–used only if two or more stations compete for transmission

Page 46: Wireless Application Protocol Random Assignment Protocols.

CSMA/CA Algorithm

Frame totransmit

MediumIdle?

Wait IFS

StillIdle?

Transmit frameExp b/o whileMedium idle

Wait until Trans ends

Wait IFS

Transmit frame

StillIdle?

No

Yes

NoNo

YesYes

If medium becomes busy during the backoff time, the backoff timer is halted and

resumes when the medium becomes idle.

Page 47: Wireless Application Protocol Random Assignment Protocols.

Example