[comp.protocols.tcp-ip] Subnetted subnets implemented!

viktor@cucumber.Princeton.EDU (Viktor Dukhovni) (03/20/90)

	A while I go I sent a query to this list asking for comments
on the feasibility of further subnetting subnets in 4.3BSD like systems,
and proposed a hypothetical algorithm for doing this.

	I got just two responses both were of the "let me know what
you find variety".  I have finally had time to try this out,  and found
a small deficiency in the original scheme,  and a clean solution.
I am sending this message from a happy sub-subnetted network. The main
point was to realize that there are two parameters determining the
interpretation of an interface address:  the first is the subnetmask,
which defines the granularity of the subnet,  and the second is the netmask(!)
which defines the size of the network attached to the interface.  

	When subnetting Class B networks,  this information is gratis,
the Class B net has 256^2 addresses.  What really makes sub-subnetting
possible is a mechanism for specifying the kernel netmask of an interface.
We can also dispense with the SUBNETSARELOCAL hack,  as one can now
fine tune the local network size by changing the netmask.
(There is some confusion on this point since what is a subnetmask
to the kernel is a "netmask" to ifconfig,  so I will use the kernel notation.)

Having added two new SIOC ioctls to define the interface "netmask"
(I had to call them SIOC?IFCLASSMASK,  since NETMASK was already (ab)used :-( )
There were only a few trivial mods to netinet/in.c to get the whole show on
the road.  I also have an ifconfig.c that sets and reports the new parameter.

	I think this code can prove useful for adding slip subnets behind
serial line concentrators on departmental without changing the outside
world to treat these as separate subnets.

	If there is enough interest I will make it available via anonymous
ftp,  please let me know if you want use use this code or have done something
similar.

	What remains to be done is a version of routed or gated that
undestands the new netmask parameter and correctly recognizes host vs.
network routes.   I am looking at gated-1.9.1.7 as a base,  but I seem
to have problems with even on "standard" 4.0.3 suns,  it readvertises
all routes back to the source net,  and acquires some bogus ones,  I am
having better luck with Suns in.routed.

-- 
	Viktor Dukhovni <viktor@math.princeton.edu>	: ARPA
		<...!uunet!princeton!math!viktor>	: UUCP
	Fine Hall, Washington Rd., Princeton, NJ 08544  : US-Post
		+1-(609)-258-5792		 	: VOICE