Download Chapter 3 Part 2 Switching and Bridging Networking CS 3470, Section 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Spanning Tree Protocol wikipedia , lookup

Transcript
Chapter 3 Part 2
Switching and Bridging
Networking
CS 3470, Section 1
Refresher





We can use switching technologies to
interconnect links to form a large network
What is a hub?
What is a switch?
What is a bridge?
Collision domains?
Hubs


Hubs operate at the physical
layer
Why?

They only repeat signals
3
Switches/Bridges


Bridges (or switches)
operate at the data link layer
Why?

They only make informed
switching decisions using link
layer addresses (typically
MAC addresses)
4
Bridge Advantages




Isolates collision domains resulting in higher
total max throughput
Limitless number of nodes and geographical
coverage
Can connect different Ethernet types
Transparent (“plug-and-play”): no
configuration necessary
Bridge Self Learning


A bridge has a bridge table
Entry in bridge table:



(Node LAN Address, Bridge Interface, Time Stamp)
Stale entries in table dropped (TTL can be 60 min)
Bridges learn which hosts can be reached
through which interfaces


When frame received, bridge “learns” location of
sender: incoming LAN segment
Records sender/location pair in bridge table
Bridge Learning: Drawback



Previous strategy works fine until a LAN has
a loop in it
Possible bad failure case – frames could loop
forever without getting to final destination!
How could this happen?


In a large network, some administrator could add
a bridge that closes a loop without realizing it
Could also be built in on purpose to provide
redundancy
7
A Loop?


Suppose all bridge table are empty
Network J wants to send to Network E
8
A Loop?



B4 does not know where E is at, so flood
B2 does not know where E is at, so flood
B6 does not know where E is at, so flood
9
Bridges Spanning Tree

For increased reliability, desirable to have
redundant, alternative paths from source to dest


But we don’t want the loop problem!
Solution: organize bridges in a spanning tree by
disabling subset of interfaces
Disabled
Spanning Tree Algorithm



Protocol used by set of bridges to agree upon
a spanning tree for a particular LAN
Each bridge decides the ports over which it is
and is not willing to forward frames
Algorithm is dynamic

Bridges may reconfigure themselves into a new
spanning tree should some bridge fail
11
Spanning Tree Algorithm

Each bridge has a unique identifier

B1, B2, B3…
B
A
B3
C
B5
B7
D
K
F
B2
E
B1
G
H
B6
B4
I
J
12
Spanning Tree Algorithm

Algorithm elects bridge with smallest ID as
root of the spanning tree
B
A
B3
C
B5
B7
D
K
F
B2
E
B1
G
H
B6
B4
I
J
13
Spanning Tree Algorithm


The root bridge has all ports enabled.
Each bridge computes the shortest path to
the root and notes which port on that path.



This is the “preferred” port to the root bridge.
All bridges connected to the same LAN elect
a single designated bridge to forward frames
to the root bridge.
If there's a tie, the one with the lowest ID
wins.
Spanning Tree Algorithm


While a human could have an overall view of
the LAN and compute the spanning tree,
bridges don’t have that luxury
Bridges must exchange configuration
information with each other to decide root
bridge and spanning tree
15
Configuration Messages

Contain three things




ID for bridge that is sending message (X)
Distance (measured in hops) from sending bridge
to the root bridge (d)
ID for what sending bridge believes to be root
bridge (Y)
In form (Y,d,X)
16
Configuration Messages


Initially, each bridge thinks it is the root
Sends configuration messages out on each
port identifying self as root and giving
distance to the root as 0
17
Spanning Tree Algorithm
B
A
B3
C
B5
B7
D
K
F
B2
E
B1
G
H
B6
B4
I
J
Spanning Tree Algorithm
B
(B3,0,B3)
(B7,0,B7)
(B1,0,B1)
A
(B5,0,B5)
B3 (B2,0,B2)
C
B2
E
(B3,0,B3)
(B1,0,B1)
B5
D
(B5,0,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B4,0,B4)
(B6,0,B6)
(B4,0,B4)
(B7,0,B7)
(B2,0,B2)
(B5,0,B5)
H
(B1,0,B1)
B4
(B6,0,B6)
J
Configuration Messages


Upon receiving messages, bridge checks to
see if new message for port is better than
currently recorded information
Message is better if it




Identifies a root with a smaller ID
Identifies a root with equal ID but shorter distance
Root ID and distance are equal, but sending
bridge has smaller ID
If message better, discard old information
20
Spanning Tree Algorithm
B
(B3,0,B3)
(B7,0,B7)
(B1,0,B1)
A
(B5,0,B5)
B3 (B2,0,B2)
C
B2
E
(B3,0,B3)
(B1,0,B1)
B5
D
(B5,0,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B4,0,B4)
(B6,0,B6)
(B4,0,B4)
(B7,0,B7)
(B2,0,B2)
(B5,0,B5)
H
(B1,0,B1)
B4
(B6,0,B6)
J
Spanning Tree Algorithm
B
(B3,0,B3)
(B7,0,B7)
(B1,0,B1)
A
(B5,0,B5)
B3 (B2,0,B2)
C
B2
E
(B3,0,B3)
(B1,0,B1)
B5
D
(B5,0,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B4,0,B4)
(B6,0,B6)
(B4,0,B4)
(B7,0,B7)
(B2,0,B2)
(B5,0,B5)
(B1,0,B1)!
H
(B1,0,B1)
B4
(B6,0,B6)
J
Configuration Messages

