Professional Documents
Culture Documents
Ccna3 Mod4 SwitchingConcepts
Ccna3 Mod4 SwitchingConcepts
Ccna3 Mod4 SwitchingConcepts
4 – Switching Concepts
Routers
Switches, Bridges
Hub, Repeaters
• Ethernet networks used to be built using repeaters.
• When the performance of these networks began to suffer because too
many devices shared the same segment, network engineers added
bridges to create multiple collision domains.
• As networks grew in size and complexity, the bridge evolved into the
modern switch, allowing microsegmentation of the network.
• Today’s networks typically are built using switches and routers, often
with the routing and switching function in the same device.
Ethernet/802.3 LAN development
• Distance limitations
• Ethernet is fundamentally a shared technology where all users on a given LAN
segment compete for the same available bandwidth.
• This situation is analogous to a number of cars all trying to access a one-lane
road at the same time.
• Because the road has only one lane, only one car can access it at a time.
• The introduction of hubs into a network resulted in more users competing for
the same bandwidth.
• Collisions are a by-product of Ethernet networks.
Bridges
• Transmission time equals the number of bits being sent times the bit
time for a given technology.
• Another way to think about transmission time is the time it takes a
frame to be transmitted.
• Small frames take a shorter amount of time. Large frames take a
longer amount of time.
• Each 10 Mbps Ethernet bit has a 100 ns transmission window.
– Therefore, 1 byte takes a minimum of 800 ns to transmit.
– A 64-byte frame, the smallest 10BASE-T frame allowing CSMA/CD
to function properly, takes 51,200 ns ( 51.2 microseconds).
– Transmission of an entire 1000-byte frame from the source station
requires 800 microseconds.
The benefits of using repeaters
3333 1111
Hey, that’s
Nope me! Nope
1111 2222 3333 nnnn Abbreviated
MAC
Addresses
3333 1111
• Each NIC card compares its own MAC address with the Destination
MAC Address.
• If it matches, it copies in the rest of the frame.
• If it does NOT match, it ignores the rest of the frame.
– Unless you are running a Sniffer program
Sending and receiving Ethernet frames on a bus
Collision!
Access Methods
Notice the
location of
the DA!
3333 1111
And as we said,
• When information (frame) is transmitted, every PC/NIC on the shared
media copies part of the transmitted frame to see if the destination
address matches the address of the NIC.
• If there is a match, the rest of the frame is copied
• If there is NOT a match the rest of the frame is ignored.
•
Sending and receiving Ethernet frames via a hub
3333 1111
3333 4444
•
Sending and receiving Ethernet frames via a hub
Hub or
•
Sending and receiving Ethernet frames via a hub
3333 1111
2222 1111
5555
Nope
Wasted
bandwidth
1111 3333
• Next, in our scenario, the
Abbreviated switch will flood the frame out
MAC all other ports, because the DA
addresses
is not in the source address
2222 4444
table.
•
Destination Address in table, Filter
switch
1111 3333
switch
3333 4444
3333
• Where is the
collision domain?
3333
Collision Domain
3333
(routing)
• Latency is the period of time from when the beginning of a frame enters
to when the end of the frame exits the switch.
• Latency is directly related to the configured switching process and
volume of traffic.
•
Memory buffering
Cut-through
• Fast-forward – Offers the lowest level of latency.
– Fast-forward switching immediately forwards a packet after reading
the destination address.
– There may be times when packets are relayed with errors.
– Although this occurs infrequently and the destination network
adapter will discard the faulty packet upon receipt.
•
Cut-through
Cut-through
• Fragment-free – Fragment-free switching filters out collision fragments before
forwarding begins.
– Collision fragments are the majority of packet errors.
– In a properly functioning network, collision fragments must be smaller than
64 bytes.
– Anything greater than 64 bytes is a valid packet and is usually received
without error.
– Fragment-free switching waits until the packet is determined not to be a
collision fragment before forwarding.
•
Two switching methods
• Adaptive cut-through
– In this mode, the switch uses cut-through until it detects
a given number of errors.
– Once the error threshold is reached, the switch changes
to store-and-forward mode.
Functions of a switch
“Learning bridges” or
Learning switches”
• If a switch has the frame’s destination address in its CAM table (or
Source Address Table) it will only send the frame out the appropriate
port.
• If a switch does not have the frame’s destination MAC address in its
CAM table, it floods (sends) it out all ports except for the incoming port
(the port that the frame came in on) known as an Unknown Unicast, or
if the destination MAC address is a broadcast.
• Note: A CAM table may contain multiple entries per port, if a hub or a
switch is attached to that port.
• Most Ethernet bridges can filter broadcast and multicast frames.
Filter or Flood (Switch)
Hub Switch
switch
Collision Domains
• A switch employs
1111 3333 “microsegmentation” to
reduce the collision
Abbreviated
MAC domain on a LAN.
addresses
• The switch does this by
2222 4444
creating dedicated network
segments, or point-to-point
connections.
•
Broadcast domains
Switch 1
172.30.1.21
255.255.255.0
172.30.2.16
172.30.2.10 172.30.1.23 172.30.2.12 Switch 2 255.255.255.0
255.255.255.0 255.255.255.0 255.255.255.0
•All Switched
ARP Network - Two Networks
Request
Ÿ Two Subnets
172.30.1.25
Ÿ Several Collision Domains 255.255.255.0
Ÿ One per switch port 172.30.2.14
172.30.1.27
255.255.255.0
Ÿ One Broadcast Domain 255.255.255.0
• Even though the LAN switch reduces the size of collision domains, all
hosts connected to the switch are still in the same broadcast domain.
• Therefore, a broadcast from one node will still be seen by all the other
nodes connected through the LAN switch.
•
Switches and broadcast domains
Hubs to VLANs
Part 1
• Layer 1 devices
• Inexpensive
• In one port, out the others
• One collision domain
• One broadcast domain
•
Single Hub
Hub 1
172.30.1.21 172.30.1.24
255.255.255.0 255.255.255.0
172.30.1.22 172.30.1.23
255.255.255.0 255.255.255.0
Single Hub
Ÿ One Network (IP Network Address - usually)
Ÿ One Collision Domain
Ÿ One Broadcast Domain
Hub 1
172.30.1.21 172.30.2.22
255.255.255.0 255.255.255.0
Hub 1
172.30.1.21
255.255.255.0
172.30.1.27
172.30.1.23 Hub 2 255.255.255.0
172.30.1.22 255.255.255.0
255.255.255.0
All Hubs
Ÿ One Network Address 172.30.1.24
255.255.255.0
Ÿ One Collision Domain 172.30.1.26
172.30.1.25 255.255.255.0
Ÿ One Broadcast Domain 255.255.255.0
• Layer 2 devices
• Layer 2 filtering based on Destination MAC addresses and
Source Address Table
• One collision domain per port
• One broadcast domain across all switches
•
Switches create multiple parallel paths
Hub
172.30.1.21
255.255.255.0
172.30.1.27
172.30.1.23 Switch 255.255.255.0
172.30.1.22 255.255.255.0
255.255.255.0
Hub
172.30.1.21
255.255.255.0
172.30.1.27
172.30.1.23 Switch 255.255.255.0
172.30.1.22 255.255.255.0
255.255.255.0
Hub
172.30.1.21
255.255.255.0
172.30.1.27
172.30.1.23 Switch 255.255.255.0
172.30.1.22 255.255.255.0
255.255.255.0
Hub
Frames
172.30.1.21 buffered
255.255.255.0
172.30.1.27
172.30.1.23 Switch 255.255.255.0
172.30.1.22 255.255.255.0
255.255.255.0
The switch keeps the frames in buffer memory, and queues the traffic for
the host 172.30.1.25.
This means that the sending hosts do not know about the collisions and do
not have to re-send the frames.
•
Other Switching Features
Review
• Asymmetric ports: 10 Mbps and 100 Mbps
• Full-duplex ports
• Cut-through versus Store-and-Forward switching
•
Other Switching Features
Switch 1
172.30.1.21
255.255.255.0
172.30.1.28
172.30.1.22 172.30.1.23 172.30.1.24 Switch 2 255.255.255.0
255.255.255.0 255.255.255.0 255.255.255.0
• Ports between switches and server ports are good candidates for higher
bandwidth ports (100 Mbps) and full-duplex ports.
• Most switch ports today are full-duplex.
•
Introducing Multiple Subnets/Networks
without Routers
• Switches are Layer 2 devices
• Router are Layer 3 devices
• Data between subnets/networks must pass through a
router.
•
Switched Network with Multiple Subnets
ARP Request
Switch 1
172.30.1.21
255.255.255.0
172.30.2.16
172.30.2.10 172.30.1.23 172.30.2.12 Switch 2 255.255.255.0
255.255.255.0 255.255.255.0 255.255.255.0
Switch 1
172.30.1.21
255.255.255.0
172.30.2.16
172.30.2.10 172.30.1.23 172.30.2.12 Switch 2 255.255.255.0
255.255.255.0 255.255.255.0 255.255.255.0
• All devices see the ARP Request, even those on the other subnets that do not need to
see it.
• One broadcast domain means the switches flood all broadcast out all ports, except the
incoming port.
• Switches have no idea of the layer 3 information contained in the ARP Request.This
consumes bandwidth on the network and processing cycles on the hosts.
•
One Solution: Physically separate the subnets
Switch 1
172.30.1.21
255.255.255.0
172.30.2.16
172.30.1.23 172.30.1.25 172.30.1.26 Switch 2 255.255.255.0
255.255.255.0 255.255.255.0 255.255.255.0
172.30.1.1
255.255.255.0
Switch 1 172.30.2.1
172.30.1.21
255.255.255.0 255.255.255.0
Router
172.30.2.16
172.30.1.23 172.30.1.25 172.30.1.26 Switch 2 255.255.255.0
255.255.255.0 255.255.255.0 255.255.255.0
Routed Networks
Ÿ Two Subnets
172.30.2.10
Ÿ Several Collision Domains 255.255.255.0
Ÿ One per switch port 172.30.2.12
172.30.2.14
255.255.255.0
Ÿ Communication between subnets 255.255.255.0
ARP Request
172.30.2.10 172.30.1.23
Routed Networks 255.255.255.0 255.255.255.0
Ÿ Two Subnets
Ÿ Communication between subnets
• When a single interface is used to route between subnets or networks,
this is know as a router-on-a-stick.
• To assign multiple ip addresses to the same interface, secondary
addresses or subinterfaces are used.
•
Router-on-a-stick or One-Arm-Router (OAR)
interface e 0 172.30.1.1
ip address 172.30.1.1 255.255.255.0 172.30.2.1 sec
ip address 172.30.2.1 255.255.255.0 secondary Router 255.255.255.0
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
172.30.2.10 172.30.1.23
Routed Networks 255.255.255.0 255.255.255.0
ARP Request
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
172.30.2.10 172.30.1.23
Routed Networks 255.255.255.0 255.255.255.0
Ÿ Two Subnets
Ÿ Communication between subnets
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
172.30.2.10 172.30.1.23
Routed Networks 255.255.255.0 255.255.255.0
Ÿ Two Subnets
Ÿ Communication between subnets
Remember to have the proper default gateway set for each host.
• 172.30.1.0 hosts - default gateway is 172.30.1.1
• 172.30.2.0 hosts - default gateway is 172.30.2.1
•
Interface for each subnet
172.30.1.1 E0 E1 172.30.2.1
255.255.255.0 255.255.255.0
Router
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
172.30.2.10 172.30.1.23
Routed Networks 255.255.255.0 255.255.255.0
Ÿ Two Subnets
Ÿ Communication between subnets
• An Ethernet router interface per subnet may be used instead of one.
• However this may be difficult if you do not have enough Ethernet ports
on your router.
•
Still one broadcast domain
172.30.1.1 172.30.2.1
255.255.255.0 255.255.255.0
Router
ARP Request
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
172.30.2.10 172.30.1.23
Routed Networks 255.255.255.0 255.255.255.0
Ÿ Two Subnets
Ÿ Communication between subnets
• Still the same problem of the switch forwarding broadcast
traffic to all devices on all subnets.
•
Introducing VLANs
• VLAN = Subnet
• VLANs create separate broadcast domains within the
switch.
• Routers are needed to pass information between different
VLANs
• This is only an introduction, as we will discuss VLANs
and Inter-VLAN Routing in later chapters.
•
Layer 2 Broadcast Segmentation
Switch Port: VLAN ID
ARP Request
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
VLAN 1
VLAN 2
172.30.2.10 172.30.1.23
255.255.255.0 255.255.255.0
VLAN 2 VLAN 1 1 2 3 4 5 6 . Port
1 2 1 2 2 1 . VLAN
Two VLANs
Ÿ Two Subnets
• An ARP Request from 172.30.1.21 for 172.30.1.23 will only be seen by
hosts on that VLAN.
• The switch will flood broadcast traffic out only those ports belonging to
that particular VLAN, in this case VLAN 1.
•
Layer 2 Broadcast Segmentation
1 2 3 4 5 6 . Port
1 2 1 2 2 1 . VLAN
Port-centric VLAN Switches
• As the Network Administrator, it is your job to assign switch
ports to the proper VLAN.
• This assignment is only done at the switch and not at the
host.
• Note: The following diagrams show the VLAN below the
host, but it is actually assigned on the switch.
•
Without VLANs – No Broadcast Control
ARP Request
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
172.30.2.10 172.30.1.23
255.255.255.0 255.255.255.0
No VLANs
Ÿ Same as a single VLAN
Ÿ Two Subnets
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
VLAN 1
VLAN 2
172.30.2.10 172.30.1.23
255.255.255.0 255.255.255.0
VLAN 2 VLAN 1 1 2 3 4 5 6 . Port
1 2 1 2 2 1 . VLAN
Two VLANs
Ÿ Two Subnets
•
Inter-VLAN Traffic
Switch Port: VLAN ID
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
VLAN 1
VLAN 2
172.30.2.10 172.30.1.23
255.255.255.0 255.255.255.0
VLAN 2 VLAN 1 1 2 3 4 5 6 . Port
1 2 1 2 2 1 . VLAN
172.30.1.21
Switch 1
172.30.2.12
255.255.255.0
255.255.255.0
VLAN 1
VLAN 2
172.30.2.10 172.30.1.23
255.255.255.0 255.255.255.0
VLAN 2 VLAN 1 1 2 3 4 5 6 . Port
1 2 1 2 2 1 . VLAN
Two VLANs
Ÿ Two Subnets
• A switch cannot route data between different VLANs.
• Note: The host will not even send the Packet unless it has a
default gateway to forward it to.
•
Inter-VLAN Routing needs a Router
172.30.1.1 172.30.2.1
255.255.255.0 255.255.255.0
(VLAN 1) Router (VLAN 2)
1 2 3 4 5 6 . Port
1 2 1 2 2 1 . VLAN