Title: CSEE W4140 Networking Laboratory
1CSEE W4140Networking Laboratory
- Lecture 8 LAN Switching
- Jong Yul Kim
- 03.25.2009
2Announcements
- Reminder of lab rules
- Labs are mandatory.
- Dont connect rack machines to Internet.
- Dont bring food / drinks to the lab.
3Announcements
- Grades
- Will be uploaded today
- Field Trip
- Two separate groups / dates
- Projects
- Projects in place of finals?
- Please come see me after class
4Short review of midterm
5Todays lecture
- Hubs
- Switches
- Learning algorithm
- Spanning Tree Protocol
6Various equipments are used to interconnect
networks
7We already know routers
- Routers operate at the Network Layer (Layer 3)
- Interconnect different subnetworks
8Weve heard about gateways
- The term Gateway is used with different meanings
in different contexts - Gateway is a generic term for routers (Level 3)
- Default gateway
- Gateway is also used for a device that
interconnects different Layer 3 networks and
which performs translation of protocols
(Multi-protocol router)
9Ethernet Hub
- A simple repeater (extends the physical cable)
- Frame collisions are propagated
- Good for sniffing traffic in a network we want to
monitor
10Bridges/LAN switches
- A bridge or LAN switch is a device that
interconnects two or more Local Area Networks
(LANs) and forwards packets between these
networks. - Bridges/LAN switches operate at the Data Link
Layer (Layer 2)
11Terminology Bridge, LAN switch, Ethernet switch
- There are different terms to refer to a data-link
layer interconnection device - The term bridge was coined in the early 1980s.
- Today, the terms LAN switch or (in the context of
Ethernet) Ethernet switch are used. - Convention
- Since many of the concepts, configuration
commands, and protocols for LAN switches were
developed in the 1980s, and commonly use the old
term bridge, we will, with few exceptions,
refer to LAN switches as bridges.
12A Switched Enterprise Network
Router
Switch
13Bridges versus Routers
- Routers
- Each hosts IP address must be configured
- If network is reconfigured, IP addresses may need
to be reassigned - Routing done via RIP or OSPF
- Each router manipulates packet header (e.g.,
reduces TTL field)
- Bridges
- MAC addresses are hardwired
- No network configuration needed
- plug-and-play!
- No routing protocol needed (sort of)
- learning bridge algorithm
- spanning tree algorithm
- Bridges do not manipulate frames
14Frame Forwarding
- Each bridge maintains a forwarding table with
entries - lt MAC address, port, agegt
-
- MAC address host name or group address
- port port number of bridge
- age aging time of entry
- with interpretation
- a machine with MAC address lies in direction of
the port number from the bridge. The entry is age
time units old.
15Frame Forwarding
- Assume a MAC frame arrives on port x.
Is MAC address of destination in
forwardingtable for ports A, B, or C ?
Notfound ?
Found?
Forward the frame on theappropriate port
Flood the frame, i.e., send the frame on all
ports except port x.
16Learning Algorithm
- Routing tables entries are set automatically with
a simple heuristic - The source field of a frame that arrives on a
port tells which hosts are reachable from this
port.
Port 1
Port 4
x is at Port 3
y is at Port 4
Port 2
Port 5
Port 3
Port 6
17Learning Algorithm
- Algorithm
- For each frame received, the source stores the
source field in the forwarding database together
with the port where the frame was received. - All entries are deleted after some time (default
is 15 seconds).
18Learning Algorithm Example
- Consider the following packets (SrcA, DestF),
(SrcC, DestA), (SrcE, DestC) - What have the bridges learned?
19Danger of Loops
- Consider the two LANs that are connected by two
bridges. - Assume host n is transmitting a frame F with
unknown destination. - What is happening?
- Bridges A and B flood the frame to LAN 2.
- Bridge B sees F on LAN 2 (with unknown
destination), and copies the frame back to LAN 1 - Bridge A does the same.
- The copying continues
- Wheres the problem? Whats the solution ?
F
20Spanning Tree Protocol (STP)
- A solution is to prevent loops in the topology
- IEEE 802.1d has an algorithm that builds and
maintains a spanning tree in a dynamic
environment - Bridges that run 802.1d are called transparent
bridges - Bridges exchange messages to configure the bridge
(Configuration Bridge Protocol Data Unit,
Configuration BPDUs) to build the tree. - Using the BPDUs, each bridges makes a local
decision which of its ports are part of the
spanning tree
21Diagram of a spanning tree
Disabled ports
Forwarding ports
22Concepts
- Each bridge as a unique identifier
- Bridge ID ltpriority number MAC addressgt
- Note that a bridge has several MAC addresses
(one for each port), but only one ID -
- lower priority number has higher priority
- (The lower the better!!)
- Each port within a bridge has a unique identifier
(port ID). - Root Bridge
- The bridge with the lowest identifier is the root
of the spanning tree. - Root Port
- Each bridge has a root port which identifies the
next hop from a bridge to the root.
23Concepts
- Root Path Cost
- For each bridge, the cost of the min-cost path to
the root. - The lower the better!!
- Designated Bridge, Designated Port
- Lowest cost bridge on the segment is the
designated bridge. - On the designated bridge, the port that is
attached to the segment is the designated port. - if two bridges have the same cost, select the one
with highest priority - if the min-cost bridge has two or more ports on
the LAN, select the port with the lowest
identifier
24Configuration BPDUs
25Steps of Spanning Tree Algorithm
- 1. Determine the root bridge
- 2. Determine the root port on all other bridges
- 3. Determine the designated port on each LAN
- Each bridge is sending out BPDUs that contain the
following information
root ID
cost
bridge ID/port ID
root bridge (what the sender thinks it is) root
path cost for sending bridgeIdentifies sending
bridge
26Determine the Root Bridge
- Initially, all bridges assume they are the root
bridge. - Each bridge B sends BPDUs of this form on its
LANs - Each bridge looks at the BPDUs received on all
its ports and its own transmitted BPDUs. - Root bridge is the smallest received root ID that
has been received so far (Whenever a smaller ID
arrives, the root is updated)
B
0
B
27Calculate the Root Path CostDetermine the Root
Port
- At this time A bridge B has a belief of who the
root is, say R. - Bridge B determines the Root Path Cost (Cost) as
follows - If B R Cost 0.
- If B ? R Cost Smallest Cost in any of BPDUs
that were received
cost of Bs interface where this
BPDU was received - Bs root port is the port from which B received
the lowest cost path to R - Knowing R and Cost, B can generate its BPDU (but
will not necessarily send it out)
R
Cost
B
28Default Cost
Ethernet Speed Cost
10 Mbps 100
100 Mbps 19
1 Gbps 4
10 Gbps 2
29Calculate the Root Path CostDetermine the Root
Port
- At this time B has generated its BPDU
- B will send this BPDU on one of its ports, say
port x, only if its BPDU is lower than any BPDU
that B received from port x. - In this case, B also assumes that it is the
designated bridge for the LAN to which the port
connects.
R
Cost
B
30Selecting the Ports for Spanning Tree
- Each bridges makes a local decision which of its
ports are part of the spanning tree - B will decide which ports are in the spanning
tree - Bs root port is part of the spanning tree
- All designated ports are part of the spanning
tree - All other ports are not part of the spanning tree
- Bs ports that are in the spanning tree will
forward packets (forwarding state) - Bs ports that are not in the spanning tree will
not forward packets (blocking state)
31Homework
- Prelab 6 due this Friday
- Lab reports due this week
32Main Points of Lab 6
- Hubs vs. switches
- Switches
- Learning algorithm
- Spanning Tree Protocol