Skip to contentSkip to conversation

Enhancements for Unsolicited Neigh. Adv. / grat ARP Reply

B.A.T.M.A.N. New Linus Lüssing 2 participants 4 messages Aug 2, 2014 – Sep 1, 2014

lore
Share & tools
lore
#0 lore raw

Hi there,

Here's a little, rough patch to illustrate the idea we discussed a little at the last Wireless Battle Mesh, that is forwarding the noisy IPv6 Unsolicited Neighbor Advertisements and gratuitous ARP Replies via unicast.

Currently these ugly unsol. NAs cause about 40% of ICMPv6 multicast overhead in our networks here.

A little more detailed explanation with some pictures can be found here:

https://www.open-mesh.org/projects/batman-adv/wiki/Unicasting-unsolicited-neighbor-advertisements

In the few, simple scenarios with bridged-in hosts in VMs, the patch seemed to do what it was supposed to do uppon roaming. Unsol. NAs did only appear on the node the host roamed away from.

If I remember correctly, there were also some worries about how this might work together with BLA-II. I gave it a little more thought and had a look at the BLA-II source code, but couldn't find any issues.

The only BLA-II related non-ideal thing I could think of so far is noted in the code of this patch at the according place (but I think that might not matter much in practice).

Looking forward to hear about what you think about it, especially conceptually.

Cheers, Linus

#1 lore raw

RFC PATCH 1/1 batman-adv: unicasting grat. ARP Reply / unsol. neigh. Advertisement

With this patch, gratouitous ARP Replies and unsolicited neighbor advertisements are forwarded via unicast to the node the according host roamed from. If this host did not roam before, then these packet are simply dropped.

Roaming devices are causing an ugly amount of ICMPv6 unsolicited neighbour advertisements: Everytime they reconnect they reassign the same IPv6 address to their interface and flood the whole mesh network with according unsolicited neighbour advertisements, telling everyone who they are. Unfortunatly unsolicited neighbor advertisements are using the all-nodes multicast address, "ff02::1", so their overhead cannot be reduced with our previously introduced group-aware multicast optimizations.

Unsolicited neighbor advertisements are being used for two things:

a) Hot-swapping devices / changing link-layer addresses (rare case)
b) Updating the mac table of switches in case of a roaming host, so that they are informed about the new port location of the roamed host, avoiding packet loss

For b) it is actually not necessary to inform all switches after
roaming: It's enough to inform the switches behind the node the host roamed to and roamed from. For any other switch, the roamed host will still appear behind bat0, somewhere in the mesh, still in the same direction.

---
 compat.h            |    7 ++++
 soft-interface.c    |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++
 translation-table.c |   62 ++++++++++++++++++++++++++-
 translation-table.h |    3 ++
 types.h             |    1 +
 5 files changed, 187 insertions(+), 1 deletion(-)
compat.h +7 -0
index ed5b815..b777a37 100644
@@ -242,6 +242,13 @@ static inline void skb_reset_mac_len(struct sk_buff *skb)
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
 
+static inline int batadv_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
+					  u8 *nexthdrp, __be16 *frag_offp)
+{
+	return ipv6_skip_exthdr(skb, start, nexthdrp);
+}
+#define ipv6_skip_exthdr batadv_ipv6_skip_exthdr
+
 #define batadv_interface_add_vid(x, y, z) \
 __batadv_interface_add_vid(struct net_device *dev, __be16 proto,\
                           unsigned short vid);\
soft-interface.c +115 -0

127 lines not on this page · raw message

translation-table.c +61 -1

90 lines not on this page · raw message

translation-table.h +3 -0
index ad84d7b..e71ca8e 100644
@@ -52,5 +52,8 @@ bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
 					  unsigned short vid);
 bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv,
 				  const uint8_t *addr, unsigned short vid);
+struct batadv_orig_node *batadv_tt_get_prev_orig(struct batadv_priv *bat_priv,
+						 const uint8_t *addr,
+						 unsigned short vid);
 
 #endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */
types.h +1 -0
index 8854c05..0c78994 100644
@@ -934,6 +934,7 @@ struct batadv_tt_common_entry {
  */
 struct batadv_tt_local_entry {
 	struct batadv_tt_common_entry common;
+	struct batadv_orig_node __rcu *prev_orig; /* rcu protected pointer */
 	unsigned long last_seen;
 };
 
Signature · 1 line
1.7.10.4
#2 lore raw
In reply to Linus Lüssing

Hello Linus,

thank you very much for the patch proposal.

Quoted 8 lines

Hi there,

Here's a little, rough patch to illustrate the idea we discussed a little at the last Wireless Battle Mesh, that is forwarding the noisy IPv6 Unsolicited Neighbor Advertisements and gratuitous ARP Replies via unicast.

Currently these ugly unsol. NAs cause about 40% of ICMPv6 multicast overhead in our networks here.

I think it's quite a good idea - to motivate your proposal, I'd suggest to add some information on how many broadcasts you think you can save in your networks - 40% of ICMPv6 traffic is a little vague, since we don't know how much of your traffic is ICMPv6 and what you have already blocked.

Quoted 5 lines

A little more detailed explanation with some pictures can be found here:

https://www.open-mesh.org/projects/batman-adv/wiki/Unicasting-unsolicited-n
eighbor-advertisements

Nice page. :)

Quoted 8 lines

In the few, simple scenarios with bridged-in hosts in VMs, the patch seemed to do what it was supposed to do uppon roaming. Unsol. NAs did only appear on the node the host roamed away from.

If I remember correctly, there were also some worries about how this might work together with BLA-II. I gave it a little more thought and had a look at the BLA-II source code, but couldn't find any issues.

I don't see any issues either - as you've implemented, it should be similarly working as the DHCP requests from client.

Quoted 4 lines

The only BLA-II related non-ideal thing I could think of so far is noted in the code of this patch at the according place (but I think that might not matter much in practice).

You describe that this feature could be used for hot-swapping, and as far as I understand, turning on that feature could break IPv6 hotswapping? I don't know how much this is actually used and its probably not the most common thing for our networks (and isn't reliable anyway), but you should make you feature optional with a sysfs option or similar. Then users or firmware engineers can turn that feature on as required, just as BLA and others.

Thanks,
Simon

#3 lore raw
Quoted 7 lines · Simon Wunderlich
Quoted 2 lines

Currently these ugly unsol. NAs cause about 40% of ICMPv6 multicast overhead in our networks here.

I think it's quite a good idea - to motivate your proposal, I'd suggest to add some information on how many broadcasts you think you can save in your networks - 40% of ICMPv6 traffic is a little vague, since we don't know how much of your traffic is ICMPv6 and what you have already blocked.

Hrmpf, had spend some time to set up some live-monitoring plus dumping into RRDs. And now figured out, that from day to it varies a lot, the NA traffic at Freifunk Hamburg for instance is very "peaky", so only at certain minutes but then quite a lot. Some days I see 40% again, some days it's maybe just 5-10%.

So at least along half of a day NA overhead is actually marginal.

I'll need to figure out first what's causing these spikes. Whether it's some broken or malicious client devices, the bus and train tables or something else causing these extreme spikes. Funnily, any other multicast traffic is smoothly following the #number-of-clients curve along the day (max at ~13:00, min at ~04:00)...

Cheers, Linus