I'm not able to figure out a good strategy for this situation.
There's one router per client and all the routers are in the same network. Each router is able to connect to an external router in a different network, but only one at a time (it's a physical limitation, so we can consider that there is an on/off switch in each router that can change every 5 seconds, but they are always synchronised in order to ensure that there's only one closed).
------------
| router X | 10.0.0.0/24
------------
|
____________________|_________________
| | |
| | |
/ off switch1 | on switch2 / off switchN
| | |
| | |
------------ ------------ ------------
| router 1 |-------| router 2 |-----| router N | 20.0.0.0/24
------------ ------------ ------------
| | |
| | |
------------ ------------ ------------
| client a | | client b | | client N |
------------ ------------ ------------
How would be the clients able to send/receive to/from router X
assuming that there is only one closed switch?
So far, my ideas are:
- Change client's gateways dynamically, i.e. when switch2 is ON, gw for
client a
andclient N
will berouter 1
, furthermore,router 1
androuter N
will behave as a layer 2 switch.
Problem here is that clients rely on the idea that they are notified with the new gw which may end up loosing data, non-synchronised behaviours and the idea that it's a dynamic design.
- Virtual gateway. All the clients have the same virtual gw, so the routers have to negotiate (based on the ON switch) each other to know which is the master (the real gateway).
The most similar idea I have seen are VRRP, CARP, etc protocols, but they are slightly different, I don't need an advertisement in order to know if the master is alive because the limitations are external to the router, furthermore, the clients are not connected to the same router, so the slaves will still have to work. However, that's my closest idea to the "virtual gateway" concept.
- NAT. Each router of each client modifies the packets and pass them to the gateway.
Limitations here are speed, I prefer to avoid the idea that each router will have to modify the data.
Any other idea or suggestion?
Thanks,