From: p_copela@csd.uwe.ac.uk (Phil (SysAdmin Parallel Research))
Newsgroups: comp.os.linux
Subject: The EtherNet FAQ - v0.1 (Alpha Test)
Date: 16 Nov 92 01:12:45 GMT
Reply-To: p_copela@csd.bristol-poly.ac.uk
Organization: The New University in the West of England, Bristol (WEB)

Well if I don't post it now I never will. In future this FAQ will
be posted on the net channel roughly every 1-2 weeks

=======================
The linux ether-NET FAQ
=======================

quick disclaimer: I must appologize for my luck of a spoll checkr

i)	Introduction
        ------------

Hello and welcome to the wonderful world of linux network
communications.

Networking has always been one of the most exciting things
that you can coax a computer to take advantage of. It allows
you to store/retrieve files from remote machines (some of which
are probably located in countries which you'll never get to visit)

	Networking also allows computers to interactively 
communicate with other processes or users on these remote machines
allowing a new social aspect of computing to be approached (mainly
in the form of talk or MUD (multi User Dungeon) sessions.
	
	Networking also has many stumbling blocks for the administrator
to fall over, most notably the initial setting up of a system network
can send the most sane person to eating the proverbial hat through
the hell of trying to coax their machines into networking life.

	This FAQ is designed to help you start into networking in a
positive direction by leading you simply to the network configuration
that best suits you, whether you are a single machine with no network
attachment (silly I know) to the multi billion cred networking enviroment
of your country's local stock exchange. Please note that this FAQ does not
follow the 'normal' format of other FAQ's as it's designed to teach you 
networking and it's idiosyncacies



ii)	What you NEED to get started
        ----------------------------

To use TCP/IP on local ethernet you will need the following

	1)	A linux machine with linux kernel 0.98.4

	2)	A WD8003/WD8013 compatible MEMORY MAPPED ethernet card
		but WD8013 is probably the best to use due to its
		electronic reconfiguration rather than jumper settings
		although you'll probably need DOS to set it up

		You should note that the kernel will always claim to
		have found a WD8013. If this bothers you, change the printk
		in linux/net/tcp/we.c to reflect your hardware.

		*NOTE* no special hardward is needed to communicate with
		yourself

		Currently I know of three cards that will work (please tell
		me if there are more) support for the ne2000 is being
		worked on but little has been heard of it's progress

		These are the WD8013, WD8003, and the SMC Elite 16.

	3)	If you are only going to use 'loopback' mode, you probably
		won't need a card either! A special loopback device is used
		to comunicate with yourself

	4)	some tcp/ip software eg telnet/ftp/talk/finger/rcp/
		rsh/various other stuff like daemons etc...

	5)	Know the IRQ's of your internal cards.

	6)	A lot of coffee and one of those stress relieving
		gadgets you can get in the local market.




iii)	Where to start
	--------------

First off you'll need to rebuild the kernel with networking compiled
into the linux kernel. You do this by removing the '#'s in
linux/net/Makefile on lines 13,14 and 26 if they haven't already been
removed. Next you'll need to calibrate  your network card. Decide what
IRQ setting you'll need for the network card.
	Anyway for those who are frexible, the standard kernel parameters
for this are :-

	INT		=	5
	mem		=	D0000
	i/o addr	=	280
	memory start	=	D0000
	memory end	=	D2000	(8K block for 8003, make it D4000
					 16k for the wd8013 )

but these can be changed on lines 12-17 (16,17 being the most important)
of the file linux/net/tcp/Space.c

*NOTE* if you have problems with the memory start addr, please get in touch 
with bir7@EDU.Stanford.leland

	Future versions of the TCP/IP code will be setable at boot time via
ioctl's. For those of you who do not have the wd8013 card, please refer to 
the ethernet board documentation on the jumper settings you may have to change.

	Right, compile the kernel (You may need to do a 'make clean dep Image')
and hopefully on the next reboot with the new kernel it should detect your card
telling you of the ethernet number it is, and also that a new family of
sockets  (AF_INET) are available.
	If your card is incorrectly inserted (I know you wouldn't) it could
cause all kinds of errors to be reported.

	At this stage you have a kernel which supports tcp/ip via the
ethernet board in your machine but knows nothing of networking, that is
where the software in the tcpip suites becomes important as it is this
software that understands networking protocols.



iv)	The tcpip-0.8.0/tcpip-0.8.1 suites (the history/differances)
	------------------------------------------------------------

History of ethernet on linux (by Ross Biro (member of the League for
------------------------------------------------------------------------
Programming Freedom LPF)) 'cos I am not worthy, I am not worthy, I am...
------------------------------------------------------------------------

In reality, I did almost all the work myself, and all from scratch.  The 
jump from slow ftp to the pace we have now was really just some minor
patches. This is how it really happened, including why I chose to switch
to Linux in the first place.
	Before I came to Stanford, I had already decided Unix was the way
