dmitrysmagin / dingoo-linux

Automatically exported from code.google.com/p/dingoo-linux
1 stars 2 forks source link

USB ethernet creates overly-large subnet. Breaks all other 10.x.x.x networking #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>What steps will reproduce the problem?
1. Use the great new usb ethernet.

>What is the expected output? What do you see instead?
The dingux box should provide a lease to the host system with an address
and subnet appropriate for the number of devices involved.

Instead it provides the address 10.0.1.0 with a subnet mask of 255.0.0.0 (
10.1.0.1/8 in CIDR notation. )

>What version of the product are you using? On what operating system?
dingux-system-20090730

>Please provide any additional information below.
The subnet that udhcpd provides the host will set a "Connected Route" in
the hosts routing table. The host will now attempt to reach every address
in that subnet via the USB ethernet device. (Unless they have a more
specific route set.)

So with the current 8 bit subnet mask they will not be able to reach any of
the other 16,777,212 addresses that begin with 10. :)

It seems more appropriate to use a very small subnet, like one with a 30
bit mask (255.255.255.252) which only contains two host addresses:
Network address     - 10.1.0.0
Network mask        - 255.255.255.252
Network mask (bits) - 30
Broadcast address   - 10.1.0.3
Addresses in network    - 4
Network range       - 10.1.0.0 - 10.1.0.3
Usable range        - 10.1.0.1 - 10.1.0.2
                           ^ See it fits perfectly :)

Another reasonable choice would be a 24 bit mask:
Network address     - 10.1.0.0
Network mask        - 255.255.255.0
Network mask (bits) - 24
Broadcast address   - 10.1.0.255
Addresses in network    - 256
Network range       - 10.1.0.0 - 10.1.0.255
Usable range        - 10.1.0.1 - 10.1.0.254

Which is still way bigger than we're likely to need on usb ethernet, but
much much smaller than the /8 we have now.

(The attached patch is not from a working build environment, It's just an
example.)

Original issue reported on code.google.com by s...@mnoble.net on 4 Aug 2009 at 6:05

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the bug submit. I just used 8 bit mask for testing and never though 
about
it again. The 30 bit submast alternative you describe is optimal. Will be 
changed in
the next release.

Original comment by igga...@gmail.com on 4 Sep 2009 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by igga...@gmail.com on 4 Sep 2009 at 11:45

GoogleCodeExporter commented 9 years ago

Original comment by igga...@gmail.com on 8 Sep 2009 at 11:37

GoogleCodeExporter commented 9 years ago

Original comment by igga...@gmail.com on 8 Sep 2009 at 11:43