Media Access Schemes
-
ALOHA
-
Build by UofHawaii in early 70s.
-
They used transmission over radio waves at 9,600 bps
-
Central node acks all correct packets and forwards them on a different
frequency.
-
If two stations stransmit at same time, packets become garbeled.
They are said to collide.
-
Central station cannot ack garbeled packets. Senders timeout and
retransmit after random delay.
-
Why RANDOM delay????
-
Three types of ALOHA, slotted and oure.
-
Pure can transmit at any time.
-
Effeciency is 18%.
-
Any transmitter can go ahead at any time. Minimizes latency on unloaded
net.
-
Slotted can transmit only on slot boundries.
-
Effeciency is 36%.
-
Must have good clock synchonization.
-
Protocol latency of unloaded net is on average 1/2 slot time.
-
Latency of loaded net lower than pure aloha.
-
Reservation Aloha
-
Uses slots like slotted aloha.
-
Protocol has two phases.
-
Reservation phase has each station that wants to transmit sending a claim
as per standard ALOHA. Just needs to send a few bytes so the slot
size in the reservation phase can be very small.
-
Once last station has made reservation, each station can transmit in it's
slot in reservation order.
-
If duration of reservation slot is 1/20 of data slot, effeciency is 88%.
-
Protocol latency is longest of ALOHA schemes of unloaded net, and best
for loaded nets.
-
Calculations Assume there are MANY nodes transmitting at random intervals.
-
Fewer nodes improve effeciency.
-
"Dialogs" improve effeciency.
-
Ethernet and the IEE 802.3 Protocols
-
Most widely used.
-
Prototcols determine both physical and data link and network layers.
-
Really is a family of protocols
-
Use a bus network with CSMA-CD type protocols.
-
Can only transmit when bus is quiet.
-
Must notice when transmission is jammed (unlike ALOHA).
-
Remember that a collision can happen at one site but not at all sites on
same transmissions (speed of light is not THAT fast).
-
10Base5 and 10Base2 notice large currents on wire.
-
1Base5 and 10BaseT when there is data on both transmit and receive lines.
-
Max distance is set so that maximally distant units hear collsion before
packet end.
-
During collion, station must send 32 to 48 bits of JAM, which can just
be random data (which wont pass CRC).
-
Algorithm for sending
-
Wait for bus to be quiet
-
When chanel is idle, start transmitting data
-
If collision not detected, go back to #1
-
Stop sending data
-
Send JAM
-
Wait random delay
-
Go back to #1 with old data
-
Random Delay computation (assuming there have been N consecutive collisions)
-
Idea: have minimal delays for a few collsions, and many delays for many
collisions.
-
If N >= 16, stop and fail.
-
Pick M = min(N, 10)
-
Pick random number K from set { 0,1,2,3,...(2^M)-1}.
-
Compute delay K*512 bits
-
Example after 1 collsion delay is 0 or 512 bits.
-
Example after 2 collsions delay is 0, 512, 1024, or 1536 bits.
-
Largest possible delay is 2^10-1 bits. For ethernet this is 523,776
bits or 1/20th of a second.
-
Maximum collsion detecion time
-
suppose A starts at time T0
-
B starts to transmit because it has not heard A. Can start any time
less than T0+PROP
-
B hears collions at T0+PROP, starts to JAM
-
A hears collsion at time T0+PROP+PROP.
-
Minimum packet size must exceed collision detection time, or transmitter
might not realize a collsion until after it has stopped transmitting.
-
Comparisions with ALOHA
-
Similarities
-
Allow multiple access and collisions
-
Uses collision detection
-
Uses random backoff delays
-
Differences
-
Uses JAMMING to allow others to detect collsions. (ALOHA only cares if
central hub sees collision; collsions at other hubs are unimportant and
unnoticed.)
-
ALOHA keeps sending even if collision (since cannot tell immediately if
colliding).
-
Packet format.
-
All ethernet cards have a hardware built in unchangeable 6byte address
that is NOT an IP address.
-
Format: (page 216)
-
7 bytes of preable to sychonize receiver
-
1 byte that frame
-
6 bytes of dest addr
-
6 bytes of sorce addr
-
2 bytes of packet kength
-
MANY bytes of Logical link control field
-
1 byte destination device access point (like a socket number)
-
1 byte src device access point (same)
-
2 byte type (CONT) (tells wether datagram, ack connectionless, connection-oriented,
etc)
-
PAD out to 64 bytes total length (for collsion handling)
-
4 bytes CRC
-
Token Ring
-
Developed by IBM in early 80's.
-
Does NOT use colisions. Designed to have theoretical effeciencies
way above ethernet, and known fixed latencies.
-
Was costly ($700 vs $300).
-
Could transmit at 4Mbps and 16Mbps interleaved
-
Basic Idea
-
If a station is dead or broken, it passes signals anyway!!!!!
-
There exists a token, that circulates around the net.
-
token is 24 bits long.
-
Ring must be at least 24 bits long so that the token always lives.
-
The MASTER STATION ensures this with a hardare buffer
-
When a station wants to send,
-
it waits for the token
-
send
-
sends token on (cannot hog token).
-
Exists way to regenerate the token.
-
STATION MASTER keeps track of token.
-
All stations have timer that resets when station master sends a I AM MASTER
token
-
If a timer goes off, then station sends a CLAIM TOKEN, followed by PURGE
RING, followed by a well formed token.
-
Packet Transmission
-
Each node talks to NEXT NODE ONLY.
-
Each packet stops and starts with a special bit pattern.
-
Each node starts retransmitting as soon as it's ELASTISICTY BUFFER is full.
-
Since nodes transmit at slightly different rates, elasticity buffer provides
cushuning.
-
Too small means it might empty during transmissions, killing packet.
-
Too big increases latency and wastes RAM.
-
If a simple token (not a packet) goes by and you want to transmit and the
priority of token less than your priority
-
Transmit packets
-
If token priority is too high but RESERVATION is lower than your desire
-
change reservation bits,
-
pass on token
-
When it finishes transmitting packet, there are two choices...
-
release token immediately (RAT 16Mb)
-
Eff = 1/(1+(prop/n*THT)
-
Max Media access time = PROP * N*TRANST + TRANSP + (N-1)*THT
-
Remember, for ethernet this is infinite.
-
Effeciency is better if you release the token quickely
-
Wait for packet to circle around (RAR 4Mb)
-
Eff=1/(1+PROP/THT)
-
MaxMedia access time = (N+1)*PROP+N*TRANST + TRANSP + (N-1)*THT
-
Can send ACK by just toggeling a bit in the packet as it circles (better
be a late bit)
-
Variant: Let a node hold the token for more time, namely THT.
-
Each node can now transmit more packets per token transfer, increasing
effeciency.
-
Increases MaxMedia access Time. Default is 10ms.
-
Adding self to ring
-
Wait for token
-
Send "Duplicate address test" token with proposed address.
-
If come back bad, try again.
-
Token Bus
-
Basic Idea -- use a ethernet like bus and token ring like software
-
What you'd get if you had ethernet hardware and a hate for violent events
(like collsions).
-
MAP (manufacturing automation protocol) by GM was this
-
Also came with very electricaly rugged hardware for factory floors (radio
interfeerence tolerent).
-
Had known and happy maxlatencies
-
Failed in commercial sense
-
Transmitting.
-
Wait for token.
-
Send data directly to destination
-
Send token on.
-
Adding a new node.
-
Each node must know the successor.
-
Needed to forward the token.
-
Not important for token ring, because the physical rings tells all for
this.
-
Occasionally, each nodes sends a "solicit a successor" packet durings its
token holding phase.
-
If someone answers ...
-
Add them after the SAS sender.
-
If collsions, CSMA-CD
-
Successor knows his successor, because SAS told him
-
SAS sender knows his successor (node that answered the SAS).
-
No one else changes
-
If removal,
-
Wait for token
-
Send I WANT OUT packet which includes the SUCCESSOR and PREDESSOR
-
Both nodes can adjust.
-
Note: Cannot leave any time you want. That would break the
ring ...
-
If node fails
-
A send to B, which does not respond.
-
A sends "WHO SUCCEEDS B"?
-
That node becomes successor of A.
-
If token lost
-
Each node has timer, waits for traffic.
-
If no traffic after a long time, send "I CLAIM TOKEN" message.
-
Just starts talking.
-
Comparision of token ring and CSMA-CD
-
CSMA-CD can have small latencies, but they are unbounded.
-
Really, true max latencies muct take into accound token losses.
-
CSMA-CD is MUCH SIMPLER
-
token protocols can have VERY NICE EFFECIENCIES