to go and had a 386/20 running Microport (This was just before Microport
went chapter 11.(an American bankrupcy (sp?) law)  Unix.  At stanford I had
the opportunity to connect my machine to the Internet (networks have
always interested me.)  Unfortuneately I couldn't get any sort of networking
code for Microport, so instead I bought Esix.  Esix had some networking
problems, but it was ok.  As of 3.2 rev d it had just learned to talk
to computers off campus.  I spent a lot of time porting networking code
to Esix and ran an anon ftp site for it.
	Then I heard about Linux 0.10.  Since my file system had been
damaged beyond the ability of fsck to do a complete repair (There was a
file in /lost+found with the name " /etc/something"  which I couldn't
get rid of.  This was a file, not a subidirectory or anything.)  I decided
to back up everything, low-level format my drive and make a linux partition.
After repartitioning my hard drive, I discovered my backup tape was 
unreadable.  At that point I made a decision.  Since I was going to 
have to start over I decided to start over with linux.  I installed
version 0.12 and decided to try my hand at kernel hacking.  I wrote a
buggy version of ptrace which Linus fixed and included in the kernel
(Actually first he included it, then he fixed it.)  By this time I was
tired of switching to DOS everytime I wanted to use telnet or ftp, so I
grabbed the 386bsd source (or is it bsd386) and copied the wd8003 driver.
Since It had to be rewritten to work with Linux and I had no clue what
it was doing, I introduced many bugs, but it worked well enough to telnet
and ftp out using ka9q, so I uploaded it to tsx and posted something to
the net.
	After a while I decided I wanted real networking code, and
after my experience with Esix bsd compatible sockets were the way to
go.  About this time Zorst was just completing the port of X and
needed some sort of socket library.  He wrote the Unix domain sockets
leaving hooks to included other types of sockets later.  Which made it
unnecessary for me to worry about the kernel/user interface.  After
serveral hectic months where I moved in with my SO, lost my internect
connection and most of the reason for writting the networking code, I
finally had something that would let me connect to and from a pc
running Clarkson's telnet.  I managed to get minamal versions of ftp
and telnet to compile and released the first alpha version of the
networking code.  (The code was all written from scrach by me with out
looking at the bsd code.)  The things like assuming all ethernet
boards are memory mapped was because mine was and I assumed that was
the cheapest/simplest way.  The ethernet board is not it's own device
because that would have required debugging code that was not
completely necessary.
	The first message I recieved about the code was how it had caused
the loss of someones hard drive (I've forgotten who, but It was one of
the testers who really deserves mentioning.)  After 3 or 4 releases with
some patches posted to the net channel in between, I began to get the
first glimmering of successes from Dirk Hondel (sp?)  who was probably
the most important of the testers.  He provided alot of debugging output
and probably risked his file system more than once.  About this time
Mitch Dsouza(sp?)  began to complain that he couldn't even get the 
patches to compile.  After a lot of working (and atleast another release
or 2)  it worked (sort of) on his machine and many others.  At this
point Bob Harris started fixing the wd8003 driver (which had suffered
from my port from 386bsd).  And Russ Nelson at cymwr software began
to tell me how other cards worked, and some of what was wrong with
my design.  Bob Harris also wrote an icmp echo routine so you could
ping your linux machine. 
	 At this point 0.8.0 was released and I descovered the need
for slow start (remeber, I've never been able to test my code on the
internet, I've always had to leave that to others.)  Not too long after that
0.8.1 was released and my advisor discovered I hadn't gone away for the
summer.  (Fortuneatly I had been thinking about math enough that he wasn't
too upset with my progress.)  0.8.1 was included in the kernel, but none
of the support code (mostly config.c) went with it.  The rest is mostly
just bug fixes and such released with every new version. 

(Thank you Ross and a big hand from everybody for his efforts)

Now an important hint, the config file from 0.8.0 isn't 'good' so please
recompile the source 'config.c' from the 0.8.1 distribution and you should
find that the protocol not supported message will evapourate.

v)	The files that you should have and setup info
	---------------------------------------------

Ok i'll stop blethering and start talking about hard fact files that you
should have and where they are supposed to be.

the 0.8.0/0.8.1 suites have reasonable enough documentation to get the
various working parts out into somewhere useful on your system, typically
/usr/etc/inet and /etc

having followed the net install shell script you'll probably find that it
asked some questions that you hadn't a clue about,... well ok lets look at
it.
 

	Enter Ip Address for (your host) (aaa.bbb.ccc.ddd)

here you are being asked what network address you would like to be known
as. Ip address are unique numbers so as to identify you machine from 
another on a multiuser network. Normally if you reside in the Internet you
will have a network address assigned by the NIC or your local network
controller and you really must stick to it there is no room for you to
bugger up the network by using someone elses ip address. If you do not
have a connection to the Internet, you will have less of a problem although
it would still be a good idea to apply for a internet class c/d network
number depending on your setup.
	Ip numbers are typically of the 0-255.0-255.0-255.0-255 range
so valid answers are 243.123.4.23 or 192.35.173.3 etc but 324.234.545.2
is completely wrong.

	Enter Net Address for (your hostname) (aaa.bbb.ccc.0)

Here you are being asked for your subnetwork address. This requires a
bit of explaination. Subnets are a 'unit' of connectivity which
depict how many possible hosts 'live' on the same piece of cable as you
do (typically this never exceeds 253 on one piece on cable)
a quick way of getting the question right is to type in whatever you 
have for your ip address but make the last number 0 eg if my ip address
was 135.56.33.155, my 'safe' Net address would be 135.56.33.0
0.0.0.0 means the whole world and is probably what slip people shoul use.

	Enter Router Address for (your hostname) (aaa.bbb.ccc.ddd)

Wibble! Ok here what is being asked is if you have a gateway machine
through which ip traffic can be passed to the great blue yonder. We 
are sneekily getting the routeing machine to do some hard work for us.
Routers tend to have 2 ethernet boards in them whith differing network
numbers for them so that they can 'bridge' between different numbered
networks, eg you could not talk directly to a ip address of 192.35.173.12
from an ip address of 192.35.175.15 but a machine in the middle with
two ip address 192,35.173.4 and 192.35.175.3 can 'collect' the data from
the xxx.xxx.173.xxx network and transfer it to the xxx.xxx.175.xxx network
All we have to do here is stick in the ip address of the local router
in this case it would be 192.35.173.4 (clear as mud I know but it's as good
as it gets) If you don't have a router,... just stick in 0.0.0.0 meaning
don't route anything.

	Enter Domain name for (your host)

This isn't too bad, domain names are 'convenient' labels eg uwe.ac.uk
is the domain name that appends to all the machines on site so that a sun
called csd would be known as csd.uwe.ac.uk This is so that you don't have 
to know the full ip number of the host, it's more convient to call out
a semi inteligable name eg 192.35.175.1 = csd.uwe.ac.uk but the 192.35.175
is aliased to uwe.ac.uk (University in the West of England, academic
community, United Kingdom) Again this should be given to you with a 
registered ip address but for now you could put in 'at.linux.net' it can
be changed later.

	Name Server for Domain (aaa.bbb.ccc.ddd)

If your networked to the local Uni/technical collage your in luck and it
shoul be able to serve you with a name server service, find out from your
local network controller what machine distributes the service. If you are
unlucky enough NOT to have a nameserver, just stick in your own IP address,
you'll just have to run your own nameserver.

Ok time for a quick check of what you *SHOULD* have
in /usr/etc/inet

config		- This sets up the ethernet ip tables
inetd		- Daemon process that invokes other network daemons
inetd.conf	- Configuration file for inetd about the other daemons
install.net	- The semi automatic script I just talked about
named-xfer	- Used for updating the nameserver records
named.reload	- used to load in the named
named.restart	- user to stop and restart the named process
rc.net		- a network rc file called from /etc/rc.local from /etc/rc!
services	- a file specifying what 'port' numbers certain services are 
		  available on
telnetd		- daemon for connecting reqesting external sites to your 
		  machine for interactive logins
named		- the nameservice daemon

time for some explainations I think,...
config is a general do it all fix your ether board to your local setup
command. It was configured when you ran the install.net script and if you
look at the rc.net file you'll see where it plugged in all the IP stuff that
you fed the script with,... a bit technical but otherwise nothing to worry
too much about provide that your original information was correct. One thing
though, I have found that it is best to edit the rc.net file and 'hard wire'
the ip addresses directly in rather than relying on the grep search from
/etc/hosts but you may disagree (personal preferance) it's the only time that
/etc/hosts is actually used as far as I can tell.

*** stop press ***
Ross: That's a bug. It should be used if /usr/etc/inet/resolv.conf is missing
or there is no named running on the machines refered to by resolv.conf.
However,
it is low on my list of priorities, and probably will not be fixed (by me) any
time soon.

	'inetd' is a daemon process that wait's for certain events to happen
upon which it will select which process to run eg if no network is happening,
only inetd will be running but if a telnet session is requested by a remote
machine, inetd will start running telnetd for that incoming call to connect
to.
	Of much more intrest is inetd.conf which has information about what
services to run and where to find them
example

sevice name	ip/tcp/udp		run as				name
|		|			|				|
|	format	|	wait/nowait	|	program to run          |
|       |       |       |               |       |                       |
|	|	|	|		|	|			|
telnet	stream	tcp	nowait		root	/usr/etc/inet/tenetd	telnetd
talk	dgram	udp	wait		root	/usr/etc/inet/talkd	talkd
echo	dgram	tcp	nowait		root	internal

most utilities will tell you what should be included in here should it require
editing for to make them run.

	Services is a file which informs the tcp/ip code what port number
a particular program will run on for example if you telnetted to port 7 on
a sun you would be connected to an echo service which would send
back a carbon copy of what you typed in but that service has a specially
allocated port number referenced in the /etc/services file of both machines

There is a complete standardized services file in circulation from Ross Biro
and is included here for your sanity

Ross: This is the one I made from the relevant rfc.  It has some typos
and such here, but it is probably ok for most use.

tcpmux		1/tcp 		# TCP Port Service Multiplexer
rje		5/tcp		# remote job entry
echo		7/tcp
echo		7/udp
discard		9/tcp		sink null
discard		9/udp		sink null
systat          11/udp          users
systat		11/tcp		users
daytime         13/udp
daytime		13/tcp
daytime		13/udp
netstat         15/udp
netstat		15/tcp
qotd            17/udp          quote
quote		17/tcp		# quote of the day
chargen		19/tcp		ttytst source
chargen		19/udp		ttytst source
ftp-data	20/tcp
ftp		21/tcp
telnet		23/tcp
smtp		25/tcp		mail #Simple Mail Transfer
nsw-fe		27/tcp		# NSW User System FE [24, RHT]
msg-icp		29/tcp		# MSG ICP [85, RHT]
msg-auth	31/tcp		# msg authentication
dsp		33/tcp		# display support protocol
lp		35/tcp		# any private printer server [JBP]
time            37/udp          timserver
time		37/tcp	        timerserver	# time
rlp             39/udp          resource
rlp		39/tcp		# resource location protocl
graphics	41/tcp		# Graphics
name		42/tcp		nameserver
name		42/udp		nameserver
whois           43/udp          nicname
whois		43/tcp		nicname
mpm-flags	44/tcp
mpm		45/tcp
mpm-snd		46/tcp
ni-ftp		47/tcp
log		49/tcp		#login host protocol
la-maint	51/tcp		# imp local address maintenance
nameserver	53/tcp          domain
nameserver	53/udp          domain
isi-gl		55/tcp		# isi graphics language
apts		57/tcp		# private terminal access
apfs		59/tcp		# private file services
ni-mail		61/tcp		# ni mail [5, SK8]
via-ftp		63/tcp		# VIA Systems - ftp
tacacs-ds	65/tcp		# tacacs-database service
bootps          67/udp          bootp
bootps		67/tcp		# bootstrap protocol server
bootpc          68/udp
bootpc		68/tcp		# bootstrap client
tftp            69/udp
tftp		69/tcp		# trivial file transfer
netrjs-1	71/tcp		# remote job service
netrjs-2	72/tcp		# " "
netrjs-3	73/tcp		# ""
netrjs-4	74/tcp		# ""
priv-dial	75/tcp		# private dial out services
rje		77/tcp	        netrjs  # any private rje service
finger		79/tcp
hosts2-ns	81/tcp          hosts2	#  hosts2 name server
mit-ml-dev	83/tcp		# MIT ML Device [DPR]
mit-ml-dev	85/tcp		# ditto
link		87/tcp          ttylink	# private terminal link
su-mit-tg	89/tcp		# su/mit telnet gateway
mit-dov		91/tcp		# mit dover spooler
dcp		93/tcp		# device control protocl
supdup		95/tcp		# supdup [27, MRC]
swift-rvf	97/tcp		# swift remote virtual file protocol
tacnews		98/tcp		# tac news
metagram	99/tcp		# metagram relay
newacct		100/tcp		# unauthorized use
hostnames	101/tcp	        hostname	# nic host name server
iso-tsap	102/tcp         tsap	# [16, MTR]
x400		103/tcp
x400-snd	104/tcp
csnet-ns	105/tcp		# csnet mailbox name nameserver
rtelnet		107/tcp		# remote telnet service
pop2		109/tcp         pop postoffice	# post office protocol version 2
pop3		110/tcp		# post office protocol version 3
sunrpc          111/udp
sunrpc		111/tcp		# SUN remote procedure call
auth		113/tcp	        authentication	# authentication service
sftp		115/tcp		# simple file transfer protocol
uucp-path	117/tcp		# uucp path service
nntp		119/tcp		# network news transfer protocol
erpc            121/udp
erpc		121/tcp		# encore Epedited remote proc. call
ntp             123/udp
ntp		123/tcp		# network time protocol
locus-map	125/tcp		# locus pc-interface net map server
locus-con	127/tcp		# locus PC-interface CONN server
pwdgen		129/tcp		# password generator protocol
cisco-fna	130/tcp		# cisco FNATIVE [WX8]
cisco-tna	131/tcp		# CISCO TNATIVE
cisco-sysmaint	132/tcp		# CISCO sysmaint
statsrv         133/udp
statsrv		133/tcp		# statistics service
ingres-net	134/tcp		# ingres-net
loc-srv		135/tcp		# location services
profile         136/udp
profile		136/tcp		# profile naming service
netbios-ns	137/tcp		# netbios name service [JBP]
netbios-dgm	138/tcp		# netbios datagram service
netbios-ssn	139/tcp		# netbios session service
emfis-data	140/tcp		# emfis Data Service [GB7]
emfis-cntl	141/tcp		# emfis control service
bl-dim		142/tcp		# britton-lee idm
imap2		143/tcp		# interim mail access protocol v2
NeWS		144/tcp         news
uaac		145/tcp		# uaac protocl [DAG4]
iso-tp0		146/tcp	        iso-ip0
is0-ip		147/tcp		# [MTR]
cronus		148/tcp		# [135, JXB]
aed-512		149/tcp		# aed 512 emulation service
sql-net		150/tcp
hems		151/tcp
bftp		152/tcp		# background file transfer program
sgmp		153/tcp		# sgmp
netsc-prod	154/tcp		# [SH37]
netsc-dev	155/tcp		#
sqlsrv		156/tcp
knet-cmp	157/tcp		# knet/vm command message protocol
pcmail-srv	158/tcp		# pcmail server
nss-routing	159/tcp
sgmp-traps	160/tcp
snmp            161/udp
snmp		161/tcp
snmp-trap       162/udp
snmptrap	162/tcp
cmip-manage	163/tcp		# cmip/tcp manager
cmip-agent	164/tcp
xns-courier	165/tcp		# Xerox
s-net		166/tcp		# Sirius Systems
namp		167/tcp
rsvd		168/tcp
send		169/tcp
print-srv	170/tcp		# network postscript
multiplex	171/tcp		# network innovations multiplex
cl/1		172/tcp
xyplex-mux	173/tcp
mailq		174/tcp
vmnet		175/tcp
genrad-mux	176/tcp
xdmcp		177/tcp		# X dispaly manager control protocol
nextstep	178/tcp
bgp		179/tcp		# Border Gateway Protocol
ris		180/tcp		# Intergraph
unify		181/tcp
unisys-cam	182/tcp
ocbinder	183/tcp
ocserver	184/tcp
remote-kis	185/tcp
kis		186/tcp		# KIS protocol
aci		187/tcp
mumps		188/tcp
qft		189/tcp		# queued file transport [WXS]
gacp		190/tcp		# gateway access control protocol
prospero	191/tcp
osu-nms		192/tcp		# osu network monitoring protocol
irq		194/tcp		# internat relay chat
dn6-nlm-aud	195/tcp		# DNSIX Network Level Module Audit
dn6-smm-red	196/tcp
dls		197/tcp
dls-mon		198/tcp
at-rtmp         201/udp
at-rmtp		201/tcp		# AppleTalk Routing Maintenance
at-nbp          202/udp
at-nbp		202/tcp		# AppleTalk Name Binding
at-3            203/udp
at-3		203/tcp		# AppleTalk Unused
at-echo         204/udp
at-echo		204/tcp		# appletalk echo
at-5            205/udp
at-5		205/tcp		# appletalk Unused
at-zis          206/udp
at-zis		206/tcp		# zone info.
at-7            207/udp
at-7		207/tcp
at-8            208/udp
at-8		208/tcp
sur-meas	243/tcp		# survey measurment
dsp3270		245/tcp		# display systems protocol
link		245/tcp		# link
biff            512/udp         # used by mail system to notify users
exec		512/tcp
who             513/udp         # maintains data bases showing who's
login		513/tcp
syslog          514/udp
cmd		514/tcp
syslog		514/udp
printer		515/tcp		# spooler
talk		517/udp
ntalk           518/udp
utime           519/udp         unixtime
router          520/udp         #local routing process (on site);
efs		520/tcp		# extended file name server
timed           525/udp         #timeserver
tempo		526/tcp		# newdate
courier		530/tcp	        rpc
conference	531/tcp	        chat
netnews		532/tcp 	readnews
netwall         533/udp         #for emergency broadcasts
uucp		540/tcp 	uucpd
klogin		543/tcp
kshell		544/tcp		krcmd
new-rwho        550/udp         new-who
dsf		555/tcp
remotefs	556/tcp		# rfs server
rmonitor        560/udp         rmonitord
monitor         561/udp
chshell		562/tcp		chcmd
meter		570/tcp		demon
meter           571/udp         udemon
pcserver	600/tcp		# sun IPC server
nqs		607/tcp
mdqs		666/tcp
elcsd           704/udp 	errlog # copy/server daemon
loadav          750/udp
rfile		750/tcp
pump		751/tcp
qrh		752/tcp
rrh		753/tcp
tell		754/tcp		send
nlogin		758/tcp
con		759/tcp
ns		760/tcp
rxe		761/tcp
quotad		762/tcp
cycleserv	763/tcp
omserv		764/tcp
webster		765/tcp
phonebook	767/tcp		phone
vid             769/udp
vid		769/tcp
cadlock         770/udp
rtip		771/tcp
cycleserv2	772/tcp
notify          773/udp
submit		773/tcp
acmaint_dbd     774/udp
rpasswd		774/tcp
acmaint_transd  775/udp
entomb		775/tcp
wpages          776/udp
wpages		776/tcp
wpgs		780/tcp
mdbs_daemon	800/tcp
device		801/tcp
maitrd		997/tcp
puparp          998/udp
busboy		998/tcp
puprouter       999/udp		applix
garcon		999/tcp
cadlock         1000/udp
blackjack	1025/tcp 	#network blackjack
 hermes          1248/udp
bbn-mmc		1347/tcp	#multi-media conferencing
bbn-mmx		1348/tcp	# ""
ingreslock	1524/tcp
orasrv		1525/tcp 	oracle
issd            1600/tcp
nkd             1650/tcp
dc              2001/tcp
wizard          2001/udp       curry
globe           2002/udp
emce            2004/udp       CCWS mm conf
mailbox         2004/tcp
berknet         2005/tcp
oracle          2005/udp
invokator       2006/tcp
raid-cc         2006/udp       raid
dectalk         2007/tcp
raid-am         2007/udp
conf            2008/tcp
terminaldb      2008/udp
news            2009/tcp
whosockami      2009/udp
pipe_server     2010/udp
search          2010/tcp
raid-cc         2011/tcp       raid
servserv        2011/udp
raid-ac         2012/udp
ttyinfo         2012/tcp
raid-am         2013/tcp
raid-cd         2013/udp
raid-sf         2014/udp
troff           2014/tcp
cypress         2015/tcp
raid-cs         2015/udp
bootserver      2016/udp
bootclient      2017/udp
cypress-stat    2017/tcp
rellpack        2018/udp
terminaldb      2018/tcp
about           2019/udp
whosockami      2019/tcp
xinupageserver  2020/udp
servexec        2021/tcp
xinuexpansion1  2021/udp
down            2022/tcp
xinuexpansion2  2022/udp
xinuexpansion3  2023/udp
xinuexpansion4  2024/udp
ellpack         2025/tcp
xribs           2025/udp
scrabble        2026/udp
shadowserver    2027/tcp
submitserver    2028/tcp
device2         2030/tcp
blackboard      2032/tcp
glogger         2033/tcp
scoremgr        2034/tcp
imsldoc         2035/tcp
objectmanager   2038/tcp
lam             2040/tcp
interbase       2041/tcp
isis            2042/tcp
isis            2042/udp
isis-bcast      2043/udp
rimsl           2044/tcp
rimsl           2044/udp
cdfunc          2045/udp
sdfunc          2046/udp
dls             2047/tcp
dls             2047/udp
dls-monitor     2048/tcp
shilp           2049/tcp
shilp           2049/udp
NSWS            3049/tcp
rfa             4672/tcp       # remote file access server
commplex-main   5000/tcp
commplex-link   5001/tcp
rmonitor_secure 5145/udp
padl2sim        5236/tcp
xdsxdm          6558/udp
man             9535/tcp
isode-dua       17007/udp



vi)	Name Service concepts and what /etc/hosts is about
	--------------------------------------------------

