+ All Categories
Home > Documents > Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP...

Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP...

Date post: 26-Dec-2015
Category:
Upload: lydia-daniels
View: 253 times
Download: 1 times
Share this document with a friend
Popular Tags:
66
Switching in LANs Lecture 5 CS 653, Fall 2008
Transcript
Page 1: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switching in LANs

Lecture 5CS 653 Fall 2008

Link layer addressing

Adaptors Communicating

link layer implemented in ldquoadaptorrdquo (aka NIC) Ethernet card 80211

card sending side

encapsulates datagram in a frame

adds error checking bits rdt flow control etc

receiving side looks for errors rdt

flow control etc extracts datagram

passes to rcving node adapter is semi-

autonomous link amp physical layers

sendingnode

frame

rcvingnode

datagram

frame

adapter adapter

link layer protocol

MAC Addresses

MAC = Media Access Control All stations receive all packets Only keep packets for our address or

explicit broadcast packets

MAC Addresses and ARP

32-bit IP address network-layer address used to get datagram to destination IP

subnet

MAC (or LAN or physical or Ethernet) address used to get frame from one interface to

another physically-connected interface (same network)

48 bit IEEE MAC address (for most LANs) burned in the adapter ROM

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 2: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Link layer addressing

Adaptors Communicating

link layer implemented in ldquoadaptorrdquo (aka NIC) Ethernet card 80211

card sending side

encapsulates datagram in a frame

adds error checking bits rdt flow control etc

receiving side looks for errors rdt

flow control etc extracts datagram

passes to rcving node adapter is semi-

autonomous link amp physical layers

sendingnode

frame

rcvingnode

datagram

frame

adapter adapter

link layer protocol

MAC Addresses

MAC = Media Access Control All stations receive all packets Only keep packets for our address or

explicit broadcast packets

MAC Addresses and ARP

32-bit IP address network-layer address used to get datagram to destination IP

subnet

MAC (or LAN or physical or Ethernet) address used to get frame from one interface to

another physically-connected interface (same network)

48 bit IEEE MAC address (for most LANs) burned in the adapter ROM

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 3: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Adaptors Communicating

link layer implemented in ldquoadaptorrdquo (aka NIC) Ethernet card 80211

card sending side

encapsulates datagram in a frame

adds error checking bits rdt flow control etc

receiving side looks for errors rdt

flow control etc extracts datagram

passes to rcving node adapter is semi-

autonomous link amp physical layers

sendingnode

frame

rcvingnode

datagram

frame

adapter adapter

link layer protocol

MAC Addresses

MAC = Media Access Control All stations receive all packets Only keep packets for our address or

explicit broadcast packets

MAC Addresses and ARP

32-bit IP address network-layer address used to get datagram to destination IP

subnet

MAC (or LAN or physical or Ethernet) address used to get frame from one interface to

another physically-connected interface (same network)

48 bit IEEE MAC address (for most LANs) burned in the adapter ROM

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 4: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

MAC Addresses

MAC = Media Access Control All stations receive all packets Only keep packets for our address or

explicit broadcast packets

MAC Addresses and ARP

32-bit IP address network-layer address used to get datagram to destination IP

subnet

MAC (or LAN or physical or Ethernet) address used to get frame from one interface to

another physically-connected interface (same network)

48 bit IEEE MAC address (for most LANs) burned in the adapter ROM

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 5: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

MAC Addresses and ARP

32-bit IP address network-layer address used to get datagram to destination IP

subnet

MAC (or LAN or physical or Ethernet) address used to get frame from one interface to

another physically-connected interface (same network)

48 bit IEEE MAC address (for most LANs) burned in the adapter ROM

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 6: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

LAN Addresses and ARP

Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 7: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

ARP Address Resolution Protocol

Each IP node (Host Router) on LAN has ARP table

ARP Table IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt TTL (Time To Live)

time after which address mapping will be forgotten (typically 20 min)

Question how to determineMAC address of Bknowing Brsquos IP address

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

237196723

237196778

237196714

237196788

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 8: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

ARP protocol Same LAN (network)

A wants to send datagram to B and Brsquos MAC address not in Arsquos ARP table

A broadcasts ARP query packet containing Bs IP address Dest MAC address =

FF-FF-FF-FF-FF-FF all machines on LAN

receive ARP query B receives ARP packet

replies to A with its (Bs) MAC address frame sent to Arsquos MAC

address (unicast)

A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information

that times out (goes away) unless refreshed

ARP is ldquoplug-and-playrdquo nodes create their ARP

tables without intervention from net administrator

Plug-and-play an incredibly nice property

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 9: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

ARP trace

Frame 203 (42 bytes on wire 42 bytes captured)Address Resolution Protocol (request) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode request (0x0001) Sender MAC address DellComp_5e40b9 (00065b5e40b9) Sender IP address 12811924581 (12811924581) Target MAC address 000000_000000 (000000000000) Target IP address 128119245254 (128119245254)

Frame 204 (60 bytes on wire 60 bytes captured)Address Resolution Protocol (reply) Hardware type Ethernet (0x0001) Protocol type IP (0x0800) Opcode reply (0x0002) Sender MAC address DigitalE_00e80b (aa000400e80b) Sender IP address 128119245254 (128119245254) Target MAC address DellComp_5e40b9 (00065b5e40b9) Target IP address 12811924581 (12811924581)

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 10: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Routing to another LAN

walkthrough send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R one for each IP network (LAN)

A

RB

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 11: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

A creates datagram with source A destination B A uses ARP to get Rrsquos MAC address for 111111111110 A creates link-layer frame with Rs MAC address as dest

frame contains A-to-B IP datagram Arsquos adapter sends frame Rrsquos adapter receives frame R removes IP datagram from Ethernet frame sees its

destined to B R uses ARP to get Brsquos MAC address R creates frame containing A-to-B IP datagram sends to

B

A

RB

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 12: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Medium access control

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 13: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-18

Multiple Access Links and Protocols

Two types of ldquolinksrdquo point-to-point

PPP for dial-up access point-to-point link between Ethernet switch and host

broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 14: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-19

Multiple Access protocols

single shared broadcast channel two or more simultaneous transmissions by nodes

interference collision if node receives two or more signals at the same

time

multiple access protocol distributed algorithm that determines how nodes

share channel ie determine when node can transmit

communication about channel sharing must use channel itself no out-of-band channel for coordination

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 15: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-20

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1 when one node wants to transmit it can send at

rate R2 when M nodes want to transmit each can send at

average rate RM3 fully decentralized

no special node to coordinate transmissions no synchronization of clocks slots

4 simple

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 16: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-21

MAC Protocols a taxonomy

Three broad classes Channel Partitioning

divide channel into smaller ldquopiecesrdquo (time slots frequency code)

allocate piece to node for exclusive use

Random Access channel not divided allow collisions ldquorecoverrdquo from collisions

ldquoTaking turnsrdquo nodes take turns but nodes with more to send can

take longer turns

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 17: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-22

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt

trans time) in each round unused slots go idle example 6-station LAN 134 have pkt slots

256 idle

1 3 4 1 3 4

6-slotframe

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 18: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-23

Channel Partitioning MAC protocols FDMA

FDMA frequency division multiple access

channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go

idle example 6-station LAN 134 have pkt

frequency bands 256 idle fr

eque

ncy

band

s time

FDM cable

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 19: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-24

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 ldquocollisionrdquo random access MAC protocol specifies

how to detect collisions how to recover from collisions (eg via delayed

retransmissions)

Examples of random access MAC protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 20: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-25

Slotted ALOHA

Assumptions all frames same size time divided into

equal size slots (time to transmit 1 frame)

nodes start to transmit only slot beginning

nodes are synchronized

if 2 or more nodes transmit in slot all nodes detect collision

Operation when node obtains fresh

frame transmits in next slot if no collision node

can send new frame in next slot

