Transcript LAN A
CMPT 371
Data Communications and Networking
Interconnections
Hubs, switches, bridges, and routers
0
© Janice Regan, CMPT 128, 2007-2012
Connecting/Interconnecting LANs
Parts of the same LAN can be connected within
the physical layer using hubs or repeaters
Different LANs can be interconnected in the
data link layer using switching hubs/level 2
switches (hardware, multiple data paths), or bridges
(software, single data path, forwards 1 packet at a time)
LANs or groups of LANs can be interconnected
in the network layer using routers (software) and
level 3 switches (hardware)
Janice Regan © 2005
1
Addressing in LANs
Bridges and level 2 switches use MAC addresses.
A network of LANs or stations connected by bridges or
switches has a ‘flat’ address space
The network has a single MAC broadcast address
There can be only one path between any two devices
Routers and level 3 switches use IP addresses
Can divide network into subnetworks connected by routers or
level 3 switches. Each subnetwork has its own MAC broadcast
address
IP routing can deal with multiple paths between subnetworks
Janice Regan © 2005
2
Star LANs
Often use twisted pair for connection of station
and hub due to availability of extra telephone
wiring in large building (avoid expense of
installing extra cables as needs change)
Hub or level 2 switch may be the active central
element
Janice Regan © 2005
3
Two level Star Topology
Multi-Tier Hubs
Janice Regan © 2005
Stallings
2003: fig 15.12
4
Star LANs: central Hub
LAN is physically a star, logically a bus
Each station connects to the hub through two point to point links,
one for propagation in each direction
Each packet received by the hub will be retransmitted on all
other outgoing lines connected to the hub.
All stations on the network share the bandwidth of a single
transmission medium
All connected networks must use the same type of link (that is
each connected net must have same data rate)
The maximum number of hosts that can be supported on one
LAN must be shared between the connected networks
Two stations simultaneously sending a packet will cause a
collision. ( LAN is shared, consists of one collision zone)
Janice Regan © 2005
5
Star: central Level 2 Switch
Each station connects to the switch through two point to
point links
Each packet received by the hub will be retransmitted
on only the outgoing link to the receiving station
Two stations simultaneously sending a packet may not
cause a collision.
There is more than one collision domain (or segment)
Different segments can have different data rates
Each segment can have the maximum number of hosts
supported on one LAN
Multiple pairs of stations in the Star LAN may
simultaneously communicate without collisions. This
increases available bandwidth.
Janice Regan © 2005
6
Hubs + Level 2 Switches (Switching Hubs)
Janice Regan © 2005
Stallings
2000: fig 13.10
7
Types of Level 2 switches
Store and forward switch:
Switch stores the packet, Forwards after receiving and
checking frame. Only forwards valid frames
Introduces a delay while waiting to receive, and to process the
frame
Cut through switch
The destination address is at the front of the frame. When the
switch has read the address it immediately forwards the packet
toward the receiver. (Begins forwarding before entire frame is
received)
Smaller delay introduced (Long enough to receive address)
Forwards all frames valid or invalid
May introduce unacceptable delays (waiting for data) when
switching from a low speed to high speed networks
Janice Regan © 2005
8
Hubs and Layer 2 Switches
Any packet received by a hub will be retransmitted to all stations or
hubs connected to that hub, except the one from which the packet
was received
Using hubs (physical layer) the LAN is one shared collision
domain. Only one packet can be transmitted at a time.
Any packet received by a switch will be retransmitted to only one
station or hub. The switch will determine the correct path for the
packet. (data link layer)
Using switches the lines to stations, (not sending or receiving this
packet) can be used for other traffic
Switches are scalable
Switches are usually hardware based, A interconnection device
which performs the same task but using software is known as a
bridge.
Janice Regan © 2005
9
Functions of Bridges
LAN’s can be connected using bridges
Bridges operate within the data link layer
Bridges route frames between LAN’s using identical protocols (e.g.
IEEE 802 )
A bridge reads all frames on each attached LAN, accepting
those intended for attached LANs other than the source LAN
A bridge then retransmits each accepted frame on the
appropriate LAN or LANs
A bridge does not modify content or format of the frames passing
through it, or examine payload (LLC frame)
A bridge must include addressing and routing intelligence (it may
be one of several bridges connecting several networks)
A bridge must contain adequate buffering facilities
Janice Regan © 2005
10
Why use Bridges
Reliability: Partitioning larger network into smaller
LANs connected by bridges isolates a network failure to
a single smaller LAN rather than the entire network
Performance: LAN performance generally decreases
as the number of stations on the LAN increases.
Keeping individual LANs smaller increases the overall
performance of the network
Geography: Use different LANs to support devices in
physically different locations (buildings, cities, labs).
And to break into LANs which comply with physical
cabling limits
Security: Divide users by group to help control access
to group facilities supporting different needs
Janice Regan © 2005
11
Simple Bridge operation
LAN A
Frames with
Addresses 11 to
20 are accepted and
repeated on LAN B
Station 1
Station 10
Station 2
Frames with
Addresses 1 to
10 are accepted and
repeated on LAN A
LAN B
Station 11
Janice Regan
2005
Stallings
2000:© fig
13.14
Station 12
Station 20
12
Operation of a LAN Bridge:
802.3 (Ethernet)
Apps
Apps
Transport
Transport
Network
Network
MAC
(Ethernet)
MAC
(Wireless to Ethernet)
MAC
(Ethernet)
Physical
Physical Physical
Physical
Ethernet (802.3) packets
Janice Regan © 2005-2012
Ethernet (802.3) packets
13
Operation of Mixed Media LAN Bridge:
802.11 (Wireless) to 802.3 (Ethernet)
Apps
Apps
Transport
Transport
Network
Network
MAC
(Wireless)
MAC
(Wireless to Ethernet)
MAC
(Ethernet)
Physical
Physical Physical
Physical
Wireless (802.11) packets
Janice Regan © 2005-2012
Ethernet (802.3) packets
14
IEEE 802 Frame formats
802.11 Wireless
Number of bytes
2
2
6
6
6
2
Frame Duration Receiver Transmitter Base Station Sequence
control
ID
Address
Address
Control
Identifier
6
0-2312
4
Frame
Body
FCS
Sender
Address
802.3 Ethernet
Number of bytes
7
1
Preamble
SDF
6
6
Destination source
Address
Address
46-1500
Data (frame body)
4
FCS
Different Frame format and Maximum Frame length (not to scale)
Wireless uses encryption, 802.3 does not
Janice Regan © 2005-2012
15
Larger networks of LANs
A single bridge can connect two or more LANs
Many LANs can be interconnected using multiple
bridges
The multiple bridges can provide redundant paths to
improve reliability only in case of failure of one path.
Multiple paths cannot exist simultaneously
The bridges must be able to communicate with each
other to coordinate (determine paths) flow of packets
through the network or interconnected LANs
Fixed routing
Spanning tree routing
Source routing (IEEE 802.5, token ring)
Janice Regan © 2005
16
LAN Configuration: Alternate Routes
Janice Regan © 2005
Stallings
2000: fig 13.16
17
Spanning Tree Forwarding
A spanning tree is a concept from graph theory.
In this context a node of the graph is a LAN and an
edge is a bridge between LANs
A spanning tree
Maintains the connectivity of the network
Removes all closed loops
The spanning tree approach to routing through bridges
provides an algorithm to build and dynamically maintain
a spanning tree topology for a network of
interconnected LANs
Janice Regan © 2005
18
Spanning Tree Approach
Three main components
Frame forwarding: Using a data base containing
forwarding information, to determining the
appropriate LAN to which to forward each packet
Address Learning: Building and maintaining the
forwarding data based used by frame forwarding.
Address Learning is effective in a network of LANs
with a spanning tree topology
Spanning Tree Algorithm: Defining and
maintaining an optimal spanning tree topology for
the network of connected LANs. Identifies and
removes possible loops.
Janice Regan © 2005
19
Spanning Tree Forwarding: 1
Each bridge connects two or more networks
Each bridge has a unique identifier or address
One bridge on the network is chosen to be the
root bridge (the bridge with the lowest address)
Each LAN talks to a particular bridge through a
particular port on that bridge
Each port on a bridge has a unique port number
Janice Regan © 2005
20
Spanning Tree Forwarding: 2
Ports may be in forwarding, listening, or
blocking mode
Packets will be received or forwarded
through a port in forwarding mode
Packets will not be forwarded or received
through a port in blocking mode
Ports transitioning from blocking to
forwarding mode will remain in listening
mode for a time during the transition
Janice Regan © 2005
21
Spanning Tree Forwarding: 2
Each bridge builds a forwarding database, which
records the port which provides the most efficient path
to each station on each network to which it is connected
(directly or indirectly)
The forwarding database in the bridge is updated each
time a packet is received.
The forwarding database is used each time a packet is
received to determine which port it should be forwarded
though
Janice Regan © 2005
22
Frame Forwarding
A packet received by the bridge has its MAC
destination address read. Then the bridge
Drops the packet if it is destined for a station on the
source network
Forwards the packet if it is destined for a station that
the forwarding database indicates can be reached
through one of the other ports on the bridge
Broadcasts the packet through all ports (except the
source port) if the station is not in the forwarding
database
Janice Regan © 2005
23
Address Learning
Each entry in the forwarding data base has an
associated timer.
An entry is discarded when its timer expires.
The bridge reads the source address on each
arriving packet, noting the port on which it
arrived
The bridge updates its forwarding data base
using the source address of the packet and the
number of the port on which the packet arrived.
Janice Regan © 2005
24
Updating the data base
The source address is searched for in the
forwarding data base
If the address is not in the database it is added
indicating the path from this bridge to the station
should pass through the port the packet arrived on.
The timer is initialized for the new entry
If the address is in the database, and the address
indicates the port the packet arrived at, the timer for
that forwarding entry is reinitialized
If the address is in the database, and the address
indicates a different port from the one on which the
packet arrived, the forwarding entry is updated and
the timer for the entry is reinitialized
Janice Regan © 2005
25
Why remove closed loops?
If multiple bridges connect two LANs, A and B, then a packet destined
from station 1 on LAN A to an unknown destination will be broadcast to
LAN B through both bridges.
This creates two copies of the packet on LAN B. The forwarding
database in both bridges will be updated to indicate the source of the
packet, station 1, lies on LAN A.
The copies of the packets on LAN A will each reach the other switch.
Since they are both addressed to an unknown address they will be
broadcast to LAN B. The forwarding database in both bridges will be
updated to indicate the source of the packet, station 1, lies in the
direction of LAN B.
A loop is created, the packet circulates forever
Janice Regan © 2005
26
Bridges: Why remove loops
Station 2
LAN A
BRIDGE y
BRIDGE x
LAN B
Station 1
Janice Regan © 2005-2012
27
Spanning Tree Forwarding: 1
Each bridge connects two or more networks
Each bridge has a unique identifier or address
One bridge on the network is chosen to be the
root bridge (the bridge with the lowest address)
Each LAN talks to a particular bridge through a
particular port on that bridge
Each port on a bridge has a unique port number
Ports may be in forwarding, listening, or
blocking mode
Janice Regan © 2005
28
Example Network
LAN 1
(1)
Bridge 3
(2)
Bridge 2
LAN 3
Bridge 1
LAN 2
(2)
(1)
(3)
(1)
(1)
(2)
Bridge 5
(2)
Bridge 6
(1)
Janice Regan © 2005-2012
Bridge 10
LAN 4
(2)
(1)
(1)
(3)
(2)
(1)
Bridge 9
(2)
Bridge 4
LAN 5
(1)
(2)
(1)
Bridge 8
Bridge identifier
(2)
Bridge 7
(2)
LAN 7
LAN 6
29
Spanning Tree Algorithm
First select a root node (bridge with the lowest id
number)
Every other bridge selects a root port.
The root port is the port through which a minimum
cost path to the root node passes.
If paths through multiple ports have the same cost,
the port with the lowest number is chosen.
For each LAN select a designated bridge
the attached bridge with the lowest cost path to the
root bridge is chosen as the designated bridge.
In the case of equal cost the lowest bridge identifier
is chosen
Janice Regan © 2005
30
Select root bridge
LAN 1
(1)
Bridge 3
(2)
Bridge 2
LAN 3
Bridge 1
Root Bridge: smallest bridge identifier
(2)
LAN 2
(3)
(1)
(1)
(1)
(2)
Bridge 4
LAN 5
(1)
(2)
Bridge 5
Bridge 9
(1)
(2)
(3)
(2)
(2)
Bridge 6
(1)
Janice Regan © 2005-2012
(1)
(1)
LAN 4
(2)
(1)
Bridge identifier
Bridge 8
Bridge 7
(2)
Bridge 10
LAN 6
(2)
LAN 7
31
Spanning Tree Algorithm
First select a root node (bridge with the lowest id
number)
Then every other bridge selects a root port.
The root port is the port through which a minimum
cost path to the root node passes.
If paths through multiple ports have the same cost,
the port with the lowest number is chosen.
Then for each LAN select a designated bridge
the attached bridge with the lowest cost path to the
root bridge is chosen as the designated bridge.
In the case of equal cost the lowest bridge identifier
is chosen
Janice Regan © 2005
32
Select root bridge
LAN 1
(1) Root Port
Bridge 3
(2)
Bridge 1
Bridge 2
LAN 3
(1)
Root Port
Root Port (1)
Root Bridge: smallest bridge identifier
(2)
LAN 2
(3)
Root Port (1)
Root Port (2)
Bridge 4
LAN 5
Root Port (1)
(2)
Bridge 5
Bridge 9
(1)
(2)
(3)
(2)
Root Port (2)
Bridge 6
(1)
Janice Regan © 2005-2012
Root Port (1)
Root Port (1)
LAN 4
(2)
Root Port (1)
Bridge identifier
Bridge 8
Bridge 7
(2)
Bridge 10
LAN 6
(2)
LAN 7
33
Spanning Tree Algorithm
First select a root node (bridge with the lowest id
number)
Every other bridge selects a root port.
The root port is the port through which a minimum
cost path to the root node passes.
If paths through multiple ports have the same cost,
the port with the lowest number is chosen.
For each LAN select a designated bridge
the attached bridge with the lowest cost path to the
root bridge is chosen as the designated bridge.
In the case of equal cost the lowest bridge identifier
is chosen
Janice Regan © 2005
34
Select root bridge
LAN 1 B1
(1) Root Port
Bridge 3
(2)
Root Port (1)
(2)
Bridge 1
Bridge 2
LAN 3 B1
(1)
Root Port
Root Port (1)
LAN 2 B1
(3)
Root Port (1)
Root Port (2)
Bridge 4
LAN 5 B4
Root Bridge: smallest bridge identifier
(2)
Bridge 5
Bridge 9
(1)
(2)
(3)
(2)
Root Port (2)
Bridge 6
(1)
Janice Regan © 2005-2012
Root Port (1)
Bridge 10
LAN 4 B5
(2)
Root Port (1)
Bridge identifier
Bridge 8
Bridge 7
(2)
Root Port (1)
LAN 6 B6
(2)
LAN 7 B8
35
Final Tree
LAN 1 B1
(1) Root Port
Bridge 3
(2)
Root Port (1)
(2)
Bridge 1
Bridge 2
LAN 3 B1
(1)
Root Port
Root Port (1)
(3)
LAN 2 B1
Root Port (1)
Root Port (2)
Bridge 4
LAN 5 B4
Root Bridge: smallest bridge identifier
(2)
Bridge 5
(1)
Bridge 9
Root Port (2)
Bridge 6
(1)
Janice Regan © 2005-2012
Bridge 10
(2)
(3)
(2)
Root Port (1)
LAN 4 B5
Root Port (1)
Root Port (1)
Bridge identifier
Bridge 8
Bridge 7
(2)
(2)
LAN 6 B6
(2)
LAN 7 B8
36
Routers and level 3 switches
Traditional routers work in software
Systems using level two switches may provide data
faster than it can be processes
High speed LANs may provide data faster that the
router can process it
Level 3 switches can deal with the higher flows
by doing forwarding in hardware
Two categories of Level 3 switches
Packet by packet
Flow based
Janice Regan © 2005
37