The internet protocol document defines names, addresses and routes as follows:

	A name indicates what we seek. An address indicates where it is.
	A route indicates how to get there.

Every network interface attached to a tcp/ip network is identified by a 
unique 32-bit IP address. A name (hostname) can be assigned to any device that
has an IP address. Names are assigned to devices because, compared to numeric
Internet addresses, names are easier to remember and type correctly. In use,
most of the tcp/ip software on linux can interchangeably use name or ip 
address but whichever is chosen, it is always the IP address that is used
to make connections. Translating names into addressses isn't simply a 'local'
issue. The command telnet on.a.linux.net is expected to work correctly on 
every host that is connected to the network. If the machine is connected to
the Internet, hosts all over the world should be able to translate the
name into a valid IP address, therefore, some facility must exist on the net
for to translate te name into the numeric IP address.
	There are two methods for doing this,... one involves using a local
lookup table (/etc/hosts) and the other uses DNS to remotely interigate the
network for the IP address.
	/etc/hosts is a very simple file which contains a numeric IP address
followed by a hostname eg

	# note that the hash is a comment, no text is processed after
	# it until the next <cr>
	#
	123.45.67.20	csd	csdsun	csd.uwe.ac.uk	csdsun.ac.uk
	123.45.67.21	manic	manic.uwe.ac.uk	# Tom's machine
	123.45.67.22	chef	chef.uwe.ac.uk	# Main waste of money
	# other nets
	192.35.173.1	hal	hal-9000	# local hidden host
	192.35.173.2	slave	slave.uwe.ac.uk	# linux engine 485 25
	192.35.173.30	zen	zen.uwe.ac.uk	# Interactive 2.2.1 386 33
	192.35.173.35	thing
	# external nets
	162.34.32.22	weird.emer.cty.oz

