Medium Access Control (MAC)

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

Medium Access Control (MAC)

Multiple Access
 Data link layer divided into two functionality-
oriented sublayers
RANDOM ACCESS
 In random access or contention methods,
• No station is superior to another station and none is
assigned the control over another.
• 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.
 No scheduled time for a station to transmit
• Transmission is random among the stations
 No rules specify which station should send next
• Stations compete with one another to access the medium
 If more than one station tries to send, access conflict-collision-and
the frames destroyed.
• ALOHA …earliest random access method
pure ALOHA
 The simplest possible medium access protocol:
Just talk when you feel like it
 Contention system: Multiple users share a common channel that may
lead to conflicts
• Acknowledgement is used for error detection of a frame

• The time-out period..max. possible round-trip propagation delay

 If frame collision occurs, the sender waits a random amount of time


back-off time TB and sends it again
• The waiting time must be random or the same frames will collide

over and over


 Whenever two frames try to occupy the channel at the same time,
there will be a collision
 When the first bit of a new frame overlaps with just the last bit

of a frame almost finished, both frames will be totally


destroyed 4
How to choose random waiting time?
 The back-off time TB is a random value 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-off.
• For each retransmission, a multiplier in the range 0 to

2K - 1 is randomly chosen and multiplied by Tp


(maximum propagation time) or Tfr (the average time
required to send out a frame) to find TB
 The range of the random numbers increases after each
collision.
 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,
 Tp = (600 × 105 ) / (3 × 108 ) = 2 ms.
 Find the value of TB for different values of
K.
 For K = 1, the range is {0, 1}. The station needs to|
generate a random number with a value of 0 or 1.
• TB is either 0 ms (0 × 2) or 2 ms (1 × 2),
based on the outcome of the random variable
 For K = 2, the range is {0, 1, 2, 3}.
• TB can be 0, 2, 4, or 6 ms, based on the outcome of the
random variable.
 For K = 3, the range is {0, 1, 2, 3, 4, 5, 6, 7}.
• TB can be 0, 2, 4, . . . , 14 ms, based on the
outcome of the random variable.
Vulnerable time for pure ALOHA
 A packet X is destroyed by another packet either
• Starting up to one packet time before X
• Starting up to immediately before the end of X

 There is no rule that defines when the station can send.


• A station may send soon after another station has started or soon
before another station has finished.

7
Slotted ALOHA
 ALOHA’s problem: Long vulnerability period of a
packet
 Reduce it by introducing time slots – transmissions
may only start at the start of a slot
• Slot synchronization is assumed to be “somehow”

available
 Possibility of collision if two stations try to send at the
beginning of the same time slot.

8
Vulnerable time for slotted ALOHA
Carrier sensing
 (Slotted) ALOHA is simple, but not satisfactory
 The chance of collision can be reduced if a station
senses the medium before trying to use it.
 Be a bit more polite: Listen before talk
• Sense the carrier to check whether it is idle before
transmitting
• Carrier Sense Multiple Access (CSMA)
• Abstain from transmitting if carrier not idle (some
other sender is currently transmitting)
 Crucial question: How to behave in detail when
carrier is busy?
• In particular: WHEN to retry a transmission?
CSMA and propagation delay
 CSMA can reduce the possibility of collision, but it cannot
eliminate it.
 Possibility of collision still exists because of propagation
delay d
 Suppose two stations become ready to send at time t and
t+ = t 2
• At t, the channel is completely idle

• The stations are separated by a propagation delay d > 

 Second station cannot detect the already started


transmission of first station
• Will sense an idle channel, send, and collide (at each
other, or at a third station)
Vulnerable time in CSMA
 The vulnerable time for CSMA is the
propagation time Tp .
• This is the time needed for a signal to propagate from one end
of the medium to the other.
• When a station sends a frame, and any other station tries to
send a frame during this time, a collision will result.
• But if the first bit of the frame reaches the end of the medium,
every station will already have heard the bit and will refrain
from sending.
1-persistent CSMA
 When carrier is busy, wait until it is idle
 Then, immediately transmit
• “Persistent” waiting
• After the station finds the line idle, it sends its frame
immediately
 Obvious problem: if more than one station wants
to transmit, they are guaranteed to collide!
• Just too impatient…

 But certainly better than pure ALOHA or slotted


ALOHA
Non-persistent CSMA
 When channel is idle, transmit
 When channel is busy, wait a random time before checking
again whether the channel is idle
• Do not continuously monitor carrier to greedily grab it

once it is idle
• Conscious attempt to be less greedy

 Performance depends a bit on the random distribution used


for the waiting time
• But in general better throughput than persistent CSMA

for higher loads


• At low loads, random waiting is not necessary and

wasteful
15
p-persistent CSMA
 Combines ideas from persistent and non-persistent
