CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture ›...

32
CISC 7332X T6 Ethernet Hui Chen Department of Computer & Information Science CUNY Brooklyn College 11/5/2019 1 CUNY | Brooklyn College

Transcript of CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture ›...

Page 1: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

CISC 7332X T6

EthernetHui Chen

Department of Computer & Information Science

CUNY Brooklyn College

11/5/2019 1CUNY | Brooklyn College

Page 2: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Outline

• CSMA/CD

• Ethernet

11/5/2019 CUNY | Brooklyn College 2

Page 3: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Medium Access Control

• Two types of network links

• Point-to-point

• Multiple access (broadcast)

• Key issue

• Who gets to use the channel when there is a

competition to it?

• Multiaccess channel/random access channel

• Medium Access Control (MAC)

11/5/2019 CUNY | Brooklyn College 3

Page 4: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

The MAC Sublayer

• The protocols used to

determine who goes next on a

multiaccess channel

• Especially important for LAN,

particularly wireless LANs

• In contrast, WANs general use

point-to-point links, excepts

for satellite networks

11/5/2019 CUNY | Brooklyn College 4

Physical

Link

Network

Transport

Application

MAC is in here!

Page 5: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

CSMA/CD

• 1-Persistent CSMA and CD

11/5/2019 CUNY | Brooklyn College 5

Detect Collision

Collision?

Pick a random number r

Wait for r amount of time

YesNo

Wait for a message to arrive

Carrier busy?

Sense the carrier

Yes

No

A message arrives

Carrier Sense

BackoffProcedure

Transmit msg

Page 6: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

1-persistent CSMA with CD

11/5/2019 CUNY | Brooklyn College 6

Wait for a message to arrive

A message arrives

Carrier busy?

Sense the carrier

Yes

Sense carrier&

Transmit …

No

Transmit msg

Page 7: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Backoffprocedure

Non-persistent CSMA with CD

11/5/2019 CUNY | Brooklyn College 7

Wait for a message to arrive

A message arrives

Carrier busy?

Sense the carrier

Yes

Sense carrier&

Transmit …

No

Transmit msg

Pick a random number r

Wait for r time unit

Page 8: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

p-persistent CSMA with CD

11/5/2019 CUNY | Brooklyn College 8

Wait for a message to arrive

A message arrives

Carrier busy?

Sense the carrier

YesSense carrier&

Transmit …

No

Transmit msg

Pick a random number r between 0 and 1

r < p?Yes

No

Page 9: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Collision Detection

• CSMA/CD improvement is to detect/abort

collisions

• Reduced contention times improve

performance

11/5/2019 CUNY | Brooklyn College 9

Collision time is much shorter than frame time

Page 10: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Questions?

• CSMA/CD

11/5/2019 CUNY | Brooklyn College 10

Page 11: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Ethernet

• Classic Ethernet

• Switching/Fast Ethernet

• Gigabit/10 Gigabit Ethernet

11/5/2019 CUNY | Brooklyn College 11

Page 12: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Classic Ethernet: Physical

Layer

• One shared coaxial cable to which all

hosts attached

• Up to 10 Mbps, with Manchester encoding

• Hosts ran the classic Ethernet protocol for

access

11/5/2019 CUNY | Brooklyn College 12

Page 13: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Classic Ethernet: MAC

• MAC protocol is 1-persistent CSMA/CD

with BEB

• Random delay (backoff) after collision is

computed with BEB (Binary Exponential

Backoff)

11/5/2019 CUNY | Brooklyn College 13

Page 14: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

1-Persistent CSMA and CD

with BEB

• Time is slotted; when n >= 10, timeout

occurs

11/5/2019 CUNY | Brooklyn College 14

Detect Collision

Collision?

n := n + 1Pick a random number r in [0, 2n)

Wait for r amount of time

YesNo

Wait for a message to arrive

Carrier busy?

Sense the carrier

Yes

No

A message arrivesn := 0

Carrier SenseBinary Exponential BackoffProcedure

Transmit msg

Page 15: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Classic Ethernet: CD

Mechanism