but clearly this has a limitation in that on large networks ALL machines would
have to have this information on disk and that could have 1000's of entries
Just think what that means if an extra 120 machines were added! 1000's of
machines would have to have their /etc/hosts table updated either by hand or
automatic shell scripts calling the list from a main machine,... (see where
this is leading?) Enter the DNS service...
	DNS (Domain Name System) scales well. It doesn't rely on a single large 
table; it is a distributed database system that doesn't bog down as the 
database grows. DNS currently provides information on approximately 700,000
hosts. DNS also guarentees thst the new host information will be disseminated 
to the rest of the network as it is needed.


vii)	DNS nameserver configuration files and how to fix them
	------------------------------------------------------

DNS configuration reqires that a numbet of files be editted
in the case of Linux these files are minimally
(resolv.conf can be optional)
	/usr/etc/inet/
		resolv.conf
	or
		named.boot
		a_hosts_table (normally called named.hosts)

named.boot:	domain	uwe.ac.uk
		primary	uwe.ac.uk	/usr/etc/inet/a_hosts_table

resolve.conf:	domain		uwe.ac.uk
		nameserver	192.35.173.2

a_hosts_table:	@	IN	SOA	slave.uwe.ac.uk. root.slave.uwe.ac.uk. (
				1.1	;serial
				3600	;refresh every 10 hours
				300	;retry every 6 minutes
				36000000;expire after 1000 hours
				3600	; default dtl is 100 hous )
			IN	NS	slave.uwe.ac.uk.
		slave	IN	A	192.35.173.2
		hal 	IN	A	192.35.173.1
		zen	IN	A	192.35.173.30
		.
		.
		.
		mother	IN	A	192.35.173.69


