Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 ·...

73
Lectures 22-23 Ethernet EECS 122 University of California Berkeley

Transcript of Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 ·...

Page 1: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

Lectures 22-23Ethernet

EECS 122

University of CaliforniaBerkeley

Page 2: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

EECS122 - COMMENTS

OverviewRobert Metcalfe at Xerox in Palo Alto developed the

original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

10-Mbps (DIX) versions in 1980 and 1982. IEEE published the IEEE802.3 standard in June 1983.

Grand Junction developed Fast Ethernet (100Mbps) in 1992 that was standardized by IEEE in 1995.

IEEE standardized Gigabit Ethernet in 1998. 10-Gigabit Ethernet was standardized in 2002.

These standard specify the physical layer, the MAC (media access control) sublayer, and the LLC (logical link control) sublayer. In addition, the standards define the rules for addressing and routing.

Page 3: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

2EECS122 - Contents – Index -

EthernetOverviewPhysical LayerMACBridged EthernetVLANLink AggregationXON/XOFF802.11

ETHERNET

Page 4: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

3EECS122 - Contents – Index -

OverviewTypical SetupNamesOperationsPerspective

ETHERNET - Overview

Page 5: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

4EECS122 - Contents – Index -

Typical Setup

ETHERNET – Overview - Typical

Page 6: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

5EECS122 - Contents – Index -

NamesStructure

[rate][modulation][media or distance]10Base5 (10Mbps, baseband, coax, 500m)10Base-T (10Mbps, baseband, twisted pair)100Base-TX (100Mbps, baseband, 2 pair)100Base-FX (100Mbps, baseband, fiber)1000Base-CX for two pairs balanced copper cabling 1000Base-LX for long wavelength optical transmission 1000Base-SX for short wavelength optical transmission.

Wireless:Wi-Fi = 802.11Versions: a, b, g

ETHERNET – Overview - Names

Page 7: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

6EECS122 - Contents – Index -

OperationsHub: Single Collision Domain

MAC Protocol: Wait until silent (carrier sense)TransmitIf collision, wait random time & repeatCSMA/CD

ETHERNET – Overview – Operations

Page 8: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

7EECS122 - Contents – Index -

OperationsSwitch: No Collisions

Multiple transmissions are possibleSwitch stores packets that wait for same output

ETHERNET – Overview Operations

Page 9: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

8EECS122 - Contents – Index -

Perspective

Ethernet is wildly successful, partly due to low cost (compare with FDDI or Token Ring--- see text book)Some issues:

nondeterministic serviceno prioritiesmin frame size may be large

ETHERNET Overview - Perspective

Page 10: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

9EECS122 - Contents – Index -

Physical Layer

ETHERNET – Physical

Page 11: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

EECS122 - COMMENTS

Physical

5 km20 km25 kmSingle-mode Fiber

550 m412 m (hd)2 km (fd)2 kmMultimode Fiber

25 m100 m500 mSTP/Coax

100 m100 m100 m (min)Cat 5 UTP

1000 Base Mbps(1 gigabit per

second)100 Mbps10 MbpsData Rate

Gigabit Ethernet1000 Base x

Fast Ethernet100 BaseT

Ethernet10 BaseT

Page 12: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

10EECS122 - Contents – Index -

Physical

ETHERNET Physical

Page 13: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

11EECS122 - Contents – Index -

MAC: Media Access ControlFrameMultiple Access

ETHERNET - MAC

Page 14: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

12EECS122 - Contents – Index -

Frame

7 byte preamble: alternating 1/0 combination producing 10Mhz square wave [@ 10Mbps] for 5.6 µsec; used for receiver synchronization

1 byte SFD (start of frame delimiter) 10101011

ETHERNET – MAC – Frame

Page 15: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

13EECS122 - Contents – Index -

FrameLength/Type field:

Type (Ethernet)indicates type of data contained in payloadissue: what is the length?

Length field (802.3)type info follows frame header

So, is it the type or length?“Ethernet”: types have values above 2048 (RFC894 for IP)802.3: length (RFC1042 for IP)

If length, next headers are LLC & SNAP (for IP)LLC (3 bytes): DSAP, SSAP, CTLSNAP (5 bytes): org code, type (above)

ETHERNET – MAC Frame

Page 16: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

EECS122 - COMMENTS

Frame Structure 802.3The frame structure has two possible versions:

Type encapsulation: (The number between parentheses are the lengths in bytes of the fields.)

[PRE (8) | DA (8) | SA (8) | Type (2) | Data (46-1500) | FCS (4)].PRE is the preamble, used for synchronization. DA is the destination

address, SA the source address. The type (> 2,048) specifies the protocol above the LLC (e.g., IP, IPX, AppleTalk, etc.).

Length encapsulation: [PRE (8) | DA (8) | SA (8) | Length (2) | DSAP (1) | SSAP (1) | Ctrl (1-2) | Data |

Pad (if needed) | FCS (4)].DSAP is the destination service access point and specifies the process

that gets the data at the destination. SSAP is the source service access point. The length specifies the length (0 – 1500) in bytes of the unpadded data. The padding makes sure that the size from the start of DSAP to the end of the padding is between 46 and 1500 bytes.

Page 17: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

14EECS122 - Contents – Index -

Multiple AccessHigh-Level ViewMultiple Access ProtocolsRandom Access ProtocolsSlotted ALOHACSMA/CD

ETHERNET – MA

Page 18: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

15EECS122 - Contents – Index -

High-Level ViewGoal: share a communication medium among multiple hosts connected to itProblem: arbitrate between connected hostsSolution goals:

High resource utilizationAvoid starvationSimplicity (non-decentralized algorithms)

ETHERNET – MA High Level

Page 19: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

16EECS122 - Contents – Index -

Medium Access ProtocolsChannel partitioning

Divide channel into smaller “pieces” (e.g., time slots, frequency)Allocate a piece to node for exclusive use

Random accessAllow collisions“recover” from collisions

“Taking-turns”Tightly coordinate shared access to avoid collisions

ETHERNET – MA Protocols

Page 20: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

17EECS122 - Contents – Index -

Random Access protocolsWhen 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 collisionsHow to recover from collisions

Examples of random access MAC protocols:Slotted ALOHACSMA and CSMA/CD

ETHERNET – MA Random

Page 21: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

18EECS122 - Contents – Index -

Slotted Aloha

Time is divided into equal size slots (= packet transmission time)Node with new arriving pkt: transmit at beginning of next slot If collision: retransmit pkt in future slots with probability p, until successful.

Success (S), Collision (C), Empty (E) slots

ETHERNET – MA – S.Aloha

Page 22: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

19EECS122 - Contents – Index -

Slotted Aloha: EfficiencyWhat is the maximum fraction of successful transmissions? Suppose N stations have packets to send

Each transmits in slot with probability pProb. successful transmission S is (very approximated analysis!):

by a particular node: S = p (1-p)(N-1)

by any of N nodes

S = Prob (only one transmits)= N p (1-p)(N-1) ≈ 1/e = 0.37

ETHERNET – MA S.Aloha

Page 23: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

20EECS122 - Contents – Index -

CSMA: Carrier Sense Multiple Access

CS (Carrier Sense) means that each node can distinguish between an idle and a busy linkSender operations:

If channel sensed idle: transmit entire packetIf channel sensed busy, defer transmission

Persistent CSMA: retry immediately with probability p when channel becomes idleNon-persistent CSMA: retry after a random time interval

ETHERNET – MA – CSMA

Page 24: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

21EECS122 - Contents – Index -

CSMA: collisionsspatial layout of nodes along ethernet

Collisions can occur:propagation delay means two nodes may not hear each other’s transmission

Collision:entire packet transmission time wasted

Note:role of distance and propagation delay in determining collision prob.

ETHERNET – MA CSMA

Page 25: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

22EECS122 - Contents – Index -

CSMA/CD (collision detection)OverviewTimingEthernet

ETHERNET – MA – CSMA/CD

Page 26: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

23EECS122 - Contents – Index -

Overview

Collisions detected within short timeColliding transmissions aborted, reducing channel wastage Easy in wired LANs: measure signal strengths, compare transmitted, received signalsDifficult in wireless LANs

ETHERNET – MA – CSMA/CD - Overview

Page 27: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

24EECS122 - Contents – Index -

Timing

ETHERNET – MA – CSMA/CD - Timing

Page 28: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

25EECS122 - Contents – Index -

EthernetOverviewCollision DetectionMinimum Frame SizeMaximum Frame SizeOperationsEfficiencyAddressingFast EthernetGigabit Ethernet

ETHERNET – MA – CSMA/CD - Ethernet

Page 29: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

26EECS122 - Contents – Index -

Overview

Will discuss “classical” Ethernet primarilySingle segments up to 500m; with up to 4 repeaters gives 2500m max lengthBaseband signals broadcast, Manchester encoding, 32-bit CRC for error detectionMax 100 stations/segment, 1024 stations/Ethernet

ETHERNET – MA – CSMA/CD – Ethernet Overview

Page 30: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

27EECS122 - Contents – Index -

Collision Detection CD circuit operates by looking for voltage exceeding a transmitted voltageWant to ensure that a station does not complete transmission prior to 1st bit arriving at farthest-away stationTime to CD can thus take up to 2x{max prop. delay}

CD

A B

time

ETHERNET – MA – CSMA/CD – Ethernet CD

Page 31: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

28EECS122 - Contents – Index -

Minimum Frame Size

Speed of light is about 4µs/km in copperSo, max Ethernet signal prop time is about 10 µsec, or 20µsec RTTWith repeaters, etc. 802.3 requires 51usec, corresponding to 512 bit-timesThus, minimum frame size is 512 bits (64 bytes); also called slot time

ETHERNET – MA – CSMA/CD – Ethernet Minimum

Page 32: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

29EECS122 - Contents – Index -

Maximum Frame Size

1500 byte limitation on maximum frame transmission sizeWe will call this the MTUlimits maximum buffers at receiverallows for other stations to send

also requires 96 bit Inter-Packet-Gap (IPG)

ETHERNET – MA – CSMA/CD – Ethernet Maximum

Page 33: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

30EECS122 - Contents – Index -

Operations

When ready & line idle, await IPG (96 bit times) and send while listening (CD)If CD true, send max 48-bit jamming sequence and do exponential backoffJamming sequence used to inform all stations that a collision has occurred

ETHERNET – MA – CSMA/CD – Ethernet – Operations

Page 34: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

31EECS122 - Contents – Index -

Operations

For retransmission N (1<=N<=10)choose k at random on U(0..2^N-1)wait k * (51.2µsec) to retransmitsend on idle; repeat on another collisionfor (11<=N<=15), use U(0..1023)if N = 16, drop frame

Longer wait implies lower priority (strategy is not “fair”)

ETHERNET – MA – CSMA/CD – Ethernet – Operations

Page 35: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

32EECS122 - Contents – Index -

Operations: Capture Effect

Given two stations A & B, unfair strategy can cause A to continue to “win”Assume A & B always ready to send:

if busy, both wait, send and collidesuppose A wins, B backs offnext time, B’s chances of winning are halved

ETHERNET – MA – CSMA/CD – Ethernet Operations

Page 36: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

33EECS122 - Contents – Index -

Efficiency Typical Sequence of Events:

Average = 5TT = max.prop.time

between 2 nodesAverage = L/R secondsL = average packet length

StartTransmitting

Collision

Wait RandomTime

Efficiency = L/RL/R + 5T

= 1/(1 + 5a)

a = T/(L/R) = RT/L

Successful Transmission

ETHERNET – MA – CSMA/CD – Ethernet – Efficiency

Page 37: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

34EECS122 - Contents – Index -

Efficiency a impacts what happens during simultaneous transmission:

a small early collision detectionEfficient

a large late detectionInefficient

Example 1: 10Mbps, 1000m => T = (1km)(4µs/km) = 4µs; RT = 400 bits

L = 4000 bits, say5a = 2000/4000 = 0.5 => efficiency = 66%

Example 2: 1Gbps, 200m=> T = (0.2km)((4µs/km) = 0.8µs; RT = 800 bits

L = 4000 bits; 5a = 4000/4000 = 1 => efficiency = 50%

a = RT/Leff = 1/(1 + 5a)

ETHERNET – MA – CSMA/CD – Ethernet – Efficiency

Page 38: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

35EECS122 - Contents – Index -

Efficiency - AnalysisModel:

Slot = 2T

N stations compete by transmitting with probability p, independently

If success => transmit L bitsIf failure (idle or collision), try next slot

P(success) = P(exactly 1 out of N transmits) = Np(1 – p)N-1

Indeed: N possibilities of station that transmitsP(one given station transmits, others do not) = p(1 – p)N-1

ETHERNET – MA – CSMA/CD – Ethernet – Efficiency

Page 39: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

36EECS122 - Contents – Index -

Efficiency - AnalysisSlot = 2T

success

Average = A

P(success) = Np(1 – p)N-1

Assume backoff algorithm results in best p = 1/N=> P(success) ≈ 1/e = 0.36

Average time until success: A = 0.36x0 + 0.64x(2T + A)

=> A = 1.28T/0.36 = 3.5TIn practice, backoff not quite optimal => 5T

ETHERNET – MA – CSMA/CD – Ethernet Efficiency

Page 40: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

EECS122 - COMMENTS

Efficiency of CSMA/CDConsider a discrete-time model where N stations compete for time

slots with duration S. In this model, the stations transmit independently, with probability p each, in every time slot.

If a single station transmits in a slot, then it keeps transmitting a full packet with duration T. If more than a station transmits, they all stop and the slot is wasted.

The probability that a slot is "successful" is then Np(1 - p)^{N - 1}. The maximum over p occurs for p = 1/N and the optimal value is close to 1/e where e = 2.718.

If A designates the average number of slots wasted until the first successful slot, then A = 0(1/e) + (1 + A)(1 - 1/e). Solving for A, one finds A = e - 1 = 1.7. Consequently, the transmission of a packet which should take T seconds takes on average T + 1.7Sseconds. The value of S is an upper bound on a round-trip propagation time on the network.

The rationale for optimizing over p is that the actual algorithm uses an exponential back off scheme that achieve a throughput close to the optimal. However, all this is rather approximate.

Page 41: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

37EECS122 - Contents – Index -

Addressing

48 bit Ethernet/MAC/Hardware AddressesPrefix assigned per-vendor by IEEEUnique per-adapter, burned in ID PROMMulticast & Broadcast (all 1’s) addressesMany adapters support promiscuous mode

ETHERNET – MA – CSMA/CD – Ethernet – Addressing

Page 42: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

38EECS122 - Contents – Index -

Addressing - Multicast

Each vendor assignment supports 2^24 individual and group (multicast) addressesEach adapter supports multiple group “subscriptions”

usually implemented as hash tablethus, software may have to filter at higher layer

ETHERNET – MA – CSMA/CD – Ethernet Addressing

Page 43: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

39EECS122 - Contents – Index -

Fast Ethernet

“Fast Ethernet” (1995) adds:10x speed increase (100m max cable length retains min 64 byte frames)replace Manchester with 4B/5B (from FDDI)full-duplex operation using switchesspeed & duplex auto-negotiation

ETHERNET – MA – CSMA/CD – Ethernet Fast

Page 44: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

40EECS122 - Contents – Index -

Gigabit Ethernet IEEE 802.3{z,ab} 1000 Mb/s

“Gigabit Ethernet” (1998,9) adds:100x speed increasecarrier extension (invisible padding...)packet bursting

ETHERNET – MA – CSMA/CD – Ethernet GE

Page 45: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

41EECS122 - Contents – Index -

Bridged Ethernets

ObjectivesNo-Frills BridgeLearning BridgeSpanning Tree AlgorithmBridge Limitations

ETHERNET – Bridged

Page 46: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

42EECS122 - Contents – Index -

Objectives

Bridges interconnect network segments at the link layer (layer 2)Handle any layer 3 protocol (incl. non-routable ones); some can interconnect different mediaMostly for LANs, also used in WANs (2 “half bridges” on ends of pt-to-pt links

ETHERNET – Bridged – Objectives

Page 47: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

43EECS122 - Contents – Index -

Objectives – Extending LANsExtending (interconnecting) multiple LANs. Appears as single LAN to layer 3.Essentially accepts and forwards all framesBenefits:

extend number of stationsextend sizelimit interfering traffic

B B R

H

ETHERNET – Bridged Objectives

Page 48: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

44EECS122 - Contents – Index -

“No-Frills” Bridge

Interconnect 2 or more LAN segmentsListens in promiscuous mode, buffers packets and transmits them on other interfaces when ableOn average, still cannot exceed link bandwidth

bridge copies all trafficsmall bursts accommodated in buffers

B

ETHERNET – Bridged No Frills

Page 49: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

45EECS122 - Contents – Index -

Learning Bridge

Bridges “learn” which interfaces reach which end stations

could do this “by hand”, but a hasslebest if this happens transparently

Learn by watching source addresses in frames

senders usually use their own addresses(note that bridges don’t!)

ETHERNET – Bridged – Learning

Page 50: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

46EECS122 - Contents – Index -

Learning Bridge

Listen promiscuously for all trafficStore (src addr, port) tuple in “station cache” for each new sender observedFor each received frame:

try to match frame dest to cache src entrynot there->send on all interfaces except rcvis there->send on indicated, or filter if same as rcvinterface

Age cache entries

ETHERNET – Bridged – Learning

Page 51: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

EECS122 - COMMENTS

LearningThe switch must learn the MAC addresses of the

NICs attached to each of its ports. If one switch port is attached to a hub, then a number of NICsare effectively attached to that port.

The switch makes a list of the NICs addresses by watching the source addresses of the packets that arrive at the port.

Page 52: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

47EECS122 - Contents – Index -

Learning Bridge – Example 1

A 1

1 2

B 1A B C D

ETHERNET – Bridged – Learning

Page 53: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

48EECS122 - Contents – Index -

Learning Bridge – Example 2

1 2

3

C D

A 1

D 3

A B E F

ETHERNET – Bridged Learning

Page 54: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

49EECS122 - Contents – Index -

Spanning Tree Algorithm

Loops hurt!Spanning TreeAlgorithmExampleTopology Change

ETHERNET – Bridged – STA

Page 55: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

EECS122 - COMMENTS

Spanning TreeTo prevent frame duplications when there are

multiple paths between pairs of hosts in a collection of bridged Ethernets, the bridges implement the spanning tree protocol.

Unfortunately, the spanning tree protocol is slow to reconfigure after failure (one minute is typical) and it uses only one possible path that is typically inefficient.

Page 56: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

50EECS122 - Contents – Index -

Loops HurtWith redundant paths, bridges can loop traffic

can happen forever (example)with more than 2, can cascade

Cascadeeach bridge with N interfaces may produce up to N -2 new copies!

ETHERNET – Bridged – STA Loops Hurt

Page 57: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

51EECS122 - Contents – Index -

Spanning TreeConsider LAN a graph G = (E, V), with LANs as vertices, and bridges as edgesSpanning Tree:

A spanning tree of an undirected, connected graph G is a subgraph which is both a tree and contains all vertices in GThus, the ST will throw out some edges and be cycle-free

Purpose will be to provide a single path to reach each networkGenerally, graphs have many STsMust be a distributed algorithmCan result in some bridges not forwarding at all!

ETHERNET – Bridged – STA Spanning Tree

Page 58: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

52EECS122 - Contents – Index -

AlgorithmEach bridge will decide over which ports it will forward frames

bridges have unique addresses per portports are also numbered by each bridgebridges have a single unique identifier (e.g. the lowest address)

UltimatelyRoot of tree = bridge with smallest IDTree = shortest paths to rootResolve ties in favor of link to bridge with smallest ID

StepsSend [ my ID | current root ID | my distance to current root ]Update when receive smaller root ID

ETHERNET – Bridged – STA Algorithm

Page 59: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

53EECS122 - Contents – Index -

Example

B1B2

B3 B4 B61 [3|3|0]

3 [1|1|0]4 [2|1|1]

5 [3|1|2] 6 [6|1|1]

B5 2 [5|3|1]

Format: [my ID | current root ID | distance to current root]

ETHERNET – Bridged – STA Example

Page 60: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

54EECS122 - Contents – Index -

Topology Change

Want to inform all bridges, but without having traffic scale as # of bridgesOperation

bridges noticing change send message on root port toward rootroot config messages subsequently contain “topology changed” flag

ETHERNET – Bridged STA – Topology Change

Page 61: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

55EECS122 - Contents – Index -

Limitations

Scale: not very realistic to interconnect more than 10’s of LANsHeterogeneity: really works best for homogeneous systemsAll broadcasts and multicasts are flooded

ETHERNET Bridged – Limitations

Page 62: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

56EECS122 - Contents – Index -

VLAN – Virtual LAN

A A

A

AB C

B

B

C

C

A, B, C A, B, C

Each port belongs to a set of VLANs and transmits only packets that belong to these VLANs

ETHERNET VLAN

Page 63: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

57EECS122 - Contents – Index -

Link Aggregation

Links are combined. Hello protocol determines which links are working and transmits across working links.

ETHERNET VLAN

Page 64: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

58EECS122 - Contents – Index -

XON/XOFF

1 - Saturated

2 - XOFF 2 - XOFF

XON/XOFF is a backpressure scheme designed to prevent nodes from saturating links. Unfortunately, in its present version, the scheme is not very effective – it stops too many flows.

ETHERNET XON/XOFF

Page 65: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

59EECS122 - Contents – Index -

Wireless (802.11) OverviewPhysicalMACSummary

ETHERNET – 802.11

Page 66: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

60EECS122 - Contents – Index -

Overview Designed for use in limited geographical area (i.e., couple of hundreds of meters)Designed for three physical media (run at either 1Mbps or 2 Mbps)

Two based on spread spectrum radioOne based on diffused infrared

ETHERNET – 802.11 Overview

Page 67: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

61EECS122 - Contents – Index -

PhysicalFrequency hoping (OFDM)

Transmit the signal over multiple frequenciesThe sequence of frequencies is pseudo-random, i.e., both sender and receiver use the same algorithm to generate their sequences

Direct sequence (DSSS)Represent each bit by multiple (e.g., n) bits in a frame; XOR signal with a pseudo-random generated sequence with a frequency n times higher

Infrared signal Sender and receiver do not need a clear line of sightLimited range; order of meters

ETHERNET – 802.11 – Physical

Page 68: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

62EECS122 - Contents – Index -

Physical802.11b

DSSS: 1, 2, 5.5, or 11 Mbps (depending on SNR)2.4GHzEach channel occupies 22MHzThere are 11 channels, but only 3 non-overlapping ones (1, 6, 11)Max. power = 1W

802.11aOFDM: 6, 9, 12, 18, 24, 36, 48, 54 Mbps (last 3 are optional)5GHz12 channelsMax. power = 40mW, 200mW, 800mW (depending on freq.)

ETHERNET – 802.11 – Physical

Page 69: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

63EECS122 - Contents – Index -

Physical802.11g

OFDM: 6, 12, 24, 18, 36, 48, 54 Mbps (last 4 are optional)2.4GHzBackward compatible with 802.11b3 non-overlapping channels

ETHERNET – 802.11 Physical

Page 70: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

64EECS122 - Contents – Index -

MAC: The ProblemsReachability is not transitive: if A can reach C, and C can reach D, it doesn’t necessary mean that A can reach D

Hidden nodes: A and C send a packet to B; neither A nor C will detect the collision!Exposed node: B sends a packet to A; C hears this and decides not to send a packet to D (despite the fact that this will not cause interference)!

A B C D

ETHERNET – 802.11 – MAC

Page 71: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

65EECS122 - Contents – Index -

MAC: RTS/CTSother node in sender’s rangeRTS

CTS

ACK

data

sender receiver

Before every data transmission Sender sends a Request to Send (RTS) frame containing the length of the transmissionReceiver respond with a Clear to Send (CTS) frameSender sends dataReceiver sends an ACK; now another sender can send data

When sender doesn’t get a CTS back, it assumes collision

ETHERNET – 802.11 – MAC

Page 72: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

66EECS122 - Contents – Index -

MAC: CSMA/CACA instead of CD: cannot listen while transmittingNAV: Network Allocation Vector: time until channel will become available – transmitted in every frameDistributed Coordinated Function: Before transmitting

Check if channel is busy, orIn an interval between frames [as determined from NAV], orIn an interval reserved for retransmission of an erroneous frame [as determined from previous transmission].If one of the above, exponential backoff; else transmit.

Centralized Controlled Access Mechanism: A point coordinator (in access point) coordinates transmissions.

Stations request that the PC puts them in polling listPeriodically, PC polls stations for traffic.Without hidden terminal; with hidden terminal

ETHERNET – 802.11 MAC

Page 73: Lectures 22-23 Ethernetrobotics.eecs.berkeley.edu/~wlr/12203/ethernet.pdf · 2003-04-15 · original Ethernet in 1973. Digital Equipment Corporation, Intel, and Xerox defined the

67EECS122 - Contents – Index -

Summary

Arbitrate between multiple hosts sharing a common communication mediaWired solution: Ethernet (use CSMA/CD protocol)

Detect collisionsBackoff exponentially on collision

Wireless solution: 802.11Use MACA protocolCannot detect collisions; try to avoid them

ETHERNET 802.11 – Summary