Professional Documents
Culture Documents
SWITCHING
An Ethernet switch is Layer 2 device (Link layer
device)
Learns MAC addresses of devices attached to each
port
Each switch port is a collision domain
More collision domains BUT smaller collision
domains
Broadcasts still sent out of every port
Each switch port has dedicated bandwidth
100% bandwidth available
1
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
2
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
stores and forwards Ethernet frames
3
CS 342: LAN SWITCHING: ETHERNET SWITCHING -
FORWARDING
switch
1
2 3
hub
hub hub
5
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Filtering /Forwarding
When switch receives a frame:
6
CS 342: LAN SWITCHING: ETHERNET
SWITCHING Forwarding Broadcasts and
Multicasts
• Broadcast frames
• Multicast frames
– Frames sent to one of a range of multicast MAC
addresses (e.g. begin with 0100.5E or 0100.5F, such
frames should be delivered to multiple devices on the
LAN, but not necessarily to all devices
7
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
SWITCH EXAMPLE
Suppose C sends frame to D
address interface
switch
A 1
B 1
E 2
hub hub hub G 3
A
I C 1
D F
B C G H
E
9
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
LAN SWITCH OPERATION
When a switch starts up it sends a broadcast out
of all ports to learn host MAC addresses
When a frame is received for an unknown
destination a broadcast is sent to discover
Addresses are added to a switching table mapping
them to the port on which they were learned
When a frame is received for a known destination
it is switched to the appropriate port
10
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
LAN SWITCH OPERATION
Switches
contain RAM – known as
CAM “Content Addressable Memory”
Stores MAC address table
Used as frame buffer
Used to queue frames in asymmetric
switching – switch ports operating at
different speeds e.g. 10 and 100 Mbps
11
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Securing Switch Ports
• Configure a permanent MAC address
12
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
LAN SWITCH OPERATION
Symmetric switching provides switching between like
bandwidths
13
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Ethernet MAC Frame Format
• Preamble: 7-octet pattern of 0s &1s used to establish
bit synchronization.
14
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Ethernet MAC Frame Format
• Length: Length of LLC data field in octets.
15
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Ethernet MAC Frame
16
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Switching Methods
Four methods for processing and forwarding frames
• Fragment-free
• Cut-through
– Forwards frame after destination MAC is read
– First 14 bytes of frame
– Lowest latency
– No error detection
• Adaptive cut-through
– Error sensing
– Uses cut-through and store-and-forward
18
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Switching Methods
19
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Switching Methods
20
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Switching Methods
21
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Switching Methods-Summary
Cut-through Switching
• Fast-forward – as soon as destination address is read switching
starts
Increased Latency
• Fragment-free – after 64 bytes have been received (minimum
valid frame size) frame is switched
22
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Buffering
• Two methods
– Port-based
• Packets stored in queues that are linked to incoming
ports – packets forwarded when queue is clear
– Shared Memory buffering
• Deposits all packets into common memory buffer
shared by all ports
– Dynamic location assigns port areas
– Switch maintains a map of ports and clears when
packet is switched
23
CS 342: LAN SWITCHING: ETHERNET
SWITCHING Transmission Time & Latency
Bit time – time taken to recognise 1 bit
Minimum frame size - 64 bytes – 512 bits
Maximum frame size – 1518 bytes – 12,144 bits
Transmission time is always 512 bit times
10Mbps – 64 byte frame - 51,200 ns (100ns bit time)
100Mbps – 64 byte frame 5,120 ns (10 ns bit time)
1000Mbps – 64 byte frame – 512 ns (1ns bit time)
24
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Types of Transmission
Half-duplex Full duplex
• Host checks medium for • Host can transmit
signal – if clear host immediately
transmits
• Only 1 host can transmit at • 2 hosts can transmit
a time simultaneously
• Collisions – jam signal • No collisions
generated, back-off • 100% bandwidth
algorithm before available
retransmission
• 50-60% bandwidth • Requires dedicated
available connection to a
switchport
25
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Half Duplex or Duplex
• Ethernet LANs are half-duplex technology
• Full-duplex Ethernet allows the transmission of a
packet and the reception of a different packet at
the same time – requires full duplex NIC card
26
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Half Duplex or Duplex
• Because both nodes can transmit and receive at
the same time, there are no negotiations for
bandwidth.
27
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Benefit of Full Duplex
• Ethernet usually can only use 50%-60% of the 10-Mbps
available bandwidth because of collisions and latency.
• Full-duplex Ethernet offers 100% of the bandwidth in both
directions.
• This produces a potential 20-Mbps throughput- 10-Mbps
TX and 10-Mbps RX.
• Remember – Transmit connects to Receive
– Think SIMPLE LAN
28
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Full Duplex
In a network that uses twisted-pair cabling, one pair is used to carry the
transmitted signal from one node to the other node.
Latency is the delay between the time a frame begins to leave the source
device and when the first part of the frame reaches its destination.
Media delays may be caused by the finite speed that signals can
travel through the physical media.
Delays may be caused by the content of the frame and the location of
the frame switching decisions. For example, a device cannot route a
frame to a destination until the destination MAC address has been
read.
30
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Auto-negotiation
Auto-negotiation allows devices to select the most
optimal way to communicate without the user having to
configure the devices.
31
CS 342: LAN SWITCHING: ETHERNET
SWITCHING Advantages of Switched Hubs
• No modifications needed to workstations when replacing
shared-medium hub
32
CS 342: LAN SWITCHING: ETHERNET
SWITCHING Differences Between Switched Hubs
and Bridges
• Bridge frame handling is done in software. A layer 2 switch
performs the address recognition and frame forwarding
functions in hardware.
33
CS 342: LAN SWITCHING: ETHERNET
SWITCHING Differences Between Switched
Hubs and Bridges
34
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Problems With Layer 2 Switches
• Broadcast overload
35
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
Layer 3 Switches
• Implement the packet-forwarding logic of the router in
hardware.
• Packet-by-packet switch operates like a traditional router
– Forwarding logic is in hardware
– Achieves an order of magnitude increase in performance
compared to software-based routers
• Flow-based switch identifies flows of IP packets that have the
same source and destination
– Once flow is identified, a predefined route can be established
to speed up the forwarding process
– Again, huge performance increases over a pure software-
based router are achieved
36
CS 342: LAN SWITCHING: ETHERNET
SWITCHING
37