Layer2 Network Design
Layer2 Network Design
Layer2 Network Design
Network Border
Core
Distribution
Access
ISP2
Network Border
Core
Distribution
Access
Layer 2 Concepts
Layer 2 protocols basically control access
to a shared medium (copper, fiber, electromagnetic waves)
Ethernet is the de-facto standard today
Reasons:
Simple
Cheap
Manufacturers keep making it faster
Ethernet Functions
Source and Destination identification
MAC addresses
Ethernet Frame
Star
One central device connects every other node
First with hubs (repeated traffic)
Later with switches (bridged traffic)
Hub
Receives a frame on one port and sends it
out every other port, always.
Collision domain is not reduced
Traffic ends up in places where its not
needed
Hub
Hub
Switch
Learns the location of each node by looking
at the source address of each incoming
frame, and builds a forwarding table
Forwards each incoming frame to the port
where the destination node is
Reduces the collision domain
Makes more efficient use of the wire
Nodes dont waste time checking frames not destined to them
Switch
Forwarding Table
Address
Port
AAAAAAAAAAAA
BBBBBBBBBBBB
Switch
B
A
Some differences:
IP packets travel inside ethernet frames
IP networks can be logically segmented into subnets
Switches do not usually know about IP, they only deal
with Ethernet frames
Traffic Domains
Router
Switch
Hub
Switch
Hub
Broadcast Domain
Hub
Hub
Collision Domain
Traffic Domains
Try to eliminate collision domains
Get rid of hubs!
Build Incrementally
Start small
Fiber link to distribution switch
Switch
Hosts
Build Incrementally
As you have demand and money, grow like
this:
Aggreg.
Switch
Hosts
Build Incrementally
And keep growing within the same
hierarchy:
Aggreg.
Switch
Switch
Hosts
Build Incrementally
At this point, you can also add a redundant
aggregation switch
Aggreg.
Aggreg.
Switch
Switch
Hosts
Do not daisy-chain
Resist the temptation of doing this:
Local VLANs
2 VLANs or more within a single switch
Edge ports, where end nodes are
connected, are configured as members of
a VLAN
The switch behaves as several virtual
switches, sending traffic only within VLAN
members
Local VLANs
Switch
VLAN X
VLAN Y
Edge ports
VLAN X nodes
VLAN Y nodes
802.1Q
The IEEE standard that defines how
ethernet frames should be tagged when
moving across switch trunks
This means that switches from different
vendors are able to exchange VLAN
traffic.
802.1Q Trunk
Trunk Port
VLAN X
VLAN Y
VLAN X
Edge Ports
VLAN Y
You have to make sure that all the switchto-switch trunks are carrying all the
necessary VLANs
Need to keep in mind when adding/removing
VLANs
Link Aggregation
Also known as port bundling, link bundling
You can use multiple links in parallel as a single,
logical link
For increased capacity
For redundancy (fault tolerance)
LACP Operation
Two switches connected via multiple links
will send LACPDU packets, identifying
themselves and the port capabilities
They will then automatically build the
logical aggregated links, and then pass
traffic.
Switche ports can be configured as active
or passive
LACP Operation
100 Mbps
Switch A
Switch B
100 Mbps
LACPDUs
Switches A and B are connected to each other using two sets of Fast
Ethernet ports
LACP is enabled and the ports are turned on
Switches start sending LACPDUs, then negotiate how to set up the
aggregation
LACP Operation
100 Mbps
Switch A
Switch B
100 Mbps
Distributing Traffic
in Bundled Links
Bundled links distribute frames using a
hashing algorithm, based on:
Source and/or Destination MAC address
Source and/or Destination IP address
Source and/or Destination Port numbers
Switching Loop
Switch A
Switch B
Swtich C
Switching Loop
If there is more than one path between
two switches:
Forwarding tables become unstable
Source MAC addresses are repeatedly seen
coming from different ports
Switching Loop
Switch A
Switch B
Node 1
Switching Loop
Switches A, B and C
Switch A
Switch B
Swtich C
Node 1
broadcast node 1s
frame out every port
Switching Loop
But
Switch A
Switch B
Swtich C
Node 1
they receive
each others
broadcasts, which
they need to forward
again out every port!
The broadcasts are
amplified, creating a
broadcast storm
Switch B
32678.0000000000BB
Switch C
32678.0000000000CC
STP Cost
10 Mbps
100
100 Mbps
19
1 Gbps
10 Gbps
Swtich A
Cost=19
Cost=19
1
Switch B
32678.0000000000BB
1
2
2
Cost=19
Switch C
32678.0000000000CC
Swtich A
Cost=19
Cost=19
Root Port
1
Switch B
32678.0000000000BB
1
2
2
Cost=19
Root Port
Switch C
32678.0000000000CC
Swtich A
Cost=19
Cost=19
1
Switch B
32678.0000000000BB
1
2
2
Cost=19
Switch C
32678.0000000000CC
Designated
Port
Swtich A
Cost=19
Cost=19
1
Switch B
Designated
Port
1
2
32678.0000000000BB
Designated
Port
2
Cost=19
Switch C
32678.0000000000CC
Blocking a port
Any port that is not elected as either a
Root Port, nor a Designated Port is put
into the Blocking State.
This step effectively breaks the loop and
completes the Spanning Tree.
Swtich A
2
Cost=19
Cost=19
1
Switch B
32678.0000000000BB
2
Cost=19
Switch C
32678.0000000000CC
Blocking
Not forwarding frames
Receiving BPDUs
Listening
Not forwarding frames
Sending and receiving BPDUs
Forwarding
Forwarding frames
Sending and receiving BPDUs
Learning new MAC addresses
A switch fails
A link fails
32678.0000000000DD
Swtich D
Switch B
32678.0000000000BB
Root
Bridge
32678.0000000000CC
Switch C
Switch A
32678.0000000000AA
Alernative
Root Bridge
1.0000000000DD
Swtich D
32678.0000000000CC
Switch C
Out to active
router
Switch B
Switch A
Root Bridge
0.0000000000BB
32678.0000000000AA
RP
DP
Root
Agreement
Switch
Switch
Switch
Switch
Root
DP
Proposal
RP
Agreement
Switch
Switch
Switch
Switch
Root
DP
RP
RP
Switch
Switch
DP
Proposal
RP
Agreement
Switch
Switch
Root
DP
RP
RP
Switch
Switch
DP
DP
Proposal
RP
Switch
Agreement
Switch
RP
Vlan A
Root VLAN B
Vlan B
MST Region
MST Region
IST
IST
802.1D switch
Selecting Switches
Minimum features:
Standards compliance
Encrypted management (SSH/HTTPS)
VLAN trunking
Spanning Tree (RSTP at least)
SNMP
At least v2 (v3 has better security)
Traps
Selecting Switches
Other recommended features:
DHCP Snooping
Prevent end-users from running a rogue DHCP
server
Happens a lot with little wireless routers (Netgear,
Linksys, etc) plugged in backwards
Selecting Switches
Other recommended features:
Dynamic ARP inspection
A malicious host can perform a man-in-the-middle
attack by sending gratuitous ARP responses, or
responding to requests with bogus information
Switches can look inside ARP packets and discard
gratuitous and invalid ARP packets.
Selecting Switches
Other recommended features:
IGMP Snooping:
Switches normally flood multicast frames out every
port
Snooping on IGMP traffic, the switch can learn
which stations are members of a multicast group,
thus forwarding multicast frames only out
necessary ports
Very important when users run Norton Ghost, for
example.
Network Management
Enable SNMP traps and/or syslog
Collect and process in centralized log server
Spanning Tree Changes
Duplex mismatches
Wiring problems
Monitor configurations
Use RANCID to report any changes in the
switch configuration
Network Management
Collect forwarding tables with SNMP
Allows you to find a MAC address in your
network quickly
You can use simple text files + grep, or a web
tool with DB backend
Documentation
Document where your switches are
located
Name switch after building name
E.g. building1-sw1