Skip to contentSkip to conversation

IPv6: enable TCP to use an anycast address

PATCH François-Xavier Le Bail 3 participants 3 messages Jan 12, 2014 – Jan 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 18 lines · Hannes Frederic Sowa
Quoted 8 lines · Alexey Kuznetsov
Quoted 1 line · François-Xavier Le Bail

Many DNS root-servers use TCP with anycast (IPv4 and IPV6).

Actually, I was alerted by reset processing in your patch, it cannot be right.

Do not you think this must not be enabled for common use? At least some separate sysctl disabled by default.

The idea I had, was, that if a socket does knowingly bind to an anycast address, it is allowed to do so and process queries on it with both TCP and UDP. I don't think we need a sysctl for that? Anycast addresses are either pre-defined (e.g. the subnet router anycast address) or specified by a flag when the administrator adds one. Currently one can only add anycast addresses either by forwarding and gets the per-subnet anycast address or with a setsockopt IPV6_JOIN_ANYCAST.

Quoted 2 lines

So the problem is what should be allowed when the socket listens on an any address? Maybe this should be protected by a sysctl?

Hi,

TCP case:
With my two patches (the one for bind and this one for tcp), when a SOCK_STREAM socket listen to in6addr_any, the server is able to send TCP reply with unicast or anycast source address, according to the destination address used by the client.

dest request unicast => src reply unicast (current behavior) dest resquet anycast => src reply anycast (new)

So, I don't think there is a need for a sysctl.

UDP case:
By default (no socket option), the server program don't know the destination address of the request. The ipv6_dev_get_saddr() is used for choosing the unicast source address of the reply.

I am not sure a change is needed here.

When using IPV6_RECVPKTINFO, a server is able to know the destination address of the request and can use it as source address for the reply.
To enable anycast for this (don't get EINVAL), there is need for a patch like the one I posted ("IPv6: add option to use anycast addresses as source addresses for datagrams").
I am working on a v2.

With the appropriate change:
dest request unicast => src reply unicast (current behavior) dest resquet anycast => src reply anycast (new)

I don't think, there either, there is a need for a sysctl.

What do you think about it?

BR,
Francois-Xavier

#1 lore raw

Hi!

Quoted 29 lines · François-Xavier Le Bail
Quoted 18 lines · Hannes Frederic Sowa
Quoted 8 lines · Alexey Kuznetsov
Quoted 1 line · François-Xavier Le Bail

Many DNS root-servers use TCP with anycast (IPv4 and IPV6).

Actually, I was alerted by reset processing in your patch, it cannot be right.

Do not you think this must not be enabled for common use? At least some separate sysctl disabled by default.

The idea I had, was, that if a socket does knowingly bind to an anycast address, it is allowed to do so and process queries on it with both TCP and UDP. I don't think we need a sysctl for that? Anycast addresses are either pre-defined (e.g. the subnet router anycast address) or specified by a flag when the administrator adds one. Currently one can only add anycast addresses either by forwarding and gets the per-subnet anycast address or with a setsockopt IPV6_JOIN_ANYCAST.

Quoted 2 lines

So the problem is what should be allowed when the socket listens on an any address? Maybe this should be protected by a sysctl?

TCP case:
With my two patches (the one for bind and this one for tcp), when a SOCK_STREAM socket listen to in6addr_any, the server is able to send TCP reply with unicast or anycast source address, according to the destination address used by the client.

Quoted 4 lines

dest request unicast => src reply unicast (current behavior) dest resquet anycast => src reply anycast (new)

So, I don't think there is a need for a sysctl.

I am still thinking about the RST-case and am a bit unsure here. But I currently don't see any problems.

Quoted 6 lines

UDP case:
By default (no socket option), the server program don't know the destination address of the request. The ipv6_dev_get_saddr() is used for choosing the unicast source address of the reply.

I am not sure a change is needed here.

If the socket did bind to anycast address, we may well send packets from anycast source without switching a sysctl IMHO.

If not bound we need to keep current behaviour, yes. As DNS-Servers normally do accept a list of addresses where to bind to, I find this acceptable. RFC6724 additionally now allowes the selection of anycast as source address, so we may think about this and maybe integrate this with ip addrlabel and such).

We also need to check the implications to icmp here (error reporting if an UDP packets is sent to an anycast address). Also we have to check for icmps generated because of forwarding errors and their source selection.

Quoted 7 lines

When using IPV6_RECVPKTINFO, a server is able to know the destination address of the request and can use it as source address for the reply.
To enable anycast for this (don't get EINVAL), there is need for a patch like the one I posted ("IPv6: add option to use anycast addresses as source addresses for datagrams").
I am working on a v2.

Ack.

Quoted 5 lines

With the appropriate change:
dest request unicast => src reply unicast (current behavior) dest resquet anycast => src reply anycast (new)

I don't think, there either, there is a need for a sysctl.

I agree here.

Greetings,

Hannes

maintainer
#2 lore raw

From: Hannes Frederic Sowa <[email protected]>
Date: Mon, 13 Jan 2014 02:11:46 +0100

Quoted 32 lines

Hi!

Quoted 29 lines · François-Xavier Le Bail
Quoted 18 lines · Hannes Frederic Sowa
Quoted 8 lines · Alexey Kuznetsov
Quoted 1 line · François-Xavier Le Bail

Many DNS root-servers use TCP with anycast (IPv4 and IPV6).

Actually, I was alerted by reset processing in your patch, it cannot be right.

Do not you think this must not be enabled for common use? At least some separate sysctl disabled by default.

The idea I had, was, that if a socket does knowingly bind to an anycast address, it is allowed to do so and process queries on it with both TCP and UDP. I don't think we need a sysctl for that? Anycast addresses are either pre-defined (e.g. the subnet router anycast address) or specified by a flag when the administrator adds one. Currently one can only add anycast addresses either by forwarding and gets the per-subnet anycast address or with a setsockopt IPV6_JOIN_ANYCAST.

Quoted 2 lines

So the problem is what should be allowed when the socket listens on an any address? Maybe this should be protected by a sysctl?

TCP case:
With my two patches (the one for bind and this one for tcp), when a SOCK_STREAM socket listen to in6addr_any, the server is able to send TCP reply with unicast or anycast source address, according to the destination address used by the client.

Quoted 7 lines
Quoted 4 lines

dest request unicast => src reply unicast (current behavior) dest resquet anycast => src reply anycast (new)

So, I don't think there is a need for a sysctl.

I am still thinking about the RST-case and am a bit unsure here. But I currently don't see any problems.

I think this needs much more discussion and analysis before I can really seriously consider applying this, sorry.