Download as pdf or txt
Download as pdf or txt
You are on page 1of 69

Computer Networks

(IT-503)

By: Jigyasu Dubey


Department of Information
Technology
The MAC Sublayer
The Channel Allocation Problem

• Static Channel Allocation in LANs and


MANs
• Dynamic Channel Allocation in LANs and
MANs

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 3
Dynamic Channel Allocation in LANs and MANs

Five Key Assumptions:


 Station Model.

 Single Channel Assumption.

 Collision Assumption.

 (a) Continuous Time.


(b) Slotted Time.

 (a) Carrier Sense.


(b) No Carrier Sense.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 4
Station Model

 Model consist of N independent stations


 Generate Frames for transmission
 Sometimes called terminals
 The probability of a frame being generated in an
interval of length ∆t is λ ∆t
 Where λ is constant: the arrival rate of new frames
 Once a frame has been generated, the station is
blocked and does nothing until the frame has been
successfully transmitted.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 5
Single Channel Assumption

 A single channel is available for all


communication
 All stations can transmit on it and all can receive
from it
 H/W concerned, all stations are equivalent
 Protocol software may assign priorities to them

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 6
Collision Assumption

 If two frames are transmitted simultaneously, they


overlap in time and the resulting signal is garbled.
 Called as collision.
 All stations can detect collisions.
 A collided frame must be transmitted again later.
 There are no errors other than those generated by
collisions.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 7
Continuous Time & Slotted Time.

 Continuous Time :
 Frame transmission can begin at any instant.
 No master clock dividing time into discrete intervals.
 Slotted Time
 Time is divided into discrete intervals
 Frame transmissions always begin at the start of a slot.
 A slot may contain 0,1, or more frames, corresponding
to an idle slot, a successful transmission, or a collision.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 8
Carrier Sense & No Carrier Sense

 Carrier Sense
 Stations can tell if the channel is in use before trying to use
it.
 If the channel is sensed as busy, no station will attempt to
use it until it goes idle.
 No Carrier Sense
 Stations can not sense the channel before trying to use it.
 They just go ahead and transmit.
 Only later can they determine whether the transmission was
successful.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 9
Multiple Access Protocols

• ALOHA
• Carrier Sense Multiple Access Protocols
• Collision-Free Protocols
• Limited-Contention Protocols
• Wavelength Division Multiple Access
Protocols
• Wireless LAN Protocols
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 10
ALOHA
ALOHA

 Two Versions of ALOHA


 Pure

 Slotted

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 12
ALOHA

 They differ with respect to whether time


is divided into discrete slots into which
all frames must fit.
 Pure Aloha does not require global time
synchronization; slotted ALOHA does.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 13
Pure Aloha

 Basic idea of ALOHA is simple


 Users transmit whenever they have data to be
sent.
 There will be collisions and the colliding frames
will be damaged
 Sender can find out its frame was destroyed by
listening to the channel- Feedback property

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 14
Pure Aloha

 If the frame was destroyed, the sender just waits a


random amount of time and sends it again.
 The waiting time must be random.
 System in which multiple users share a common
channel in a way that can lead to conflicts are
widely known as contention systems.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 15
Pure ALOHA

In pure ALOHA, frames are transmitted at completely arbitrary times.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 16
 The throughput of ALOHA system is maximized by
having a uniform frame size rather than by allowing
variable length frames.
 Two frames try to occupy the channel at the same time
 Result in collision
 Both will be garbled
 If the 1st bit of a new frame overlaps with just the last bit
of a frame almost finished
 Both frames will be totally destroyed
 Both will have to retransmitted later.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 17
Efficiency of ALOHA

 Frame time – amount of time needed to transmit


standard fixed-length frame ( l / b )
 Users generate new frames with mean N frames
per frame time (Poisson)
 If N > 1, user generate frames at higher rate than
