Data-Link Layer 2 Flashcards
Multiple Access Protocols
Types of Random Access Protocols
- ALOHA
- CSMA
- CSMA/CD
- CSMA/CA
Random Access Protocols: CSMA
CSMA
- Carrier Sense Multiple Access
- Listen before transmit
- Reduce possibility of collision
- Cannot completely eliminate possibility of collision
Random Access Protocols: CSMA
Simple CSMA
If channel sensed idle: transmit entire frame
If channel sensed busy: defer transmission
Random Access Protocols: CSMA
CSMA: Persistance Method Types
- 1-persistent
- Non-persistent
- p-persistent
Random Access Protocols: CSMA
CSMA: 1-Persistent
- Continuously senses at the beginning of each time unit.
- Transmits when channel finally idle.
Random Access Protocols: CSMA
CSMA: Non-Persistent
- Wait to sense for a random amount of time.
- Transmits when channel finally idle.
Random Access Protocols: CSMA
CSMA: p-Persistent
- Continuously sense at the beginning of each time slot.
- When channel finally idle, send based on probability p (doesn’t send every time).
- If probability p prevents sending, wait for set amount of time and try to retransmit with probability p again. (repeats until successful)
Random Access Protocols: CSMA
CSMA: Persistence Method Downfall
- If 2 stations send frame at same time, collision occurs but station continues transmitting until whole frame sent
- Wastes time instead of immediately interrupting transmission
Random Access Protocols: CSMA
CSMA/CD
- Carrier Sense Multiple Access/Collision Detection
- Collisions detected within short time
- Colliding transmissions aborted, reduces amount of time wasted in collisions
- Collision detection easy in wired, difficult in wireless
Random Access Protocols: CSMA
CSMA: Collisions
- Collision: entire packet and transmission time wasted
- Collisions can still occur even if carrier is sensing (two nodes can start at exact same time)
Random Access Protocols: CSMA
CSMA/CD: Algorithm
- NIC receives datagram from network layer, creates frame
- NIC senses channel (if idle: transmit, if busy: wait until channel idle)
- If NIC transmits entire frame without collision, then complete
- If NIC detects collision, abort and send jam signal
- After aborting: NIC enters Binary (Exponential) Backoff
Random Access Protocols: CSMA
CSMA/CD: Binary (Exponential) Backoff
- After mth collision, NIC chooses K at random from {0, 1, 2, …, 2^m - 1}
- NIC waits K x 512 bit times, returns to step 2 in algoritm
- More Collisions = longer backoff interval
Random Access Protocols: CSMA
CSMA/CA
- Carrier Sense Multiple Access/Collision Avoidance
- Specficially designed for wireless networks
- In Wired: if collision occured then energy of received signal almost doubles, allowing station to sense possibility of collision
- In Wireless: can’t increase energy bc most of it used for transmission and can only increase energy by small amount
Random Access Protocols: CSMA
CSMA/CA: Three Strategies
- InterFrame Space (IFS)
- Contention window
- Acknowledgments
Random Access Protocols: CSMA
CSMA/CA Strategies: InterFrame Space (IFS)
- When station finds channel busy: it senses the channel again
- When station finds channel idle: it wait for a period of time called IFS time before transmitting
- Can also be used to define priority of station or frame (higher IFS means lower priority)
Random Access Protocols: CSMA
CSMA/CA Strategies: Contention Window
- Amount of time is divided into slots
- Station that is ready to transmit chooses random value for wait time
Random Access Protocols: CSMA
CSMA/CA Strategies: Acknowledgments
Positive ACKs and time-out timer are used to help guarantee successful transmission