For Britta
Subnetting is not only an organizational benefit, it is frequently a natural consequence of hardware boundaries. The viewpoint of a host on a given physical network, such as an Ethernet, is a very limited one: the only hosts it is able to talk to directly are those of the network it is on. All other hosts can be accessed only through so-called gateways. A gateway is a host that is connected to two or more physical networks simultaneously and is configured to switch packets between them.
For IP to be able to easily recognize if a host is on a local physical network, different physical networks have to belong to different IP networks. For example the network number 149.76.4.0 is reserved for hosts on the mathematics LAN. When sending a datagram to quark, the network software on erdos immediately sees from the IP address, 149.76.12.4, that the destination host is on a different physical network, and therefore can be reached only through a gateway (sophus by default).
sophus itself is connected to two distinct subnets: the Mathematics Department, and the campus backbone. It accesses each through a different interface, eth0 and fddi0, respectively. Now, what IP address do we assign it? Should we give it one on subnet 149.76.1.0, or on 149.76.4.0?
The answer is: both. When talking to a host on the Maths LAN, sophus should use an IP address of 149.76.4.1, and when talking to a host on the backbone, it should use 149.76.1.4.
Thus, a gateway is assigned one IP address per network it is on. These addresses --- along with the corresponding netmask --- are tied to the interface the subnet is accessed through. Thus, the mapping of interfaces and addresses for sophus would look like this:
The last entry describes the loopback interface lo, which was introduced above.
Figure #introfigip#93> shows a part of the network topology at Groucho Marx University (GMU). Hosts that are on two subnets at the same time are shown with both addresses.
[htbp]
figures/groucho.epsf
(350,357)(0,-10) (21,246)(21,256)(8,256) (8,246)(21,246) (19,248)(19,254)(10,254) (10,248)(19,248) (8,244)(21,244)(25,241) (25,240)(5,240)(5,241)(8,244) (91,311)(91,321)(78,321) (78,311)(91,311) (89,313)(89,319)(80,319) (80,313)(89,313) (78,309)(91,309)(95,306) (95,305)(75,305)(75,306)(78,309) (166,246)(166,256)(153,256) (153,246)(166,246) (164,248)(164,254)(155,254) (155,248)(164,248) (153,244)(166,244)(170,241) (170,240)(150,240)(150,241)(153,244) (201,246)(201,256)(188,256) (188,246)(201,246) (199,248)(199,254)(190,254) (190,248)(199,248) (188,244)(201,244)(205,241) (205,240)(185,240)(185,241)(188,244) (271,311)(271,321)(258,321) (258,311)(271,311) (269,313)(269,319)(260,319) (260,313)(269,313) (258,309)(271,309)(275,306) (275,305)(255,305)(255,306)(258,309) (346,246)(346,256)(333,256) (333,246)(346,246) (344,248)(344,254)(335,254) (335,248)(344,248) (333,244)(346,244)(350,241) (350,240)(330,240)(330,241)(333,244) (91,176)(91,186)(78,186) (78,176)(91,176) (89,178)(89,184)(80,184) (80,178)(89,178) (78,174)(91,174)(95,171) (95,170)(75,170)(75,171)(78,174) (271,176)(271,186)(258,186) (258,176)(271,176) (269,178)(269,184)(260,184) (260,178)(269,178) (258,174)(271,174)(275,171) (275,170)(255,170)(255,171)(258,174) (221,141)(221,151)(208,151) (208,141)(221,141) (219,143)(219,149)(210,149) (210,143)(219,143) (208,139)(221,139)(225,136) (225,135)(205,135)(205,136)(208,139) (151,76)(151,86)(138,86) (138,76)(151,76) (149,78)(149,84)(140,84) (140,78)(149,78) (138,74)(151,74)(155,71) (155,70)(135,70)(135,71)(138,74) (296,76)(296,86)(283,86) (283,76)(296,76) (294,78)(294,84)(285,84) (285,78)(294,78) (283,74)(296,74)(300,71) (300,70)(280,70)(280,71)(283,74) (221,6)(221,16)(208,16) (208,6)(221,6) (219,8)(219,14)(210,14) (210,8)(219,8) (208,4)(221,4)(225,1) (225,0)(205,0)(205,1)(208,4) (85,245)110110 (265,245)110110 (215,75)110110 (30,245)(20,245) (140,245)(155,245) (85,305)(85,300) (210,245)(200,245) (320,245)(335,245) (265,305)(265,300) (85,190)(85,185) (265,190)(265,185) (85,170)(85,160) (265,170)(265,160) (55,160)(290,160) 4.000(55,160)(25,160) 4.000(290,160)(320,160) (215,160)(215,150) (215,135)(215,130) (160,75)(150,75) (270,75)(285,75) (215,15)(215,20) (100,175)(0,0)[lb]910.8rmsophus (280,175)(0,0)[lb]910.8rmniels (330,230)(0,0)[lb]910.8rmquark (150,230)(0,0)[lb]910.8rmerdos (340,260)(0,0)[b]910.8rm12.4 (160,260)(0,0)[b]910.8rm4.17 (0,230)(0,0)[lb]910.8rmgauss (80,195)(0,0)[lb]910.8rm4.1 (260,195)(0,0)[lb]910.8rm12.1 (60,165)(0,0)[lb]910.8rm1.4 (235,165)(0,0)[lb]910.8rm1.12 (75,240)(0,0)[lb]1214.4tt4.0 (250,240)(0,0)[lb]1214.4tt12.0 (5,260)(0,0)[lb]910.8rm4.23 (55,145)(0,0)[lb]1113.2itCampus Backbone (230,140)(0,0)[lb]910.8rm
Up to now, we've been talking quite a bit about network interfaces and general TCP/IP issues, but didn't really cover exactly what happens when ``the networking code'' in the kernel accesses a piece of hardware. For this, we have to talk a little about the concept of interfaces and drivers.
First, of course, there's the hardware itself, for example an Ethernet board: this is a slice of Epoxy, cluttered with lots of tiny chips with silly numbers on them, sitting in a slot of your PC. This is what we generally call a device.
For you to be able to use the Ethernet board, special functions have to be present in your kernel that understand the particular way this device is accessed. These are the so-called device drivers. For example, has device drivers for several brands of Ethernet boards that are very similar in function. They are known as the ``Becker Series Drivers'', named after their author, Donald Becker. A different example is the D-Link driver that handles a D-Link pocket adaptor attached to a parallel port.
But, what do we mean when we say a driver ``handles'' a device? Let's go back to that Ethernet board we examined above. The driver has to be able to communicate with the peripheral's on-board logic somehow: it has to send commands and data to the board, while the board should deliver any data received to the driver.
[tbp]
figures/iface.epsf
(405,270)(0,-10) (120,0)(120,40)(90,40) (90,0)(120,0) (115,35)(111,35)(111,16)(103,10) (113,33)(113,15)(103,7) (115,33)(115,13)(103,4) (103,3)(103,15)(95,15) (95,3)(103,3) (105,20)(105,35)(95,35) (95,20)(105,20) (105,20)(105,35)(95,35) (95,20)(105,20) (107,31)(107,34)(93,34) (93,31)(107,31) (107,26)(107,29)(93,29) (93,26)(107,26) (107,21)(107,24)(93,24) (93,21)(107,21) (190,0)(190,40)(160,40) (160,0)(190,0) (185,35)(181,35)(181,16)(173,10) (183,33)(183,15)(173,7) (185,33)(185,13)(173,4) (173,3)(173,15)(165,15) (165,3)(173,3) (175,20)(175,35)(165,35) (165,20)(175,20) (175,20)(175,35)(165,35) (165,20)(175,20) (177,31)(177,34)(163,34) (163,31)(177,31) (177,26)(177,29)(163,29) (163,26)(177,26) (177,21)(177,24)(163,24) (163,21)(177,21) (370,0)(370,40)(340,40) (340,0)(370,0) (365,35)(361,35)(361,16)(353,10) (363,33)(363,15)(353,7) (365,33)(365,13)(353,4) (353,3)(353,15)(345,15) (345,3)(353,3) (355,20)(355,35)(345,35) (345,20)(355,20) (355,20)(355,35)(345,35) (345,20)(355,20) (357,31)(357,34)(343,34) (343,31)(357,31) (357,26)(357,29)(343,29) (343,26)(357,26) (357,21)(357,24)(343,24) (343,21)(357,21) (300,0)(300,40)(270,40) (270,0)(300,0) (295,35)(291,35)(291,16)(283,10) (293,33)(293,15)(283,7) (295,33)(295,13)(283,4) (283,3)(283,15)(275,15) (275,3)(283,3) (285,20)(285,35)(275,35) (275,20)(285,20) (285,20)(285,35)(275,35) (275,20)(285,20) (287,31)(287,34)(273,34) (273,31)(287,31) (287,26)(287,29)(273,29) (273,26)(287,26) (287,21)(287,24)(273,24) (273,21)(287,21)
(175,155)3030
13.2ttbrewhq (290,163)(290,138)(170,138) (170,163)(290,163) (180,148)(0,0)[lb]1113.2ttgargleblaster.com (120,48)(120,23)(35,23) (35,48)(120,48) (230,138)(205,48) (185,38)(120,38) (120,28)(185,28) (80,48)(55,138) (40,138)(65,48) (90,163)(90,138)(0,138) (0,163)(90,163)
(39,138)(39,124)(48,127)(40,138) (39,138)(39,124)(48,127)(40,138) (81,48)(81,62)(72,59)(80,48) (81,48)(81,62)(72,59)(80,48) (120,39)(133,43)(133,34)(120,38) (120,39)(133,43)(133,34)(120,38) (184,29)(171,33)(171,24)(184,28) (184,29)(171,33)(171,24)(184,28) (204,48)(204,62)(213,59)(205,48) (204,48)(204,62)(213,59)(205,48)
(40,163)(40,163) 6.000(40,163)(95,218) 6.000(55,163)(105,213) 6.000(230,163)(173,220) 6.000(215,163)(160,218) (245,138)(220,48)
(246,138)(246,124)(237,127)(245,138) (246,138)(246,124)(237,127)(245,138) (109,237)(0,0)[lb]1214.4rmUsenet (45,33)(0,0)[lb]1113.2ttgroucho.edu (10,148)(0,0)[lb]1113.2ttbarnyard.edu (70,103)(0,0)[lb]1012.0ttcomp,sci, (75,88)(0,0)[lb]1012.0ttrec (25,83)(0,0)[lb]1012.0ttall (135,43)(0,0)[lb]1012.0ttall,!fj (125,13)(0,0)[lb]1012.0ttcomp.os, (125,0)(0,0)[lb]1012.0ttcomp.periphs (240,88)(0,0)[lb]1012.0ttfj (205,98)(0,0)[lb]10
Articles may be fed to C News in several ways. When a local user posts an article, the newsreader usually hands it to the inews command, which completes the header information. News from remote sites, be it a single article or a whole batch, is given to the rnews command, which stores it in the /var/spool/news in.coming directory, from where it will be picked up at a later time by newsrun. With any of these two techniques, however, the article will eventually be handed to the relaynews command.
For each article, the relaynews command first checks if the article has already been seen at the local site by looking up the message id in the history file. Duplicate articles will be dropped. Then, relaynews looks at the Newsgroups: header line to find out if the local site requests articles from any of these groups. If it does, and the newsgroup is listed in the active file, relaynews tries to store the article in the corresponding directory in the news spool area. If this directory does not exist, it is created. The article's message id will then be logged to the history file. Otherwise, relaynews drops the article.
If relaynews fails to store an incoming article because a group it has been posted to is not listed in your active file, the article will be moved to the junk group. relaynews will also check for stale or misdated articles and reject them. Incoming batches that fail for any other reason are moved to /var/spool/news /in.coming/bad, and an error message is logged.
After this, the article will be relayed to all other sites that request news from these groups, using the transport specified for each particular site. To make sure it isn't sent to a site that already has seen it, each destination site is checked against the article's Path: header field, which contains the list of sites the article has traversed so far, written in bang path style. Only if the destination site's name does not appear in this list will the article be sent to it.
C News is commonly used to relay news between UUCP sites, altough it is also possible to use it in a NNTP environment. To deliver news to a remote UUCP site --- either single articles or whole batches --- uux is used to execute the rnews command on the remote site, and feed the article or batch to it on standard input.
When batching is enabled for a given site, C News does not send any incoming article immediately, but appends its path name to a file, usually out.going/site/togo. Periodically, a batcher program is executed from a crontab entry, which puts the articles in one or more files, optionally compresses them, and sends them to rnews at the remote site.
Figure #cnewsfigflow#62> shows the news flow through relaynews. Articles may be relayed to the local site (denoted by ME), to some site named ponderosa via email, and a site named moria, for which batching is enabled.
[htbp]
figures/flow.epsf
(318,230)(0,-10) (290,28)(290,50)(273,50) (273,28)(290,28) (276,50)(276,53)(293,53) (293,31)(290,31) (25,28)(25,50)(8,50) (8,28)(25,28) (11,50)(11,53)(28,53) (28,31)(25,31) (115,28)(115,50)(98,50) (98,28)(115,28) (101,50)(101,53)(118,53) (118,31)(115,31) (100,148)(100,170)(83,170) (83,148)(100,148) (86,170)(86,173)(103,173) (103,151)(100,151) (215,178)(215,200)(198,200) (198,178)(215,178) (201,200)(201,203)(218,203) (218,181)(215,181) (178,113)(178,98) (176.000,106.000)(178.000,98.000)(180.000,106.000) (213,83)(213,98)(143,98) (143,83)(213,83) (318,83)(318,98)(248,98) (248,83)(318,83) (98,83)(98,98)(28,98) (28,83)(98,83) (63,83)(63,68) (61.000,76.000)(63.000,68.000)(65.000,76.000) (16.000,61.000)(18.000,53.000)(20.000,61.000) (18,53)(18,68)(108,68)(108,53) (106.000,61.000)(108.000,53.000)(110.000,61.000) (178,83)(178,48) (176.000,56.000)(178.000,48.000)(180.000,56.000) (283,83)(283,53) (281.000,61.000)(283.000,53.000)(285.000,61.000) (148,48)(218,48)(208,33) (138,33)(148,48) (61.000,106.000)(63.000,98.000)(65.000,106.000) (63,98)(63,113)(283,113)(283,98) (281.000,106.000)(283.000,98.000)(285.000,106.000) (208,148)(208,113) (206.000,121.000)(208.000,113.000)(210.000,121.000) (111.000,160.000)(103.000,158.000)(111.000,156.000) (103,158)(173,158) (165.000,156.000)(173.000,158.000)(165.000,160.000) (208,178)(208,163) (206.000,171.000)(208.000,163.000)(210.000,171.000) (178,163)(248,163)(238,148) (168,148)(178,163) (63,88)(0,0)[b]1012.0ttME (178,88)(0,0)[b]1012.0ttponderosa (283,88)(0,0)[b]1012.0ttmoria (178,38)(0,0)[b]1012.0ttmail (18,13)(0,0)[b]10
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found.
one line to give the program's name and a brief idea of what it does. Copyright © 19yy name of author
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a ``copyright disclaimer'' for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
Glossary
The following is a list of books you might want to read to if you want to know more about some of the topics covered in the Networking Guide. It is not very complete or systematic, I just happen to have read them and find them quite useful. Any additions to, and enhancement of this list are welcome.
General Books on the Internet
Administration Issues
hunt-tcpip Hunt92 TCP/IP Network Administration