15-441 Computer Networking: Lecture 5 - Ethernet
15-441 Computer Networking: Lecture 5 - Ethernet
Lecture 5 – Ethernet
MAC Protocols: A Taxonomy
Three broad classes:
• Channel partitioning
• Divide channel into smaller “pieces” (time slots,
frequency)
• Allocate piece to node for exclusive use
• Random access
• Allow collisions
• “Taking turns”
• Tightly coordinate shared access to avoid collisions
Lecture 5: 9-11-01 3
Random Access Protocols
Lecture 5: 9-11-01 4
Aloha – Basic Technique
Lecture 5: 9-11-01 5
Slotted Aloha
• Time is divided into equal size slots (= pkt trans. time)
• Node (w/ packet) transmits at beginning of next slot
• If collision: retransmit pkt in future slots with probability
p, until successful
Lecture 5: 9-11-01 7
Outline
Lecture 5: 9-11-01 8
Ethernet
• First practical local area network, built at
Xerox PARC in 70’s
• “Dominant” LAN technology:
• Cheap $20 for 100Mbs!
• Kept up with speed race: 10, 100, 1000 Mbps
Metcalfe’s Ethernet
sketch
Lecture 5: 9-11-01 9
Ethernet MAC – Carrier Sense
• Basic idea:
• Listen to wire before
transmission Hidden Exposed
• Avoid collision with A
active transmission A
Lecture 5: 9-11-01 10
Ethernet MAC – Collision
Detection
• Note: ALOHA has collision detection also, should
really be called “Fast Collision Detection”
• Basic idea:
• Listen while transmitting
• If you notice interference assume collision
• Why didn’t ALOHA have this?
• Very difficult for radios to listen and transmit
• Signal strength is reduced by distance for radio
• Much easier to hear “local, powerful” radio station than one in
NY
• You may not notice any “interference”
Lecture 5: 9-11-01 11
Ethernet MAC (CSMA/CD)
Packet?
No
Yes
Discard
Packet Jam channel
attempts < 16 b=CalcBackoff();
wait(b);
attempts++;
attempts == 16
Lecture 5: 9-11-01 12
Ethernet’s CSMA/CD (more)
Lecture 5: 9-11-01 13
Ethernet Backoff Calculation
Lecture 5: 9-11-01 14
Outline
Lecture 5: 9-11-01 15
Slotted Aloha Efficiency
Lecture 5: 9-11-01 16
Pure Aloha (cont.)
S = throughput = “goodput”
0.4
• Key assumptions
• All packets are same, small size
• Packet size = size of contention slot
• All nodes always have pkt to send
• p is chosen carefully to be related to N
• p is actually chosen by exponential backoff
• Takes full slot to detect collision (I.e. no “fast
collision detection”)
Lecture 5: 9-11-01 18
Ethernet Problems
Lecture 5: 9-11-01 19
Outline
Lecture 5: 9-11-01 20
Minimum Packet Size
• What if two
people sent
really small
packets
• How do you find
collision?
Lecture 5: 9-11-01 21
Ethernet Collision Detect
Lecture 5: 9-11-01 22
End to End Delay
Lecture 5: 9-11-01 23
Packet Size
Lecture 5: 9-11-01 24
Ethernet Frame Structure
Lecture 5: 9-11-01 25
Ethernet Frame Structure (cont.)
• Preamble: 8 bytes
• 101010…1011
• Used to synchronize receiver, sender clock
rates
• CRC: 4 bytes
• Checked at receiver, if error is detected, the
frame is simply dropped
Lecture 5: 9-11-01 26
Ethernet Frame Structure (cont.)
Lecture 5: 9-11-01 27
Addressing Alternatives
• Addresses: 6 bytes
• Each adapter is given a globally unique address at
manufacturing time
• Address space is allocated to manufacturers
• 24 bits identify manufacturer
• E.g., 0:0:15:* 3com adapter
• Frame is received by all adapters on a LAN and dropped if
address does not match
• Special addresses
• Broadcast – FF:FF:FF:FF:FF:FF is “everybody”
• Range of addresses allocated to multicast
• Adapter maintains list of multicast groups node is interested in
Lecture 5: 9-11-01 29
Ethernet Technologies: 10Base2
• 10: 10Mbps; 2: under 185 (~200) meters cable length
• Thin coaxial cable in a bus topology
Lecture 5: 9-11-01 30
10BaseT and 100BaseT
Lecture 5: 9-11-01 31
10BaseT and 100BaseT (more)
Lecture 5: 9-11-01 32
Gbit Ethernet
Lecture 5: 9-11-01 33
Gbit Ethernet
Lecture 5: 9-11-01 34
LAN Switching
LAN 1 LAN 2
Lecture 5: 9-11-01 35
Switched Network Advantages
Lecture 5: 9-11-01 36
Outline
Lecture 5: 9-11-01 37
“Taking Turns” MAC Protocols
channel
• High load: collision overhead
Lecture 5: 9-11-01 38
“Taking Turns” MAC protocols
Polling Token Passing
• Master node “invites” slave • Control token passed from
nodes to transmit in turn one node to next
• Request to Send, Clear to sequentially.
Send msgs • Token message
• Concerns: • Concerns:
• Polling overhead • Token overhead
• Latency • Latency
• Single point of failure • Single point of failure (token)
(master)
Lecture 5: 9-11-01 39
Token Rings
Lecture 5: 9-11-01 40
Why Did Ethernet Win?
• Failure modes
• Token rings – network unusable
• Ethernet – node detached
• Good performance in common case
• Volume lower cost higher volume ….
• Adaptable
• To higher bandwidths (vs. FDDI)
• To switching (vs. ATM)
• Completely distributed, easy to maintain/administer
• Easy incremental deployment
• Cheap cabling, etc
Lecture 5: 9-11-01 41