SlideShare a Scribd company logo
1 of 33
1
Module 13
Medium access control
Link Layer 5-2
Multiple access links, protocols
Two types of “links”:
 point-to-point
 PPP for dial-up access
 point-to-point link between Ethernet switch & host
 broadcast (shared wire or medium)
 Shared wire (coaxial): old-fashioned Ethernet
 Shared wireless (RF); 802.11WiFi, satellite
shared wire (e.g.,
cabled Ethernet)
shared RF
(e.g., 802.11 WiFi)
shared RF
(satellite)
Link Layer 5-3
Multiple access protocols
 single shared broadcast channel
 two or more simultaneous transmissions by nodes interfere
 collision if node receives two or more signals at the same time
multiple access protocol
 distributed algorithm that determines how nodes share
channel
 coordination for channel sharing also uses channel itself!
 no out-of-band channel for coordination
Link Layer 5-4
An ideal multiple access protocol
given: broadcast channel of rate R bps
desired:
1. when one node wants to transmit, it can send at
rate R
2. when M nodes want to transmit, each can send
at average rate R/M
3. fully decentralized:
• no special node to coordinate transmissions
• no synchronization of clocks, slots
4. simple
Link Layer 5-5
MAC protocols: classes
Three broad classes:
 channel partitioning
 divide channel into smaller “pieces” (time/ frequency/ code slots)
 allocate piece to node for exclusive use
 Time Division MA , Frequency Division MA
 random access
 channel not divided, allow/ avoid collisions
 detect & recover from collisions
 ALOHA, S-ALOHA, CSMA, CSMA/CD, CSMA/CA
 “taking turns”
 nodes take turns but nodes with more to send can take longer turns
 polling from central site, token passing
 bluetooth, FDDI, token ring
Link Layer 5-6
Channel partitioning MAC protocols:TDMA
TDMA: time division multiple access
 access to channel in "rounds"
 each station gets fixed length slot (length = pkt
trans time) in each round
 unused slots go idle
 example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6
idle
1 3 4 1 3 4
6-slot
frame
6-slot
frame
Link Layer 5-7
FDMA: frequency division multiple access
 channel spectrum divided into frequency bands
 each station assigned fixed frequency band
 unused transmission time in frequency bands go idle
 example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6
idle
frequencybands
time
FDM cable
Channel partitioning MAC protocols: FDMA
Link Layer 5-8
Random access protocols
 when node has packet to send
 transmit at full channel data rate R.
 no a priori coordination among nodes
 two or more transmitting nodes ➜ “collision”,
 random access MAC protocol specifies:
 how to detect/ avoid collisions
 how to recover from collisions (e.g., via delayed
retransmissions)
 examples of random access MAC protocols:
 (pure/unslotted) ALOHA
 slotted ALOHA
 CSMA, CSMA/CD, CSMA/CA
Link Layer 5-9
Pure (unslotted) ALOHA
 unslotted Aloha: simpler, no synchronization
 when frame first arrives
 transmit immediately
 collision probability:
 frame sent at t0 collides with other frames sent in [t0-1,t0]
