NetworkSystemManual EricSchmidt May1979 (RevisedMarch1980) Introduction Thisdocumentationshouldbereadbypeopleresponsibleformaintainingthenetwork(andthe systemsitrunson).Itisdividedintothefollowingsections: MaintainingtheNetwork SettinguptheNetwork FuturePlans ForBerkeley Bugs Besidesthecommandsdescribedinthenetintroduction,thereareanumberofnetwork-internal commandsandstatisticsfiles. MaintainingtheNetwork 1.Checkthenetwork: a)Seeifthenetworkdaemonsarerunningwiththecommand %psax|grepnet Ifnotrunning,seebelow. b)Checkthenetworkqueuetoseehowlongcommandshavebeenwaitingtobesent. 2.Torestartthenetworkdaemons,try a)Seeiftheyarerunning,asabove. b)Ifso,thereshouldbetwonetdaemonprocessespermachineconnection—‘‘kill−9’’ thechildnamed‘‘netdaemon’’andtheparent‘‘netstart’’willstartanewone. c)Ifthereareno‘‘netstart’s’’or‘‘netdaemon’s’’,executingtheshellscript %/usr/net/bin/start willtruncatethelogfilesandstartupallthedaemonsonyourmachine. d)Tohavetwo‘‘netdaemons’’pointingtothesamemachineistoinvitedisaster.What happensisthatafewsmallrequestsgetthrough,andthentheerrorrategoesupbya factorofahundred.Thefirstthingtodowhenyouseethisistocheckthenumberof netdaemons. (Allthismustbedoneassuper-user). 3.Therearefiles/usr/spool/berknet/plogfile?withalogforeachdirectly-connectedmachine. Example: %tail/usr/spool/berknet/plogfiley willtellyouinacrypticformwhatthenetworkhasdoneontheCorymachine.Thisisa goodfiletoinspecttoseeiftransmissionsarefailing,etc. Basically,‘‘sends’’begin‘‘ˆ S’’andend‘‘ˆ T’’.Ifasendfailsforsomereason,‘‘ˆ F’’isprinted insteadof‘‘ˆ T’’.‘‘ˆ R’’isprintedwhenareceivebegins.‘‘RCV’’isenteredwhenthe -2-commandisreceivedandexecuted.‘‘ˆ P’’indicatesapassthrough. Thefile/usr/spool/berknet/netstat?,oneperdirectly-connectedmachine,havevarious statisticsabouttheusageofthenetwork,andthesystemload. 4.Theoverloadingonvariousmachinesiscausinghigherrorrates.Iftheseratespersist,the networkcanoverloadtothepointwherethequeuesareimmenseandnothinggetsthrough. Theonlythingthatcanbedoneatthispointistoremovethefiles(usingnetrmassuperuser)andadjustthedelaytimesinthe‘initfile’. 5.Iffreespaceisascarcecommodity,truncatelogfileandplogfile?,andcheck /usr/spool/berknet/send?and/usr/spool/berknet/rcv.Ifthereareanyfilestherewhichare quiteold,useyourjudgementtoremovethem. 6.Netnewsshouldbeprovidedperiodically(usuallyin‘/usr/help’or‘/usr/news’). 7.Thenetworkqueuesmayhavetoomanyentriesand‘‘break’’thesimplerendezvousprotocol Iuse.Theeasiestwaytofixthisistorenamethesenddirectorythatistoolarge,makea new,emptyone,andmoveasmallgroupoffilesinatatimefromtherename’ddirectoryto thenewone.Inthiswaythedaemonthinksthesendingdirectoryissmallanditlesslikely tohaveproblems. 8.Thenetdaemonstakeanumberofcommandlineoptions: netdaemon−mmach[−d][−or][−os][−ounum] where−misrequiredandspecifiestheremotemachine.If−disset,debugmodeisturned on.If−orisspecified,thedaemonwillonlyrecieve,notsend,requests(‘‘or’’standsforonly receive).Likewise,−osis‘‘onlysend’’.Finally,‘‘−ounum’’,wherenumisauser-id,as returnedbygetuid(),willforcethedaemontoonlysendqueuefilesownedby‘‘root’’(passthroughs),ownedby‘‘network’’(mail,e.g.)andbyuser-idnum. SettinguptheNetwork 1.Hardware Foranothermachinetojointhenetwork,theremustbesomehardwarelink,suchas ttylines,specialcharacter-orientedhardware,orDMAlinesbetweenthetwomachines.The softwaredoesnotrequirethelinktobereliableorfast.ThebestwaytostartiswithslowspeedTTYlines(say1200baud)whichdemonstratethenetwork’susefulnessatlowcost. ThehighesttransferspeedonaTTYlinkisaboutone-halfthelinkspeed(atbest),because ofprocessingtime,the3→4characterexpansionfrom8bitsto6,andtheresponses. 2.Software Torunthenetworkcode,youmusthaveaUNIX◯rrunningVersion6or7.Version7 machinesshouldhavealltherightsoftwarealready.Version6systemsmusthavethemake command,the‘‘Version7’’CcompilerthatcameoutafewyearsafterinitialVersion6 (about1978),andthealarm()systemcall.Thiscompiler,forexample,supportsmulti-level includefiles. Thereisadirectory‘‘/usr/src/cmd/berknet’’withallthenetworksourcefilesanda ‘‘makefile’’.Thefile‘‘README’’hasinformationaboutthedifferentconditionalcompilationoptionavailable,andtableentrieswhichmustbemadeinthe‘.c’files. Assumingtheoptionshavebeenspecifiedinthemakefile,thecommand %makeall willmakeallthenecessaryfiles.Thenthecommand %makeinstallDESTDIR= willinstalltheusercommandsandserviceprograms.Thedirectoriesarespecifiedas optionsinthemakefile.Finally, -3- %makeclean removesallthe‘.o’andexecutablefiles. Therearealsootherlittle-usedprograms,madeby‘‘makeothernet’’.Includedarepro-gramstosendandreceivepacketsandfiles,andaprogramtosimulateTTYlinesusing pipes.Itshouldnotbenecessarytorunthese. Thedocumentationisin/usr/man/man1andin/usr/doc/berknet. 3.DirectoriesandFiles. Thecentraldirectoriesare‘/usr/net’,whichhassubdirectories‘bin’and‘network’,and ‘/usr/spool/berknet’,whichhassubdirectories‘rcv’and‘send?’,wherethe‘?’representsthe one-lettercodesofthedirectly-connectedmachines.Forvariousreasons,thesupportpro-grams(netdaemon,netstart,mmail,mwrite,etc.)mustbein‘/usr/net/bin’.Theuserpro-gramsmaybeanywherebutthepathnamesin‘‘Paths.h’’mustberesetcorrectly. Thelogfilesare‘logfile’and‘plogfile?’,oneforeachdirectly-connectedmachine.Ifnot presentin‘/usr/spool/berknet’,theyarenotcreated. Thefile‘/usr/net/bin/start’shouldstartupallthenetdaemonsonthecurrent machine.Thisfileisnormallyexecutedby‘/etc/rc’.Thefile‘/usr/net/initfile’hasaformatsimilarto‘.netrc’butisreadbythenetdaemonswhentheyarestarted.Ithasthenetworkdevicenames,speedandvarioustuningparameters.Thecompletelistisinthesource file‘netrc.c’.Itisgenerallypossibletochangealmostanythingaboutthenetworkthrough the‘initfile’andrestartingthedaemon. Theprogram‘/usr/net/bin/netstart’isasimpleprogramtostartupanetdaemon, andifitshouldabortforanyreason,restartit. Theremustbeanaccount‘network’,whichexecutesallresponsesandthefreecommands.Itslogindirectoryshouldbe‘/usr/net/network’andloginshellshouldbe‘nsh’in thatdirectory.Thelistoffreecommandscanbechangedin‘nsh.c’. AtBerkeley,wefollowtheconventionthattheTTYspecialfilesarenamed‘/dev/net-X’,where‘X’istheremotemachinename. TheUNIXmailprogramshouldbemodifiedtorecognizeremotenamesandtoforka ‘‘/usr/net/bin/sendberkmail’’command.Sincemanypeoplewillnotorcannotaddthe optionsthenetworkwouldlikemailtohave,thereisaprogram‘‘v6mail.c’’thatimplements alltheoptionsthenetworkwants. 4.Addinganewmachine. Tablesin‘config.h’mustbeupdated.Machinedescriptions(V6,etc.)mustbeadded to‘mach.h’.Pathnamesmustbespecifiedin‘Paths.h’.Freecommandsmustbecheckedin ‘nsh.c’.Aprocedure‘‘gothru’’in‘sub.c’mustbeupdated.Allthefilesetc.describedin#3 abovemustbepresent. FuturePlans Itisimportanttounderstandthescopeofthisnetwork;whatitisandwhatitisnot.Since itis‘‘batched’’,therearealotofthingsitcannotdo.Ourexperienceisthatremotefilecopying, mailingandprintingbetweenUNIXmachinesareadequateforourimmediateneeds. Inthefuture,wewillconcentrateonimprovingthehardwareandspeedingupthenetwork, ratherthanmajoruser-interfacechanges. Thisisalistofthethingsthathavebeenplannedforthefutureforthenetwork. 1.UseBillJoy’sretrofitlibrarytosimulatetheversion7systemcalls.Thiswouldreducethe dependenceonconditionalcompilationforV6code. 2.Thefilelengthrestrictionisamajorinconvenience.Onewaytoallowlargefileswouldbeto sendlargefiles(over100,000chars)onlywhentherearenosmallerones.Thiswouldbe -4-non-preemptive,butmightbeworkable.Anotherwaywouldbetohavetwohardwarelinks, andtwosetsofdaemons,oneforlargefilesandoneforsmallones. 3.BobFabryhassuggestedgeneralizingthemachinenametobeuser-definableasa login/machinepair,tomakeiteasierforpeoplewithmultipleaccountsonmultiple machines. 4.Itispossibletosharebinariesbetweenallthesimilarmachineconfigurations(e.g.the Comp.Centermachines).Thisinvolves‘‘patching’’thelocalmachineinthebinary. 5.EdGouldsuggestedthatthenotionof‘‘default’’machinewastoorestrictive—thatan appropriatedefaultfor,say,‘‘netlpr’’wasanearbymachinewithaqualityprinter,whereas thedefaultfor‘‘net’’shouldbethelogicalmostusefulmachine. 6.Security—Ihavejustrecentlybullet-proofedthenetworkso‘root’commandsarevery restricted.However,thepresenceofpasswordsinthe‘.netrc’filesposesahazardtoother machineswhenonemachineisbrokeninto.Aslongastherootpasswordisnotinafile,the rootissafe.Iamfairlyconvincedthereisnowayusingencryptiontohandlethe‘.netrc’ files.Theintroductorydocumentationisveryexplicitaboutthethreatthesepasswords pose. 7.Certainothermoreexoticrequestsareunlikelytogetdoneuntilthingschange: a)Havingthesameuser-id’sacrossmachines. b)Addinganoptionto‘‘net’’towaituntilaresponsehasbeenreceived. c)Thereshouldbeanetstatuscommandwhichwouldgivethingslikeloadaverages,the numberofusers,etc. d)Thenotionofalocalqueueisnotgeneralenough—netqshouldprintoutrelevant queuesonothermachines. e)Filesonintermediatemachinescan’tbenetrm’ed. ForBerkeley 1.Adriverforthenetworklinkstoavoidcharacterprocessingwouldmake9600-baudpracti-cal.OntheComputerCentermachines,thiscouldbeaccomplishedusingahighspeedlink throughtheBussiplexor. 2.Weneedanetrcscommandtousethercsfacilitiesfromremotemachines. Bugs 1.Extrafilesbeginningwith‘df...’arecreatedinthe‘send?’directories,withnocontrolfiles (‘cf...’).Theyshouldberemovedperiodically.netrmwillremovethem. 2.Ingeneral,somerequestscanblockthequeueuntilremoved.Shorterrequestswillget through,andlongeroneswillnot.Again,theirnetqueuefilesshouldberemoved. 3.Thenetworkrendezvousprotocolseemstooccasionallygetinastatewhereaspecificfileis continuallyretransmittedandneverseemstogetthrough.Thishappenswhenboththe hostsystemandthenetworkqueuesareoverloaded,andthusisveryunpleasanttodebug. 4.Thenetworkdaemonsoccasionallycoredump.Theyshouldnot.