[16984] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

Re: renumbering and roaming

daemon@ATHENA.MIT.EDU (Daniel Reed)
Mon May 18 18:00:14 1998

Date: Mon, 18 May 1998 17:49:41 -0400 (EDT)
From: Daniel Reed <djr@narnia.n.ml.org>
To: Phillip Vandry <vandry@Mlink.NET>
cc: nanoh@merit.edu
In-Reply-To: <199805181806.OAA16923@Iodine.Mlink.NET>

On Mon, 18 May 1998, Phillip Vandry wrote:
) > Anyone care to co-author an RFC suggesting a sensible global standard for
) > "local" mail relays, time servers, resolvers etc so that dial-in people can
) > roam without getting filtered, blocked etc?
) How about defining 192.x.y.port-number, where port-number is the port
) number of the service. 192.x.y.53 is the DNS server, etc..
) 
) Nah, good idea, but too many useful services with port numbers > 255, so
) it doesn't work too well.
192.69.0.25:25 -> SMTP
192.69.0.53:53 -> DNS
192.69.0.80:80 -> HTTP
192.69.66.67:6667 -> IRC
etc.

Why not just 192.x.*.* and have the first two numbers in the port be
represented in the second to last quad, and the last two numbers in the
last quad?

Or, maybe more practically (to take care of those pesky 5 digit ports that
someone might use for some reason), you could just use the actual numeric
representation, ie:
   25 -> 0x0019 -> 192.69.0.25 (0x00 is 0, 0x19 is 25)
   80 -> 0x0050 -> 192.69.0.80 (0x00 is 0, 0x50 is 80)
 6667 -> 0x1A0B -> 192.69.26.11 (0x1A is 26, 0x0B is 11)
54321 -> 0xD431 -> 192.69.212.49 (0xD4 is 212, 0x31 is 49)
etc. To reconstruct the original port from the host, just take the second
to last quad, multiple it by 256 (aka left bitshift it 8 places), and add
the last quad. 0*256 + 25 = 25; 0*256 + 80 = 80; 26*256 + 11 = 6667;
212*256 + 49 = 54321

--
Daniel Reed <n@ml.org> (ask me for my PGP key)
Man will occasionally stumble over the truth, but most times he will pick
 himself up and carry on. -- Winston Churchill



home help back first fref pref prev next nref lref last post