W6 B - CHP4-CNS3200
W6 B - CHP4-CNS3200
36-slot 3 4
frame
1 4 1
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 collisions
– how to recover from collisions
– Examples protocols: slotted ALOHA, ALOHA,
CSMA, CSMA/CD, CSMA/CA
ALOHA
• Developed for packet radio nets
• When station has frame, it sends
• Then listens for a bit over max round trip time
– if receive ACK then fine
– if not, retransmit
– if no ACK after repeated transmissions, give up
• frame may be damaged by noise or collision
Figure 12.3 Frames in a pure ALOHA network
Figure 12.4 Procedure for pure ALOHA protocol
Slotted ALOHA
Assumptions: Operation:
• all frames same size • when node obtains fresh
• time divided into equal frame, transmits in next slot
size slots (time to – if no collision: node can
transmit 1 frame)
send new frame in next
• nodes start to transmit
slot
only slot beginning
• nodes are synchronized – if collision: node
retransmits frame in
• if 2 or more nodes
transmit in slot, all nodes each subsequent slot
detect collision with probability p
Slotted ALOHA
Pros Cons
• single active node can • collisions, wasting slots
continuously transmit at
• idle slots
full rate of channel
• highly decentralized: • clock synchronization
nodes decides
independently
• simple
CSMA (Carrier Sense Multiple Access)
• stations soon know transmission has started
• so first listen for clear medium (carrier sense)
• if medium idle, transmit
• if two stations start at the same instant,
collision
– wait reasonable time
– if no ACK then retransmit
CSMA/CD Description
CSMA/CD rules:
1. if medium idle, transmit
2. if busy, listen for idle, then transmit
3. if collision detected, transmit jam signal and
then stop transmission, wait random time
then retry
CSMA/CD
(2)
(1)
(3)
CSMA/CA
IEEE 802.11
MAC Protocol
IFS : Inter Frame Spacing
CSMA/CA Description
CSMA/CA rules:
1. if medium idle, wait for some interframe space
(IFS) time, then sense the channel
1. If busy – go to step 2
2. If still idle – transmit a frame
2. if busy, wait until transmission end and then
wait for some IFS time, then sense the
channel again
1. If busy – go to Step 2
2. If idle – backoff/wait for some random time and
transmit a frame
“Taking Turns” MAC protocols
Polling:
• master node data
poll
“invites” slave master
nodes to transmit data
in turn
slaves
https://www.computersciencelearn.in/taking-
turns-protocols/
“Taking Turns”
MAC protocols
T
Two methods
Stop-and-wait
Sliding window
Stop and Wait
• source transmits frame
• destination receives frame and replies with
acknowledgement (ACK)
• source waits for ACK before sending next
• destination can stop flow by not send ACK
• works well for a few large frames
• Stop and wait becomes inadequate if large
block of data is split into small frames
Stop and Wait
Link Utilization
Sliding Windows
Flow Control
• allows multiple numbered frames to be in transit
• receiver has buffer W long
• transmitter sends up to W frames without ACK
• ACK includes number of next frame expected
• sequence number is bounded by size of field (k)
– frames are numbered modulo 2k
– giving max window size of up to 2k - 1
• receiver can ack frames without permitting
further transmission (Receive Not Ready)
• must send a normal acknowledge to resume
• if have full-duplex link, can piggyback ACks
Sliding Window Example
Error Control
- Refers to methods of error detection and
correction due to
lost frames
damaged frames
- common techniques use:
error detection (CRC,checksum)
positive acknowledgment
retransmission after timeout
negative acknowledgement & retransmission
Automatic Repeat Request
(ARQ)
• collective name for such error control
mechanisms, including:
• stop and wait
• go back N
• selective repeat (selective retransmission)
Stop and Wait
• see example
with both types
of errors
• pros and cons
– simple
– inefficient
Go-Back-N