All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address
@ 2021-05-13  4:36 Seth David Schoen
  2021-05-13  4:37 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Seth David Schoen @ 2021-05-13  4:36 UTC (permalink / raw)
  To: netdev
  Cc: John Gilmore, Dave Taht, David S. Miller, Hideaki YOSHIFUJI, David Ahern

Treat the lowest address in a subnet (the address within the subnet
which contains all 0 bits) as an ordinary unicast address instead
of as a potential second broadcast address.  For example, in subnet
192.168.17.24/29, which contains 8 addresses, make address 192.168.17.24
usable as a normal unicast address (while continuing to support
192.168.17.31 as a broadcast address).

Since EVERY network number or subnet formerly had its host number 0
reserved, this patchset adds 1 more usable host address to every network
and subnet (i.e., 2^(32-n)-1 instead of 2^(32-n)-2 addresses available
for assignment on each IPv4 /n subnet).  For small subnets, this is a
significant gain; instead of 6 usable host addresses, a /29 would now
contain 7, a 16% increase.

The reserving of host number 0 for broadcast came about in RFC 1122 from
1989 (page 31, "IP addresses are not permitted to have the value 0 or -1
for any of the <Host-number>, <Network-number>, or <Subnet-number>
fields (except in the special cases listed above)" and page 66, "There
is a class of hosts [4.2BSD Unix and its derivatives, but not 4.3BSD]
that use non-standard broadcast address forms, substituting 0 for -1.
All hosts SHOULD recognize and accept any of these non-standard
broadcast addresses as the destination address of an incoming
datagram.").  This has been repeated in subsequent RFCs, always with
backwards-compatibility rationales.  Network troubles (broadcast storms)
ensued when some early hosts on a LAN treated the lowest address as
unicast and others treated it as broadcast.  Multiple 1989 changes to IP
successfully prevented these.  The key was adding the layering violation
rule requiring hosts to ignore all IP datagrams with unicast destination
addresses that were received in low-level (Ethernet) broadcasts.  That
change is still in effect, and this patchset does not alter it.  All
operating systems since 4.3BSD, including all the current BSD OSes, now
use the standard IP broadcast address.  4.2BSD has been obsolete for
more than 30 years, and all modern hosts ignore hardware broadcasts
containing unicast IP addresses, so there is no modern likelihood of
broadcast storms even when hosts disagree on the unicast vs. broadcast
status of a given address.

Tests with this patchset show that other Linux hosts on the local segment
simply ignore a host numbered with the lowest address, both for incoming
and outgoing packet purposes.  They don't interoperate with it, but they
also don't cause broadcast storms or any other malfunction.  If patched,
they have no trouble interoperating with a host at the lowest address.

Unmodified "distant" hosts that are not on the same segment successfully
interoperate, as long as the gateway on the local segment, and the local
host itself using the lowest address, have this patch.  (Distant hosts
have no way of knowing whether a given address is the lowest address
in a faraway network segment, so they treat it no differently than any
other unicast address.)  This means that each local site can change this
behavior locally, resulting immediately in global interoperability with
the newly usable lowest local address.

Modern software and documentation continues to use the definition of the
directed, or "net-directed", broadcast address as "a host ID of all one
bits".  The Internet no longer gets any benefit from having two different
broadcast addresses usable on every Ethernet segment.  I have not been
able to find any documentation that suggests that users or software should
ever intentionally use the all-zero form, or that justifies it other than
as a historic Berkeleyism.  RFCs 1112, 1812, and 3021 state that hosts and
routers need to maintain compatibility with the old form -- but they give
no rationale other than the past existence of the 4.2BSD behavior.

We're happy to provide more historical details or information about
behavior of other systems in this regard by e-mail or as future patches
to kernel documentation files.

Seth David Schoen (2):
  ip: Treat IPv4 segment's lowest address as unicast
  selftests: Lowest IPv4 address in a subnet is valid

 net/ipv4/fib_frontend.c                         |  4 +---
 .../testing/selftests/net/unicast_extensions.sh | 17 +++++++++--------
 2 files changed, 10 insertions(+), 11 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast
  2021-05-13  4:36 [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address Seth David Schoen
@ 2021-05-13  4:37 ` Seth David Schoen
  2021-05-14  1:43   ` David Ahern
  2021-05-13  4:38 ` [RESEND PATCH net-next 2/2] selftests: Lowest IPv4 address in a subnet is valid Seth David Schoen
  2021-05-17 21:00 ` [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address patchwork-bot+netdevbpf
  2 siblings, 1 reply; 8+ messages in thread
From: Seth David Schoen @ 2021-05-13  4:37 UTC (permalink / raw)
  To: netdev
  Cc: John Gilmore, Dave Taht, David S. Miller, Hideaki YOSHIFUJI, David Ahern

Treat only the highest, not the lowest, IPv4 address within a local
subnet as a broadcast address.

Signed-off-by: Seth David Schoen <schoen@loyalty.org>
Suggested-by: John Gilmore <gnu@toad.com>
Acked-by: Dave Taht <dave.taht@gmail.com>
---
 net/ipv4/fib_frontend.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 84bb707bd88d..bfb345c88271 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1122,10 +1122,8 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)
 				  prefix, ifa->ifa_prefixlen, prim,
 				  ifa->ifa_rt_priority);
 
-		/* Add network specific broadcasts, when it takes a sense */
+		/* Add the network broadcast address, when it makes sense */
 		if (ifa->ifa_prefixlen < 31) {
-			fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix, 32,
-				  prim, 0);
 			fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix | ~mask,
 				  32, prim, 0);
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RESEND PATCH net-next 2/2] selftests: Lowest IPv4 address in a subnet is valid
  2021-05-13  4:36 [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address Seth David Schoen
  2021-05-13  4:37 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
@ 2021-05-13  4:38 ` Seth David Schoen
  2021-05-14  1:43   ` David Ahern
  2021-05-17 21:00 ` [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address patchwork-bot+netdevbpf
  2 siblings, 1 reply; 8+ messages in thread
From: Seth David Schoen @ 2021-05-13  4:38 UTC (permalink / raw)
  To: netdev
  Cc: John Gilmore, Dave Taht, David S. Miller, Hideaki YOSHIFUJI, David Ahern

Expect the lowest IPv4 address in a subnet to be assignable
and addressable as a unicast (non-broadcast) address on a
local network segment.

Signed-off-by: Seth David Schoen <schoen@loyalty.org>
Suggested-by: John Gilmore <gnu@toad.com>
Acked-by: Dave Taht <dave.taht@gmail.com>
---
 .../testing/selftests/net/unicast_extensions.sh | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/net/unicast_extensions.sh b/tools/testing/selftests/net/unicast_extensions.sh
index dbf0421986df..66354cdd5ce4 100755
--- a/tools/testing/selftests/net/unicast_extensions.sh
+++ b/tools/testing/selftests/net/unicast_extensions.sh
@@ -189,6 +189,15 @@ segmenttest 255.255.255.1 255.255.255.254 24 "assign and ping inside 255.255.255
 route_test 240.5.6.7 240.5.6.1  255.1.2.1    255.1.2.3      24 "route between 240.5.6/24 and 255.1.2/24 (is allowed)"
 route_test 0.200.6.7 0.200.38.1 245.99.101.1 245.99.200.111 16 "route between 0.200/16 and 245.99/16 (is allowed)"
 #
+# Test support for lowest address ending in .0
+segmenttest 5.10.15.20 5.10.15.0 24 "assign and ping lowest address (/24)"
+#
+# Test support for lowest address not ending in .0
+segmenttest 192.168.101.192 192.168.101.193 26 "assign and ping lowest address (/26)"
+#
+# Routing using lowest address as a gateway/endpoint
+route_test 192.168.42.1 192.168.42.0 9.8.7.6 9.8.7.0 24 "routing using lowest address"
+#
 # ==============================================
 # ==== TESTS THAT CURRENTLY EXPECT FAILURE =====
 # ==============================================
@@ -202,14 +211,6 @@ segmenttest 255.255.255.1 255.255.255.255 16 "assigning 255.255.255.255 (is forb
 # Currently Linux does not allow this, so this should fail too
 segmenttest 127.99.4.5 127.99.4.6 16 "assign and ping inside 127/8 (is forbidden)"
 #
-# Test support for lowest address
-# Currently Linux does not allow this, so this should fail too
-segmenttest 5.10.15.20 5.10.15.0 24 "assign and ping lowest address (is forbidden)"
-#
-# Routing using lowest address as a gateway/endpoint
-# Currently Linux does not allow this, so this should fail too
-route_test 192.168.42.1 192.168.42.0 9.8.7.6 9.8.7.0 24 "routing using lowest address (is forbidden)"
-#
 # Test support for unicast use of class D
 # Currently Linux does not allow this, so this should fail too
 segmenttest 225.1.2.3 225.1.2.200 24 "assign and ping class D address (is forbidden)"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast
  2021-05-13  4:37 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
@ 2021-05-14  1:43   ` David Ahern
  0 siblings, 0 replies; 8+ messages in thread
From: David Ahern @ 2021-05-14  1:43 UTC (permalink / raw)
  To: Seth David Schoen, netdev, John Gilmore, Dave Taht,
	David S. Miller, Hideaki YOSHIFUJI, David Ahern

On 5/12/21 10:37 PM, Seth David Schoen wrote:
> Treat only the highest, not the lowest, IPv4 address within a local
> subnet as a broadcast address.
> 
> Signed-off-by: Seth David Schoen <schoen@loyalty.org>
> Suggested-by: John Gilmore <gnu@toad.com>
> Acked-by: Dave Taht <dave.taht@gmail.com>
> ---
>  net/ipv4/fib_frontend.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESEND PATCH net-next 2/2] selftests: Lowest IPv4 address in a subnet is valid
  2021-05-13  4:38 ` [RESEND PATCH net-next 2/2] selftests: Lowest IPv4 address in a subnet is valid Seth David Schoen
@ 2021-05-14  1:43   ` David Ahern
  0 siblings, 0 replies; 8+ messages in thread