if collision node retransmits frame in each subsequent slot with prob p until success

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 21: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-26

Slotted ALOHA

Pros single active node can

continuously transmit at full rate of channel

highly decentralized only slots in nodes need to be in sync

simple

Cons collisions wasting

slots idle slots nodes may be able to

detect collision in less than time to transmit packet

clock synchronization

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 22: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-27

Slotted Aloha efficiency

suppose N nodes with many frames to send each transmits in slot with probability p

prob that given node has success in a slot = p(1-p)N-1

prob that any node has a success = Np(1-p)N-1

max efficiency find p that maximizes Np(1-p)N-1

for many nodes take limit of Np(1-p)N-1

as N goes to infinity gives

Max efficiency = 1e = 37

Efficiency long-run fraction of successful slots (many nodes all with many frames to send)

At best channelused for useful transmissions 37of time

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 23: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-28

Pure (unslotted) ALOHA

unslotted Aloha simpler no synchronization when frame first arrives

transmit immediately

collision probability increases frame sent at t0 collides with other frames sent in [t0-

1t0+1]

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 24: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-29

Pure Aloha efficiency

P(success by given node) = P(node transmits)

P(no other node transmits in [t0-

1t0]

P(no other node transmits in [t0t0+1]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip choosing optimum p and then letting n -gt infty

= 1(2e) = 18

even worse than slotted Aloha

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 25: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-30

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmitIf channel sensed idle transmit entire frame If channel sensed busy defer transmission

human analogy donrsquot interrupt others

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 26: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-31

CSMA collisions

collisions can still occurpropagation delay means two nodes may not heareach otherrsquos transmission

collisionentire packet transmission time wasted

spatial layout of nodes

noterole of distance amp propagation delay in determining collision probability

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 27: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-32

CSMACD (Collision Detection)

CSMACD carrier sensing deferral as in CSMA collisions detected within short time colliding transmissions aborted reducing

channel wastage collision detection

easy in wired LANs measure signal strengths compare transmitted received signals

difficult in wireless LANs received signal strength overwhelmed by local transmission strength

human analogy the polite conversationalist

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 28: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-33

CSMACD collision detection

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 29: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-34

ldquoTaking Turnsrdquo MAC protocols

channel partitioning MAC protocols share channel efficiently and fairly at high load inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocols efficient at low load single node can fully utilize

channel high load collision overhead

ldquotaking turnsrdquo protocolslook for best of both worlds

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 30: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-35

ldquoTaking Turnsrdquo MAC protocols

Polling master node

ldquoinvitesrdquo slave nodes to transmit in turn

typically used with ldquodumbrdquo slave devices

concerns polling overhead latency single point of

failure (master)

master

slaves

poll

data

data

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 31: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-36

ldquoTaking Turnsrdquo MAC protocols

Token passing control token passed

from one node to next sequentially

token message concerns

token overhead latency single point of failure

(token)

T

data

(nothingto send)

T

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 32: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-37

Summary of MAC protocols

channel partitioning by time frequency or code Time Division Frequency Division

random access (dynamic) ALOHA S-ALOHA CSMA CSMACD carrier sensing easy in some technologies (wire)

hard in others (wireless) CSMACD used in Ethernet CSMACA used in 80211

taking turns polling from central site token passing Bluetooth FDDI IBM Token Ring

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 33: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Ethernet hubs switches routers

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 34: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Ethernet

ldquodominantrdquo wired LAN technology cheap - $20 for 1000Mbs first widely used LAN technology Simpler cheaper than token LANs and ATM Kept up with speed race 10 Mbps ndash 10 Gbps

Metcalfersquos Ethernetsketch

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 35: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

5 DataLink Layer 5-40

Star topology bus topology popular through mid 90s

all nodes in same collision domain (can collide with each other)

today star topology prevails active switch in center each ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 36: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Ethernet Frame Structure

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

Preamble 7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 used to synchronize receiver sender clock

rates

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 37: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Unreliable connectionless service

Connectionless No handshaking between sending and receiving adapter

Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapter stream of datagrams passed to network layer

can have gaps gaps will be filled if app is using TCP otherwise app will see the gaps

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 38: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Ethernet uses CSMACD

No slots adapter doesnrsquot

transmit if it senses that some other adapter is transmitting that is carrier sense

transmitting adapter aborts when it senses that another adapter is transmitting that is collision detection

Before attempting a retransmission adapter waits a random time that is random access

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 39: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Ethernet CSMACD algorithm

1 Adaptor receives datagram from net layer amp creates frame

2 If adapter senses channel idle it starts to transmit frame If it senses channel busy waits until channel idle and then transmits

3 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

4 If adapter detects another transmission while transmitting aborts and sends jam signal

5 After aborting adapter enters exponential backoff after the mth collision adapter chooses a K at random from 012hellip2m-1 Adapter waits K512 bit times and returns to Step 2

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 40: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Bit time 1 microsec for 10 Mbps Ethernet for K=1023 wait time is about 50 msec

Exponential Backoff Goal adapt retransmission

attempts to estimated current load heavy load random wait

will be longer first collision choose K

from 01 delay is K 512 bit transmission times

after second collision choose K from 0123hellip

after ten collisions choose K from 01234hellip1023

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 41: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Interconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become

one large collision domain Canrsquot interconnect 10BaseT amp 100BaseT

hub

hubhub

hub

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 42: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switch

Link layer device stores and forwards Ethernet frames examines frame header and selectively

forwards frame based on MAC dest address when frame is to be forwarded on segment

uses CSMACD to access segment transparent

hosts are unaware of presence of switches plug-and-play self-learning

switches do not need to be configured

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 43: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Forwarding

bull How do determine onto which LAN segment to forward framebull Looks like a routing problem

hub

hubhub

switch1

2 3

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 44: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Self learning

A switch has a switch table entry in switch table

(MAC Address Interface Time Stamp) stale entries in table dropped (TTL can be 60

min) switch learns which hosts can be reached through

which interfaces when frame received switch ldquolearnsrdquo location

of sender incoming LAN segment records senderlocation pair in switch table

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 45: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

FilteringForwarding

When switch receives a frame

index switch table using MAC dest addressif entry found for destination

then if dest on segment from which frame arrived

then drop the frame else forward the frame on interface indicated else flood

forward on all but the interface on which the frame arrived

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 46: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switch example

Suppose C sends frame to D

Switch receives frame from from C notes in bridge table that C is on interface

1 because D is not in table switch forwards

frame into interfaces 2 and 3 frame received by D

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEG

1123

12 3

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 47: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switch example

Suppose D replies back with frame to C

Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table switch forwards frame

only to interface 1 frame received by C

hub

hub hub

switch

A

B CD

EF

G H

I

address interface

ABEGC

11231

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 48: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switch traffic isolation switch installation 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

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 49: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switches dedicated access

Switch with many interfaces

Hosts have direct connection to switch

No collisions full duplex

Switching A-to-Arsquo and B-to-Brsquo simultaneously no collisions

switch

A

Arsquo

B

Brsquo

C

Crsquo

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 50: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

More on Switches

cut-through switching frame forwarded from input to output port without first collecting entire frameSlight reduction in latencyWas a big deal in the days of

10Mbits Q could we do this on routers

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 51: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Typical institutional network

hub

hubhub

switch

to externalnetwork

router

IP subnet

mail server

web server

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 52: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Switches vs Routers both store-and-forward devices

routers network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables implement routing algorithms

switches maintain switch tables implement filtering learning algorithms

Switch

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 53: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Summary comparison

hubs routers switches

traf f ic isolation

no yes yes

plug amp play yes no yes

optimal routing

no yes no

cut through

yes no yes

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 54: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Bridging LANs

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 55: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Self-learning =gt Loops

Assume X sends a frame to Y

B1 repeats it first and B2 receives it on interface 2

What does B2 do

B1 B2

X

Y

1

2

1

2

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 56: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Self-learning =gt Broadcast storms

Frames may reproduce with more bridges

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 57: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Spanning tree protocol

Spanning tree protocol prevents loops and broadcast stormsAvoids some links to prevent

loopsstormsSpanning tree = acyclic subgraph

covering all vertices

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 58: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Protocol requirements

Should allow redundant bridges connected ldquocarelesslyrdquo

Self-configuring or plug-and-play Small memory usage Constant message overhead in each

LAN Quick stabilization to loop-freeness Assume connectionless service ie

messages may be lost

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 59: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Algorithm

Elect a root Root = switch with the smallest ID

Nodes periodically send HELLO message Transmitting node ID ID of bridge assumed to be root Length of best known path to root

Node = bridge or LAN segment Edge = from a switch interface to LAN or

interface in adjacent switch

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 60: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Algorithm

Goal to identify if an interface is on shortest path to root

Start each switch X thinks it is root Announces (XX0)

Distributed asynchronous step Update root to node with minimum ID Announce 1 + length of minimum distance

heard from neighbors to that root Accept neighbor closer to root as ldquodesignatedrdquo

for that LAN segment and stop sending it HELLOs

Or designate self

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 61: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Example

4 thinks it is root Sends (440) to 2 and 7

4 receives (220) from 2 Thinks 2 is root and just

one hop away 4 receives (271) from 7

Prefers 2 over 7 to reach root

Removes link 4-7 from tree

Designates 2 and stops sending it messages

1

2

3

4

5

67

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 62: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Tolerating failures

Soft state approachReceived messages have an expiry time

MAX_AGE If no new messages received after expiry

nodes will try to take over as rootMAX_AGE gt MaxPropTime (Why)Re-convergece time after failure =

MAX_AGE + 2MaxPropTime (Why)

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 63: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

State machine

PRE_BACKUP_DELAY to prevent transient partitions gt 2MAX_AGE Why

PRE_FORWARD_DELAY to prevent transient loops 3MAX_AGE Why

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 64: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Virtual LANs

Switched LANs have limited scalabilityLinear scaling behavior of spanning treeBroadcast packets sent to all nodesMovement across domains a problem

Solution virtual LANs (VLANs)LANs partitioned using colorsEg red packets forwarded only to red

LANs Q VLANs vs subnets difference

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 65: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.

Discussion questions

The plug-and-play property of switches implies less management overhead Why are routers not plug-and-play

Each interface has a MAC address and an IP address Why canrsquot we just route over MAC addresses

IP addresses conflate location and names Implications on multihoming Implications on mobility

  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions
Page 66: Switching in LANs Lecture 5 CS 653, Fall 2008. Interconnected networks Tier 1 ISP NAP Tier-2 ISP local ISP local ISP local ISP local ISP local ISP Tier.
  • Switching in LANs
  • Link layer addressing
  • Adaptors Communicating
  • MAC Addresses
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • ARP trace
  • Routing to another LAN
  • Slide 16
  • Medium access control
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • Slotted ALOHA
  • Slide 26
  • Slotted Aloha efficiency
  • Pure (unslotted) ALOHA
  • Pure Aloha efficiency
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 35
  • Slide 36
  • Summary of MAC protocols
  • Ethernet hubs switches routers
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Unreliable connectionless service
  • Ethernet uses CSMACD
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • Interconnecting with hubs
  • Switch
  • Forwarding
  • Self learning
  • FilteringForwarding
  • Switch example
  • Slide 52
  • Switch traffic isolation
  • Switches dedicated access
  • More on Switches
  • Typical institutional network
  • Switches vs Routers
  • Summary comparison
  • Bridging LANs
  • Self-learning =gt Loops
  • Self-learning =gt Broadcast storms
  • Spanning tree protocol
  • Protocol requirements
  • Algorithm
  • Slide 65
  • Example
  • Tolerating failures
  • State machine
  • Virtual LANs
  • Discussion questions

Recommended