Link Layer 5-10
Pure ALOHA efficiency
P(success by given node) = P(node transmits) .
P(no other node transmits in [t0-1,t0] .
P(no other node transmits in [t0 , t0+1]
= p .(1-p)N-1 .(1-p)N-1
= p .(1-p)2(N-1) = f(p)
--- For maximum efficiency,find p which maximize f(p)
--- then assuming large systems let N
max efficiency = 1/(2e) = .18
at best: channel used
for useful transmission
18% of time!
Link Layer 5-11
Slotted ALOHA
assumptions:
 all frames same size
 time divided into equal size
slots (time to transmit 1 frame)
 nodes are synchronized
 nodes start to transmit only
at slot-beginning
 if 2 or more nodes transmit
in same slot, all nodes
detect collision
operation:
 when node obtains fresh
frame, transmits in next slot
 if no collision: node can send
new frame in next slot
 if collision: node retransmits
frame in each subsequent
slot with prob= p until
success
Link Layer 5-12
Pros:
 single active node can
continuously transmit at
full rate of channel
 highly decentralized: only
slots in nodes need to be
in sync
 simple
Cons:
 collisions, wasting slots
 idle slots
 nodes may be able to
detect collision in less
than time to transmit
packet
 clock synchronization
Slotted ALOHA
1 1 1 1
2
3
2 2
3 3
node 1
node 2
node 3
C C CS S SE E E
Link Layer 5-13
 suppose: N nodes with many
frames to send, each
transmits in slot with
probability p
 prob that given node has
success in a slot = p(1-p)N-1
 prob that any node has a
success = Np(1-p)N-1
 max efficiency: find p* that
maximizes Np(1-p)N-1
 for many nodes, take limit
of Np*(1-p*)N-1
as N goes
to infinity, gives:
max efficiency = 1/e = .37
efficiency: long-run fraction
of successful slots
(many nodes, all with many
frames to send)
at best: channel used
for useful transmission
37% of time!
!
Slotted ALOHA: efficiency
Link Layer 5-14
CSMA (carrier sense multiple access)
CSMA: listen before transmit:
if channel sensed idle: transmit entire frame
 if channel sensed busy, defer transmission
 human analogy: don’t interrupt others!
Link Layer 5-15
CSMA collisions
 collisions can still occur:
propagation delay means
two nodes may not hear
each others transmission
 collision: entire packet
transmission time
wasted
 distance &
propagation delay
play role in
determining collision
probability
spatial layout of nodes
Link Layer 5-16
CSMA/CD (collision detection)
CSMA/CD: carrier sensing & transmission deferral
as in CSMA
 collisions detected within short time
 colliding transmissions aborted, reducing channel
wastage
 collision detection:
 easy in wired LANs: measure signal strengths,
compare transmitted, received signals
 difficult in wireless LANs: received signal strength
overwhelmed by local transmission strength
Link Layer 5-17
CSMA/CD (collision detection)
spatial layout of nodes
Link Layer 5-18
Ethernet CSMA/CD algorithm
1. NIC receives datagram
from network layer,
creates frame
2. If NIC senses channel idle,
starts frame transmission.
If NIC senses channel
busy, waits until channel
idle, then transmits.
3. If NIC transmits entire
frame without detecting
another transmission,
NIC is done with frame !
4. If NIC detects another
transmission while
transmitting, aborts and
sends jam signal
5. After aborting, NIC
enters binary (exponential)
backoff:
 after mth collision, NIC
chooses K at random
from {0,1,2, …, 2m
-1}.
NIC waits K·512 bit
times, returns to Step 2
 longer backoff interval
with more collisions
Link Layer 5-19
CSMA/CD efficiency
 Tprop = max prop delay between 2 nodes in LAN
 ttrans = time to transmit max-size frame
 efficiency goes to 1
 as tprop goes to 0
 as ttrans goes to infinity
 better performance than ALOHA: and simple, cheap,
decentralized!
transprop /tt
efficiency
51
1
+
=
Link Layer 5-20
“Taking turns” MAC protocols
channel partitioning MAC protocols:
 share channel efficiently & fairly at high load
 inefficient at low load as 1/N of bandwidth
allocated even if only one active node!
random access MAC protocols
 efficient at low load: single node can fully
utilize channel
 Inefficient at high load due to high collision
overhead
“taking turns” protocols
look for best of both worlds!
Link Layer 5-21
polling:
 master node “invites”
slave nodes to transmit
in turn
 typically used with
“dumb” slave devices
 concerns:
 polling overhead
latency
 single point of
failure (master)
master
slaves
poll
data
data
“Taking turns” MAC protocols
Link Layer 5-22
token passing:
 control token passed
from one node to next
sequentially.
 token message
 concerns:
 token overhead
latency
 single point of failure
(token)
T
data
(nothing
to send)
T
“Taking turns” MAC protocols
Link Layer 5-23
Topics Outline
 principles behind data link layer services:
 error detection, correction
 sharing a broadcast channel: multiple access
 link layer addressing & ARP
 instantiation and implementation of various link
layer technologies
 Ethernet, 802.11
 switched LANS,VLANs
 virtualized networks as a link layer: MPLS
 synthesis: a day in the life of a web request
Link Layer 5-24
MAC addresses and ARP
 32-bit IP address:
 network-layer address for interface
 used for layer 3 (network layer) forwarding
 MAC (or LAN or physical or Ethernet) address:
 function: used ‘locally” to get frame from one interface to
another physically-connected interface (same network, in IP-
addressing sense)
 48 bit MAC address (for most LANs) burned in NIC ROM,
also sometimes software settable
 e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation
(each “number” represents 4 bits)
Link Layer 5-25
LAN addresses and ARP
each adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
(wired or
wireless)
Link Layer 5-26
LAN addresses (more)
 MAC address allocation administered by IEEE
 manufacturer buys portion of MAC address space
(to assure uniqueness)
 analogy:
 MAC address: like Social Security Number
 IP address: like postal address
 MAC flat address ➜ portability
 can move LAN card from one LAN to another
 IP hierarchical address not portable
 address depends on IP subnet to which node is
attached
Link Layer 5-27
ARP: address resolution protocol
ARP table: each IP node (host, router) on
LAN has this table
IP/MAC address mapping for some LAN
nodes: < IP address; MAC address;TTL>
-TTL (TimeTo Live): time after which address mapping will be
forgotten (typically 20 min)
Determines interface’s
MAC address, knowing
its IP address?
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137.196.7.23
137.196.7.78
137.196.7.14
137.196.7.88
Link Layer 5-28
ARP protocol: within same LAN
 A wants to send datagram
to B
 B’s MAC address not in A’s
ARP table.
 A broadcasts ARP query
packet, containing B's IP
address
 dest MAC address = FF-FF-
FF-FF-FF-FF
 all nodes on LAN receive
ARP query
 B receives ARP packet,
replies to A with its (B's)
MAC address
 frame sent to A’s MAC
address (unicast)
 A caches (saves) IP-to-MAC
address pair for B in its ARP
table until information
becomes old (times out)
 soft state: information that times
out (goes away) unless refreshed
 ARP is “plug-and-play”:
 nodes create their ARP tables
without intervention from net
administrator
Link Layer 5-29
walkthrough: send datagram from A to B via R
 focus on addressing – at IP (datagram) and MAC layer (frame)
 assume A knows B’s IP address
 assume A knows IP address of first hop router, R (how?)
 assume A knows R’s MAC address (how?)
Addressing: routing to another LAN
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-30
Addressing: routing to another LAN
IP
Eth
Phy
IP src: 111.111.111.111
IP dest: 222.222.222.222
 A creates IP datagram with IP source A, destination B
 A creates link-layer frame with A’s MAC address as
source & R's MAC address as dest,
frame also contains A-to-B IP datagram
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
5-31
Addressing: routing to another LAN
IP
Eth
Phy
 frame sent from A to R
IP
Eth
Phy
 frame received at R, datagram removed, passed up to IP
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP src: 111.111.111.111
IP dest: 222.222.222.222
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-32
Addressing: routing to another LAN
IP src: 111.111.111.111
IP dest: 222.222.222.222
 R forwards datagram with IP source A, destination B
 R creates link-layer frame with own MAC address as
source & B's MAC address (?) as dest,
frame contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP
Eth
Phy
IP
Eth
Phy
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-33
Addressing: routing to another LAN
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP
Eth
Phy
 frame sent from R to B
 frame received at B, datagram removed, passed up to IP

More Related Content

What's hot

3.Medium Access Control
3.Medium Access Control3.Medium Access Control
3.Medium Access Control
Sonali Chauhan
 
Dc chapter 13
Dc chapter   13Dc chapter   13
Dc chapter 13
TechiNerd
 
9 multiple access
9 multiple access9 multiple access
9 multiple access
ampas03
 
The mac layer
The mac layerThe mac layer
The mac layer
aazamk
 

What's hot (20)

3.Medium Access Control
3.Medium Access Control3.Medium Access Control
3.Medium Access Control
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
Multiple access control protocol
Multiple access control protocol Multiple access control protocol
Multiple access control protocol
 
Wireless Communications and a Priority Access Protocol for Multiple Mobile Te...
Wireless Communications and a Priority Access Protocol for Multiple Mobile Te...Wireless Communications and a Priority Access Protocol for Multiple Mobile Te...
Wireless Communications and a Priority Access Protocol for Multiple Mobile Te...
 
M.A.C (Medium Access Control)
M.A.C (Medium Access Control)M.A.C (Medium Access Control)
M.A.C (Medium Access Control)
 
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
MULTIPLE ACCESS PROTOCOL COMPUTER NETWORKS
 
Dc chapter 13
Dc chapter   13Dc chapter   13
Dc chapter 13
 
9 multiple access
9 multiple access9 multiple access
9 multiple access
 
The medium access sublayer
 The medium  access sublayer The medium  access sublayer
The medium access sublayer
 
aloha
alohaaloha
aloha
 
The mac layer
The mac layerThe mac layer
The mac layer
 
MAC
MACMAC
MAC
 
Mac sub layer
Mac sub layerMac sub layer
Mac sub layer
 
Media Access Control
Media Access ControlMedia Access Control
Media Access Control
 
Controlled Access Protocols
Controlled Access ProtocolsControlled Access Protocols
Controlled Access Protocols
 
Chapter4 1
Chapter4 1Chapter4 1
Chapter4 1
 
Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
Mac
MacMac
Mac
 
Media Access Control
Media Access ControlMedia Access Control
Media Access Control
 

Viewers also liked

Sensys ch5-mac
Sensys ch5-macSensys ch5-mac
Sensys ch5-mac
hinalala
 
Elizabeth palmer peabody powerpoint (1)
Elizabeth palmer peabody powerpoint (1)Elizabeth palmer peabody powerpoint (1)
Elizabeth palmer peabody powerpoint (1)
kathy0117
 
مادة الفروق الفردية- لمسه- المجموعة الاولى
مادة الفروق الفردية- لمسه- المجموعة الاولىمادة الفروق الفردية- لمسه- المجموعة الاولى
مادة الفروق الفردية- لمسه- المجموعة الاولى
Salah Abdelsalam
 
Portfolio-anis
Portfolio-anisPortfolio-anis
Portfolio-anis
artcitizen
 
Healthrisks co cs
Healthrisks co csHealthrisks co cs
Healthrisks co cs
Naz Kasim
 
عبد الكريم بكار المتحدث الجيد
عبد الكريم بكار   المتحدث الجيدعبد الكريم بكار   المتحدث الجيد
عبد الكريم بكار المتحدث الجيد
Salah Abdelsalam
 
Business secure-policy tnc-arabic
Business secure-policy tnc-arabicBusiness secure-policy tnc-arabic
Business secure-policy tnc-arabic
thraacapital
 

Viewers also liked (17)

Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
Sensys ch5-mac
Sensys ch5-macSensys ch5-mac
Sensys ch5-mac
 
Mild hdp
Mild hdpMild hdp
Mild hdp
 
F pabove35
F pabove35F pabove35
F pabove35
 
Mencari mean, median, dan modus pada
Mencari mean, median, dan modus padaMencari mean, median, dan modus pada
Mencari mean, median, dan modus pada
 
Elizabeth palmer peabody powerpoint (1)
Elizabeth palmer peabody powerpoint (1)Elizabeth palmer peabody powerpoint (1)
Elizabeth palmer peabody powerpoint (1)
 
Abstract box
Abstract boxAbstract box
Abstract box
 
Digital Marketing Company - SEO Services | Internet Marketing | Ecommerce Sol...
Digital Marketing Company - SEO Services | Internet Marketing | Ecommerce Sol...Digital Marketing Company - SEO Services | Internet Marketing | Ecommerce Sol...
Digital Marketing Company - SEO Services | Internet Marketing | Ecommerce Sol...
 
Brianne Garcia is ready to rumble
Brianne Garcia is ready to rumbleBrianne Garcia is ready to rumble
Brianne Garcia is ready to rumble
 
Game show
Game showGame show
Game show
 
مادة الفروق الفردية- لمسه- المجموعة الاولى
مادة الفروق الفردية- لمسه- المجموعة الاولىمادة الفروق الفردية- لمسه- المجموعة الاولى
مادة الفروق الفردية- لمسه- المجموعة الاولى
 
Portfolio-anis
Portfolio-anisPortfolio-anis
Portfolio-anis
 
Healthrisks co cs
Healthrisks co csHealthrisks co cs
Healthrisks co cs
 
Ценовые политики и возможные модели сотрудничества
Ценовые политики и возможные модели сотрудничестваЦеновые политики и возможные модели сотрудничества
Ценовые политики и возможные модели сотрудничества
 
Geometria a l’espai
Geometria a l’espaiGeometria a l’espai
Geometria a l’espai
 
عبد الكريم بكار المتحدث الجيد
عبد الكريم بكار   المتحدث الجيدعبد الكريم بكار   المتحدث الجيد
عبد الكريم بكار المتحدث الجيد
 
Business secure-policy tnc-arabic
Business secure-policy tnc-arabicBusiness secure-policy tnc-arabic
Business secure-policy tnc-arabic
 

Similar to Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN

Chapter5 link layer and la ns
Chapter5 link layer and la nsChapter5 link layer and la ns
Chapter5 link layer and la ns
Khánh Ghẻ
 
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptxLecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
HanzlaNaveed1
 
wireless.ppt
wireless.pptwireless.ppt
wireless.ppt
SandipPradhan23
 

Similar to Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN (20)

Ch5 data layer network
Ch5 data layer networkCh5 data layer network
Ch5 data layer network
 
Chapter5 link layer and la ns
Chapter5 link layer and la nsChapter5 link layer and la ns
Chapter5 link layer and la ns
 
Link layer
Link layerLink layer
Link layer
 
link layer
link layerlink layer
link layer
 
Link layer.ppt
Link layer.pptLink layer.ppt
Link layer.ppt
 
Lect16
Lect16Lect16
Lect16
 
Chapter 5 my_ppt
Chapter 5 my_pptChapter 5 my_ppt
Chapter 5 my_ppt
 
Chapter_5_CN Link Layer.ppt
Chapter_5_CN Link Layer.pptChapter_5_CN Link Layer.ppt
Chapter_5_CN Link Layer.ppt
 
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptxLecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
 
Ch 5- link layer in lan
Ch 5- link layer in lanCh 5- link layer in lan
Ch 5- link layer in lan
 
Mac
MacMac
Mac
 
MACPresentation based on medium access control mechanism
MACPresentation based on medium access control mechanismMACPresentation based on medium access control mechanism
MACPresentation based on medium access control mechanism
 
Week15 lec1
Week15 lec1Week15 lec1
Week15 lec1
 
Data centers architecture and design guide
Data centers architecture and design guideData centers architecture and design guide
Data centers architecture and design guide
 
Datacenters.pptx
Datacenters.pptxDatacenters.pptx
Datacenters.pptx
 
Topic5
Topic5Topic5
Topic5
 
wireless.ppt
wireless.pptwireless.ppt
wireless.ppt
 
datalink.ppt
datalink.pptdatalink.ppt
datalink.ppt
 
Chapter 5 v6.01
Chapter 5 v6.01Chapter 5 v6.01
Chapter 5 v6.01
 
9 lan
9 lan9 lan
9 lan
 

Recently uploaded

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN

  • 2. Link Layer 5-2 Multiple access links, protocols Two types of “links”:  point-to-point  PPP for dial-up access  point-to-point link between Ethernet switch & host  broadcast (shared wire or medium)  Shared wire (coaxial): old-fashioned Ethernet  Shared wireless (RF); 802.11WiFi, satellite shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite)
  • 3. Link Layer 5-3 Multiple access protocols  single shared broadcast channel  two or more simultaneous transmissions by nodes interfere  collision if node receives two or more signals at the same time multiple access protocol  distributed algorithm that determines how nodes share channel  coordination for channel sharing also uses channel itself!  no out-of-band channel for coordination
  • 4. Link Layer 5-4 An ideal multiple access protocol given: broadcast channel of rate R bps desired: 1. when one node wants to transmit, it can send at rate R 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: • no special node to coordinate transmissions • no synchronization of clocks, slots 4. simple
  • 5. Link Layer 5-5 MAC protocols: classes Three broad classes:  channel partitioning  divide channel into smaller “pieces” (time/ frequency/ code slots)  allocate piece to node for exclusive use  Time Division MA , Frequency Division MA  random access  channel not divided, allow/ avoid collisions  detect & recover from collisions  ALOHA, S-ALOHA, CSMA, CSMA/CD, CSMA/CA  “taking turns”  nodes take turns but nodes with more to send can take longer turns  polling from central site, token passing  bluetooth, FDDI, token ring
  • 6. Link Layer 5-6 Channel partitioning MAC protocols:TDMA TDMA: time division multiple access  access to channel in "rounds"  each station gets fixed length slot (length = pkt trans time) in each round  unused slots go idle  example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle 1 3 4 1 3 4 6-slot frame 6-slot frame
  • 7. Link Layer 5-7 FDMA: frequency division multiple access  channel spectrum divided into frequency bands  each station assigned fixed frequency band  unused transmission time in frequency bands go idle  example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequencybands time FDM cable Channel partitioning MAC protocols: FDMA
  • 8. Link Layer 5-8 Random access protocols  when node has packet to send  transmit at full channel data rate R.  no a priori coordination among nodes  two or more transmitting nodes ➜ “collision”,  random access MAC protocol specifies:  how to detect/ avoid collisions  how to recover from collisions (e.g., via delayed retransmissions)  examples of random access MAC protocols:  (pure/unslotted) ALOHA  slotted ALOHA  CSMA, CSMA/CD, CSMA/CA
  • 9. Link Layer 5-9 Pure (unslotted) ALOHA  unslotted Aloha: simpler, no synchronization  when frame first arrives  transmit immediately  collision probability:  frame sent at t0 collides with other frames sent in [t0-1,t0]
  • 10. Link Layer 5-10 Pure ALOHA efficiency P(success by given node) = P(node transmits) . P(no other node transmits in [t0-1,t0] . P(no other node transmits in [t0 , t0+1] = p .(1-p)N-1 .(1-p)N-1 = p .(1-p)2(N-1) = f(p) --- For maximum efficiency,find p which maximize f(p) --- then assuming large systems let N max efficiency = 1/(2e) = .18 at best: channel used for useful transmission 18% of time!
  • 11. Link Layer 5-11 Slotted ALOHA assumptions:  all frames same size  time divided into equal size slots (time to transmit 1 frame)  nodes are synchronized  nodes start to transmit only at slot-beginning  if 2 or more nodes transmit in same slot, all nodes detect collision operation:  when node obtains fresh frame, transmits in next slot  if no collision: node can send new frame in next slot  if collision: node retransmits frame in each subsequent slot with prob= p until success
  • 12. Link Layer 5-12 Pros:  single active node can continuously transmit at full rate of channel  highly decentralized: only slots in nodes need to be in sync  simple Cons:  collisions, wasting slots  idle slots  nodes may be able to detect collision in less than time to transmit packet  clock synchronization Slotted ALOHA 1 1 1 1 2 3 2 2 3 3 node 1 node 2 node 3 C C CS S SE E E
  • 13. Link Layer 5-13  suppose: N nodes with many frames to send, each transmits in slot with probability p  prob that given node has success in a slot = p(1-p)N-1  prob that any node has a success = Np(1-p)N-1  max efficiency: find p* that maximizes Np(1-p)N-1  for many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives: max efficiency = 1/e = .37 efficiency: long-run fraction of successful slots (many nodes, all with many frames to send) at best: channel used for useful transmission 37% of time! ! Slotted ALOHA: efficiency
  • 14. Link Layer 5-14 CSMA (carrier sense multiple access) CSMA: listen before transmit: if channel sensed idle: transmit entire frame  if channel sensed busy, defer transmission  human analogy: don’t interrupt others!
  • 15. Link Layer 5-15 CSMA collisions  collisions can still occur: propagation delay means two nodes may not hear each others transmission  collision: entire packet transmission time wasted  distance & propagation delay play role in determining collision probability spatial layout of nodes
  • 16. Link Layer 5-16 CSMA/CD (collision detection) CSMA/CD: carrier sensing & transmission deferral as in CSMA  collisions detected within short time  colliding transmissions aborted, reducing channel wastage  collision detection:  easy in wired LANs: measure signal strengths, compare transmitted, received signals  difficult in wireless LANs: received signal strength overwhelmed by local transmission strength
  • 17. Link Layer 5-17 CSMA/CD (collision detection) spatial layout of nodes
  • 18. Link Layer 5-18 Ethernet CSMA/CD algorithm 1. NIC receives datagram from network layer, creates frame 2. If NIC senses channel idle, starts frame transmission. If NIC senses channel busy, waits until channel idle, then transmits. 3. If NIC transmits entire frame without detecting another transmission, NIC is done with frame ! 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, NIC enters binary (exponential) backoff:  after mth collision, NIC chooses K at random from {0,1,2, …, 2m -1}. NIC waits K·512 bit times, returns to Step 2  longer backoff interval with more collisions
  • 19. Link Layer 5-19 CSMA/CD efficiency  Tprop = max prop delay between 2 nodes in LAN  ttrans = time to transmit max-size frame  efficiency goes to 1  as tprop goes to 0  as ttrans goes to infinity  better performance than ALOHA: and simple, cheap, decentralized! transprop /tt efficiency 51 1 + =
  • 20. Link Layer 5-20 “Taking turns” MAC protocols channel partitioning MAC protocols:  share channel efficiently & fairly at high load  inefficient at low load as 1/N of bandwidth allocated even if only one active node! random access MAC protocols  efficient at low load: single node can fully utilize channel  Inefficient at high load due to high collision overhead “taking turns” protocols look for best of both worlds!
  • 21. Link Layer 5-21 polling:  master node “invites” slave nodes to transmit in turn  typically used with “dumb” slave devices  concerns:  polling overhead latency  single point of failure (master) master slaves poll data data “Taking turns” MAC protocols
  • 22. Link Layer 5-22 token passing:  control token passed from one node to next sequentially.  token message  concerns:  token overhead latency  single point of failure (token) T data (nothing to send) T “Taking turns” MAC protocols
  • 23. Link Layer 5-23 Topics Outline  principles behind data link layer services:  error detection, correction  sharing a broadcast channel: multiple access  link layer addressing & ARP  instantiation and implementation of various link layer technologies  Ethernet, 802.11  switched LANS,VLANs  virtualized networks as a link layer: MPLS  synthesis: a day in the life of a web request
  • 24. Link Layer 5-24 MAC addresses and ARP  32-bit IP address:  network-layer address for interface  used for layer 3 (network layer) forwarding  MAC (or LAN or physical or Ethernet) address:  function: used ‘locally” to get frame from one interface to another physically-connected interface (same network, in IP- addressing sense)  48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable  e.g.: 1A-2F-BB-76-09-AD hexadecimal (base 16) notation (each “number” represents 4 bits)
  • 25. Link Layer 5-25 LAN addresses and ARP each adapter on LAN has unique LAN address adapter 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless)
  • 26. Link Layer 5-26 LAN addresses (more)  MAC address allocation administered by IEEE  manufacturer buys portion of MAC address space (to assure uniqueness)  analogy:  MAC address: like Social Security Number  IP address: like postal address  MAC flat address ➜ portability  can move LAN card from one LAN to another  IP hierarchical address not portable  address depends on IP subnet to which node is attached
  • 27. Link Layer 5-27 ARP: address resolution protocol ARP table: each IP node (host, router) on LAN has this table IP/MAC address mapping for some LAN nodes: < IP address; MAC address;TTL> -TTL (TimeTo Live): time after which address mapping will be forgotten (typically 20 min) Determines interface’s MAC address, knowing its IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 137.196.7.23 137.196.7.78 137.196.7.14 137.196.7.88
  • 28. Link Layer 5-28 ARP protocol: within same LAN  A wants to send datagram to B  B’s MAC address not in A’s ARP table.  A broadcasts ARP query packet, containing B's IP address  dest MAC address = FF-FF- FF-FF-FF-FF  all nodes on LAN receive ARP query  B receives ARP packet, replies to A with its (B's) MAC address  frame sent to A’s MAC address (unicast)  A caches (saves) IP-to-MAC address pair for B in its ARP table until information becomes old (times out)  soft state: information that times out (goes away) unless refreshed  ARP is “plug-and-play”:  nodes create their ARP tables without intervention from net administrator
  • 29. Link Layer 5-29 walkthrough: send datagram from A to B via R  focus on addressing – at IP (datagram) and MAC layer (frame)  assume A knows B’s IP address  assume A knows IP address of first hop router, R (how?)  assume A knows R’s MAC address (how?) Addressing: routing to another LAN R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B
  • 30. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-30 Addressing: routing to another LAN IP Eth Phy IP src: 111.111.111.111 IP dest: 222.222.222.222  A creates IP datagram with IP source A, destination B  A creates link-layer frame with A’s MAC address as source & R's MAC address as dest, frame also contains A-to-B IP datagram MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B
  • 31. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B 5-31 Addressing: routing to another LAN IP Eth Phy  frame sent from A to R IP Eth Phy  frame received at R, datagram removed, passed up to IP MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP src: 111.111.111.111 IP dest: 222.222.222.222 IP src: 111.111.111.111 IP dest: 222.222.222.222
  • 32. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-32 Addressing: routing to another LAN IP src: 111.111.111.111 IP dest: 222.222.222.222  R forwards datagram with IP source A, destination B  R creates link-layer frame with own MAC address as source & B's MAC address (?) as dest, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy
  • 33. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-33 Addressing: routing to another LAN IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy  frame sent from R to B  frame received at B, datagram removed, passed up to IP