Network Protocols
When two nodes in same network want to send data thru a common transmission line, a collision occurs. In a collision situation, both signals get interfered and corrupted.
Protocols are software implementations defined to avoid these collisions from happening.
Multiple Access Protocols
A multiple access protocol is a distributed algorithm that decides how nodes share the channel, meaning when each node may transmit. The coordination about sharing must use the channel itself, because there is no separate out-of-band channel
if the broadcast channel has rate bps
- If one node wants to send, it can send at rate bps
- If nodes want to send, each averages a rate of
- It is fully decentralized, with no master node and no clock or slot synchronization.
- It is simple.
This is the ideal protocol, no real protocol can achieve all , there will always be tradeoffs.
Main Broadcast Classes
-
Channel Partitioning
- divide channel into smaller “pieces” (time slots, frequency, code)
- allocate piece to node for exclusive use
-
Random Access
- channel not divided, allow collisions
- “recover” from collisions
-
“taking turns”
- nodes take turns, but nodes with more to send can take longer turns
Channel partitioning
TDMA: time division multiple access
- gives each station a fixed slot in every round.
- The slot length equals one packet transmission time.
- Unused slots go idle.
6-Node LAN
- 1, 3, 4 send packets
- 2, 5, 6 are idle

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

CDMA: code division multiple access
Random Access
Allow collisions to happen and then how to detect and recover.
ALOHA and slotted ALOHA
ALOHA is the Hawaiian word for hello and goodbye.
- The sender do not know if a collision occurred.
- For each successful receive, receiver sends back an acknowledgement (ACK)
- If no ACK received, the sender assume it is dropped or collision happened.
- Sender backoff for a random interval so it won't collide again on the retry (aka delayed transmission).
- After the backoff the station sends the same frame again.
- It repeats the cycle until an ACK arrives.
- Most implementations stop after a maximum number of attempts, , and report failure to the layer above.

Slotted ALOHA
Time is cut into slots, each exactly one frame long. A node sends only at the start of a slot. If there is a collision, it retransmits in each later slot with probability until it succeeds.
CSMA: Carrier Sense Multiple Access
Listen before you talk
Carrier sense means it will check if something is transmitting in the wire. If it senses like nothing is transmitting, it will send the full frame. Due to propagation delays, collisions will still happen.
CSMA/CD: Collision Detection
Collision detection on wired medium is easy, since the sender can compare sent signal and received signal. There are always two wires for receiving and sending signals. TX - Transmitter RX - Receiver
Once detected a collision the sender abort the request and backoff for binary amount of frame times. Which is for th retry, for a random number b/w , it would wait before next retry.
Ethernet uses CSMA/CD. This method is half duplex. So only one sender can send a signal at a given time. (Gigabit Ethernet with a switch does not use CSMA/CD)
Wireless is a whole different story since the sending signal is much stronger than receiving, we cannot directly compare them and see if there is a collision.
Do NOT use an ACK (cuz it doesn't need to).
CSMA/CA: Collision Avoidance
This is the random access method wireless communications use such as uses. Since wireless do not have a way to detect collisions beforehand, it act to avoid being collided in the first place. (not necessarily meant it avoids 100% collisions)
- Wait for the channel to be idle, and then wait a little longer.
- Add a random wait, so two stations that were both waiting don't start together.
- Use an acknowledgement (ACK) to learn whether the frame got through.
| CSMA/CD | CSMA/CA | |
|---|---|---|
| Medium | wired (Ethernet) | wireless (802.11) |
| How it handles collisions | detects and aborts | avoids, backoff and ACK |
| Needs ACK? | no | yes |
| After a collision | jam signal, binary backoff | double contention window, backoff, retry |
Taking Turns
Polling
A master node "invites" slave nodes to transmit in turn. It is typically used with "dumb" slave devices. A dumb slave never speaks unless it is asked, so it needs no access logic of its own.
+---------+
| MASTER |
+----+----+
poll | ^ data (repeat for each slave in turn)
+-------+--+-------+---------+
v v v
+-------+ +-------+ +-------+
|Slave 1| |Slave 2| |Slave 3|
+-------+ +-------+ +-------+Key:
- The master sends a poll to Slave 1.
- Slave 1 replies with data if it has any. Otherwise it says it has nothing, and the master moves on.
- The master polls Slave 2, then Slave 3, and keeps cycling.
Concerns:
- Polling overhead: a poll is sent even to a slave with nothing to say.
- Latency: a slave must wait for its next poll, even if the channel is idle.
- Single point of failure: if the master fails, the whole channel stops.
Token passing
A control token is passed from one node to the next, in sequence. The token is a special small message. Only the node holding the token may transmit. When it has nothing to send, or has finished, it passes the token on.
The word "token" here means a permission marker, like a talking stick that gives its holder the right to speak.
Concerns:
- Token overhead: the token circulates even when nobody has data.
- Latency: a node waits for the token to come round.
- Single point of failure: if the token is lost, nobody can transmit.