CSMA
• Uses a slotted time model

 When channel is idle, send


 When channel is busy, continuously monitor it until it
becomes idle
• But then, do not always transmit immediately

• But flip a coin – transmit with probability p

• With probability 1-p, do not send and wait for the next

slot
• If channel is busy in the next slot, monitor for idleness
• Else, flip a coin again
Behavior of three persistence
methods
Collision detection – CSMA/CD
 When two packets collide, lots of time is wasted by completing
their transmission
 If it were possible to detect a collision when it happens,

transmission could be aborted and a new attempt made


• Wasted time reduced, no need to wait for (destroyed) packets

to complete
 Depending on physical layer, collisions can be detected!

• Necessary: Sender must be able to listen to the medium when

sending, compare what it sends with what it receives


• If different: declare a collision

! CSMA/CD – Carrier Sense Multiple Access/Collision Detection


What to do after a collision happens?
 Stations want to transmit their packets, despite detecting a collision
 Have to try again
• Immediately? Would again ensure another collision 

• Coordinate somehow? Difficult, no communication medium available

• Wait a random time!

 Randomization “de-synchronizes” medium access, avoids

collisions
 However: will result in some idle time, occasionally

! Alternation between contention and transmission phases

Not necessarily
slotted time!
Collision and abortion in
CSMA/CD

Minimum Frame Size = 2 × Tp


 A network using CSMA/CD has a bandwidth of 10 Mbps. If
the maximum propagation time 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.
Wired LANs: Ethernet
 Local area network (LAN) is a computer network
that is designed for a limited geographic area such
as a building or a campus
 Issues
• Cabling
• Physical layer
• MAC sublayer
IEEE standard for LANs
STANDARD ETHERNET
 The original Ethernet created in 1976 at Xerox’s Palo
Alto Research Center (PARC).
 Since then, it has gone through four generations.
MAC frame
 Destination address (DA). The DA field is 6 bytes and contains the
physical address of the destination station or stations to receive the
packet
 Source address (SA). The SA field is also 6 bytes and contains the
physical address of the sender of the packet.
 Length or type. define the number of bytes in the data field.
• Data. This field carries data encapsulated from the upper-layer protocols.
• It is aminimum of 46 and a maximum of 1500 bytes.

 CRC. The last field contains error detection information, CRC-32


Categories of Standard Ethernet
10Base5

10Base2

10Base-T
Standard Ethernet …cabling
FAST ETHERNET
 Fast Ethernet under the name IEEE 802.3u.
 Backward-compatible with Standard Ethernet,
but it can transmit data 10 times faster at a rate
of 100 Mbps.
 Topology
Fast Ethernet …cabling
GIGABIT ETHERNET
 Operate at 1000 Mbps.
 The IEEE 802.3z standard
Ten-Gigabit Ethernet
 Ten-Gigabit Ethernet operates only in full duplex
mode
 There is no need for contention; CSMA/CD is not
used in Ten-Gigabit Ethernet.
 The physical layer in Ten-Gigabit Ethernet is
designed for using fiber-optic cable over long
distances.
Twisted-Pair Cabling Overview
 A typical twisted-pair cable consists of four pairs
of copper wires, for a total of eight wires.
 Each side of the cable is terminated using an
RJ45 connector, which has eight pins.
 When the connector is crimped onto the cable,
these pins make contact with each wire
Twisted-Pair Cabling Overview
 A typical twisted-pair cable consists of four pairs of copper
wires, for a total of eight wires.
 Each side of the cable is terminated using an RJ45
connector, which has eight pins.
 When the connector is crimped onto the cable, these pins
make contact with each wire
 For communication to occur, transmit pins must connect to
the receive pins of the remote host.
Twisted-Pair Cabling Overview
 The crossover can be controlled either by the cable, or an
intermediary device, such as a hub or switch.
 There are three common types of twisted-pair cable:
• Straight-through cable
• Crossover cable
• Rollover cable
Twisted-Pair Cabling Overview
 Straight-Through Cable
 A straight-through cable is used in the following
circumstances:
 From a host to a hub
 From a host to a switch
 From a router to a hub
 From a router to a switch

 Essentially, a straight-through cable is used to connect


any device to a hub or switch, except for another
hub or switch.
Twisted-Pair Cabling Overview
 Crossover Cable
 A crossover cable is used in the following
circumstances:
• From a host to a host
• From a hub to a hub
• From a switch to a switch
• From a hub to a switch
• From a router to a router
 A hub or a switch will provide the crossover
function..
Twisted-Pair Cabling Overview
 Rollover Cable
 A rollover cable is used to connect a
workstation or laptop into a Cisco device’s
console or auxiliary port, for management
purposes.
 A rollover cable is often referred to as a console
cable,..

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