For most people, a nameserver will be available in which case the only file
really needed is resolv.conf which would contain only the domain name of the
site and a nameserver ip address to point to all the named functions are thus
the responsibility of the nameserver and not your machine (crafty huh?)
	Now unfortunately there are those of us that were just plain born
unlucky and had to RTFM so,... where a nameserver is not available it is
possible to run a nameserver service on your local machine.
	The following is a list of flies that you will eventually need
although just named.boot and a_hosts_table will suffice

	named.boot:	Sets general named parameters and points to the
			sources of the domain database information used
			by this server. The sources can be local disks or
			remote servers.
	named.ca:	Points to the root domain servers
	named.local:	Used to locally resolve the loopback address
	named.hosts:	The zone info file that maps host names to IP addresses
	named.rev:	the zone file for the reverse domain that maps IP 
			addresses to host names (you'll prob never touch it
			so i'm going to skip it's description unless people
			get upset enough to lynch me)


*** STOP PRESS ***

	I've just found out from Ross by sheer accident that there is a 
program release in comp.sources.unix (volume25) called hostcvt (mutter mutter)
which is supposidly capable of converting /etc/host entried into the nesessary
corrisponding named files. I just pulled it down and it looks quite good
although 'out of the box' you'll have to #define R_OK 4 in main.c and fix the
bindir/mandir in the makefile. I've NOT run it cos I did all my configuration
by hand so I'm too stubborn to let a meer machine do the job I did over 2 day's
in 5 seconds. (ah that pride of mine). I know that there have been two
patchlevels release but I only added patch1 cos it's a hassle for me to get to
the internet (me being on x25 prtocol based JANET). As /etc/hosts file's are
amazingly easy to generate this is a handy tool to have and I hope to see it
included in the next tcp/ip util kit-bag.

