Computer Networks-MAC

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 10

MEDIUM ACCESS CONTROL SUBLAYER (MAC)

Networks can be categories in to two ways


a) Point to point b) Broad cast channel

- In broadcast network, the key issue is how to share the channel among several users.
- Ex a conference call with five people
-Broadcast channels are also called as multi-access channels or random access channels.
-Multi-access channel belong to a sublayer at the DL layer called the MAC sublayer.
The Channel Allocation problem:

a) Static channel allocation in LANs & MANs


i) FDM ii) TDM

Drawbacks: -1) Channel is wasted if one or more stations do not send data.
2) If users increases this will not support.

b) Dynamic channel allocation

i) Pure ALOHA & Slotted ALOHA


CSMA/CD
ii) CSMA
CSMA/CA
Pure ALOHA
-1970’s Norman Abramson end his colleagues devised this method, used ground –based radio
broad costing. This is called the ALOHA system.
-The basic idea, many users are competing for the use of a single shared channel.
-There are two versions of ALOHA: Pure and Slotted.
-Pure ALOHA does not require global time synchronization, where as in slotted ALOHA the time
is divided into discrete slots into which all frames must fit.
-Let users transmit whenever they have data to be sent.
-There will be collisions and all collided frames will be damaged.
-Senders will know through feedback property whether the frame is destroyed or not by listening
channel.
1
[-With a LAN it is immediate, with a satellite, it will take 270m sec.]
-If the frame was destroyed, the sender waits random amount of time and again sends the frame.
-The waiting time must be random otherwise the same frame will collide over and over. USER

TIME
Frames are transmitted at completely arbitrary times
-Whenever two frames try to occupy the channel at the same time, there will be a collision and
both will be destroyed.
-We have to find out what is the efficiency of an ALOHA channel?
-Let the ‘Frame time’ denotes the time required to transmit one fixed length frame.
-Assume that infinite populations of users are generating new frames according to possion
distribution with mean N frames per frame time.
-If N>1 users are generating frames at a higher rate than the channel can handle.
-For reasonable throughput 0<N<1.
-In addition to new frames, the station also generates retransmission of frames.
-Old and new frames are G per frame time.
-G> N
-At low load there will be few collisions, so G ~ N

2
-Under all loads, the throughput S = GPo, where Po is the probability that a frame does not suffer a
collision.
-A frame will not suffer a collision if no other frames are sent with one frame time of its start.
-Let ‘t’ be the time required to send a frame.
-If any other user has generated a frame between time to and to+t, the end of that frame will collide
with the beginning of the shaded frame.
-Similarly, any other frame started b/w to+t and to+2t will bump into the end of the shaded frame.
-The probability that ‘k’ frames are generated during a given frame time is given by the possion
distribution:

Pr[k] = Gke-G
k!
-The probability of zero frames is just e-G
-In an interval two frame times long, the mean number at frames generated is 2G.
-The probability at no other traffic being initiated during the entire vulnerable period is given by
Po = e-2G. Using S = GP0, we get S= Ge-2G
The Maximum through put occurs at G=0.5 with S=1/2e = 0.184
The channel utilization at pure ALOHA =18%.

Collides Collides
with the with the
start of the t end of the
shaded shaded
frame frame

3
to+t to+2t
to to+3t Time
Vulnerable

4
S (throughput per frame time)

0.368

0.184

Slotte
Pure
d ALO
ALO
0.5HA : 1.0
HAS :=
S = -G G (attempts per packet time)
Ge
Ge-G

Throughput versus offered traffic for ALOHA systems

Slotted ALOHA
-In 1972, Roberts’ devised a method for doubling the capacity of ALOHA system.
-In this system the time is divided into discrete intervals, each interval corresponding to one frame.

-One way to achieve synchronization would be to have one special station emit a pip at the start of
each interval, like a clock.
-In Roberts’ method, which has come to be known as slotted ALOHA, in contrast to Abramson’s
pure ALOHA; a computer is not permitted to send whenever a carriage return is typed.
-Instead, it is required to wait for the beginning of the next slot.
-Thus the continuous pure ALOHA is turned into a discrete one.
-Since the vulnerable period is now halved, the of no other traffic during the same slot as our test
frame is e-G which leads to
S = Ge –G
- At G=1, slotted ALOHA will have maximum throughput.
- So S=1/e or about 0.368, twice that of pure ALOHA.
- The channel utilization is 37% in slotted ALOHA.

5
CSMA-Carrier Sense Multiple Access Protocols

With slotted ALOHA the best channel utilization that can be achieved is 1/e. Protocols in which
stations listen for a carrier (i.e., a transmission) and act accordingly are called carrier sense
protocols. A number of them have been proposed. Kleinrock and Tobagi (1975) have analysed
several such protocols in detail. The several versions of the carrier sense protocols are given
below:
 Persistent CSMA
