+ All Categories
Home > Documents > Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

Date post: 27-Mar-2015
Category:
Upload: evelyn-phillips
View: 218 times
Download: 0 times
Share this document with a friend
Popular Tags:
26
Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008
Transcript
Page 1: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

Interconnection: Switching and Bridging

CS 4251: Computer Networking IINick FeamsterSpring 2008

Page 2: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

2

In This Lecture• How hosts find each other on a subnet

– Address Resolution Protocol (ARP)– Broadcast

• Interconnecting subnets– Switches: Forwarding and filtering– Self-learning bridges– Spanning tree protocols

• Switches vs. Hubs• Swtiches vs. Routers• Can Ethernet scale to a million nodes?

– VLANs– Other alternatives

Page 3: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

3

Bootstrapping: Networks of Interfaces

• LAN/Physical/MAC address– Flat structure– Unique to physical interface (no two alike)…how?

sender

frame

receiverdatagram

frame

adapter adapter

link layer protocol

What are the advantages to separating network layer from MAC layer?

• Frames can be sent to a specific MAC address or to the broadcast MAC address

Page 4: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

4

ARP: IP Addresses to MAC addresses

• Query is IP address, response is MAC address• Query is sent to LAN’s broadcast MAC address• Each host or router has an ARP table

– Checks IP address of query against its IP address– Replies with ARP address if there is a match

Potential problems with this approach?

• Caching on hosts is really important– Try arp –a to see an ARP table

Page 5: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

5

Life of a Packet: On a Subnet

• Packet destined for outgoing IP address arrivesat network interface– Packet must be encapsulated into a frame with the

destination MAC address

• Frame is sent on LAN segment to all hosts

• Hosts check destination MAC address against MAC address that was destination IP address of the packet

Page 6: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

6

Interconnecting LANs

• Receive & broadcast (“hub”)• Learning switches

• Spanning tree (RSTP, MSTP, etc.) protocols

Page 7: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

7

Interconnecting LANs with Hubs

• All packets seen everywhere– Lots of flooding, chances for collision

• Can’t interconnect LANs with heterogeneous media (e.g., Ethernets of different speeds)

hub

hubhub

hub

Page 8: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

8

Problems with Hubs: No Isolation

• Scalability

• Latency– Avoiding collisions requires backoff– Possible for a single host to hog the medium

• Failures– One misconfigured device can cause problems for

every other device on the LAN

Page 9: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

9

Improving on Hubs: Switches

• Link-layer– 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 CSMA/CD to access segment

• Transparent– Hosts are unaware of presence of switches

• Plug-and-play, self-learning– Switches do not need to be configured

Page 10: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

10

Switch: Traffic Isolation

• Switch breaks subnet into LAN segments• Switch filters packets

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

– Segments become separate collision domains

hub hub hub

switch

collision domain collision domain

collision domain

Page 11: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

11

Filtering and Forwarding

• Occurs through switch table

• Suppose a packet arrives destined for node with MAC address x from interface A– If MAC address not in table, flood (act

like a hub)– If MAC address maps to A, do nothing

(packet destined for same LAN segment)– If MAC address maps to another

interface, forward

• How does this table get configured?

LAN A

LAN B

LAN C

AB

C

Page 12: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

12

Advantages vs. Hubs

• Better scaling– Separate collision domains allow longer distances

• Better privacy– Hosts can “snoop” the traffic traversing their segment– … but not all the rest of the traffic

• Heterogeneity– Joins segments using different technologies

Page 13: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

13

Disadvantages vs. Hubs• Delay in forwarding frames

– Bridge/switch must receive and parse the frame– … and perform a look-up to decide where to forward– Storing and forwarding the packet introduces delay– Solution: cut-through switching

• Need to learn where to forward frames– Bridge/switch needs to construct a forwarding table– Ideally, without intervention from network administrators– Solution: self-learning

Page 14: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

14

Motivation For Self-Learning

• Switches forward frames selectively– Forward frames only on segments that need them

• Switch table– Maps destination MAC address to outgoing interface– Goal: construct the switch table automatically

switch

A

B

C

D

Page 15: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

15

(Self)-Learning Bridges