• Collisions can occur and take as long as

2 to detect

• When it detects a collision, the receiver

transmits a short jamming signal

11/5/2019 CUNY | Brooklyn College 15

Page 16: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Classic Ethernet: Minim

Frame Length

• is the time it takes to propagate over

the Ethernet

• Leads to minimum packet size/frame

length for reliable detection

11/5/2019 CUNY | Brooklyn College 16

Page 17: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

CD and Minimum Frame

Length

• To make CD effective, we want a sending

station not to complete transmission (last

bit leaving the station) before the first bit

reaches the receiving station.

• At 10 Mbps, 1RTT 50 s, add a margin of

safety, the shortest frame is 512 bits or 64

bytes

11/5/2019 CUNY | Brooklyn College 17

010…011FrameSender Receiver

2500 meters

Page 18: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Classic Ethernet:

Performance

• Efficient for large frames, even with

many senders; degrades for small frames

(and long LANs)

11/5/2019 CUNY | Brooklyn College 18

10 Mbps Ethernet,64 byte min. frame

Page 19: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Classic Ethernet: Frame

Format

• Frame format is still used with modern

Ethernet

11/5/2019 CUNY | Brooklyn College 19

Ethernet(DIX)

IEEE 802.3

Page 20: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Frame Format: Minimum

Frame Length

• Minimum 46 bytes of data or padding

11/5/2019 CUNY | Brooklyn College 20

Ethernet(DIX)

IEEE 802.3

Page 21: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Questions?

• Channel allocation algorithms for

Ethernet

• Frame format

• Minimum length requirement

11/5/2019 CUNY | Brooklyn College 21

Page 22: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

LAN Switching

• LAN switching will be discussed next

week in detail

• LAN switching → Switched/Fast Ethernet

11/5/2019 CUNY | Brooklyn College 22

Page 23: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Hub and Switch

• Hubs wire all lines into a single CSMA/CD

domain

• Switches isolate each port to a separate

domain

• Much greater throughput for multiple ports

• No need for CSMA/CD with full-duplex lines

11/5/2019 CUNY | Brooklyn College 23

Page 24: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Hub and Switch

11/5/2019 CUNY | Brooklyn College 24

Page 25: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Switched/Fast Ethernet

• Switches can be wired to computers,

hubs and switches

• Hubs concentrate traffic from computers

• More on how to switch frames the in next

week

11/5/2019 CUNY | Brooklyn College 25

Switch

Twisted pair

Switch ports

Hub

Page 26: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Switched/Fast Ethernet

• Fast Ethernet extended Ethernet from 10

to 100 Mbps

• Twisted pair (with Cat 5) dominated the

market

11/5/2019 CUNY | Brooklyn College 26

Page 27: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Gigabit/10 Gigabit Ethernet

• Switched Gigabit Ethernet has many

varieties with full-duplex lines between

computers/switches

11/5/2019 CUNY | Brooklyn College 27

Page 28: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Gigabit / 10 Gigabit Ethernet:

Varieties

• Gigabit Ethernet

• 10 Gigabit Ethernet

• 40/100 Gigabit Ethernet

11/5/2019 CUNY | Brooklyn College 28

Page 29: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Gigabit Ethernet

• 1000Base-T is popular

11/5/2019 CUNY | Brooklyn College 29

Page 30: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

10 Gigabit Ethernet

11/5/2019 CUNY | Brooklyn College 30

Page 31: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Questions?

• Switched Ethernet

• Fast Ethernet

• Gigabit Ethernet

• 10 Gigabit Ethernet

• 40/100 Gigabit Ethernet

11/5/2019 CUNY | Brooklyn College 31

Page 32: CISC 7332X T6 Ethernet - huichen-cs.github.io › course › CISC7332X › 19FA › lecture › eth… · Carrier busy? Sense the carrier Yes No A message arrives Carrier Sense Backoff

Accessing Ethernet Service

on Host

• Using socket API

• raw socket

• Example Programs

• https://github.com/huichen-cs/ethernet

11/5/2019 CUNY | Brooklyn College 32