*** RESUME PRESS ***

named.boot
----------
	the named.boot file points to sources of DNS information. Some of these
sources are local files; others are remote servers. You only need to create the
files referanced in the primary and the cache statements.

commands	|	functions
----------------+--------------------------------------------------------------
directory	|	Defines a directory for all subsequent file referances
primary		|	Declares this server as primary for the specified zone
secondary	|	Declares this server as secondary for the specified zone
cache		|	Points to the cashe file
forwarders	|	Lists servers to which queries are forwarded
slave		|	Forces the server to only use the Forwarders
----------------^--------------------------------------------------------------

example setups

named.boot:
	; cache only server
	;
	primary	0.0.127.IN-ADDR.ARPA	/usr/etc/inet/named.local
	cache	.			/usr/etc/inet/named.ca

The loopback domain is an in-addr.arpa domain that maps the address 127.0.0.1
to the name localhost. The idea of resolving your own loopback address makes
sense to most people, so most named.boot files contain this entry.

named.boot:
	; Primary name server boot
	;
	directory				/usr/etc/inet
	primary		big.cty.com		named.hosts
	primary		54.152.IN-ADDR.ARPA	named.rev
	primary		0.0.127.IN-ADDR-ARPA	named.local
	cache		.			named.ca

the directory statement tells named that all subsequent filenames are relative
to the /usr/etc/inet directory. The first primary statement declares that this
is the primary server for the big.cty.com domain and that the data for that 
domain is loaded from the file named.hosts. The second primary statement points
to the file that maps IP addresses from 152.54.xxx.xxx to hostnames. This
statement says that the local server is the primary server for the reverse
domain 54.152.in-addr.arpa and that the data for the domain can be loaded from
the file named.rev

