[alt.sys.sun] /etc/protocols

barmar@think.com (Barry Margolin) (12/06/90)

In article <1990Dec5.225824.10377@melba.bby.oz.au> gnb@bby.oz.au (Gregory N. Bond) writes:
>4.1 needs a file in /etc called protocols containing the following
>stuff:
...
>Now, why in EARTH put that in a file?  IS sun afraid that the protocol
>numbers are about to change.....????????

Neither are TCP and UDP port numbers, but they're in a file (actually, an
NIS map these days) as well.

One benefit of putting all these things in configuration files is that it
makes it easy to debug new implementations.  While debugging you might not
want to bother or be bothered by other implementations, so you could edit
/etc/protocols to specify your own protocol number.
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) (12/07/90)

>>Now, why in EARTH put that in a file?  IS sun afraid that the protocol
>>numbers are about to change.....????????

The /etc/protocols file originated with BSD networking.  At that time,
I'm sure which protocols would exist in the future was very uncertain.
(Some might claim that it's even more uncertain today.)

According to Nemeth, Snyder, and Seebass (Unix System Administration
Handbook, p 264), "if a user writes his own protocol using the raw
socket interface provided for such purposes, it will have to be listed
in the /etc/protocols file in order for inetd to manage daemons using
it."  So long as we allow protocols to be added to /etc/protocols, it
makes sense to put all of them there.

Perhaps the real question is, why sequential access of a text file
rather than quick look-up of a direct access database.  Perhaps the
answer is that the file is small and read infrequently (no more than
once by a process), and database style access is available, at least on
some machines, through YP/NIS.
--
Rahul Dhesi <dhesi%cirrusl@oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi