EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122,...

26
EECS 122, Lecture 7 Kevin Fall [email protected] Jean Walrand [email protected]

Transcript of EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122,...

Page 1: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122, Lecture 7Kevin Fall

[email protected] Walrand

[email protected]

Page 2: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 198

Ethernet: OutlineTypical SetupNamesPhysical LayerFrameFast Ethernet; Gigabit Ethernet10Base5 Efficiency of CSMA/CDPerspective

Page 3: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 199

Ethernet Typical Setup

Page 4: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 200

Ethernet Names

Names of form[rate][modulation][media or distance]

Examples:n 10Base2 (10Mb/s, baseband, small coax, 200m)n 10Base5 (10Mb/s, baseband, coax, 500m)n 10Base-T (10Mb/s, baseband, twisted pair)n 100Base-TX (100Mb/s, baseband, 2 pair)n 100Base-FX (100Mb/s, baseband, fiber)

Page 5: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 201

Ethernet Physical Layer

Page 6: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 202

Ethernet Physical Layer

Page 7: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 203

Ethernet Physical Layer

Hub: Single Collision Domain

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

Page 8: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 204

Ethernet Physical Layer

Switch: No Collisions

Multiple transmissions are possibleSwitch stores packets that wait for same output

Page 9: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 205

Ethernet 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

Page 10: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 206

Ethernet Frame

Length/Type field:§ Type (Ethernet)

§ indicates type of data contained in payload§ issue: 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, CTL§ SNAP (5 bytes): org code, type (above)

Page 11: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 207

Ethernet IEEE 802.3u 100 Mb/s

“Fast Ethernet” (1995) adds:n 10x speed increase (100m max cable

length retains min 64 byte frames)n replace Manchester with 4B/5B (from

FDDI)n full-duplex operation using switchesn speed & duplex auto-negotiation

Page 12: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 208

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

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

Page 13: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 209

Ethernet 10base5 - Definition

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

Page 14: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 210

Ethernet 10base5 – 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}

A B

CD

time

Page 15: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 211

Ethernet 10base5 – 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

Page 16: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 212

Ethernet 10base5 – max. frame size

1500 byte limitation on maximum frame transmission sizeLater we will call this the MTUlimits maximum buffers at receiverallows for other stations to sendn also requires 96 bit Inter-Packet-Gap (IPG)

Page 17: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 213

Ethernet 10base5 - Transmitter

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

Page 18: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 214

Ethernet 10base5 – Exponential Backoff

For retransmission N (1<=N<=10)n choose k at random on U(0..2^N-1)n wait k * (51.2µsec) to retransmitn send on idle; repeat on another collisionn for (11<=N<=15), use U(0..1023)n if N = 16, drop frameLonger wait implies lower priority (strategy is not “fair”)

Page 19: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 215

Ethernet 10base5 – Capture Effect

Given two stations A & B, unfair strategy can cause A to continue to “win”Assume A & B always ready to send:n if busy, both wait, send and colliden suppose A wins, B backs offn next time, B’s chances of winning are

halved

Page 20: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 216

Ethernet Efficiency of CSMA/CD

Typical Sequence of Events:

StartTransmitting

Collision

Wait RandomTime

Successful Transmission

Average = L/R secondsL = average packet length

Average = 5TT = max.prop.time

between 2 nodes

Efficiency = L/RL/R + 5T

= 1/(1 + 5a)

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

Page 21: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 217

Ethernet Efficiency of CSMA/CD

a impacts what happens during simultaneous transmission:n a small early collision detection

Efficient

n 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)

Page 22: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 218

Ethernet Efficiency of CSMA/CD - Analysis

Model: 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

Page 23: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 219

Ethernet Efficiency of CSMA/CD - Analysis

Slot = 2T

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

success

Average = A

Page 24: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 220

Ethernet 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 promiscuousmode

Page 25: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 221

Ethernet Addressing: Multicast

Each vendor assignment supports 2^24 individual and group (multicast) addressesEach adapter supports multiple group “subscriptions”n usually implemented as hash tablen thus, software may have to filter at higher

layer

Page 26: EECS 122, Lecture 7robotics.eecs.berkeley.edu/~wlr/12202/Lecture Slides/lec07.pdf · EECS 122, Lecture 7 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu. ... types

EECS 122 - Fall & Walrand 222

Ethernet Perspective

Ethernet is wildly successful, partly due to low cost (compare with FDDI or Token Ring--- see text book)Some issues:n nondeterministic servicen no prioritiesn min frame size may be large