From: David Ahern @ 2021-05-14  1:43 UTC (permalink / raw)
  To: Seth David Schoen, netdev, John Gilmore, Dave Taht,
	David S. Miller, Hideaki YOSHIFUJI, David Ahern

On 5/12/21 10:38 PM, Seth David Schoen wrote:
> Expect the lowest IPv4 address in a subnet to be assignable
> and addressable as a unicast (non-broadcast) address on a
> local network segment.
> 
> Signed-off-by: Seth David Schoen <schoen@loyalty.org>
> Suggested-by: John Gilmore <gnu@toad.com>
> Acked-by: Dave Taht <dave.taht@gmail.com>
> ---
>  .../testing/selftests/net/unicast_extensions.sh | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address
  2021-05-13  4:36 [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address Seth David Schoen
  2021-05-13  4:37 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
  2021-05-13  4:38 ` [RESEND PATCH net-next 2/2] selftests: Lowest IPv4 address in a subnet is valid Seth David Schoen
@ 2021-05-17 21:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-17 21:00 UTC (permalink / raw)
  To: Seth David Schoen; +Cc: netdev, gnu, dave.taht, davem, yoshfuji, dsahern

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Wed, 12 May 2021 21:36:25 -0700 you wrote:
> Treat the lowest address in a subnet (the address within the subnet
> which contains all 0 bits) as an ordinary unicast address instead
> of as a potential second broadcast address.  For example, in subnet
> 192.168.17.24/29, which contains 8 addresses, make address 192.168.17.24
> usable as a normal unicast address (while continuing to support
> 192.168.17.31 as a broadcast address).
> 
> [...]

Here is the summary with links:
  - [RESEND,net-next,1/2] ip: Treat IPv4 segment's lowest address as unicast
    https://git.kernel.org/netdev/net-next/c/94c821c74bf5
  - [RESEND,net-next,2/2] selftests: Lowest IPv4 address in a subnet is valid
    https://git.kernel.org/netdev/net-next/c/6101ca0384e3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast
  2021-05-05 23:28 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
@ 2021-05-07  0:36   ` Jakub Kicinski
  0 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2021-05-07  0:36 UTC (permalink / raw)
  To: Seth David Schoen; +Cc: netdev, gnu, dave.taht

On Wed, 5 May 2021 16:28:12 -0700 Seth David Schoen wrote:
> Treat only the highest, not the lowest, IPv4 address within a local
> subnet as a broadcast address.

We don't accept patches to net-next during the merge window.

Please repost in a week, please make sure you CC IP maintainers
(get_maintainer script will point them out).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast
  2021-05-05 23:25 Seth David Schoen
@ 2021-05-05 23:28 ` Seth David Schoen
  2021-05-07  0:36   ` Jakub Kicinski
  0 siblings, 1 reply; 8+ messages in thread
From: Seth David Schoen @ 2021-05-05 23:28 UTC (permalink / raw)
  To: netdev; +Cc: gnu, dave.taht

Treat only the highest, not the lowest, IPv4 address within a local
subnet as a broadcast address.

Signed-off-by: Seth David Schoen <schoen@loyalty.org>
Suggested-by: John Gilmore <gnu@toad.com>
Acked-by: Dave Taht <dave.taht@gmail.com>
---
 net/ipv4/fib_frontend.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 84bb707bd88d..bfb345c88271 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1122,10 +1122,8 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)
 				  prefix, ifa->ifa_prefixlen, prim,
 				  ifa->ifa_rt_priority);
 
-		/* Add network specific broadcasts, when it takes a sense */
+		/* Add the network broadcast address, when it makes sense */
 		if (ifa->ifa_prefixlen < 31) {
-			fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix, 32,
-				  prim, 0);
 			fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix | ~mask,
 				  32, prim, 0);
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-17 21:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13  4:36 [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address Seth David Schoen
2021-05-13  4:37 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
2021-05-14  1:43   ` David Ahern
2021-05-13  4:38 ` [RESEND PATCH net-next 2/2] selftests: Lowest IPv4 address in a subnet is valid Seth David Schoen
2021-05-14  1:43   ` David Ahern
2021-05-17 21:00 ` [RESEND PATCH net-next 0/2] Treat IPv4 lowest address as ordinary unicast address patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-05-05 23:25 Seth David Schoen
2021-05-05 23:28 ` [RESEND PATCH net-next 1/2] ip: Treat IPv4 segment's lowest address as unicast Seth David Schoen
2021-05-07  0:36   ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.