Multiple Access: Ethernet

dingdongboomNetworking and Communications

Oct 27, 2013 (3 years and 5 months ago)

60 views

1

Multiple Access: Ethernet

Section 2.6

2

Point
-
to
-
Point vs. Broadcast
Media


Point
-
to
-
point


PPP for dial
-
up access


Point
-
to
-
point link between Ethernet switch and host


Broadcast (shared wire or medium)


Traditional Ethernet


802.11 wireless LAN





mmmmmmmmmm
mmmmmmmmmm
mmmmmmmmmm
mmmmmmmmmm
mmmmmmmmmm
mmmmmmmmmm
mmmmmmmmmm
m

3

Multiple Access Protocol


Single shared broadcast channel


Avoid having multiple nodes speaking at once


Otherwise, collisions lead to garbled data


Multiple access protocol


Distributed algorithm for sharing the channel


Algorithm determines which node can transmit


Classes of techniques


Channel partitioning: divide channel into pieces


Taking turns: passing a token for the right to transmit


Random access: allow collisions, and then recover

4

Random Access Protocols


When node has packet to send


Transmit at full channel data rate R.


No a priori coordination among nodes


Two or more transmitting nodes


“collision”


Random access MAC protocol specifies:


How to detect collisions


How to recover from collisions


Examples


CSMA/CD (Ethernet: IEEE 802.3)


CSMA/CA (Wireless: IEEE 802.11)

5

Key Ideas of Random Access


Carrier sense


Listen before speaking, and don’t interrupt


Checking if someone else is already sending data


… and waiting till the other node is done


Collision detection


If someone else starts talking at the same time, stop


Realizing when two nodes are transmitting at once


…by detecting that the data on the wire is garbled


Randomness


Don’t start talking again right away


Waiting for a random time before trying again

6

CSMA/CD (Collision Detection)


Carrier Sense Multiple Access, CSMA: listen
before transmit


If channel sensed idle: transmit entire frame


If channel sensed busy, defer transmission


CD, Collision Detection :


Collisions detected
within short time


Colliding transmissions
aborted
, reducing wastage


Easy in wired LANs: measure signal strengths,
compare transmitted, received signals


Difficult in wireless LANs: receiver shut off while
transmitting



Human analogy: the polite conversationalist

7

CSMA/CD Collision Detection

8

Ethernet


Dominant wired LAN technology


First widely used LAN technology


Simpler, cheaper than token LANs and ATM


Kept up with speed race: 10 Mbps


10 Gbps

Metcalfe’s

Ethernet

sketch

9

Ethernet Topologies

Bus Topology: Shared

All nodes connected
to a wire

Star Topology:

All nodes connected to a
central repeater

10

Ethernet Connectivity

10Base5


ThickNet

< 500m

Controller

Vampire Tap

Transceiver

Bus Topology

Detects when the line is idle

Drives the signal when the host is transmitting

Receives incoming signals

Controller:

Implements all the
logic that makes
up the Ethernet

11

Ethernet Connectivity

10Base2


ThinNet

< 200m

Controller

BNC T
-
Junction

Transceiver

Bus Topology

12

Ethernet Connectivity

10BaseT

< 100m

twisted pair

hub

Controller

Star Topology

13

Ethernet MAC Protocol, CSMA/CD


Carrier sense: wait for link to be idle


Channel idle: start transmitting


must wait
9.6
µ
s

between back
-
to
-
back frames


Channel busy: wait until idle and transmit immediately




Collision detection: listen while transmitting


No collision: transmission is complete


Collision: abort transmission, and send a 32
-
bit “jamming
sequence”

14

Ethernet MAC Protocol, CSMA/CD(cont.)


Random access: exponential back
-
off


After collision, wait a random time before trying again


After m
th
collision, choose K randomly from {0
,...,

2
m
-
1}


… and wait for K*512 bits transmission time before trying
again


K*51.2
µ
s on 10Mbps Ethernet


15

Delay Times After Collision


Delay and try again


1st time: 0 or 51.2
µ
s


2nd time: 0, 51.2, or 102.4
µ
s


3rd time: 0, 51.2, 102.4, or 153.6
µ
s


After n collisions,



wait

time:
k
x 51.2
µ
s,

for randomly selected
k
=0 … 2
n

-

1


give up after several tries (up to 16)


