[Gllug] sorts of ports

Kieran Barry kieran at esperi.demon.co.uk
Sun Sep 9 11:02:46 UTC 2001


On Tue, 4 Sep 2001, Paul Brazier wrote:

> > That's a good idea, but instead of making these unique service
> > identifiers strings, we could assign a number to each service. 'http'
> > could be '80', for instance. Ooops, port numbers again.
> 
> Well, to the computer strings are numbers really underneath as well. I
> suppose it's a case of using the /etc/services (?) file to translate
> "ports" to daemons instead of using ASCII. Although it doesn't even need
> to know ASCII to compare two strings (e.g. if the header contains
> "httpd" then notify "httpd" or whatever), it just makes it more
> "human-readable".
> I suppose when it was invented diskspace/bandwidth etc was very precious
> and human-readability wasn't an issue. 

Actually, no. TCP and UDP allocate 16 bits in their headers for ports.
That would not be enough for a strings based system. And you really
don't want to have redundancy in the headers. For example, DNS is highly
tuned so that data plus headers always come in under 576, which is the
largest packet which can't be fragmented. (Fragmentation is apparently
quite expensive)

> > More seriously, your scheme does not permit running services on
> > non-standard ports (perhaps several such), and offers no advantages.
> 
> Surely it caters in theory for an _infinite_ number of "ports" - if you
> run a server called "asdfasdf", this string *is* the port, and just
> looks for/is sent IP packets with "asdfasdf" in the header.

This would be a definite advantage. On the minus side, it would be far
more likely to have probs with typos.
> 
> It wouldn't allow multiple http servers to run on one machine (on
> different "ports") but would you need this? Doesn't inetd sort this out
> or something?
> 
The current system can use IP based virtual hosting (vhing), port based
vhing or name based vhing.

These days, name based hosting is prefered because it is simplest. The
http transaction goes like this:
$ telnet slashdot.org 80
Trying 64.28.67.150...
Connected to slashdot.com.
Escape character is '^]'.
get / HTTP/1.0
Host: slashdot.com

HTTP/1.1 301 Moved Permanently
Date: Sun, 09 Sep 2001 10:55:53 GMT
Server: Apache/1.3.20 (Unix) mod_perl/1.25
Location: http://slashdot.org/
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>301 Moved Permanently</TITLE>
</HEAD><BODY>
<H1>Moved Permanently</H1>
The document has moved <A HREF="http://slashdot.org/">here</A>.<P>
<HR>
<ADDRESS>Apache/1.3.20 Server at www.slashdot.org Port 80</ADDRESS>
</BODY></HTML>
Connection closed by foreign host.

(I used this because slashdot.org and slashdot.com are on the same IP
address)

Clearly, your scheme isn't going to affect this.

It's also worth remembering that in your scheme, you could have http1,
http2 etc. So, it should be workable. The valid arguments against it
are:
1. Extra bandwidth (someone would call a port supercalifradgilistic)
2. Cost of string compares in networking stack
3. Difficulty of standardising port names 
4. Difficulty of building backwards compatibility with installed base.

Regards

Kieran


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list