channel handle
 Every frame will suffer collision
 For reasonable throughput 0 < N < 1

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 18
Efficiency of ALOHA

 Stations also generate retransmission


 Frame transmission per frame time = G ( Old +
New)
 Clearly G ≥ N
 At low load N ≈ 0 , so G ≈ N [few collision hence
few retransmission]
 At high load G > N [many collisions]

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 19
 Under all loads throughput S
= Offered load X Probability of a
transmission succeeding

 S = G * P0

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 20
Pure ALOHA

Vulnerable period for the shaded frame.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 21
 A frame will not suffer collision if no other
frames are sent within one frame time

 The probability that K frames are generated


during a given frame time is given by the Poisson
distribution:
Pr[k] = Gk e-G / k!

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 22
 Pr[k] = Gk e-G / k!
 So the probability of zero frames generated:
P0 = G0 e-G / 0!
P0 = e-G
 In an interval two frame times long, mean no. of
frame generated = 2G
 Probability of no other traffic generated during
two frame time
P0 = e-2G
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 23
 Using S = G * P0
 S = G * e-2G
 The max through put occur at G=0.5
 S = 1/2e
 0.184
 Only 18% channel utilization

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 24
Pure ALOHA (3)

Throughput versus offered traffic for ALOHA


systems.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 25
Slotted Aloha

 Double capacity of an ALOHA system


 Divide time into discrete intervals,
 Each interval corresponding to one frame
 Requires the user to agree on slot boundaries,
 To achieve synchronization
 To have one special station emit a pip at the start of
each interval, like a clock.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 26
 To send data it required to wait for the beginning
of the next slot
 The continuous pure ALOHA is turned into a
discrete one.
 S = G * e-G
 S = 1/e about 0.368
 37% utilization

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 27
Carrier Sense Multiple
Access Protocols
 In ALOHA best channel utilization 1/e
 Stations transmitting at will, without paying
attention to what the other stations are doing
 In LAN it is possible for station to detect what
other stations are doing
 Protocols in which stations listen for a carrier and
act accordingly are called carrier sense
protocols.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 29
Persistent and Nonpersistent
CSMA
1-persistent CSMA

 When a station has data to send, it first listen to


the channel to see if any one else is transmitting at
that moment
 If the channel is busy, the station waits until it
becomes idle
 When the station detects an idle channel, it
transmits a frame

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 31
 If a collision occurs , the station waits a random
amount of time and start all over again
 The protocol is called 1-persistent because the
station transmits with a probability of 1 when it
finds the channel idle.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 32
 Propagation delay has an important effect on the
performance
 Longer the propagation delay, worse the
performance
 If the propagation delay is zero, there will still be
collisions
 Protocol is better than pure ALOHA

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 33
Nonpersistent CSMA

 A conscious attempt is made


 Before sending , a station senses the channel
 If channel is idle send the data
 If channel is already in use, the station does not
continually sense it
 It waits a random period of time and then repeats
the algorithm

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 34
P-persistent CSMA

 It applies to slotted channel


 Before sending data station senses the channel
 If it is idle , it transmits with a probability p
 with a probability q=1-p , it defer until the next
slot

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 35
Persistent and Nonpersistent CSMA

Comparison of the channel utilization versus


load for various random access protocols.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 36
CSMA with Collision Detection

 Persistent and nonpersistent CSMA are


improvement over ALOHA
 They ensure that no station begins to transmit
when it senses the channel busy
 Another improvement is for stations to abort their
transmissions as soon as they detect a collision

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 37
CSMA with Collision Detection

 If two stations sense the channel to be idle


 Begin transmitting simultaneously
 Both detect the collision almost immediately
 Rather than finish transmitting their frames
 They should abruptly stop transmitting as soon as
the collision is detected
 Quickly terminating damaged frames saves time
and bandwidth

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 38
 This protocol is known as CSMA/CD
 Widely used on LANs in the MAC sublayer
 Basis of the popular Ethernet LAN

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 39
CSMA with Collision Detection

CSMA/CD can be in one of three states:


contention, transmission, or idle.
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 40
 Collision detection is an analog process
 Station ‘s hardware must listen to the cable while
it is transmitting
 If what it reads back is different from what it is
putting out, it knows that a collision is occurring
 CSMA/CD with a single channel is inherently a
half-duplex system

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 41
Wireless LAN Protocols
 A system of notebook computers that
communicate by radio can be regarded as a
wireless LAN
 Wireless LANs have different properties than
conventional LANs
 Requires special MAC sub layer protocol

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 43
 When a receiver is within range of two active
transmitters, the resulting signal will be corrupted
and useless.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 44
Hidden Station Problem

 The problem of a station not being able to detect a


potential competitor for the medium because the
competitor is too far away is called the Hidden
Station Problem.
 Exposed Station Problem

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 45
 The problem is that before starting a transmission,
a station really wants to know whether there is
activity around the receiver.
 In a system based on short-range radio waves,
multiple transmissions can occur simultaneously
if they all have different destinations and these
destinations are out of range of one another.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 46
Wireless LAN Protocols

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


transmitting.
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 47
Wireless LAN Protocols

 MACA (Multiple Access with collision


Avoidance)
 MACAW (MACA for Wireless)

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 48
MACA

 Sender stimulate the receiver into outputting a


short frame, so stations nearby can detect this
transmission and avoid transmitting for the
duration of the upcoming (large) data frame.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 49
MACA

 A starts by sending an RTS (request To Send)


frame to B
 This short frame contains the length of the data
frame that will eventually follow
 B replies with a CTS (Clear to Send) frame
 CTS frame contains the data length
 Upon receipt of the CTS frame, A begins
transmission.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 50
 Any station hearing the RTS is clearly close to A
 Must remain silent long enough for the CTS to be
transmitted back to A without conflict.
 Any station hearing the CTS is clearly close to B
and must remain silent during the upcoming data
transmission

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 51
Wireless LAN Protocols

The MACA protocol. (a) A sending an RTS to B.


(b) B responding with a CTS to A.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 52
MACA for Wireless

 Introduce an ACK frame after each successful


data frame

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 53
ETHERNET
Ethernet Cabling

The most common kinds of Ethernet cabling.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 55
Ethernet Cabling (2)

Three kinds of Ethernet cabling.


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

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 56
Ethernet Cabling (3)

Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d)


Segmented.
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 57
Ethernet Cabling (4)

(a) Binary encoding, (b) Manchester encoding,


(c) Differential Manchester encoding.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 58
Ethernet MAC Sublayer Protocol

Frame formats. (a) DIX Ethernet, (b) IEEE 802.3.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 59
Ethernet MAC Sublayer Protocol (2)

Collision detection can take as long as 2 .


Computer Networks (IT 503), SVITS,
10/8/2012 Indore 60
Fast Ethernet

The original fast Ethernet cabling.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 61
IEEE 802.2: Logical Link Control

(a) Position of LLC. (b) Protocol formats.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 62
Wireless LANs

• The 802.11 Protocol Stack


• The 802.11 Physical Layer
• The 802.11 MAC Sublayer
Protocol
• The 802.11 Frame Structure
• Services
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 63
The 802.11 Protocol Stack

Part of the 802.11 protocol stack.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 64
The 802.11 MAC Sublayer Protocol

(a) The hidden station problem.


(b) The exposed station problem.
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 65
The 802.11 MAC Sublayer Protocol
(2)

The use of virtual channel sensing using


CSMA/CA.
Computer Networks (IT 503), SVITS,
10/8/2012 Indore 66
The 802.11 MAC Sublayer Protocol
(3)
A fragment burst.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 67
The 802.11 MAC Sublayer Protocol
(4)

Interframe spacing in 802.11.


Computer Networks (IT 503), SVITS,
10/8/2012 Indore 68
The 802.11 Frame Structure

The 802.11 data frame.

Computer Networks (IT 503), SVITS,


10/8/2012 Indore 69

You might also like