When a bridge receives a message that it is
not the root bridge…


It stops generating configuration messages on its
own
Only forwards configuration messages from other
bridges after first adding 1 to the distance field
23
Spanning Tree Algorithm

B3 has accepted B2 as root
B
(B3,0,B3)
(B7,0,B7)
(B1,0,B1)
A
(B5,0,B5)
B3 (B2,0,B2)
C
B2
E
(B3,0,B3)
(B1,0,B1)
B5
D
(B5,0,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B4,0,B4)
(B6,0,B6)
(B4,0,B4)
(B7,0,B7)
(B2,0,B2)
(B5,0,B5)
(B1,0,B1)!
H
(B1,0,B1)
B4
(B6,0,B6)
J
Spanning Tree Algorithm

B3 sends (B2,1,B3) towards B5

B2 accepts B1 as root and sends (B1,1,B2) towards B3
B
(B2,1,B3)
(B1,1,B7)
(B1,0,B1)
A
(B1,1,B5)
B3 (B1,1,B2)
C
B2
E
(B2,1,B3)
(B1,0,B1)
B5
D
(B1,1,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B1,1,B4)
(B1,1,B6)
(B1,1,B4)
(B1,1,B7)
(B1,1,B2)
(B1,1,B5)
H
(B1,0,B1)
B4
(B1,1,B6)
J
Spanning Tree Algorithm

B5 accepts B1 as root and sends (B1,1,B5) towards B3
B
(B2,1,B3)
(B1,1,B7)
(B1,0,B1)
A
(B1,1,B5)
B3 (B1,1,B2)
C
B2
E
(B2,1,B3)
(B1,0,B1)
B5
D
(B1,1,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B1,1,B4)
(B1,1,B6)
(B1,1,B4)
(B1,1,B7)
(B1,1,B2)
(B1,1,B5)
H
(B1,0,B1)
B4
(B1,1,B6)
J
Spanning Tree Algorithm

B3 accepts B1 as root

Stops forwarding on both ports because B2 and B5 are closer
to root
(B2,1,B3)
B
A
(B1,1,B7)
(B1,0,B1)
(B1,1,B5)
B3 (B1,1,B2)
C
B2
E
(B2,1,B3)
(B1,0,B1)
B5
D
(B1,1,B5)
(B1,0,B1)
B7
K
F
B1
G
B6
I
(B1,0,B1)
(B1,1,B4)
(B1,1,B6)
(B1,1,B4)
(B1,1,B7)
(B1,1,B2)
(B1,1,B5)
H
(B1,0,B1)
B4
(B1,1,B6)
J
A Loop?

So how do we fix our first example’s loop
using spanning tree?
28
Limitations of Bridges

Bridges only mean to connect a “handful” of
similar LANs

Spanning tree algorithm scales linearly



At some point there are just too many messages
Bridges forward all broadcast frames
A different approach to increase the
scalability of LANs is through the use of
virtual LANs (VLANs)
29
VLANs



IEEE 802.1Q standard
VLANs separate the
collision domain as well
as the broadcast domain
Hosts in each VLAN are
in the same Virtual LAN


“Color coded”
“Trunks” carry multiple
VLANs between
switches
A
B
E
VLANs

Security


Data on a VLAN is separated from other data
VLAN can span multiple switches


Example: Resnet
Flexibility

Now, users can connect to the closest switch and
be put onto a VLAN with similar systems
VLANs






VLAN tagged frames are carried as standard
data link layer (802.3) frames
Type field is modified from 0x8000 to 0x8100
DST and SRC addresses are preserved
LEN/TYPE fields are modified to include the
VLAN tag
Data field is preserved
TAG field adds 22 bytes to the frame
VLAN Notes



4096 VLANs allowed
Most switches only support up to 1024
VLANs
Spanning tree should be run on each VLAN
Routers

Routers are nodes that
interconnect networks



Often called gateways
Network layer device
Why?


Works with IP addresses
Connects heterogeneous
networks based off of different
data link protocols

Example?
34
Bridges vs. Routers

Both store-and-forward devices




Routers: network layer devices (examine network layer
headers)
Bridges are link layer devices
Routers maintain routing tables, implement routing
algorithms
Bridges maintain bridge tables, implement filtering,
learning and spanning tree algorithms
Routers vs. Bridges
Bridges Pros
 Bridge operation is
simpler requiring less
packet processing
 Bridge tables are self
learning
Bridges Cons


All traffic confined to
spanning tree, even
when alternative
bandwidth is available
Bridges do not offer
protection from
broadcast storms
Routers vs. Bridges
Routers Pros
 Arbitrary topologies can
be supported, cycling is
limited by TTL counters
(and good routing
protocols)
 Provide protection
against broadcast storms
Routers Cons


Require IP address
configuration (not plug
and play)
Require higher packet
processing
Routers vs. Bridges

Bridges do well in small (few hundred hosts)
while routers used in large networks
(thousands of hosts)
38