• Switch is initially empty• For each incoming frame, store

– The incoming interface from which the frame arrived– The time at which that frame arrived– Delete the entry if no frames with a particular source address

arrive within a certain time

A

B

C

D

Switch learns how to reach A.

Page 16: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

16

Cut-Through Switching

• Buffering a frame takes time– Suppose L is the length of the frame– And R is the transmission rate of the links– Then, receiving the frame takes L/R time units

• Buffering delay can be a high fraction of total delay, especially over short distances

A B

switches

Page 17: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

17

Cut-Through Switching

• Start transmitting as soon as possible– Inspect the frame header and do the look-up

– If outgoing link is idle, start forwarding the frame

• Overlapping transmissions– Transmit the head of the packet via the outgoing link

– … while still receiving the tail via the incoming link

– Analogy: different folks crossing different intersections

A B

switches

Page 18: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

18

Limitations on Topology

• Switches sometimes need to broadcast frames– Unfamiliar destination: Act like a hub– Sending to broadcast

• Flooding can lead to forwarding loops and broadcast storms– E.g., if the network contains a cycle of switches– Either accidentally, or by design for higher reliability

Worse yet, packets can be duplicated and proliferated!

Page 19: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

19

Solution: Spanning Trees

• Ensure the topology has no loops– Avoid using some of the links when flooding– … to avoid forming a loop

• Spanning tree– Sub-graph that covers all vertices but contains no cycles– Links not in the spanning tree do not forward frames

Page 20: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

20

Constructing a Spanning Tree

• Elect a root– The switch with the smallest identifier

• Each switch identifies if its interface is on the shortest path from the root– And it exclude from the tree if not– Also exclude from tree if same distance,

but higher identifier

• Message Format: (Y, d, X)– From node X – Claiming Y as root– Distance is d

root

One hop

Three hops

Page 21: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

21

Steps in Spanning Tree Algorithm

• Initially, every switch announces itself as the root– Example: switch X announces (X, 0, X)

• Switches update their view of the root– Upon receiving a message, check the root id– If the new id is smaller, start viewing that switch as root

• Switches compute their distance from the root– Add 1 to the distance received from a neighbor– Identify interfaces not on a shortest path to the root and exclude

those ports from the spanning tree

Page 22: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

22

Example From Switch #4’s Viewpoint

• Switch #4 thinks it is the root– Sends (4, 0, 4) message to 2 and 7

• Switch #4 hears from #2– Receives (2, 0, 2) message from 2– … and thinks that #2 is the root– And realizes it is just one hop away

• Switch #4 hears from #7– Receives (2, 1, 7) from 7– And realizes this is a longer path– So, prefers its own one-hop path– And removes 4-7 link from the tree

1

2

3

4

5

67

Page 23: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

23

Robust Spanning Tree Algorithm

• Algorithm must react to failures– Failure of the root node

• Need to elect a new root, with the next lowest identifier– Failure of other switches and links

• Need to recompute the spanning tree

• Root switch continues sending messages– Periodically reannouncing itself as the root (1, 0, 1)– Other switches continue forwarding messages

• Detecting failures through timeout • Switch waits to hear from others

– Eventually times out and claims to be the root

Page 24: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

24

Extension: Virtual LANs

• Partition a single switched LAN into several virtual ones– Switched LANs do not scale well to large networks– Spanning tree algorithm has linear scaling behavior– Some frames are broadcast

• Group users/hosts based on organizational structure, rather than physical location– Improve privacy and isolation– Exploit locality

• Avoid physical rewiring• More in Lec. 12 (Plus, Network Layers as Link Layers)

Page 25: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

25

Switches vs. Routers

• Switches are automatically configuring• Forwarding tends to be quite fast, since packets

only need to be processed through layer 2

• Router-level topologies are not restricted to a spanning tree– Can even have multipath routing

Switches

Routers

Page 26: Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008.

26

Scaling Ethernet

• Main limitation: Broadcast– Spanning tree protocol messages– ARP queries

• High-level proposal: Distributed directory service– Each switch implements a directory service– Hosts register at each bridge– Directory is replicated– Queries answered locally

• …are there other ways to do this?


Recommended