exponential backoff

16

Collisions

A

B

How can we ensure that A knows about the collision?

17

Limitations on Ethernet Length


Latency depends on physical length of link


Time to propagate a packet from one end to the other



Suppose A sends a packet at time t


And B sees an idle line at a time just before t+d


… so B happily starts transmitting a packet


B detects a collision, and sends jamming signal


But A doesn’t see collision till t+2d

latency d

A

B

18

Limitations on Ethernet Length


A needs to wait for time 2d to detect collision


So, A should keep transmitting during this period


… and keep an eye out for a possible collision


Imposes restrictions on Ethernet


Maximum length of the wire: 2500 meters


Minimum length of the packet: 512 bits (64 bytes)


802.3


2d is bounded to 51.2

s


At 10Mbps, and during 51.2

s, 512bit are transmitted (64B)


Packet length


64B

latency d

A

B

19

Ethernet Frame Structure


Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in
Ethernet
frame




Preamble:

8 bytes


7 bytes with pattern 10101010 followed by one
byte with pattern 10101011


Used to synchronize receiver, sender clock rates
(Manchester encoding)

20

Ethernet Frame Structure (con. I)


Address:

6 bytes


unique, 48
-
bit unicast address assigned to each
adapter (2
48

> 281 Billion); human readable, burned in
ROM (example: 8:0:2b:e4:b1:2 (00001000 00000000
00101011 11100100 10110001 00000010)


broadcast: all 1s


multicast: first bit is 1


used to send messages to some subset of the hosts on an
Ethernet (e.g. all file servers)


adaptor programmed to accept some set of multicast
addresses



21

Ethernet Frame Structure (con. II)


Adaptor receives all frames and accepts:


Frames addressed to its address;


Frames addressed to the broadcast address;


Frames addressed to a multicast address, if it has been
instructed to listen to that address;


All frames, if it has been placed in promiscuous mode.


Type:

2B; indicates the higher layer protocol (mostly IP but
others may be supported such as Novell IPX and AppleTalk)


CRC:

4B; checked at receiver, if error then frame is
discarded

22

Ethernet Frame Structure (con. III)


Frame Data: Up to 1500 data bytes



Minimally 46 bytes of data


Minimal frame = 46 (data) + 14 (header) + 4 (CRC) = 64
bytes


The reason for a minimum frame size is that the frame must be
long enough to detect a collision

14
-
byte header

23

Unreliable, Connectionless
Service


Connectionless


No handshaking between sending and receiving
adapter.


Unreliable


Receiving adapter doesn’t send ACKs


Packets passed to network layer can have gaps


Gaps will be filled if application is using TCP


Otherwise, the application will see the gaps

24

Hubs: Physical
-
Layer Repeaters


Hubs are physical
-
layer repeaters


Bits coming from one link go out all other links


At the same rate, with no frame buffering


No CSMA/CD at hub: adapters detect
collisions

twisted pair

hub

25

Interconnecting with Hubs


Backbone hub interconnects LAN segments


All packets seen everywhere, forming one large
collision domain


Can’t interconnect Ethernets of different speeds

hub

hub

hub

hub

26

Switch


Link layer device


Stores and forwards Ethernet frames


Examines frame header and selectively forwards
frame based on MAC destination address


When frame is to be forwarded on segment, uses
CSMA/CD to access segment


Transparent


Hosts are unaware of presence of switches


Plug
-
and
-
play, self
-
learning


Switches do not need to be configured

27

Switch: Traffic Isolation


Switch breaks subnet into LAN segments


Switch filters packets


Same
-
LAN
-
segment frames not usually forwarded
onto other LAN segments


Segments become separate collision domains

hub

hub

hub

switch

collision domain

collision domain

collision

domain

28

Benefits of Ethernet


Easy to administer and maintain


Inexpensive


Increasingly higher speed



Moved from shared media to switches


Change everything except the frame format


A good general lesson for evolving the Internet

29

Conclusions


IP runs on a variety of link layer technologies


Point
-
to
-
point links vs. shared media


Wide varieties within each class


Link layer performs key services


Encoding, framing, and error detection


Optionally error correction and flow control


Shared media introduce interesting challenges


Decentralized control over resource sharing


Partitioned channel, taking turns, and random access


Ethernet as a wildly popular example


Next time: Token Ring


Reading: Section 2.7