Lecture 2
Lecture 2
Comsats University,
Islamabad FALL, 2024
1
Medium Access Control
2
When do we need MAC?
3
Shared Links
4
Expanded Data Link Layer
5
Types of MAC
6
Types of MAC: Channel Access Policy
7
Another way to look at it…
8
Contention-Based Protocols
9
CSMA
10
CSMA Variants
11
CSMA/CD
12
CSMA/CD Algorithm:
2. Frame Transmission:
a. Transmit the frame onto the network.
b. Simultaneously, listen to the channel to detect any collisions.
4. Backoff:
a. Calculate a random backoff time.
b. Wait for the backoff time to expire.
5. Retry:
a. Return to step 1 to attempt to retransmit the frame.
Binary Exponential Backoff
Algorithm:
1. Initialize:
a. Set the collision count `n` to 0.
2. Collision Handling:
a. If a collision is detected:
i. Increment the collision count `n = n + 1`.
ii. If `n` exceeds the maximum number of retries (usually 16),
give up and abort the transmission.
iii. Calculate the maximum backoff time `K`:
K = min(2^n - 1, 1023) // 1023 is the upper limit in Ethernet standard
iv. Choose a random integer `r` in the range [0, K].
v. Compute the backoff time `T`:
T = r × slot_time
vi. Wait for the backoff time `T`.
3. Retry Transmission:
a. After waiting for the backoff time, attempt to retransmit the
frame by returning to the main CSMA/CD algorithm.
Security Issues in IEEE 802.11
1.Integrity Check Value (ICV) Before transmitting a data packet, WEP generates
a 32-bit checksum (ICV) from the data. This checksum is appended to the data.
2. Encryption The data, along with the ICV, is then encrypted using a stream
cipher called RC4, which uses a key that is shared between the sender and the
receiver.
3. Transmission and Verification When the receiver gets the encrypted packet,
it decrypts it using the same RC4 key. The receiver then checks the ICV by
recalculating it from the received data and comparing it with the ICV sent by the
sender.
If they match, the data is considered intact; otherwise, it is assumed that the
data has been tampered with.
Wired Equivalent Privacy
(WEP)
Collision Scenarios
19
CSMA/
CA
20
Hidden-Terminal Problem
21
Hidden- and Exposed Terminals
22
CSMA/CA: RTS-CTS Solution
“Channel reservation”
23
CSMA-CA
24
How does CSMA-CA work?
25
IEEE 802.11
26
IEEE 802.11 DCF
27
IEEE 802.11 MAC Protocol: CSMA (no CA)
28
IEEE 802.11 MAC Protocol: CSMA/CA
29
CSMA-CA Examples
30
IEEE 802.11 Wireless LAN
31
32
Solutions to Hidden/Exposed Nodes in CSMA
33
Dynamic Reservation Approaches:
Sender- vs. Receiver-initiated
34
Single vs. Multiple Channel Protocols
35
Other criteria for classification
36
Rivest Cipher 4 (RC 4)
2nd Step: Stream Generation
3rd Step: Encryption & Decryption
Wi-Fi Protected Access (WPA)