neighbour: Support broadcast ARP in neighbor PROPE state
Subsystems (4)
v2 cover neighbour: Support broadcast ARP in neighbor PROPE state
V2:
set ARP_PROBE_BCAST default N.
V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.
The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE state
include/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/1 neighbour: Support broadcast ARP in neighbor PROPE state
From: Zhu Yanjun <[email protected]>
When the neighbor state machine is in PROBE state, it will normally send a number of unicast ARP requests (number defined in "ucast_probes" entry in the proc file system, default=3) and if no reply is received, it will change state to FAILED.
Enabling CONFIG_ARP_PROBE_BCAST, will make the state machine try to send broadcast ARP requests if the unicast ARP requests failed. The state machine will only enter FAILED state if the broadcast ARP requests did not receive a reply.
Enabling CONFIG_ARP_PROBE_BCAST, makes the IPv4 ARP behaviour more similar to the IPv6 Neighbor Discovery protocol, and is necessary, if the other end only responds to broadcast ARPs.
--- include/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
include/net/neighbour.h +7 -0
@@ -40,6 +40,9 @@ struct neighbour;enum {NEIGH_VAR_MCAST_PROBES , +#ifdef CONFIG_IP_ARP_BROADCAST +NEIGH_VAR_BCAST_PROBES , +#endif NEIGH_VAR_UCAST_PROBES ,NEIGH_VAR_APP_PROBES ,NEIGH_VAR_RETRANS_TIME ,
@@ -122,6 +125,10 @@ struct neigh_statistics {unsigned long rcv_probes_mcast;/* number of received mcast ipv6 */ unsigned long rcv_probes_ucast;/* number of received ucast ipv6 */ +#ifdef CONFIG_IP_ARP_BROADCAST +unsigned long rcv_probes_bcast;/* number of received ucast ipv6 */ +#endif +unsigned long periodic_gc_runs;/* number of periodic GC runs */ unsigned long forced_gc_runs;/* number of forced GC runs */
include/uapi/linux/neighbour.h +6 -0
@@ -103,6 +103,9 @@ struct ndt_stats {__u64 ndts_lookups;__u64 ndts_hits;__u64 ndts_rcv_probes_mcast; +#ifdef CONFIG_IP_ARP_BROADCAST +__u64 ndts_rcv_probes_bcast; +#endif __u64 ndts_rcv_probes_ucast;__u64 ndts_periodic_gc_runs;__u64 ndts_forced_gc_runs;
@@ -121,6 +124,9 @@ enum {NDTPA_APP_PROBES ,/* u32 */ NDTPA_UCAST_PROBES ,/* u32 */ NDTPA_MCAST_PROBES ,/* u32 */ +#ifdef CONFIG_IP_ARP_BROADCAST +NDTPA_BCAST_PROBES ,/* u32 */ +#endifNDTPA_ANYCAST_DELAY ,/* u64, msecs */ NDTPA_PROXY_DELAY ,/* u64, msecs */ NDTPA_PROXY_QLEN, /* u32 */
include/uapi/linux/sysctl.h +3 -0
@@ -598,6 +598,9 @@ enum {NET_NEIGH_GC_THRESH3 =16 ,NET_NEIGH_RETRANS_TIME_MS =17 ,NET_NEIGH_REACHABLE_TIME_MS =18 , +#ifdef CONFIG_IP_ARP_BROADCAST + NET_NEIGH_BCAST_SOLICIT=19, +#endif };/* /proc/sys/net/dccp */
kernel/sysctl_binary.c +3 -0
@@ -267,6 +267,9 @@ static const struct bin_table bin_net_neigh_vars_table[] = { { CTL_INT, NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" }, { CTL_INT, NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" }, { CTL_INT, NET_NEIGH_APP_SOLICIT, "app_solicit" }, +#ifdef CONFIG_IP_ARP_BROADCAST + { CTL_INT, NET_NEIGH_BCAST_SOLICIT, "bcast_solicit" }, +#endif /* NET_NEIGH_RETRANS_TIME "retrans_time" no longer used */ { CTL_INT, NET_NEIGH_REACHABLE_TIME, "base_reachable_time" }, { CTL_INT, NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" },
net/core/neighbour.c +40 -4
103 lines not on this page · raw message
net/ipv4/Kconfig +57 -0
63 lines not on this page · raw message
net/ipv4/arp.c +5 -2
@@ -168,8 +168,11 @@ struct neigh_table arp_tbl = { .tbl = &arp_tbl, .reachable_time = 30 * HZ, .data = { - [NEIGH_VAR_MCAST_PROBES] = 3, - [NEIGH_VAR_UCAST_PROBES] = 3, + [NEIGH_VAR_MCAST_PROBES] = CONFIG_IP_ARP_MCAST_PROBES, + [NEIGH_VAR_UCAST_PROBES ] =CONFIG_IP_ARP_UCAST_PROBES , +#ifdef CONFIG_IP_ARP_BROADCAST + [NEIGH_VAR_BCAST_PROBES] = CONFIG_IP_ARP_BCAST_PROBES, +#endif [NEIGH_VAR_RETRANS_TIME] = 1 * HZ, [NEIGH_VAR_BASE_REACHABLE_TIME] = 30 * HZ, [NEIGH_VAR_DELAY_PROBE_TIME] = 5 * HZ,
Signature · 1 line
1.9.1
Hi,
Quoted 7 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
When the neighbor state machine is in PROBE state, it will normally send a number of unicast ARP requests (number defined in "
ucast_probes" entry in the proc file system, default=3) and if no reply is received, it will change state to FAILED.
Quoted 8 lines
Enabling
CONFIG_ARP_PROBE_BCAST, will make the state machine try to send broadcast ARP requests if the unicast ARP requests failed. The state machine will only enter FAILED state if the broadcast ARP requests did not receive a reply.Enabling
CONFIG_ARP_PROBE_BCAST, makes the IPv4 ARP behaviour more similar to the IPv6 Neighbor Discovery protocol, and is necessary, if the other end only responds to broadcast ARPs.
I don't think There are any difference between the state machine of ARP and the state machine of NDP here.
--yoshfuji
Quoted 295 lines
CC WANG Cong <[email protected]>Reviewed-by Yang Shi <[email protected]>Signed-off-by eulfsam <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>--- include/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)include/net/neighbour.h +7
-0@@ -40,6 +40,9 @@ struct neighbour;enum {NEIGH_VAR_MCAST_PROBES , +#ifdef CONFIG_IP_ARP_BROADCAST +NEIGH_VAR_BCAST_PROBES , +#endif NEIGH_VAR_UCAST_PROBES ,NEIGH_VAR_APP_PROBES ,NEIGH_VAR_RETRANS_TIME ,@@ -122,6 +125,10 @@ struct neigh_statistics {unsigned long rcv_probes_mcast;/* number of received mcast ipv6 */ unsigned long rcv_probes_ucast;/* number of received ucast ipv6 */ +#ifdef CONFIG_IP_ARP_BROADCAST +unsigned long rcv_probes_bcast;/* number of received ucast ipv6 */ +#endif +unsigned long periodic_gc_runs;/* number of periodic GC runs */ unsigned long forced_gc_runs;/* number of forced GC runs */ include/uapi/linux/neighbour.h +6
-0@@ -103,6 +103,9 @@ struct ndt_stats {__u64 ndts_lookups;__u64 ndts_hits;__u64 ndts_rcv_probes_mcast; +#ifdef CONFIG_IP_ARP_BROADCAST +__u64 ndts_rcv_probes_bcast; +#endif __u64 ndts_rcv_probes_ucast;__u64 ndts_periodic_gc_runs;__u64 ndts_forced_gc_runs;@@ -121,6 +124,9 @@ enum {NDTPA_APP_PROBES ,/* u32 */ NDTPA_UCAST_PROBES ,/* u32 */ NDTPA_MCAST_PROBES ,/* u32 */ +#ifdef CONFIG_IP_ARP_BROADCAST +NDTPA_BCAST_PROBES ,/* u32 */ +#endifNDTPA_ANYCAST_DELAY ,/* u64, msecs */ NDTPA_PROXY_DELAY ,/* u64, msecs */ NDTPA_PROXY_QLEN, /* u32 */include/uapi/linux/sysctl.h +3
-0@@ -598,6 +598,9 @@ enum {NET_NEIGH_GC_THRESH3 =16 ,NET_NEIGH_RETRANS_TIME_MS =17 ,NET_NEIGH_REACHABLE_TIME_MS =18 , +#ifdef CONFIG_IP_ARP_BROADCAST + NET_NEIGH_BCAST_SOLICIT=19, +#endif };/* /proc/sys/net/dccp */ kernel/sysctl_binary.c +3
-0@@ -267,6 +267,9 @@ static const struct bin_table bin_net_neigh_vars_table[] = { { CTL_INT, NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" }, { CTL_INT, NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" }, { CTL_INT, NET_NEIGH_APP_SOLICIT, "app_solicit" }, +#ifdef CONFIG_IP_ARP_BROADCAST + { CTL_INT, NET_NEIGH_BCAST_SOLICIT, "bcast_solicit" }, +#endif /* NET_NEIGH_RETRANS_TIME "retrans_time" no longer used */ { CTL_INT, NET_NEIGH_REACHABLE_TIME, "base_reachable_time" }, { CTL_INT, NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" },net/core/neighbour.c +40
-4@@ -936,10 +936,16 @@ static void neigh_timer_handler(unsigned long arg)if ((neigh->nud_state & (NUD_INCOMPLETE |NUD_PROBE )) &&atomic_read (&neigh->probes) >=neigh_max_probes (neigh)) { - neigh->nud_state =NUD_FAILED ; - notify =1 ; -neigh_invalidate (neigh); - goto out; +#ifdef CONFIG_IP_ARP_BROADCAST +int delta_probes =atomic_read (&neigh->probes) -neigh_max_probes (neigh); + if (delta_probes >= NEIGH_VAR(neigh->parms, BCAST_PROBES)) +#endif + { + neigh->nud_state =NUD_FAILED ; + notify =1 ; +neigh_invalidate (neigh); + goto out; + } }if (neigh->nud_state &NUD_IN_TIMER ) {@@ -973,6 +979,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) goto out_unlock_bh;if (!(neigh->nud_state & (NUD_STALE |NUD_INCOMPLETE ))) { +/* We are in (NUD_NONE | NUD_FAILED) */ if (NEIGH_VAR (neigh->parms,MCAST_PROBES ) +NEIGH_VAR (neigh->parms,APP_PROBES )) {unsigned long next, now = jiffies;@@ -1783,6 +1790,10 @@ static int neightbl_fill_parms(struct sk_buff *skb, struct neigh_parms *parms) NEIGH_VAR(parms, UCAST_PROBES)) || nla_put_u32(skb, NDTPA_MCAST_PROBES, NEIGH_VAR(parms, MCAST_PROBES)) || +#ifdef CONFIG_IP_ARP_BROADCAST + nla_put_u32(skb, NDTPA_BCAST_PROBES, + NEIGH_VAR(parms, BCAST_PROBES)) || +#endif nla_put_msecs(skb, NDTPA_REACHABLE_TIME, parms->reachable_time) || nla_put_msecs(skb, NDTPA_BASE_REACHABLE_TIME, NEIGH_VAR(parms, BASE_REACHABLE_TIME)) ||@@ -1870,6 +1881,9 @@ static int neightbl_fill_info(struct sk_buff *skb, struct neigh_table *tbl, ndst.ndts_lookups += st->lookups; ndst.ndts_hits += st->hits; ndst.ndts_rcv_probes_mcast += st->rcv_probes_mcast; +#ifdef CONFIG_IP_ARP_BROADCAST + ndst.ndts_rcv_probes_bcast += st->rcv_probes_bcast; +#endif ndst.ndts_rcv_probes_ucast += st->rcv_probes_ucast; ndst.ndts_periodic_gc_runs += st->periodic_gc_runs; ndst.ndts_forced_gc_runs += st->forced_gc_runs;@@ -1942,6 +1956,9 @@ static const struct nla_policy nl_ntbl_parm_policy[NDTPA_MAX+1] = { [NDTPA_APP_PROBES] = { .type = NLA_U32 }, [NDTPA_UCAST_PROBES] = { .type = NLA_U32 }, [NDTPA_MCAST_PROBES] = { .type = NLA_U32 }, +#ifdef CONFIG_IP_ARP_BROADCAST + [NDTPA_BCAST_PROBES] = { .type = NLA_U32 }, +#endif [NDTPA_BASE_REACHABLE_TIME] = { .type = NLA_U64 }, [NDTPA_GC_STALETIME] = { .type = NLA_U64 }, [NDTPA_DELAY_PROBE_TIME] = { .type = NLA_U64 },@@ -2042,6 +2059,12 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh)NEIGH_VAR_SET (p,MCAST_PROBES ,nla_get_u32 (tbp[i]));break ; +#ifdef CONFIG_IP_ARP_BROADCAST +case NDTPA_BCAST_PROBES : +NEIGH_VAR_SET (p,BCAST_PROBES , +nla_get_u32 (tbp[i])); +break ; +#endif case NDTPA_BASE_REACHABLE_TIME :NEIGH_VAR_SET (p,BASE_REACHABLE_TIME ,nla_get_msecs (tbp[i]));@@ -2702,11 +2725,18 @@ static int neigh_stat_seq_show(struct seq_file *seq, void *v)struct neigh_statistics *st = v;if (v ==SEQ_START_TOKEN ) { +#ifdef CONFIG_IP_ARP_BROADCAST +seq_printf (seq,"entries allocs destroys hash_grows lookups hits res_failed rcv_probes_bcast rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs unresolved_discards\n" ); +#else seq_printf (seq,"entries allocs destroys hash_grows lookups hits res_failed rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs unresolved_discards\n" ); +#endif return 0 ; } seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " +#ifdef CONFIG_IP_ARP_BROADCAST + "%08lx " +#endif "%08lx %08lx %08lx %08lx %08lx\n", atomic_read(&tbl->entries),@@ -2719,6 +2749,9 @@ static int neigh_stat_seq_show(struct seq_file *seq, void *v) st->res_failed, +#ifdef CONFIG_IP_ARP_BROADCAST + st->rcv_probes_bcast, +#endif st->rcv_probes_mcast, st->rcv_probes_ucast,@@ -2992,6 +3025,9 @@ static struct neigh_sysctl_table { } neigh_sysctl_template __read_mostly = { .neigh_vars = { NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(MCAST_PROBES, "mcast_solicit"), +#ifdef CONFIG_IP_ARP_BROADCAST + NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(BCAST_PROBES, "bcast_solicit"), +#endif NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(UCAST_PROBES, "ucast_solicit"), NEIGH_SYSCTL_ZERO_INTMAX_ENTRY(APP_PROBES, "app_solicit"), NEIGH_SYSCTL_USERHZ_JIFFIES_ENTRY(RETRANS_TIME, "retrans_time"),net/ipv4/Kconfig +57
-0@@ -1,6 +1,63 @@ # # IP configuration # +config IP_ARP_BROADCAST + bool "IP: allow broadcast ARP" + default N + ---help--- + The stack will periodically refresh ARP cache by sending unicast ARP requests. + if a number of unicast ARP request fails, the stack will normally enter + FAILED state, and the ARP entry will be removed by the garbage collector. + Enabling this option will make the stack try to send broadcast ARP requests + if the unicast ARP requests fails, before entering FAILED state. + The number of broadcast packets is controlled by + '/proc/sys/net/ipv4/neigh/<dev>/bcast_solicit' which defaults to "0". + The parameter must be assigned a value to enable sending broadcast ARPs. + + If unsure, say N here. + + +config IP_ARP_UCAST_PROBES + int "ucast_solicit initial value" + default "3" + + ---help--- + This value defines the initial value for how many unicast ARP requests + are sent by the ARP state machine in PROBE state. + It can be controlled runtime by '/proc/sys/net/ipv4/neigh/<dev>/ucast_solicit' + + If unsure, say "3" here. + + +config IP_ARP_MCAST_PROBES + int "mcast_solicit initial value" + default "3" + + ---help--- + This value defines the initial value for how many broadcast ARP requests + are sent by the ARP state machine in INCOMPLETE state. + It can be controlled runtime by '/proc/sys/net/ipv4/neigh/<dev>/mcast_solicit' + + If unsure, say "3" here. + + +config IP_ARP_BCAST_PROBES + int "bcast_solicit initial value" + depends on IP_ARP_BROADCAST + default "0" + + ---help--- + This value defines the initial value for how many broadcast ARP requests + are sent by the ARP state machine in PROBE state. + It can be controlled runtime by '/proc/sys/net/ipv4/neigh/<dev>/bcast_solicit' + The default value of 'bcast_solicit' is zero, mimicking the behaviour of + older kernels which does not send out broadcast ARPs except for new entries. + If you want broadcast ARP requests to happen in PROBE state, set the number here. + To be compatible with IPv6, the number should be "3" + + If unsure, say "0" here. + + config IP_MULTICAST bool "IP: multicasting" helpnet/ipv4/arp.c +5
-2@@ -168,8 +168,11 @@ struct neigh_table arp_tbl = { .tbl = &arp_tbl, .reachable_time = 30 * HZ, .data = { - [NEIGH_VAR_MCAST_PROBES] = 3, - [NEIGH_VAR_UCAST_PROBES] = 3, + [NEIGH_VAR_MCAST_PROBES] = CONFIG_IP_ARP_MCAST_PROBES, + [NEIGH_VAR_UCAST_PROBES ] =CONFIG_IP_ARP_UCAST_PROBES , +#ifdef CONFIG_IP_ARP_BROADCAST + [NEIGH_VAR_BCAST_PROBES] = CONFIG_IP_ARP_BCAST_PROBES, +#endif [NEIGH_VAR_RETRANS_TIME] = 1 * HZ, [NEIGH_VAR_BASE_REACHABLE_TIME] = 30 * HZ, [NEIGH_VAR_DELAY_PROBE_TIME] = 5 * HZ,
Signature · 2 lines
吉藤英明 <[email protected]> ミラクル・リナックス株式会社 技術本部 サポート部
The state machine is in the attachment.
Best Regards!
Zhu Yanjun
Quoted 39 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Hello.
Quoted 28 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 23 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in NUD_PROBE state if mcast_solicit is more than ucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1
--yoshfuji
Quoted 17 lines
Quoted 16 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Signature · 2 lines
Hideaki Yoshifuji <[email protected]> Technical Division, MIRACLE LINUX CORPORATION
That also means that you increase the number of broadcasts in incomplete state. Is that really desirable?
Best Regards
Ulf Samuelsson
[email protected]
+46 (722) 427 437
Quoted 69 lines
12 mar 2015 kl. 09:42 skrev YOSHIFUJI Hideaki <[email protected]>:
Hello.
Quoted 28 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 24 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 15 lines
Quoted 15 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)Signature · 6 lines
Hideaki Yoshifuji <[email protected]> Technical Division, MIRACLE LINUX CORPORATION -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 2 lines · Ulf samuelsson
That also means that you increase the number of broadcasts in incomplete state. Is that really desirable?
In NUD_INCOMPLETE state, neighbour subsystem *skips* sending unicast probes and send multicast probes mcast_solicit times. If you do not increase the number of mcast_solicit, the number of multicast probes in NUD_INCOMPLETE will not increased.
--yoshfuji
Quoted 76 lines
Best Regards
Ulf Samuelsson
[email protected]
+46 (722) 427 437Quoted 69 lines
12 mar 2015 kl. 09:42 skrev YOSHIFUJI Hideaki <[email protected]>:
Hello.
Quoted 28 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 24 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 7 lines
Quoted 7 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateQuoted 8 lines
Quoted 8 lines
include/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)--
Hideaki Yoshifuji <[email protected]> Technical Division, MIRACLE LINUX CORPORATION
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
吉藤英明 <[email protected]> ミラクル・リナックス株式会社 技術本部 サポート部
If you want to send 3 unicasts followed by 3 broadcast, you have to set mcast_solicit to 6.
This means you will send 6 broadcasts in incomplete state.
I think the following configuration is wanted:
Incomplete state: send 3 broadcast
Probe state: send 3 unicast, followed by 3 broadcast then goto STALE OR
Send 3 unicast, then go to STALE
Best Regards
Ulf Samuelsson
[email protected]
+46 (722) 427 437
Quoted 99 lines
12 mar 2015 kl. 10:28 skrev YOSHIFUJI Hideaki/吉藤英明 <[email protected]>:
Hi,
Quoted 2 lines · Ulf samuelsson
That also means that you increase the number of broadcasts in incomplete state. Is that really desirable?
In
NUD_INCOMPLETEstate, neighbour subsystem *skips* sending unicast probes and send multicast probesmcast_solicittimes. If you do not increase the number ofmcast_solicit, the number of multicast probes inNUD_INCOMPLETEwill not increased.--yoshfuji
Quoted 76 lines
Best Regards
Ulf Samuelsson
[email protected]
+46 (722) 427 437Quoted 69 lines
12 mar 2015 kl. 09:42 skrev YOSHIFUJI Hideaki <[email protected]>:
Hello.
Quoted 28 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 24 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 7 lines
Quoted 7 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateQuoted 8 lines
Quoted 8 lines
include/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)--
Hideaki Yoshifuji <[email protected]> Technical Division, MIRACLE LINUX CORPORATION
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 6 lines
吉藤英明 <[email protected]> ミラクル・リナックス株式会社 技術本部 サポート部 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 9 lines · Ulf samuelsson
If you want to send 3 unicasts followed by 3 broadcast, you have to set
mcast_solicitto 6.
This means you will send 6 broadcasts in incomplete state.I think the following configuration is wanted:
Incomplete state: send 3 broadcast
Probe state: send 3 unicast, followed by 3 broadcast then goto STALE OR
Send 3 unicast, then go to STALE
I pointed out that we deal with nodes that won't reply against unicast ARP/NDP via existing knobs.
If you really want such configuration, it is better to split mcast_solicit. "bcast_solicit" does not sound good to me. You could say "probe_mcast_solicit".
--yoshfuji
Quoted 106 lines
Best Regards
Ulf Samuelsson
[email protected]
+46 (722) 427 437Quoted 99 lines
12 mar 2015 kl. 10:28 skrev YOSHIFUJI Hideaki/吉藤英明 <[email protected]>:
Hi,
Quoted 2 lines · Ulf samuelsson
That also means that you increase the number of broadcasts in incomplete state. Is that really desirable?
In
NUD_INCOMPLETEstate, neighbour subsystem *skips* sending unicast probes and send multicast probesmcast_solicittimes. If you do not increase the number ofmcast_solicit, the number of multicast probes inNUD_INCOMPLETEwill not increased.--yoshfuji
Quoted 76 lines
Best Regards
Ulf Samuelsson
[email protected]
+46 (722) 427 437Quoted 69 lines
12 mar 2015 kl. 09:42 skrev YOSHIFUJI Hideaki <[email protected]>:
Hello.
Quoted 28 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 24 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 7 lines
Quoted 7 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateQuoted 8 lines
Quoted 8 lines
include/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)--
Hideaki Yoshifuji <[email protected]> Technical Division, MIRACLE LINUX CORPORATION
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
吉藤英明 <[email protected]>
ミラクル・リナックス株式会社 技術本部 サポート部
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Hideaki Yoshifuji <[email protected]> Technical Division, MIRACLE LINUX CORPORATION
Quoted 40 lines · YOSHIFUJI Hideaki
Hello.
Quoted 30 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 25 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast
requests,
which will not get any replies.The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which
failed,
and then tried to change the state to PROBE which also failed.The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.
Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"mcast_solicit" is not used at all.
It is only used when in INCOMPLETE state as far as I can tell.
I do not see that the stack is returning to INCOMPLETE after it has reached REACHABLE once.
Can it do so? In that case, in what part of the code.
=============================
int confirmed; /* time of last ARP reply */ int ucast_solicit; /* sysctl */ int app_solicit; /* sysctl */
neigh_timer_handler()
begin
if (in REACHABLE) then
if ("current time" <=( confirmed + reachable)) then
we are OK, test later
else if ("current time" <= used + DELAY_PROBE_TIME) then
set state to DELAY
else
set state to STALE
end if
else if (in DELAY) then
if ("current time" <= confirmed + DELAY_PROBE_TIME) then
change state to REACHABLE
send notification
else
change state to PROBE
probes = 0;
do not send notification
end if
if (in PROBE state) then
if (probes >= (ucast_solicit + app_solicit)) then
change state to FAILED
send notification
end if
end if
if (in PROBE state) then
send ARP request;
end if
if (notify) then
send notification
end if
end
====================
Anyway, the behaviour I would like to see is:
INCOMPLETE:
Send 3 broadcast ARP
PROBE
Send 3 unicast ARP
Send 3 broadcast ARP
which not possible with your suggestion
I do not want to send 6 broadcast ARP in INCOMPLETE state.
Best Regards,
Ulf Samuelsson
Quoted 20 lines
Quoted 19 lines
Quoted 18 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Hi,
Quoted 45 lines · Ulf Samuelsson
Quoted 38 lines · YOSHIFUJI Hideaki
Hello.
Quoted 28 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 23 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 8 lines
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
OK, I found I made this change in 2003:
From d12fd76789e80ae337408834f45dae7cba23fc55 Mon Sep 17 00:00:00 2001
From: Hideaki Yoshifuji <[email protected]>
Date: Sun, 6 Jul 2003 23:32:45 +1000
Subject: [PATCH] [NET] Send only unicast NSs in PROBE state.
--- net/core/neighbour.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/core/neighbour.c +3 -1
@@ -608,7 +608,9 @@ next_elt:static __inline__int neigh_max_probes (struct neighbour *n) {struct neigh_parms *p = n->parms; -return p->ucast_probes + p->app_probes + p->mcast_probes; +return (n->nud_state &NUD_PROBE ? + p->ucast_probes : + p->ucast_probes + p->app_probes + p->mcast_probes); }
As I recall, I was hesitating adding new sysctl knob, but now I am okay to have knob to enable mcast probes in PROBE state as well. (By default, it should NOT send multicast probe (expecially for IPv6) in PROBE state.)
How about these?
- introduce probe_mcast_probes knob, default to 0.
- Change neigh_max_probes() to reflect that.
Then, arp_colisit() and ndict_solicit() should send multicast probes in PROBE state as well, if probe_mcast_probes is set to positive value.
Will this work for you?
Regards,
--yoshfuji
Quoted 27 lines
Best Regards,
Ulf SamuelssonQuoted 19 lines
Quoted 18 lines
Quoted 17 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Signature · 2 lines
吉藤英明 <[email protected]> ミラクル・リナックス株式会社 技術本部 サポート部
Quoted 95 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 48 lines · Ulf Samuelsson
Quoted 41 lines · YOSHIFUJI Hideaki
Hello.
Quoted 31 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 26 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast
request,
which is fine, but after the reply, the kernel sends unicast
requests,
which will not get any replies.The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which
failed,
and then tried to change the state to PROBE which also failed.The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 8 lines
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
OK, I found I made this change in 2003:
From
d12fd76789e80ae337408834f45dae7cba23fc55Mon Sep 17 00:00:00 2001
From: Hideaki Yoshifuji <[email protected]>
Date: Sun, 6 Jul 2003 23:32:45 +1000
Subject: [PATCH] [NET] Send only unicast NSs in PROBE state.--- net/core/neighbour.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/core/neighbour.c +3
-1@@ -608,7 +608,9 @@ next_elt:static __inline__int neigh_max_probes (struct neighbour *n) {struct neigh_parms *p = n->parms; -return p->ucast_probes + p->app_probes + p->mcast_probes; +return (n->nud_state &NUD_PROBE ? + p->ucast_probes : + p->ucast_probes + p->app_probes + p->mcast_probes); }As I recall, I was hesitating adding new sysctl knob, but now I am okay to have knob to enable mcast probes in PROBE state as well. (By default, it should NOT send multicast probe (expecially for IPv6) in PROBE state.)
How about these?
- introduceprobe_mcast_probesknob, default to 0.
- Changeneigh_max_probes()to reflect that.
Quoted 7 lines
Then,
arp_colisit()andndict_solicit()should send multicast probes in PROBE state as well, ifprobe_mcast_probesis set to positive value.Will this work for you?
Regards,
"probe_mcast_probes" as a name sucks...
It is also confusing since it is doing something very similar to ucast_solicit, app_solicit and mcast_solicit.
As I see it, it should be named "<XXX>_solicit" to show how it is related to the rest of the sysctl entries.
If XXX is "bcast", as in my suggestion, is less important.
"mcast_probe_solicit" would work for me, but prefer "bcast_solicit".
What exactly is wrong with that name?
=================
Your suggestion was my initial suggestion for solution, and after consideration by Wind River reviewers it was rejected, since it affected IPv6. Did not check in what way.
The WR proposed solution, which is the one that was sent to the list, was to keep neigh_max_probes as is, but add check for "bcast_solicit" inside the timer handler, which they think makes sure that it affects IPv4 processing only.
The solution should allow broadcast ARP requests in IPv4 after unicast ARP requests without making IPv6 incompatible with RFCs.
Yanjun may be able to comment further.
Best Regards,
Ulf Samuelsson
Quoted 34 lines
--yoshfuji
Quoted 30 lines
Best Regards,
Ulf SamuelssonQuoted 22 lines
Quoted 21 lines
Quoted 20 lines
I think the recommended behaviour in IPv6 is to send out 3
unicasts
and if all fails, to send out broadcasts.Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Hi,
Quoted 107 lines · Ulf Samuelsson
Quoted 93 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 46 lines · Ulf Samuelsson
Quoted 39 lines · YOSHIFUJI Hideaki
Hello.
Quoted 29 lines · yzhu1 wrote:
The state machine is in the attachment.
My proposal is rather fix my ancient mistake.Best Regards!
Zhu YanjunQuoted 23 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast requests, which will not get any replies.
The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which failed, and then tried to change the state to PROBE which also failed.
The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 8 lines
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
OK, I found I made this change in 2003:
From
d12fd76789e80ae337408834f45dae7cba23fc55Mon Sep 17 00:00:00 2001
From: Hideaki Yoshifuji <[email protected]>
Date: Sun, 6 Jul 2003 23:32:45 +1000
Subject: [PATCH] [NET] Send only unicast NSs in PROBE state.--- net/core/neighbour.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/core/neighbour.c +3
-1@@ -608,7 +608,9 @@ next_elt:static __inline__int neigh_max_probes (struct neighbour *n) {struct neigh_parms *p = n->parms; -return p->ucast_probes + p->app_probes + p->mcast_probes; +return (n->nud_state &NUD_PROBE ? + p->ucast_probes : + p->ucast_probes + p->app_probes + p->mcast_probes); }As I recall, I was hesitating adding new sysctl knob, but now I am okay to have knob to enable mcast probes in PROBE state as well. (By default, it should NOT send multicast probe (expecially for IPv6) in PROBE state.)
How about these?
- introduceprobe_mcast_probesknob, default to 0.
- Changeneigh_max_probes()to reflect that.Quoted 7 lines
Then,
arp_colisit()andndict_solicit()should send multicast probes in PROBE state as well, ifprobe_mcast_probesis set to positive value.Will this work for you?
Regards,
"
probe_mcast_probes" as a name sucks...It is also confusing since it is doing something very similar to
ucast_solicit,app_solicitandmcast_solicit.
Quoted 6 lines
As I see it, it should be named "<XXX>_solicit" to show how it is related to the rest of the sysctl entries.
If XXX is "bcast", as in my suggestion, is less important.
"
mcast_probe_solicit" would work for me, but prefer "bcast_solicit".
Sorry, I meant "probe_mcast_solicit", as you see, which denotes "mcast_solicit" in PROBE state. I do not prefer "bcast" because
1) it is not a broadcast for IPv6 and 2) it is not descriptive about the affected state.
Quoted 3 lines
Your suggestion was my initial suggestion for solution, and after consideration by Wind River reviewers it was rejected, since it affected IPv6. Did not check in what way.
The "probe_mcast_solicit" variable can be (and MUST be) set per interface, per protocol basis, so I do not think it will affect IPv6 if the variable is set properly, and it should be done by default.
Quoted 4 lines
The WR proposed solution, which is the one that was sent to the list, was to keep
neigh_max_probesas is, but add check for "bcast_solicit" inside the timer handler, which they think makes sure that it affects IPv4 processing only.
Please do not do this; it becomes more complex.
Thanks.
--yoshfuji
Quoted 116 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 113 lines · Ulf Samuelsson
Quoted 96 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 49 lines · Ulf Samuelsson
Quoted 42 lines · YOSHIFUJI Hideaki
Hello.
Quoted 32 lines · yzhu1 wrote:
The state machine is in the attachment.
My proposal is rather fix my ancient mistake.Best Regards!
Zhu YanjunQuoted 26 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast
request,
which is fine, but after the reply, the kernel sends unicast
requests,
which will not get any replies.The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE,
which failed,
and then tried to change the state to PROBE which also failed.The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 8 lines
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
OK, I found I made this change in 2003:
From
d12fd76789e80ae337408834f45dae7cba23fc55Mon Sep 17 00:00:00 2001
From: Hideaki Yoshifuji <[email protected]>
Date: Sun, 6 Jul 2003 23:32:45 +1000
Subject: [PATCH] [NET] Send only unicast NSs in PROBE state.--- net/core/neighbour.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/core/neighbour.c +3
-1@@ -608,7 +608,9 @@ next_elt:static __inline__int neigh_max_probes (struct neighbour *n) {struct neigh_parms *p = n->parms; -return p->ucast_probes + p->app_probes + p->mcast_probes; +return (n->nud_state &NUD_PROBE ? + p->ucast_probes : + p->ucast_probes + p->app_probes + p->mcast_probes); }As I recall, I was hesitating adding new sysctl knob, but now I am okay to have knob to enable mcast probes in PROBE state as well. (By default, it should NOT send multicast probe (expecially for IPv6) in PROBE state.)
How about these?
- introduceprobe_mcast_probesknob, default to 0.
- Changeneigh_max_probes()to reflect that.Quoted 7 lines
Then,
arp_colisit()andndict_solicit()should send multicast probes in PROBE state as well, ifprobe_mcast_probesis set to positive value.Will this work for you?
Regards,
"
probe_mcast_probes" as a name sucks...It is also confusing since it is doing something very similar to
ucast_solicit,app_solicitandmcast_solicit.As I see it, it should be named "<XXX>_solicit" to show how it is related to the rest of the sysctl entries.
Quoted 9 lines
Quoted 3 lines
If XXX is "bcast", as in my suggestion, is less important.
"
mcast_probe_solicit" would work for me, but prefer "bcast_solicit".Sorry, I meant "
probe_mcast_solicit", as you see, which denotes "mcast_solicit" in PROBE state. I do not prefer "bcast" because
1) it is not a broadcast for IPv6 and 2) it is not descriptive about the affected state.
"mcast_probe_solicit" is better than "probe_mcast_solicit" since they will sort together.
Another alternative would be to change "mcast_solicit" from an integer to a record
echo "1" > mcast_solicit # set # broadcasts in incomplete state
echo "1,3" > mcast_solicit # set # broadcasts in incomplete and probe state.
could be "1:3", "{1,3}" or whatever syntax is most suitable for existing kernel parsers.
Think I like this more
The two values have to be assigned to two different parameters.
Quoted 9 lines
Quoted 3 lines
Your suggestion was my initial suggestion for solution, and after consideration by Wind River reviewers it was rejected, since it affected IPv6. Did not check in what way.
The "
probe_mcast_solicit" variable can be (and MUST be) set per interface, per protocol basis, so I do not think it will affect IPv6 if the variable is set properly, and it should be done by default.
You are right, so then it would work to set neigh_max_probes
to use the second parameter of mcast_solicit.
One question is what the sane default is.
For large datacenters I could see that you want the new sysctl to be set to 0.
For home users, then it should be set to a low number like 3.
I have problems at home where machines lose contact with each other at startup. Windows/Linux machines are not found
After 5-10 minutes, they can suddenly appear.
I suspect it is related to this issue.
Have no problems with a few broadcasts at home.
I have problem if machines cannot be found.
Quoted 10 lines
Quoted 4 lines
The WR proposed solution, which is the one that was sent to the list, was to keep
neigh_max_probesas is, but add check for "bcast_solicit" inside the timer handler, which they think makes sure that it affects IPv4 processing only.Please do not do this; it becomes more complex.
Thanks.
--yoshfuji
Best Regards,
Ulf Samuelsson
KI/EAB/ILM/GF
[email protected]
+46 722 427 437
Quoted 135 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 110 lines · Ulf Samuelsson
Quoted 96 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 49 lines · Ulf Samuelsson
Quoted 42 lines · YOSHIFUJI Hideaki
Hello.
Quoted 32 lines · yzhu1 wrote:
The state machine is in the attachment.
My proposal is rather fix my ancient mistake.Best Regards!
Zhu YanjunQuoted 26 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast
request,
which is fine, but after the reply, the kernel sends unicast
requests,
which will not get any replies.The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE,
which failed,
and then tried to change the state to PROBE which also failed.The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 8 lines
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
OK, I found I made this change in 2003:
From
d12fd76789e80ae337408834f45dae7cba23fc55Mon Sep 17 00:00:00 2001
From: Hideaki Yoshifuji <[email protected]>
Date: Sun, 6 Jul 2003 23:32:45 +1000
Subject: [PATCH] [NET] Send only unicast NSs in PROBE state.--- net/core/neighbour.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/core/neighbour.c +3
-1@@ -608,7 +608,9 @@ next_elt:static __inline__int neigh_max_probes (struct neighbour *n) {struct neigh_parms *p = n->parms; -return p->ucast_probes + p->app_probes + p->mcast_probes; +return (n->nud_state &NUD_PROBE ? + p->ucast_probes : + p->ucast_probes + p->app_probes + p->mcast_probes); }As I recall, I was hesitating adding new sysctl knob, but now I am okay to have knob to enable mcast probes in PROBE state as well. (By default, it should NOT send multicast probe (expecially for IPv6) in PROBE state.)
How about these?
- introduceprobe_mcast_probesknob, default to 0.
- Changeneigh_max_probes()to reflect that.Quoted 7 lines
Then,
arp_colisit()andndict_solicit()should send multicast probes in PROBE state as well, ifprobe_mcast_probesis set to positive value.Will this work for you?
Regards,
"
probe_mcast_probes" as a name sucks...It is also confusing since it is doing something very similar to
ucast_solicit,app_solicitandmcast_solicit.Quoted 6 lines
As I see it, it should be named "<XXX>_solicit" to show how it is related to the rest of the sysctl entries.
If XXX is "bcast", as in my suggestion, is less important.
"
mcast_probe_solicit" would work for me, but prefer "bcast_solicit".Sorry, I meant "
probe_mcast_solicit", as you see, which denotes "mcast_solicit" in PROBE state. I do not prefer "bcast" because
1) it is not a broadcast for IPv6 and 2) it is not descriptive about the affected state.Quoted 3 lines
Your suggestion was my initial suggestion for solution, and after consideration by Wind River reviewers it was rejected, since it affected IPv6. Did not check in what way.
The "
probe_mcast_solicit" variable can be (and MUST be) set per interface, per protocol basis, so I do not think it will affect IPv6 if the variable is set properly, and it should be done by default.Quoted 1 line
Quoted 5 lines
Quoted 3 lines
The WR proposed solution, which is the one that was sent to the list, was to keep
neigh_max_probesas is, but add check for "bcast_solicit" inside the timer handler, which they think makes sure that it affects IPv4 processing only.Please do not do this; it becomes more complex.
This can avoid risk to IPv6. I think it should put in the timer handler.
Best Regards!
Zhu Yanjun
Quoted 6 lines
Thanks.
--yoshfuji
Quoted 123 lines · Ulf Samuelsson
Quoted 95 lines · YOSHIFUJI Hideaki/吉藤英明
Hi,
Quoted 48 lines · Ulf Samuelsson
Quoted 41 lines · YOSHIFUJI Hideaki
Hello.
Quoted 31 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 26 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast
request,
which is fine, but after the reply, the kernel sends unicast
requests,
which will not get any replies.The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which
failed,
and then tried to change the state to PROBE which also failed.The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
Quoted 8 lines
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
OK, I found I made this change in 2003:
From
d12fd76789e80ae337408834f45dae7cba23fc55Mon Sep 17 00:00:00 2001
From: Hideaki Yoshifuji <[email protected]>
Date: Sun, 6 Jul 2003 23:32:45 +1000
Subject: [PATCH] [NET] Send only unicast NSs in PROBE state.--- net/core/neighbour.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/core/neighbour.c +3
-1@@ -608,7 +608,9 @@ next_elt:static __inline__int neigh_max_probes (struct neighbour *n) {struct neigh_parms *p = n->parms; -return p->ucast_probes + p->app_probes + p->mcast_probes; +return (n->nud_state &NUD_PROBE ? + p->ucast_probes : + p->ucast_probes + p->app_probes + p->mcast_probes); }As I recall, I was hesitating adding new sysctl knob, but now I am okay to have knob to enable mcast probes in PROBE state as well. (By default, it should NOT send multicast probe (expecially for IPv6) in PROBE state.)
How about these?
- introduceprobe_mcast_probesknob, default to 0.
- Changeneigh_max_probes()to reflect that.Quoted 7 lines
Then,
arp_colisit()andndict_solicit()should send multicast probes in PROBE state as well, ifprobe_mcast_probesis set to positive value.Will this work for you?
Regards,
"
probe_mcast_probes" as a name sucks...It is also confusing since it is doing something very similar to
ucast_solicit,app_solicitandmcast_solicit.As I see it, it should be named "<XXX>_solicit" to show how it is related to the rest of the sysctl entries.
If XXX is "bcast", as in my suggestion, is less important.
"
mcast_probe_solicit" would work for me, but prefer "bcast_solicit".What exactly is wrong with that name?
=================Your suggestion was my initial suggestion for solution, and after consideration by Wind River reviewers it was rejected, since it affected IPv6. Did not check in what way.
Quoted 8 lines
The WR proposed solution, which is the one that was sent to the list, was to keep
neigh_max_probesas is, but add check for "bcast_solicit" inside the timer handler, which they think makes sure that it affects IPv4 processing only.The solution should allow broadcast ARP requests in IPv4 after unicast ARP requests without making IPv6 incompatible with RFCs.
Yanjun may be able to comment further.
Yes. I prefer to this solution since this only affects IPv4.
Best Regards!
Zhu Yanjun
Quoted 43 lines
Best Regards,
Ulf SamuelssonQuoted 34 lines
--yoshfuji
Quoted 30 lines
Best Regards,
Ulf SamuelssonQuoted 22 lines
Quoted 21 lines
Quoted 20 lines
I think the recommended behaviour in IPv6 is to send out 3
unicasts
and if all fails, to send out broadcasts.Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Quoted 104 lines · Ulf Samuelsson
Quoted 40 lines · YOSHIFUJI Hideaki
Hello.
Quoted 30 lines · yzhu1 wrote:
The state machine is in the attachment.
Best Regards!
Zhu YanjunQuoted 25 lines · Zhu Yanjun
V2:
setARP_PROBE_BCASTdefault N.V1:
Have a problem with an HP router at a certain location, which is configured to only answer to broadcast ARP requests. That cannot be changed.The first ARP request the kernel sends out, is a broadcast request, which is fine, but after the reply, the kernel sends unicast
requests,
which will not get any replies.The ARP entry will after some time enter STALE state, and if nothing is done it will time out, and be removed. This process takes to long, and I have been told that it is difficult to makes changes that will eventually remove it.
Have tried to change the state from STALE to INCOMPLETE, which
failed,
and then tried to change the state to PROBE which also failed.The stack is only sending out unicasts, and never broadcast. Is there any way to get the stack to send out a broadcast ARP without having to wait for the entry to be removed?
Neighbour subsystem will send multicast probes after unicast probes in
NUD_PROBEstate ifmcast_solicitis more thanucast_solicit. Try setting net.ipv4.neigh.*.ucast_solicit to the value less than net.ipv4.neigh.*.mcast_solicit, please? e.g.Quoted 5 lines
net.ipv4.neigh.eth0.mcast_solicit = 3
net.ipv4.neigh.eth0.ucast_solicit = 1--yoshfuji
I dont see how, and I would like to focus on code discussion.
Below is simplified pseudo code of the timer handler after you have reached REACHABLE the first time.
"
mcast_solicit" is not used at all.It is only used when in INCOMPLETE state as far as I can tell.
I do not see that the stack is returning to INCOMPLETE after it has reached REACHABLE once.
Can it do so? In that case, in what part of the code.
=============================
int confirmed; /* time of last ARP reply */ int ucast_solicit; /* sysctl */ int app_solicit; /* sysctl */
neigh_timer_handler()
begin
if (in REACHABLE) then
if ("current time" <=( confirmed + reachable)) then
we are OK, test later
else if ("current time" <= used +DELAY_PROBE_TIME) then
set state to DELAY
else
set state to STALE
end if
else if (in DELAY) then
if ("current time" <= confirmed +DELAY_PROBE_TIME) then
change state to REACHABLE
send notification
else
change state to PROBE
probes = 0;
do not send notification
end ifif (in PROBE state) then
if (probes >= (ucast_solicit+app_solicit)) then
change state to FAILED
send notification
end if
end ifif (in PROBE state) then
send ARP request;
end ifif (notify) then
send notification
end if
end====================
Anyway, the behaviour I would like to see is:
Quoted 8 lines
INCOMPLETE:
Send 3 broadcast ARP
PROBE
Send 3 unicast ARP
Send 3 broadcast ARPwhich not possible with your suggestion
I do not want to send 6 broadcast ARP in INCOMPLETE state.
Yes. I agree with you. I made tests for several days. I can not reproduce this with the method from YOSHIFUJI.
Best Regards!
Zhu Yanjun
Quoted 30 lines
Best Regards,
Ulf SamuelssonQuoted 20 lines
Quoted 19 lines
Quoted 18 lines
I think the recommended behaviour in IPv6 is to send out 3 unicasts and if all fails, to send out broadcasts.
Zhu Yanjun (1):
neighbour: Support broadcast ARP in neighbor PROPE stateinclude/net/neighbour.h | 7 ++++++ include/uapi/linux/neighbour.h | 6 +++++ include/uapi/linux/sysctl.h | 3 +++ kernel/sysctl_binary.c | 3 +++ net/core/neighbour.c | 44 +++++++++++++++++++++++++++++--- net/ipv4/Kconfig | 57 ++++++++++++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 7 ++++-- 7 files changed, 121 insertions(+), 6 deletions(-)
Like Yoshifuji and others I agree that:
1) You can get working behavior by adjusting existing sysctls.
2) IPV4 ARP and IPV6 NDISC are not different in this regard.
I'm really tired of all of these ARP hacks being submitted recently, and I want people to think more deeply about what they are proposing first.
Quoted 9 lines · David Miller
Like Yoshifuji and others I agree that:
1) You can get working behavior by adjusting existing sysctls.
2) IPV4 ARP and IPV6 NDISC are not different in this regard.
I'm really tired of all of these ARP hacks being submitted recently, and I want people to think more deeply about what they are proposing first.
Which sysctls are you referring to?
As I can see it, there are three sysctls that control this.
ucast_solicit.mcast_solicitapp_solicit.
If you think any other sysctl is useful here, which one?
From Documentation/networking/ip-sysctl.txt.
+++++++++++++app_solicit - INTEGER
The maximum number of probes to send to the user space ARP daemon via netlink before dropping back to multicast probes (see mcast_solicit). Defaults to 0.
----------------------------
so that ain't it.
If you disagree, what should the Documentation look like?
=============================================
From net/core/neighbour.c(timer_handler):
if ((neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) &&
atomic_read(&neigh->probes) >= neigh_max_probes(neigh)) {
neigh->nud_state = NUD_FAILED;
notify = 1;
neigh_invalidate(neigh);
goto out;
}From net/core/neighbour.c(neigh_max_probes):
static __inline__ int neigh_max_probes(struct neighbour *n)
{
struct neigh_parms *p = n->parms;
int max_probes = NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES);
if (!(n->nud_state & NUD_PROBE))
max_probes += NEIGH_VAR(p, MCAST_PROBES);
return max_probes;
}=============================================
If we simplify this when we are in NUD_PROBE state we see:
=============================================
if (atomic_read(&neigh->probes) >= NEIGH_VAR(p, UCAST_PROBES) +
NEIGH_VAR(p, APP_PROBES)) {
neigh->nud_state = NUD_FAILED;
notify = 1;
neigh_invalidate(neigh);
goto out;
}=============================================
Since APP_PROBES is 0, and according to documentation has nothing to do with Broadcast:
=============================================
if (atomic_read(&neigh->probes) >= NEIGH_VAR(p, UCAST_PROBES)) {
neigh->nud_state = NUD_FAILED;
notify = 1;
neigh_invalidate(neigh);
goto out;
}=============================================
so we will send out "ucast_solicit" unikcast probes, and then we will enter FAILED state. mcast_solicit is ignored when in NUD_PROBE state.
"mcast_solicit" is only used when in NUD_INCOMPLETE state, and broadcasts will never be sent out by the stack for an entry, once it is in NUD_REACHABLE for the first time.
I would be happy, if you can show me that I have misunderstood something.
Best Regards,
Ulf Samuelsson
Quoted 75 lines · Ulf Samuelsson
Quoted 9 lines · David Miller
Like Yoshifuji and others I agree that:
1) You can get working behavior by adjusting existing sysctls.
2) IPV4 ARP and IPV6 NDISC are not different in this regard.
I'm really tired of all of these ARP hacks being submitted recently, and I want people to think more deeply about what they are proposing first.
Which sysctls are you referring to?
As I can see it, there are three sysctls that control this.
ucast_solicit.mcast_solicitapp_solicit.If you think any other sysctl is useful here, which one?
From
Documentation/networking/ip-sysctl.txt.
+++++++++++++app_solicit- INTEGER
The maximum number of probes to send to the user space ARP daemon via netlink before dropping back to multicast probes (seemcast_solicit). Defaults to 0.
----------------------------
so that ain't it.
If you disagree, what should the Documentation look like?=============================================
From net/core/neighbour.c(timer_handler):if ((neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) && atomic_read(&neigh->probes) >= neigh_max_probes(neigh)) { neigh->nud_state = NUD_FAILED; notify = 1; neigh_invalidate(neigh); goto out; }From net/core/neighbour.c(neigh_max_probes):
static__inline__intneigh_max_probes(struct neighbour *n){
structneigh_parms*p =n->parms;
intmax_probes=NEIGH_VAR(p, UCAST_PROBES)+ NEIGH_VAR(p,APP_PROBES); if (!(n->nud_state & NUD_PROBE)) max_probes += NEIGH_VAR(p, MCAST_PROBES); return max_probes; }=============================================
If we simplify this when we are in
NUD_PROBEstate we see:=============================================
if (atomic_read(&neigh->probes) >= NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES)) { neigh->nud_state = NUD_FAILED; notify = 1; neigh_invalidate(neigh); goto out; }=============================================
Since
APP_PROBESis 0, and according to documentation has nothing to do with Broadcast:=============================================
if (atomic_read(&neigh->probes) >= NEIGH_VAR(p, UCAST_PROBES)) { neigh->nud_state = NUD_FAILED; notify = 1; neigh_invalidate(neigh); goto out; }
Quoted 4 lines
=============================================
so we will send out "
ucast_solicit" unikcast probes, and then we will enter FAILED state.mcast_solicitis ignored when inNUD_PROBEstate.
Yes. I agree with you. That is why I add the bcast_probe here.
Quoted 3 lines
"
mcast_solicit" is only used when inNUD_INCOMPLETEstate, and broadcasts will never be sent out by the stack for an entry, once it is inNUD_REACHABLEfor the first time.
We can see this in "Figure 26-13. Transitions among NUD states" of Understanding Linux Network Internals.
Zhu Yanjun
Quoted 8 lines
I would be happy, if you can show me that I have misunderstood something.
Best Regards,
Ulf Samuelsson