Standard Resource Records
-------------------------


Resource Record		Record type	function
-----------------------------------------------------------------------------
Start of authority	SOA		Mark the beginning of a zone's data,
					and define parameters that affect the
					entire zone
Name server		NS		Identifies a domain's name server
Address			A		Converts a host name to an address
Pointer			PT		Converts an address to a hostname
Mail Exchange		MX		Identifies where to deliver mail for a
					given domain name
Canonical name		CNAME		Defines an alias host name
Host information	HINFO		describes a hosts hardware and OS
Well Known Service	WKS		Advertises network services
------------------------------------------------------------------------------

These resourse records are defined in RFC 1033.
The format of DNS resourse records is:
	[name] [ttl] IN	type data

	name:	This is the name of the domain object the resource record
		references. It can be an individual host or an entire domain
	ttl:	time-to-live defines the length of time in seconds that the
		information in this resource record should be kept in the
		cache. Usually this field is left blank and the default ttl
		set in the SOA is used.
	IN:	Identifies the record as an internet DNS resource record. There
		are other classes of records, but they are not used by the DNS
	type:	Identifies what kind of resourse record this is
	data:	the information specific to this type of resourse record


The cache Initialization file
-----------------------------

The basic named.ca file contains NS records that name the root servers and
'A' records tha provide the addresses of the root servers. A basic named.ca
is shown here

	named.ca:
		; named.ca - typical setup
		;
		; Servers for the root domain
		;
		99999999	IN	NS	tsx-11.mit.edu.
		99999999	IN	NS	nic.funet.fi.
		;
		; Root servers by addresses
		;
		tsx-11.mit.edu.	99999999	IN	A	231.232.21.12
		nic.funet.fi.	99999999	IN	A	123.45.67.32

note that the ttl is 99999999 the largest possible size so that the root
servers are never removed from the cache


The named.local file
--------------------

The named.local file is used to convert the address 127.0.0.1 (the loopback
address) into the name localhost. It's the zone file for the reverse domain 
0.0.127.in-addr.arpa. because ALL systems use 127.0.0.1 as the loopback
address, this file is virtually identical on every server.

	named.local:
		@	IN 	SOA	slave.uwe.ac.uk. root.slave.uwe.ac.uk. (
					1	;	serial
					36000	;	refresh every 10 hrs
					3600	;	retry after 1 hr
					3600000	;	expire after 1000 hrs
					36000	;	default ttl is 10 hrs
					)
			IN	NS	slave.uwe.ac.uk.
		1	IN	PTR	localhost.



The named.hosts file
--------------------

The named.hosts file contains most of the domain information. This file
converts
host names to IP addresses, so 'A' records predominate, but it also contains
'MX', CNAME and other records. 

	; named.hosts file example
	;
	@	IN 	SOA	slave.uwe.ac.uk.	probs.slave.uwe.ac.uk. (
				1	;	serial
				36000	;	refresh every X seconds
				3600	;	retry every X seconds
				3600000	;	expire after X seconds
				36000	;	default time to live X seconds
				)
	; define nameservers and mailservers
		IN	NS	slave.uwe.ac.uk.
		IN	MX	csd.uwe.ac.uk.
	;
	; define localhost
	;
	localhost	IN	A	127.0.0.1
	;
	;hosts in this zone
	;
	loghost		IN	A	192.35.173.1
	hal		IN	A	192.35.173.1
	zen		IN	A	192.35.173.30
	thing		IN	A	192.35.173.35
	slave		IN	A	192.35.173.2
			IN	MX	2	192.35.173.2
	servent		IN	CNAME	slave.uwe.ac.uk.
	mother		IN	A	192.35.173.69
	;
	; outside domains now follow
	;	
	csd		IN	A	192.35.175.1
			IN	MX	5	192.35.175.1
	csdsun		IN	CNAME	csd.uwe.ac.uk.
	chef		IN	A	192.35.176.1
	;
	;fictional outside gateway
	midway		IN	A	166.23.44.2
	;
	; etc until you have built a reasonable host table
	; that you feel will be adaquate for your network



vii)	NFS - the network filing system
	-------------------------------

Network filing systems are convenient mechinisms which allow your machine
axcess to more disk space that it actually has by 'borrowing' disk space
from another networked machine for either sharing of common data or if allowed,
the storing of data generated by your machine.
	NFS is still in alpha testing and has the unfortunate handicap of not
being able to run binaries over the interface due to mmap support not being
available at the moment but shell scripts can be run.
	NFS has several benifits,

	1)	it reduces local disk storage requirements because
		a network can store a single copy of a directory, while
		the directory continues to be fully axcessible to everyone
		on the network.
	2)	NFS simplifies central support tasks, becaue files can be
		updated centrally, yet be available throughout the network
	3)	NFS allows users to use familiar UNiX commands to manipulate
		files with rather than learning new ones. There is no need
		to use rcp/tftp/ftp to copy files, just 'cp' will do

