Unmanaged Ethernet Redundant Ring
Unmanaged Ethernet Redundant Ring
Unmanaged Ethernet Redundant Ring
A Simple and Cost Effective Solution using the KSZ8863 / KSZ8873 3-Port
Ethernet Switch family
A WHITE PAPER
By Mike Jones
Senior FAE, Micrel Inc.
Micrel, Inc. • 2180 Fortune Drive • San Jose, CA 95131 • USA • tel + 1 (408) 944-0800 • fax 1 (408) 474-1000 • http://www.micrel.com
Unmanaged Ethernet Redundant Ring
Introduction
Unlike office Ethernet ‘star’ networks, industrial control applications tend to favour ‘ring’
topology. The ‘ring’ simplifies cabling and provides inherent redundancy. The basic building
block for a ‘ring’ network is the 3-Port switch as shown in Figure 1 below.
Managed 3-Port
Redundant Switch
Link
3-Port 3-Port 3-Port
Switch Switch Switch
There is no commonly available standard that deals with the management of Ethernet Ring
topology. Various different techniques can be used for the implementation of network ring
management. One popular protocol is Spanning Tree or Rapid Spanning Tree. Spanning Tree
Protocol (STP) and Rapid STP, IEEE 802.1d and 802.1w create a ‘spanning tree’ within a mesh
network of Ethernet switches by blocking duplicate links, to form a single active path between any
two network nodes. The redundancy in the network can provide automatic backup paths if any of
the active links fail.
Using STP as the basis for redundancy is relatively expensive in the overheads for the software
stack and processor power required to implement the solution. This is undesirable for simpler
applications which either do not require or simply cannot afford such performance. For such
applications a means of providing reasonable redundancy performance in the ring with minimal
management would be highly desirable.
With this mechanism the MAC Source Address is only ever learnt and never used in the decision
making when forwarding the packet. However, if the switch could filter packets based on the MAC
Source Address (instead of the MAC Destination Address) a true ring network can be realised.
Now the switch can detect and filter (drop) any packet that arrives with a MAC Source Address
matched to the local processor MAC Address. As a consequence packets are always removed from
the ring following one complete loop. Figure 2 shows such an example of how this can work.
SA = 1 SA = 1
DA = B* P3 P3 P3 P3
DA = B*
P1 P2 P1 P2 P1 P2 P1 P2
*B = Broadcast
Unfortunately Fast Ethernet switches today do not offer Source Address Filtering, except for the
KSZ8873 and KSZ8863 families of 3-Port Ethernet switches from Micrel. These switches provide
two independent MAC Addresses that can be programmed and used for MAC Source Address
filtering.
SA = 1 SA = 1
DA = 3 P3 DA = 3 P3 P3 P3
P1 P2 P1 P2 P1 P2 P1 P2
The disadvantage of this method is that receiving duplicate packets increases the processor work
load significantly and the bandwidth of the network is effectively halved. Sending duplicate
packets on the ring in both directions can also cause ‘confusion’ for the switches learning
mechanism. Here the switch will receive packets with the same MAC Source Address from two
different ingress ports, potentially leading to one of the packets being dropped as a ‘local packet’.
A packet is defined as a ‘local packet’ and dropped by the switch if the destination port from the
‘Lookup’ table matches the port from which the packet originated. Figures 4a and 4b demonstrate
an example of this potential issue.
Now there is no way of distinguishing whether a dropped packet is the result of a link failure or
just this issue.
SA = n SA = n SA = n SA = n
DA = 1 P3 DA = 1 P3 P3 P3 DA = 1
DA = 1
P1 P2 P1 P2 P1 P2 P1 P2
Forwarding Table:
MAC n = P2
SA = 2 SA = 2 SA = 2
P3 DA = n P3 DA = n P3 DA = n P3
P1 P2 P1 P2 P1 P2 P1 P2
Forwarding Table:
MAC n = P2
To ensure that both packets always reach the destination switch, if no link failure exists, you need
to disable learning. By disabling learning the ‘Forwarding’ table will always be empty and hence,
incoming packets can never be ‘local’ and dropped. The major drawback to this approach is an
increased overhead to the processor. Now all incoming packets will be forwarded to the processor
port (port 3) irrespective of whether or not they are destined for the processor. The KSZ8863/73
switch family can overcome this short fall by the processor manually programming the Forwarding
table to ensure any ‘unknown’ packets are passed on the ring and not to the processor port.
This solution uses very minimal management by the processor and offers extremely quick fault
recognition and correction, even in a large ring network, as demonstrated in Figures 5a and 5b.
Processor Processor
MAC=n MAC=n
Pin 41,
INTRN
P3 P3
P2 Receive
Disabled
P1 P2 P1 P2
KSZ8873MLL KSZ8873MLL
Switch #n Switch #n
Initialisation:
1. Disable learning on ports 1 & 2 of each switch (Port Control Reg2.0 =1)
2. Configure the Static MAC Forwarding Table to forward packets with DA = local uP to port
3
3. Enable ‘Unknown MAC Address Forwarding’ (Reg14.7 = 1 and Reg14.2-0 = 011)
4. Disable Port 2 Receive (Port 1 Control Reg2.1 = 0)
• Other methods do exist including tail-tagging, VID etc.
5. Enable Link Status Interrupt (Reg187.1:0 = 1,1)
P3 P3 P3 P3
P1 P2 P1 P2 P1 P2 P1 P2
KSZ8873MLL KSZ8873MLL
Bcst KSZ8873MLL KSZ8873MLL
Switch #1 Link Switch #2 Fail Switch #3 Switch #n
Fail
Switchover Routine:
The Switchover routine is simple and acts with minimal latency and processor workload.
1. Read Interrupt Register (Reg 188)
2. If Port 1 link down then
• Send a broadcast message to notify all switches to enable Port 2 Receive
• Enable Port 2 Receive (Port 1 Control Reg2.1 =1 )
• Write 0xff to register 188 to clear interrupts
3. If Port 2 link down then
• Ignores ‘enable port 2 Receive’ request
• Perform Fault Diagnostics
The KSZ8863/73 offers a cable diagnostic feature LinkMD™ that can be used (in this example
Switch #1) to identify and locate location of fault.
When link has been fixed the Interrupt signal will indicate a ‘link change status’ ie. Link is good.
Switchover Latency:
Latency = Tinterrupt + Tread interrupt + Tbroadcast message + Tenable P2 Receive
Therefore:
Latency = 100us + 4.8us + (n-1)x7.7us + 4.8us
Therefore:
1ms = 100us + 4.8us + (n-1)x7.7us + 4.8us
n < (890.4 / 7.7) + 1
Conclusion
‘Ring’ topology is commonly implemented in Industrial Control networks. However, such a
configuration is generally forbidden in Ethernet networks. Packets will endlessly circulate the
network in the presence of a loop, quickly resulting in bandwidth degradation. Complex high layer
protocols, such as Spanning Tree, can be utilised to manage the ring and provide redundancy via
the ‘broken’ link. Complexity and cost are significantly increased as a result. In this paper we have
shown that by providing the unique feature ‘Source Address Filtering’ supported by the Micrel
KSZ8863 and KSZ8873 3-Port Ethernet switch family, a simple and cost effective alternative is
available.
Start
YES
NOT
FOUND
Search complete.
Get PTF1 from FOUND
Dynamic Table This search is based on
Dynamic MAC Search DA+FID
Table
NOT
FOUND
Search complete.
Get PTF1 from
VLAN Table
PTF1
Search engine looks up the VLAN ID, Static MAC Table and Dynamic Mac Table for the
destination address, and comes up with “port to forward 1” (PTF1).
PTF1
- RX
Port Mirror - TX
Process - RX or TX
- RX and TX
Port
Membership
Check
‘Unknown MAC
Address
Forwarding’
PTF2
PTF1 is then further modified by Spanning Tree, IGMP Snooping, Port Mirroring, Port VLAN and
‘Unknown MAC Address Forwarding’ processes to come up with “Port to Forward 2” (PTF2).