Community discussions

MikroTik App
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

L2 ring redundancy protocol support?

Wed Dec 09, 2020 7:23 pm

Hi!
Is there a way to build a layer 2 redundant ring with routeros? This is often used with industrial equipment and switches where fast fail over is needed and (r)stp can't be used. I have used hirschman switches with their Hiper ring protocol in the past which basically send a test telegram around in the ring and if the telegram suddenly is missing on the other ring port than it was sent from, it activates switching on both ports but if the telegram is instead received on the blocking ring port it will continue to block other traffic on it and stops it from creating a loop.
Many industrial devices like PLCs, remote I/Os, variable speed drives and so on comes with dual switched ethernet ports for this but you need a "master" in the ring to handle the redundancy so a complete loop isn't formed.
Would be cool if this could be done with routeros :)
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: L2 ring redundancy protocol support?

Wed Dec 09, 2020 11:52 pm

It is called ERPS, Ethernet Ring Protection Switching.

As far as I know Mikrotik does not support it "yet", will be cool though
 
robertkjonesjr
Frequent Visitor
Frequent Visitor
Posts: 71
Joined: Tue Jul 03, 2012 1:39 am

Re: L2 ring redundancy protocol support?

Wed Dec 09, 2020 11:59 pm

where fast fail over is needed
How fast is fast?
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: L2 ring redundancy protocol support?

Thu Dec 10, 2020 12:11 am

where fast fail over is needed
How fast is fast?

With ERPS, they aiming at 50ms
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Thu Dec 10, 2020 10:16 am

There is also MRP
https://en.wikipedia.org/wiki/Media_Redundancy_Protocol
Which should deal with up to 14 switches at 10ms (and more switches at higer switch over times)

I thought maybe it could be done with a looping script? One that sends a test packet and listens + count the timeout and if packet is received it triggers sending another packet. And maybe this could be done using a vlan or L2 fw rules so the "blocking" end can hear the test packet while all other traffic is blocked, just some quick ideas :)
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: L2 ring redundancy protocol support?

Thu Dec 10, 2020 2:27 pm

G.8032 is definitely the way to go....would love to see this in the CRS3xx series.
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Thu Dec 10, 2020 7:56 pm

G.8032 is definitely the way to go....would love to see this in the CRS3xx series.
Not sure that is meant for industrial use where all the dual port devices functions as "dumb" switches? I think G.8032 will require this support on all nodes while MRP could work on only the "ring master" switch but not 100% sure of this. As I said, I used hirschman hiper ring before and it works like that and MRP is a IEC standardisation and continued development of the hiper ring technology so I would guess it could work like I think it would with all other switches "dumb".
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Mon Dec 28, 2020 5:31 pm

Hi!
I'm thinking of trying to script this using pings. Starting a ping every few ms using a script is not hard but and then how to catch it on the other end in the best way? I'm thinking of using L2 mac ping and specify which port the packets goes out on and ping the second ports mac address. And then use bridge firewall rules to capture the ping, as long as pings reach the second port (backup port) the port is member of some dummy bridge. If mac-ping packets stop coming in on that interface, the script switch the port to be part of the main bridge instead. And if pings start to make it through again port is moved back to dummy bridge. My biggest question right now is how to make the bridge firewall rules to execute scripts depending on if the mac-pings are coming in or not, any hints are welcome :)
 
User avatar
TomjNorthIdaho
Forum Guru
Forum Guru
Posts: 1493
Joined: Mon Oct 04, 2010 11:25 pm
Location: North Idaho
Contact:

Re: L2 ring redundancy protocol support?

Tue Dec 29, 2020 4:44 am

Ya might want to take a look at spanning-tree and see what it can do. Spanning-tree will normally handle redundant L2 connections. In a ring enviornment, it is possible to have 1/2 the traffic go clock-wise and the other half go counter-clock-wise - and if the ring is broken then both directions will be used at the same time up to the break in the ring so that everything still talks.
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Tue Dec 29, 2020 1:38 pm

Ya might want to take a look at spanning-tree and see what it can do. Spanning-tree will normally handle redundant L2 connections. In a ring enviornment, it is possible to have 1/2 the traffic go clock-wise and the other half go counter-clock-wise - and if the ring is broken then both directions will be used at the same time up to the break in the ring so that everything still talks.
Several problems with spanning tree, it is slow, I'm looking for like 50ms fail over to not cause communication problems in industrial system which uses near realtime communication.
And the ring is made of several two port devices which are not (r)stp compatible. If you build a ring using that my understanding is that either all devices has to understand (r)stp or only one can do it (main switch). If the ring has two or more (r)stp switches and dumb devices between them the "loop" will not be noticed.
So no, any spanning tree is not an option here.
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: L2 ring redundancy protocol support?

Tue Dec 29, 2020 11:15 pm

If you are looking at sub 50ms, I doubt very much you will achieve this using scripts
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Tue Dec 29, 2020 11:41 pm

If you are looking at sub 50ms, I doubt very much you will achieve this using scripts
You can ping with 1ms resolution so that part is fine I guess. And the receive monitoring script would have to loop since you can't execute a new script instance faster than 1s. But I still believe it is possible using a looping script. Question is how to "catch" the ping...
Another possibility could be using a single script if it was possible to evaluate if a ping was successful or not...
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Tue Dec 29, 2020 11:56 pm

found this script which does about what I want. Seems ping will return number of successful pings as the return value? Manual for ping does not state this but maybe it is documented somewhere else...
viewtopic.php?t=125759#p619531
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Wed Dec 30, 2020 1:53 pm

Some success :)
Failover to ether2 works when both consecutive pings fail but when ring is completed again it is not detected :(
There seems to be a problem when mac pinging ether2 from ether1 like this when they belongs to the same bridge, ping just don't go through then :(
:local RingStatus 0
:do {

:if ([/ping 48:8F:5A:11:E8:8E interface=ether1 interval=00:00:00.02 count=2] = 0) do={
  :if ($RingStatus != 2) do={
    /interface bridge port set bridge=bridge1 numbers=1
    :log info ("Ring broken!!!!!!!, ether2 active")
    :set RingStatus 2;
  }
} else={
  :if ($RingStatus != 1) do={
    /interface bridge port set bridge=bridge2 numbers=1
    :log info ("Ring working, eth2 inactive")
    :set RingStatus 1;
  }
}

} while=(true)
 
User avatar
nz_monkey
Forum Guru
Forum Guru
Posts: 2104
Joined: Mon Jan 14, 2008 1:53 pm
Location: Over the Rainbow
Contact:

Re: L2 ring redundancy protocol support?

Wed Dec 30, 2020 3:12 pm

G.8032v2 was on the roadmap. Maybe the Mikrotik guys can provide a status update ?
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Wed Dec 30, 2020 3:41 pm

Seems like it could be the loop that is causing it, I had a slight idea the loop would cause problems but I thought if the switching back was fast enough the packet storm would be so fast it would not be noticeable. But it seems to completely block all traffic the exact same ms the loop is formed :(
 
dnordenberg
Member Candidate
Member Candidate
Topic Author
Posts: 126
Joined: Wed Feb 24, 2016 8:00 pm

Re: L2 ring redundancy protocol support?

Wed Dec 30, 2020 3:42 pm

G.8032v2 was on the roadmap. Maybe the Mikrotik guys can provide a status update ?
That would not help here anyway since it would be required on all devices in a ring.

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], GoogleOther [Bot], scoobyn8, shahzaddj1 and 141 guests