Professional Documents
Culture Documents
Mac Sblayer
Mac Sblayer
COMPUTER NETWORKS
Data-link Layer
(The Medium Access Control Sublayer)
MAC Sublayer
Questions to be answered ?
In broadcast networks, How the
channel is divided between competing
users?
What is Medium Access Control
(MAC)?
What protocols are used for
allocating a multiple access
channel ? Computer Networks
2
MAC Sublayer
MAC Sublayer
What is MAC?
- Medium Access Control (MAC) is a
sublayer of the Data-link layer.
- The protocols used to determine who goes
next on a multiaccess channel belongs to a
MAC sublayer.
- MAC is important in LAN which use a
multiaccess channel as the basis for
communication.
Computer Networks
MAC Sublayer
Computer Networks
Types of
MAC
Control:
Distributed.
Centralized.
Computer Networks
Contention-Based MAC
No control.
Stations try to acquire the medium.
Distributed in nature.
Computer Networks
MAC Protocols
Contention-based
ALOHA and Slotted ALOHA.
CSMA.
CSMA/CD.
Round-robin : token-based protocols.
Token bus.
Token ring.
Computer Networks
MAC Sublayer
MAC Sublayer
10
MAC Sublayer
11
Pure ALOHA
MAC Sublayer
Pure ALOHA
The system is working as follows:
1- let users transmit whenever they
have data to be sent.
2- expected collisions will occur.
3- the collided frames will be
destroyed.
4- using a feedback mechanism to
know about the status of frame.
5- retransmit the destroyed frame.
Computer Networks
13
MAC Sublayer
Pure ALOHA
The main disadvantage of Pure
ALOHA is a low channel utilization.
This is expected due to the feature that
all users transmit whenever they
want.
Computer Networks
15
ALOHAs
Let S represents the
number of good transmissions per
Performance
Computer Networks
17
MAC Sublayer
Slotted ALOHA
In this method the proposal was to divide the
time into discrete intervals each interval
corresponding to one frame.
In Slotted ALOHA, a computer can not send
anytime, instead it is required to wait for
the beginning of the time slot.
The big advantage of Slotted ALOHA is the
increase in channel utilization.
Computer Networks
18
Slotted ALOHA
Assumptions
all frames same size
time is divided into equal
size slots, time to transmit
1 frame
nodes start to transmit
frames only at beginning
of slots
nodes are synchronized
if 2 or more nodes
transmit in slot, all nodes
detect collision
Operation
when node obtains fresh
frame, it transmits in next
slot
no collision, node can send
new frame in next slot
if collision, node retransmits
frame in each subsequent
slot with prob. p until
success
Computer Networks
19
Pros
Cons
collisions, wasting slots
idle slots
nodes may be able to detect
collision in less than time to
transmit packet
clock synchronization
Computer Networks
20
SLOTTED
ALOHAs
Performance
Doubles performance
of ALOHA.
Frames can only be transmitted at beginning of
slot: discrete ALOHA.
Vulnerable period is halved.
S = G e-G.
S = Smax = 1/e = 0.368 for G = 1.
Computer Networks
21
MAC Sublayer
Slotted ALOHA
There is a limit for the best channel utilization
using Slotted ALOHA.
To reduce the chance of collisions the
station should be able to detect what
other stations are doing.
In LAN networks this is possible, therefore
they can achieve better utilization than
Slotted ALOHA.
Carrier Sense Protocols are protocols in
which stations listen for a carrier.
Computer Networks
23
MAC Sublayer
24
MAC Sublayer
MAC Sublayer
26
MAC Sublayer
MAC Sublayer
Computer Networks
28
MAC Sublayer
Computer Networks
29
MAC Sublayer
30
worst-case scenario
Let the time for a signal to propagate between the two farthest stations be
. At t0, one station begins transmitting. At - , an instant before the
signal arrives at the most distant station, that station also begins
transmitting.
Node A starts
transmission at time t0
Computer Networks
Node B starts
transmission at time
- ,
33
34
MAC Sublayer
Computer Networks
35
Description of CSMA/CD
1
2
3
4
5
used in random access MAC protocols. This algorithm is used in Ethernet (IEEE
802.3) wired LANs.
In Ethernet networks, this algorithm is commonly used to schedule retransmissions
after collisions.
After a collision, time is divided into discrete slots whose length is equal to 2,
where is the maximum propagation delay in the network.
The reason for this choice is that 2 is the minimum amount of time a source needs
to listen to the channel to always detect a collision.
The stations involved in the collision randomly pick an integer from the set {0,1}.
This set is called the contention window. If the sources collide again because they
picked the same integer, the contention window size is doubled and it becomes
{0,1,2,3}. Now the sources involved in the second collision randomly pick an integer
from the set {0,1,2,3} and wait that number of slot times before trying again. Before
they try to transmit, they listen to the channel and transmit only if the channel is idle.
This causes the source which picked the smallest integer in the contention window to
succeed in transmitting its frame.
Ethernet Cabling
Transceiver
That part of the network interface that
transmits and receives the data signal.
The interface to the media.
It places 1s and 0s on the media and picks
up 1s and 0s from the media.
NIC
Limitations of Bus
Technologies
10Base5
o
o
10Base2
o
o
Repeater
Ethernet 2-Port Repeater
BNC-0
AUI-0
BNC-1
AUI-1
Repeater
BNC-0
AUI-0
BNC-1
AUI-1
50
The Repeater:
Repeater
Disadvantages
Limited aggregate throughput due to shared link
hub
Cannot support multiple rates or formats
(e.g., 10 Mbps vs. 100 Mbps Ethernet)
Limitations on maximum # of
hub
hub
nodes and physical distance
54
host
host
host
host
host
host
host
Bridge
host
host
host
host
57
Source
Address
Data
CRC
Cut-through switching
Start forwarding a frame while it is still arriving
switch/bridge
segment
hub
segment
segment
hub
hub
59
C
switch
60
Full duplex
Each connection can send in both directions
Host sending to switch, and host receiving from
switch
E.g., in 10BaseT and 100Base T
segment
segment
hub
hub
62
Higher cost
64
switches
65
Cut-Through Switching
Start transmitting as soon as possible
Inspect the frame header and do the look-up
If outgoing link is idle, start forwarding the frame
Overlapping transmissions
Transmit the head of the packet via the outgoing link
while still receiving the tail via the incoming link
Analogy: different folks crossing different
intersections
A
B
switches
66
Bridge/
Router
Repeater
Switch
Protocol layer
physical
link
networ
k
Traffic isolation
no
yes
yes
yes
yes
no
Efficient routing
no
no
yes
Cut through
yes
yes
no
67
TRANSPORT GATEWAY
Up another layer we find transport gateways. These
connect two computers that use different
connection-oriented transport protocols.
For example, suppose a computer using the
connection-oriented TCP/IP protocol needs to talk
to a computer using the connection-oriented ATM
transport protocol. The transport gateway can copy
the packets from one connection to the other,
reformatting them as need be.
69
APPLICATION GATEWAY
Finally, application gateways understand
the format and contents of the data and
translate messages from one format to
another.
An e-mail gateway could translate Internet
messages into SMS messages for mobile
phones, for example.
C
o
l
u
0 m
Ro
wn 3
Ro
w
1
3
2
1
70