Skip to contentSkip to conversation

Multiple border gateways between bat-networks

B.A.T.M.A.N. Gui Iribarren 3 participants 3 messages Mar 19, 2013 – Mar 20, 2013

lore
Share & tools
lore
#0 lore raw

Hey folks!
today we bring you a riddle to start the week
/me grins...

First, some clues:
http://comments.gmane.org/gmane.org.freifunk.batman/6603
http://www.open-mesh.org/projects/open-mesh/wiki/FAQ#How-do-I-announce-IP-subnets-using-batman-adv

now, given the attached diagram .png

* the description given in the wiki still applies, i.e. A, B, C...
nodes run your favourite layer3 dynamic routing protocol, and all nodes run batman, in segmented (colored) clouds = subnets.
* i am one of the clients connected to F
* in the blue cloud, there's one preferred gw_mode=server which is D
(or E for that matter, but certainly not F or G)
* D gave me a DHCP OFFER and since then is my default gw, which i use
to access the internet. I have no other routes setup.
* the violet link G <-> H although it looks "long" is in fact a superb
link, 0% packet loss, high bw. F <-> G also works great.

Now, i want to send a file to H. Visibly, the optimal route would be F -> G -> H.
BUT, i only have a default gw, which is D. I pass the packet to D. Thanks to the layer3 routing protocol, D knows that both E and G have access to the red network. However, E is closer so it relays the packet there, and at the same time ICMP-REDIRECTs me saying "hey, in order to get to the red network, you don't need to send packets to me; save yourself a hop and use E directly" Great, so now i get a new temporary routing entry which is sub-optimal, since my traffic will go all over 5 hops, instead of taking the optimal F-G-H

Now the catchy question: Is there any way for my traffic to find the optimal path, in this scenario?

Spoiler: I get the feeling the answer is "no", since D is giving me the optimal path *according to D perspective*, and there's no way to for D to understand my perspective.
So... it seems to me that, even with this mix of layer2 and 3 described in the wiki, the solution cannot currently handle traffic in the most optimal way, inside networks that have more than one border gateway with another network.

But asking never hurts!

Bonus question: If my reasoning is correct, and my conclusion is sadly true... are there any plans to address this issue (/corner case?), and how?

Have a nice week!

Gui

#1 lore raw
Quoted 21 lines · Gui Iribarren

Hey folks!
today we bring you a riddle to start the week
/me grins...

First, some clues:
http://comments.gmane.org/gmane.org.freifunk.batman/6603
http://www.open-mesh.org/projects/open-mesh/wiki/FAQ#How-do-I-announce-IP-subnets-using-batman-adv

now, given the attached diagram .png

* the description given in the wiki still applies, i.e. A, B, C...
nodes run your favourite layer3 dynamic routing protocol, and all nodes run batman, in segmented (colored) clouds = subnets.
* i am one of the clients connected to F
* in the blue cloud, there's one preferred gw_mode=server which is
D (or E for that matter, but certainly not F or G)
* D gave me a DHCP OFFER and since then is my default gw, which i
use to access the internet. I have no other routes setup.
* the violet link G <-> H although it looks "long" is in fact a
superb link, 0% packet loss, high bw. F <-> G also works great.

Quoted 6 lines

Now, i want to send a file to H. Visibly, the optimal route would be F -> G -> H.
BUT, i only have a default gw, which is D. I pass the packet to D. Thanks to the layer3 routing protocol, D knows that both E and G have access to the red network. However, E is closer so it relays the packet there,

Hi Gui

So D, E, G and H are L3 routers. I'm assuming they all know of each other in terms of L3 routing protocol. They are all speaking OSPF or something.

At L3, there are two sensible routes F->E->H and F->G->H. Both are two L3 hops, so if you are going on plain number of hops, you have a 50/50 chance of taking G->H.

However, OSPF is not really hop based. You assign costs to each link. Higher bandwidth links have lower cost. OSPF will optimize the cost. So if the total cost of F-G->H is lower than F->E->H, it will take that route.

Set the cost correct in the L3 routing protocol.

Andrew

#2 lore raw
Quoted 39 lines · Andrew Lunn
Quoted 21 lines · Gui Iribarren

Hey folks!
today we bring you a riddle to start the week
/me grins...

First, some clues:
http://comments.gmane.org/gmane.org.freifunk.batman/6603
http://www.open-mesh.org/projects/open-mesh/wiki/FAQ#How-do-I-announce-IP-subnets-using-batman-adv

now, given the attached diagram .png

* the description given in the wiki still applies, i.e. A, B, C...
nodes run your favourite layer3 dynamic routing protocol, and all nodes run batman, in segmented (colored) clouds = subnets.
* i am one of the clients connected to F
* in the blue cloud, there's one preferred gw_mode=server which is
D (or E for that matter, but certainly not F or G)
* D gave me a DHCP OFFER and since then is my default gw, which i
use to access the internet. I have no other routes setup.
* the violet link G <-> H although it looks "long" is in fact a
superb link, 0% packet loss, high bw. F <-> G also works great.

Quoted 6 lines

Now, i want to send a file to H. Visibly, the optimal route would be F -> G -> H.
BUT, i only have a default gw, which is D. I pass the packet to D. Thanks to the layer3 routing protocol, D knows that both E and G have access to the red network. However, E is closer so it relays the packet there,

Hi Gui

So D, E, G and H are L3 routers. I'm assuming they all know of each other in terms of L3 routing protocol. They are all speaking OSPF or something.

At L3, there are two sensible routes F->E->H and F->G->H. Both are two L3 hops, so if you are going on plain number of hops, you have a 50/50 chance of taking G->H.

Quoted 6 lines

However, OSPF is not really hop based. You assign costs to each link. Higher bandwidth links have lower cost. OSPF will optimize the cost. So if the total cost of F-G->H is lower than F->E->H, it will take that route.

Set the cost correct in the L3 routing protocol.

Hi andrew,

AFAIK, this cost you set at the L3 protocol level won't be accurate for all members of the network. It's a matter of perspective. From the perspective of the gw, one border gw might be better to get to another segment (less real -wifi- hops involved), and this will be OK for clients that are near this gw.
But if you are connecting to this gw from a distant node, the preferred border gw will probably be a bad choice for you and you won't even get the 50/50 chance because of the different cost assigned.

We found this to be a tricky problem and we are wondering how other networks that implement batman-adv as their main dynamic routing protocol are coping with it.

The provided graphic does not really stress the problem. With linear segments "touching" at both ends it gets critical. A client connected near one end might be sending traffic to the neighboring segment through the other end, traversing all the network just because the wrong decision is being made as to what's the best border gw for that particular client to that destination. This could be a common scenario in the DeltaLibre network, that is composed of many linear segments along the rivers.

Cheers,
NicoEchániz