When a station has data to send, it first listens to the channel to see if any one else is transmitting
at that moment. If the channel is busy, the station waits until it become idle. When the station
detects an idle channel, it transmits a frame. If a collision occurs, the station waits a random
amount of time and starts all over again. The protocol is called 1- persistent also because the
station transmits with a probability of 1 when it finds the channel idle.
The propagation delay has an important effect on the performance of the protocol. The longer the
propagation delay the worse the performance of the protocol.
Even if the propagation delay is zero, there will be collisions. If two stations listen the channel,
that is idle at the same, both will send frame and there will be collision.

 Non persistent CSMA

A second carrier sense protocol is nonpersistent CSMA. In this protocol, a conscious attempt is
made to be less greedy than in the previous one. Before sending, a station senses the channel. If no
one else is sending, the station begins doing so itself. However, if the channel is already in use, the
station does not continually sense it for the purpose of seizing it immediately upon detecting the
end of the previous transmission. Instead, it waits a random period of time and then repeats the
algorithm. Consequently, this algorithm leads to better channel utilization but longer delays than 1-
persistent CSMA.

 P-persistent CSMA
The last protocol is p-persistent CSMA. It applies to slotted channels and works as follows. When a
station becomes ready to send, it senses the channel. If it is idle, it transmits with a probability p. With
a probability q = 1 - p, it defers until the next slot. If that slot is also idle, It either transmits or defers
again, with probabilities p and q. This process is repeated until either the frame has been transmitted or
another station has begun transmitting. In the latter case, the unlucky station acts as if there had been a
collision (i.e., it waits a random time and starts again). If the station initially senses the channel busy, it
6
waits until the next slot and applies the above algorithm. [

CSMA with Collision Detection(CSMA/CA)


In many wireless LANS, unlike wired LANS, the station has no idea whether the packet collided
with another packet or not until it receives an acknowledgement from receiver. In this situation,
collisions have a greater effect on performance than with CSMA/CD, where colliding packets can
be quickly detected and aborted. Thus, it makes sense to try to avoid collisions, if possible.
CSMA/CA is basically p-persistence, with the twist that when the medium becomes idle, a station
must wait for a time called the interframe spacing or IFS before contending for a slot. A station
gets a higher priority if it is allocated smaller inter frame spacing.
When a station wants to transmit data, it first checks if the medium is busy. If it is, it continuously
senses the medium, waiting for it to become idle. When the medium becomes idle, the station first
waits for an interframe spacing corresponding to its priority level, then sets a contention timer to a
time interval randomly selected in the range [0,CW], where CW is a predefined contention window
length. When this timer expires, it transmits a packet and waits for the receiver to send an ack. If
no ack is received, the packet is assumed lost to collision, and the source tries again, choosing a
contention timer at random from an interval twice as long as the one before(binary exponential
backoff). If the station senses that another station has begun transmission while it was waiting for
the expiration of the contention timer, it does not reset its timer, but merely freezer it, and restarts
the countdown when the packet completes transmission. In this way, stations that happen to choose
a longer timer value get higher priority in the next round of contention.

Collision-Free Protocols
A Bit-Map Protocol
In the basic bit-map method, each contention period consists of exactly N slots. If station 0 has a
frame to send, it transmits a 1 bit during the zeroth slot. No other station is allowed to transmit
during this slot. Regardless of what station 0 does, station 1 gets the opportunity to transmit a
1during slot 1, but only if it has a frame queued. In general, station j may announce the fact that it
has a frame to send by inserting a 1 bit into slot j. after all N slots have passed by, each station has
complete knowledge of which stations with to transmit.

7
8 Contention slots 8 Contention slots
Frames

0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
1 3
1 1 1 7 1 1 1 5

The basic bit-map protocol

Since everyone agrees on who goes next, there will never be any collisions. After the last ready
station has transmitted its frame, an event all stations can easily monitor, another N bit contention
period is begun. If a station becomes ready just after its bit slot has passed by, it is out of luck and
must remain silent until every station has had a chance and the bit map has come around again.
Protocols like this in which the desire to transmit is broadcast before the actual transmission are
called reservation protocols.

Binary Countdown
A problem with the basic bit-map protocol is that the overhead is 1 bit per station. A station
wanting to use the channel now broadcasts its address as a binary bit string, starting with the high-
order bit. All addresses are assumed to be the same length. The bits in each address position from
different stations are BOOLEAN ORed together. We will call this protocol binary countdown. It is
used in Datakit.
As soon as a station sees that a high-order bit position that is 0 in its address has been overwritten
with a 1, it gives up. For example, if station 0010,0100,1001, and 1010 are all trying to get the
channel, in the first bit time the stations transmit 0,0,1, and 1, respectively. Stations 0010 and 0100
see the 1 and know that a higher-numbered station is competing for the channel, so they give up
for the current round. Stations 1001 and 1010 continue.

8
The next bit is 0, and both stations continue. The next bit is 1, so station 1001 gives up. The winner
is station 1010, because it has the highest address. After winning the bidding, it may now transmit
a frame, after which another bidding cycle starts.
The binary countdown protocol. A dash indicates silence
Bit time
0 1 2 3

0010 0---

0100 0---

1001 100-

1010 1010
Result 1010

9
Stations 0010 Station 1001
and 0100 see sees this 1
this 1 and give and gives up
up

10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy