MAC Protocols Media Access Control who gets the

  • Slides: 13
Download presentation
MAC Protocols Media Access Control (who gets the use the channel) TDM and FDM

MAC Protocols Media Access Control (who gets the use the channel) TDM and FDM are inefficient for bursty data network. It is best to share the medium so that who ever needs it can use it. And if it is not needed, it is not used. Think of bursty transmissions. The objective is dynamic allocation of the channel. z. Contention-based y. ALOHA and Slotted ALOHA. y. CSMA/CD.

The ALOHA Protocol • Developed @ U of Hawaii in early 70’s. • Packet

The ALOHA Protocol • Developed @ U of Hawaii in early 70’s. • Packet radio networks. • “Free for all”: whenever station has a frame to send, it does so. – Station listens for an ACK. – If no ACK after a specified amount of time (how long? ), re -sends frame after waiting a random amount of time (why random? ) – It continues to retry for a number of times and then gives up. – Receivers check FCS and destination address to ACK.

Collisions • Invalid frames may be caused by channel noise or • Because other

Collisions • Invalid frames may be caused by channel noise or • Because other station(s) transmitted at the same time: collision. • Collision happens even when the last bit of a frame overlaps with the first bit of the next frame.

ALOHA’s t 0+t vulnerable t 0+2 t t 0+3 t Time

ALOHA’s t 0+t vulnerable t 0+2 t t 0+3 t Time

ALOHA’s Performance • Assume that users try to send frames at random times (Poisson

ALOHA’s Performance • Assume that users try to send frames at random times (Poisson events). • Let G be the average rate that users try to send frames per frame time. • The probability of trying to send k frames in TWO frame time is The probability no other frames are sent is P(0)=e-2 G. The throughput is the rate that frames are sent multiplied by the probability that the transmission is successful G e-2 G

ALOHA’s Performance The best throughput occurs for what value of G? What is this

ALOHA’s Performance The best throughput occurs for what value of G? What is this best throughput?

Slotted Aloha • Doubles performance of ALOHA. • Frames can only be transmitted at

Slotted Aloha • 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.

Slotted Aloha Performance

Slotted Aloha Performance

Slotted Aloha Performance How long does it take to send a frame? one success

Slotted Aloha Performance How long does it take to send a frame? one success k-1 failures Expected number of transmissions

Carrier Sense Multiple Access (CSMA) • ALOHA Protocols have poor utilization. • Key property

Carrier Sense Multiple Access (CSMA) • ALOHA Protocols have poor utilization. • Key property of LANs: propagation delay between stations is small compared to frame transmission time. • Consequence: stations can sense the medium before transmitting. • This can reduce the vulnerable period.

CSMA • 1 -persistent – If medium is idle, then transmit. – If medium

CSMA • 1 -persistent – If medium is idle, then transmit. – If medium is not idle, then wait until it is and then transmit. • p-persistent (for slotted channels only) – If medium is idle, then transmit. – If medium is not idle, then wait until it is idle – Once idle then transmit with probability p. And wait for the next slot with probability 1 -p and repeat. • Problem: when a collision occurs, it lasts for a long time, the whole frame transmission time.

Carrier Sense Multiple Access with Collision Detection CSMA/CD When transmitting, detect if a collision

Carrier Sense Multiple Access with Collision Detection CSMA/CD When transmitting, detect if a collision is occurring. If a collision is occurring, abort as soon as possible and wait a random amount of time before retrying. Suppose that two nodes begin to transmit at the same time. How long until the collision is detected? The propagation delay. After beginning transmission, how long until we know that we have control of the channel? Twice the propagation delay.

CSMA/CD After beginning transmission, how long until we know that we have control of

CSMA/CD After beginning transmission, how long until we know that we have control of the channel? Twice the propagation delay. Let T be the propagation delay. At t=0, node 1 begins transmission. Suppose that at t=T- node 2 begins to transmit. At t=T, node 2 detects the collision. At t=2 T- , node 1 detects the collision. Keeping propagation delay small can improve efficiency. After a collision is detected, often a jamming signal is applied. This slightly increases the contention interval.