NFS is controlled by several files

	/etc/exports
	/usr/etc/inet/rc.net
	

The /etc/exports file
---------------------

/etc/exports allows your machine to decide what local filesystems it will
allow remote clients to NFS mount and decide what access those clients
should have to your filespace.
	Example (I just love examples):
	/etc/exports allows your machine to decide what local filesystems it will allow
remote clients to NFS mount and decide what access those clients
should have to your filespace.
	Example (I just love examples):

	/	-access=slave:moonbeam
	/usr	-ro
	/home	-root=slave:csdsun,-access=slave,csdsun

--------v---------------------------------------------------------------
flag	|	function
--------+---------------------------------------------------------------
ro	|	read only, if this is not specified, the directory is mounted
	|	as read/write.
rw	|	read and write, used to explicitly show that the FS is read
	|	and write
root	|	normally root cannot use root privillages on an NFS FS as that
	|	id is untrusted, :. you would not be able to make a root owned
	|	shell. Unless the root option is used, a UID of 0 translates 
	|	to 65536
access	|	list of hosts who may mount the specified filesystem
--------^---------------------------------------------------------------


The /usr/etc/inet/rc.net file
-----------------------------

This rc file is used to start the named services and nfs
the suggested setup is as follows:
	
	.
	.
	.
	if [ -f /etc/portmap ]
	then
        	echo "Starting portmapper..."
        	/etc/portmap
		echo "Starting nfsd..."
		/etc/nfsd
		echo "Starting mountd...."
		/etc/mountd
		echo
		mount -vt nfs fish:/pub /pub &
		mount -vt nfs sparky:/mnt/a /test &
	fi

Here if the portmapper isn't running it is started. Once started, it is now
possible to hang the nfsd daemon on it as well as the mountd daemon.
The two mount commands are from the modified mount command that come
with the NFS package and both are run in the background so that if one
of the servers were unreachable the system would continue to try while
going on to finish the system setup and allow root/users to login.
The '-vt nfs' bit isn't nessessary as the mount program understands the nfs
syntax and mounts it as an nfs system but I include it anyway.


==============================================================================

Touble shooting
---------------


One of the most common complaints requards the config command
what isn't often noted is that this has to be recompiled from the 0.8.1
sources (available currently on tsx-11.mit.edu: as 
/pub/linux/ALPHA/tcpip/tcpip-0.8.1.tar.Z). Another problem that crops up is
that some binaries that are distributed requires libc.2.2.2 to be present
(mine I've no idea what version/wher it came from but it's 173060 bytes long if
it helps!)
	Other people think that it's their version of libraries that casue the
problem but can't find the source code for the various utils to recompile.
Well sorry folks you are out of luck, the source code for those utils like ftpd
and inetd are jealously held back because they are buggy and full of ugly hacks
so rather than have the net flooded with complaints, they have been compiled
into binary form and shoved out the door with innocent looks about them. Of
note are inetd and named from the BSD sources, someone needs to port them as
the current ones are erm.. well not really inetd/named. A new telnetd will
probably be available after the kernel pty's are fixed which looks as though
it'll break a lot of ioctl code.


Several things that can help

	1)	upgrade your kernel to the latest one that you can grab 
		a copy of (currently at time of writting 0.98.4)
	2)	join the NET mail channel, you can learn an awful lot
		from the guys on this channel (like the various new
		copyrighted techniques for tearing out your hair)
	3)	try and upgrade your C compiler and libraries to at least
		version 2.2.2d7
	4)	binary distributions of various network probrams can be
		found on sunsite.unc.edu,.. always read the README files
		they are there for a reason! (personal show/contacts/etc..)
	5)	Depending on your type of problem, contacting the author
		of the software or the person who ported the software would
		be a better choice.
	6)	Complain bitterly to me if I haven't covered your problem 
		and I'll get it sorted for the next FAQ


Cast of this production
-----------------------

Ross Biro	-	Without whom all this wouldn't be possible
			and who pointed out holes in my documentation.
			Also contributed the history of tcp/ip on linux
			after he saw my rather perverted view of it.

Mitch DSouza	-	Constant alpha tester. Also pointed out mistakes
			and made critical and helpfull suggestions (like
			getting a spell checker). Also gave me his Tel No.
			which I used to annoy him with.

Rick Sladkey	-	The current Author of the NFS client server code
			who with the help of Doug Quale repatched the
			kernel to support networking filesystems.

The pioneers	-	Mentioned in the history of TCP/IP 0.8.[01] by
			Ross earlier in this FAQ

The supporting	-	You know who you are (probably, depending on how
extras			much virtual beer you had last night) for contributing
			to the network code.

Linus Torvolds	-	The elusive ecentric UNiX kernel coder who probably
			burns more CPU time on compiling than anyone else
			Here's to a long and healthy kernel development
			program and a Nobel equiv award for his efforts.

Myself		-	The only sad person to take on the FAQ because I was
			getting annoyed at the number of 'petty' tcp/ip code
			problems being asked on the net. Besides of which I
			wanted to give something useful towards Linux which
			I've used since 0.10 (does this make me a vetrian?)

                                                        
Phil	(The non spell checking insomniacial/palagerist who never learnt
=--=	 english grammer)


p_copela@uk.ac.uwe.csd on JANET in the UK and p_copela@csd.uwe.ac.uk elsewhere







-- 

===============================================================================
  (c) 1992 Philip Copeland - alias 'Bryce'                    (SysAdmin)
  JANET      : p_copela@uk.ac.bristol-poly.csd

                                  "... I can resist anything but temptation..."
-------------------------------------------------------------------------------
Newsgroups: comp.os.linux