home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / INTERNE2.ZIP / interne2.txt
Text File  |  1997-08-10  |  96KB  |  2,176 lines

  1.                        A Hacker's Guide to the Internet
  2.  
  3.                                  By The Gatsby
  4.  
  5.                       Version 2.00 / AXiS / July 7, 1991
  6. ______________________________________________________________________________
  7.  
  8.  
  9. 1   Index
  10. ~~~~~~~~~
  11.             Part:     Title:
  12.             ~~~~      ~~~~~
  13.              1        Index
  14.              2        Introduction
  15.              3        Glossary, Acronyms, and Abbreviations
  16.              4        What is the Internet?
  17.              5        Where You Can Access The Internet
  18.              6        TAC
  19.              7        Basic Commands
  20.                a           TELNET command
  21.                b           ftp ANONYMOUS to a Remote Site
  22.                c           Basic How to tftp the Files
  23.                d           Basic Fingering
  24.              8        Networks
  25.              9        Internet Protocols
  26.             10        Host Names and Addresses
  27.  
  28.  
  29. 2   Introduction
  30. ~~~~~~~~~~~~~~~~
  31.      The original release of this informative file was in an IRG newsletter,
  32. but it had some errors that I wanted to correct.  I have also added more
  33. technical information.
  34.  
  35.      This file is intended for the newcomer to Internet and people (like
  36. me) who are not enrolled at a university with Internet access.  It covers the
  37. basic commands, the use of Internet, and some tips for hacking through
  38. Internet. There is no MAGICAL way to hacking a UNIX system.  If you have any
  39. questions, I can be reached on a number of boards.
  40.  
  41. - The Crypt       -            - 619/457+1836 -     - Call today -
  42. - Land of Karrus  -            - 215/948+2132 -
  43. - Insanity Lane   -            - 619/591+4974 -
  44. - Apocalypse NOW  -            - 2o6/838+6435 -  <*> AXiS World HQ <*>
  45.  
  46.   Mail me on the Internet:  gats@ryptyde.cts.com
  47.                             bbs.gatsby@spies.com
  48.  
  49.                                 The Gatsby
  50.  
  51. *** Special Thanks go to Haywire (a/k/a Insanity: SysOp of Insanity Lane),
  52.     Doctor Dissector, and all the members of AXiS.
  53.  
  54.  
  55. 3   Glossary, Acronyms, and Abbreviations
  56. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. ACSE     -  Association Control Service Element, this is used with ISO to help
  58.             manage associations.
  59. ARP      -  Address Resolution Protocol, this is used to translate IP protocol
  60.             to Ethernet Address.
  61. ARPA     -  Defense Advanced Research Project Agency
  62. ARPANET  -  Defense Advanced Research Project Agency or ARPA.  This is an
  63.             experimental PSN which is still a sub network in the Internet.
  64. CCITT    -  International Telegraph and Telephone Consultative Committee is a
  65.             international committee that sets standard.  I wish they would set
  66.             a standard for the way they present their name!
  67. CERT     -  Computer Emergency Response Team, they are responsible for
  68.             coordinating many security incident response efforts.  They have
  69.             real nice reports on "holes" in various UNIX strands, which you
  70.             should get because they are very informative.
  71. CMIP     -  Common Management Information Protocol, this is a new HIGH level
  72.             protocol.
  73. CLNP     -  Connection Less Network Protocol is OSI equivalent to Internet IP
  74. DARPA    -  Defence Advanced Research Project Agency.  See ARPANET
  75. DDN      -  Defence Data Network
  76. driver   -  a program (or software) that communicates with the network itself,
  77.             examples are TELNET, FTP, RLOGON, etc.
  78. ftp      -  File Transfer Protocol, this is used to copy files from one host
  79.             to another.
  80. FQDN     -  Fully Qualified Domain Name, the complete hostname that reflects
  81.             the domains of which the host is a part.
  82. Gateway  -  Computer that interconnects networks.
  83. Host     -  Computer that is connected to a PSN.
  84. Hostname -  Name that officially identifies each computer attached
  85.             internetwork.
  86. Internet -  The specific IP-base internetwork.
  87. IP       -  Internet Protocol which is the standard that allows dissimilar
  88.             host to connect.
  89. ICMP     -  Internet Control Message Protocol is used for error messages for
  90.             the TCP/IP.
  91. LAN      -  Local Area Network
  92. MAN      -  Metropolitan Area Network
  93. MILNET   -  DDN unclassified operational military network.
  94. NCP      -  Network Control Protocol, the official network protocol from 1970
  95.             until 1982.
  96. NIC      -  DDN Network Information Center
  97. NUA      -  Network User Address
  98. OSI      -  Open System Interconnection.  An international standardization
  99.             program facilitate to communications among computers of different
  100.             makes and models.
  101. Protocol -  The rules for communication between hosts, controlling the
  102.             information by making it orderly.
  103. PSN      -  Packet Switched Network
  104. RFC      -  Request For Comments, is technical files about Internet protocols
  105.             one can access these from anonymous ftp at NIC.DDN.MIL.
  106. ROSE     -  Remote Operations Service Element, this is a protocol that is used
  107.             along with OSI applications.
  108. TAC      -  Terminal Access Controller; a computer that allow direct access to
  109.             Internet.
  110. TCP      -  Transmission Control Protocol
  111. TELNET   -  Protocol for opening a transparent connection to a distant host.
  112. tftp     -  Trivial File Transfer Protocol, one way to transfer data from one
  113.             host to another.
  114. UDP      -  User Datagram _Protocol
  115. Unix     -  This is copyrighted by AT&T, but I use it to cover all the
  116.             look-alike Unix systems, which you will run into more often.
  117. UUCP     -  Unix-to-Unix Copy Program, this protocol allows UNIX file
  118.             transfers.  This uses phone lines using its own protocol, X.25 and
  119.             TCP/IP.  This protocol also exist for VMS and MS-DOS.
  120. uucp     -  uucp when in lower case refers to the UNIX command uucp.  For
  121.             more information on uucp read files by The Mentor in the Legion of
  122.             Doom Technical Journals.
  123. WAN      -  Wide Area Network
  124. X.25     -  CCITTs standard protocol that rules the interconnection of two
  125.             hosts.
  126.  
  127.  
  128.      In this file I have used several special charters to signify certain
  129. things. Here is the key;
  130.  
  131. *  - Buffed from UNIX itself.  You will find this on the left side of the
  132.      margin.  This is normally "how to do" or just "examples" of what to do
  133.      when using Internet.
  134.  
  135. #  - This means these are commands, or something that must be typed in.
  136.  
  137.  
  138. 4   What is the Internet?
  139. ~~~~~~~~~~~~~~~~~~~~~~~~~
  140.      To understand the Internet you must first know what it is.  The Internet
  141. is a group of various networks, ARPANET (an experimental WAN) was the first.
  142. ARPANET started in 1969, this experimental PSN used Network Control Protocol
  143. (NCP).  NCP was the official protocol from 1970 until 1982 of the Internet (at
  144. this time also known as DARPA Internet or ARPA Internet).  In the early 80's
  145. DARPA developed the Transmission Control Protocol/Internet Protocol which is
  146. the official protocol today, but much more on this later.  Due to this fact,
  147. in 1983 ARPANet split into two networks, MILNET and ARPANET (both are still
  148. part of the DDN).
  149.  
  150.     The expansion of Local Area Networks (LAN) and Wide Area Networks (WAN)
  151. helped make the Internet connecting 2,000+ networks strong.  The networks
  152. include NSFNET, MILNET, NSN, ESnet and CSNET.  Though the largest part of the
  153. Internet is in the United States, the Internet still connects the TCP/IP
  154. networks in Europe, Japan, Australia, Canada, and Mexico.
  155.  
  156.  
  157. 5   Where You Can Access Internet
  158. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  159.      Internet is most likely to be found on Local Area Networks or LANs and
  160. Wide Area networks or WANs.  LANs are defined as networks permitting the
  161. interconnection and intercommunication of a group of computers, primarily for
  162. the sharing of resources such as data storage device and printers.  LANs cover
  163. a short distance (less than a mile) and are almost always within a single
  164. building complex.  WANs are networks which have been designed to carry data
  165. calls over long distances (many hundreds of miles).  You can also access
  166. Internet through TymNet or Telenet via gateway.  You'll have to find your own
  167. NUAs though.
  168.  
  169.  
  170. 6   TAC
  171. ~~~~~~~
  172.      TAC (terminal access controller) is another way to access Internet.  This
  173. is just dial-up terminal to a terminal access controller.  You will need to
  174. get a password and an account.  TAC has direct access to MILNET.  One example
  175. of a TAC dialup is (800)368-2217, but there are several out there to be found.
  176. In fact, CERT has a report circulating about people attempting to find these
  177. dialups through social engineering.
  178.  
  179.      If you want the TAC manual you can write a letter to:
  180.  
  181.        Defense Communications Agency
  182.        Attn: Code BIAR
  183.        Washington, DC 2o3o5-2ooo
  184.  
  185. Be sure to write that you want the TAC User Guide, 310-p70-74.
  186.  
  187.      In order to logon, you will need a TAC Access Card.  You would probably
  188. get it from the DDN NIC.  Here is a sample logon:
  189.  
  190.  
  191. Use Control-Q for help...
  192.  
  193. *
  194. * PVC-TAC 111: 01               \ TAC uses to this to identify itself
  195. * @ #o 124.32.5.82               \ Use ``O'' for open and the internet
  196. *                                / address which yea want to call.
  197. *
  198. * TAC Userid: #THE.GATSBY
  199. * Access Code: #10kgb0124
  200. * Login OK
  201. * TCP trying...Open
  202. *
  203. *
  204.  
  205.  
  206. 7   Basic Commands
  207. ~~~~~~~~~~~~~~~~~~
  208. a:  Basic TELNET Commands
  209.  
  210.       Situation:  You have an account on a UNIX system that is a host on
  211. Internet.  Now you can access the entire world!  Once the UNIX system you
  212. should see a prompt, which can look like a '$' or '%' (it also depends on what
  213. shell you are in and the type of Unix system).  At the prompt you can do all
  214. the normal UNIX commands, but when on a Internet host you can type 'telnet'
  215. which will bring you to the 'telnet' prompt.
  216.  
  217. *
  218. * $ #telnet
  219. * ^   ^
  220.   |   |
  221.   |  the command that will bring you to the telnet prompt
  222.   |
  223.   a normal UNIX prompt
  224.  
  225.  
  226.      You should get this:
  227.  
  228. *
  229. * telnet>
  230. *
  231.      At this prompt you will have a whole different set of commands which are
  232. as follows (This comes from UCSD, so it may vary from place to place).
  233.  
  234. *
  235. * telnet> #help
  236. *
  237. * close           close current connection
  238. * display         display operating parameters
  239. * open            connect to a site
  240. * quit            exit telnet
  241. * send            transmit special character
  242. * set             set operating parameters
  243. * status          print status information
  244. * toggle          toggle operating parameters
  245. * ?               to see what you are looking at now
  246. *
  247.  
  248. close      - this command is used to 'close' a connection, when multitasking
  249.              or jumping between systems.
  250.  
  251. display    - this set the display setting, commands for this are as follow.
  252.  
  253.              ^E    echo.
  254.              ^]    escape.
  255.              ^H    erase.
  256.              ^O    flushoutput.
  257.              ^C    interrupt.
  258.              ^U    kill.
  259.              ^\    quit.
  260.              ^D    eof.
  261.  
  262.  
  263. open       - type 'open [host]' to connect to a system
  264.  
  265. *
  266. * $ #telnet ucsd.edu
  267. *
  268.  
  269.      or
  270. *
  271. * telnet> #open 125.24.64.32.1
  272. *
  273.  
  274. quit   - to get out of telnet and back to UNIX
  275. send   - send files
  276. set    - set
  277. echo   - character to toggle local echoing on/off
  278. escape - character to escape back to telnet command mode
  279.  
  280.  
  281.      The following need 'localchars' to be toggled:
  282.  
  283. erase         -  character to cause an Erase Character
  284. flushoutput   -  character to cause an Abort Output
  285. interrupt     -  character to cause an Interrupt Process
  286. kill          -  character to cause an Erase Line
  287. quit          -  character to cause a Break
  288. eof           -  character to cause an EOF
  289. ?             -  display help information
  290.  
  291.  
  292. b:   ftp ANONYMOUS to a remote site
  293.  
  294.      ftp or file transfer protocol is used to copy files from a remote host to
  295. the one that you are on.  You can copy anything.  Security has really clamped
  296. down on the passwd file, but it will still work here and there (always worth a
  297. shot).
  298.  
  299.      This could be useful when you see a Internet CuD (Computer Underground
  300. Digest) site that accepts a anonymous ftps, and you want to read the CuDs, but
  301. do not feel like wasting your time on boards downloading them.  The best way
  302. to start out is to ftp a directory to see what you are getting.
  303.  
  304.      Example:  The CuD archive site has an Internet address of 192.55.239.132
  305. and my account name is "gats".
  306.  
  307. *
  308. * $ #ftp
  309. * ^  ^
  310.   |  |
  311.   | ftp command
  312.   |
  313.  UNIX prompt
  314.  
  315. *
  316. * ftp> #open 192.55.239.132
  317. * Connected to 192.55.239.132
  318. * 220 192.55.239.132 FTP Server (sometimes the date, etc)
  319. * Name (192.55.239.132:gats): #anonymous
  320. *            ^         ^        ^
  321.              |         |        |
  322.              |         |       This is where you type 'anonymous' unless
  323.              |         |     you have a account on 192.55.239.132.
  324.              |         |
  325.              |        This is the name of my account or [from]
  326.              |
  327.             This is the Internet address or [to]
  328. *
  329. * Password: #gats
  330. *            ^
  331.              |
  332.             For this just type your username or anything you feel like typing
  333.             in at that time.  It doesn't matter.
  334.  
  335. *
  336. * % ftp 192.55.239.132
  337. * Connected to 192.55.239.132
  338. * ftp> #ls
  339. *       ^
  340.         |
  341.        You are connected now, thus you can ls it.
  342.  
  343.      Just move around like you would in a normal unix system.  Most of the
  344. commands still apply on this connection. Here is a example of me getting a
  345. copy of the Electronic Frontier Foundation's Effector (issue 1.04) from
  346. Internet address 192.55.239.132.
  347.  
  348. *
  349. * % #ftp
  350. * ftp> #open 128.135.12.60
  351. * Trying 128.135.12.60...
  352. * 220 chsun1 FTP server (SunOS 4.1) ready.
  353. * Name (128.135.12.60:gatsby): anonymous
  354. * 331 Guest login ok, send ident as password.
  355. * Password: #gatsby
  356. * 230 Guest login ok, access restrictions apply.
  357. * ftp> #ls
  358. * 200 PORT command successful.
  359. * 150 ASCII data connection for /bin/ls (132.239.13.10,4781) * (0 bytes).
  360. * .hushlogin
  361. * bin
  362. * dev
  363. * etc
  364. * pub
  365. * usr
  366. * README
  367. * 226 ASCII Transfer complete.
  368. * 37 bytes received in 0.038 seconds (0.96 Kbytes/s)
  369. * ftp>
  370.  
  371.      _________________________________________________________________________
  372.     |
  373.     |  This is where you can try to 'cd' the "etc" dir or just 'get'
  374.     |  /etc/passwd, but grabbing the passwd file this way is a dieing art.
  375.     |_________________________________________________________________________
  376.  
  377. * ftp> #cd pub
  378. * 200 PORT command successful.
  379. * ftp> #ls
  380. * ceremony
  381. * cud
  382. * dos
  383. * eff
  384. * incoming
  385. * united
  386. * unix
  387. * vax
  388. * 226 ASCII Transfer cmplete.
  389. * 62 bytes received in 1.1 seconds (0.054 Kbytes/s)
  390. * ftp> #cd eff
  391. * 250 CWD command successful.
  392. * ftp> #ls
  393. * 200 PORT command successful.
  394. * 150 ASCII data connection for /bin/ls (132.239.13.10,4805) (0 bytes).
  395. * Index
  396. * eff.brief
  397. * eff.info
  398. * eff.paper
  399. * eff1.00
  400. * eff1.01
  401. * eff1.02
  402. * eff1.03
  403. * eff1.04
  404. * eff1.05
  405. * realtime.1
  406. * 226 ASCII Transfer complete.
  407. * 105 bytes received in 1.8 seconds (0.057 Kbytes/s)
  408. * ftp> #get
  409. * (remote-file) #eff1.04
  410. * (local-file) #eff1.04
  411. * 200 PORT command successful.
  412. * 150 Opening ASCII mode data connection for eff1.04 (909 bytes).
  413. * 226 Transfer complete.
  414. * local: eff1.04 remote: eff1.04
  415. * 931 bytes received in 2.2 seconds (0.42 Kbytes/s)
  416. * ftp> #close
  417. * Bye...
  418. * ftp> #quit
  419. * %
  420. *
  421.  
  422.      To read the file you can just 'get' the file and buffer it.  If the files
  423. are just too long, you can 'xmodem' it off the host you are on.  Just type
  424. 'xmodem' and that will make it much faster to get the files.  Here is the set
  425. up (as found on ocf.berkeley.edu).
  426.  
  427.    If you want to:                                         type:
  428.  
  429. send a text file from an apple computer to the ME       xmodem ra <filename>
  430. send a text file from a non-apple home computer         xmodem rt <filename>
  431. send a non-text file from a home computer               xmodem rb <filename>
  432. send a text file to an apple computer from the ME       xmodem sa <filename>
  433. send a text file to a non-apple home computer           xmodem st <filename>
  434. send a non-text file to a home computer                 xmodem sb <filename>
  435.  
  436. xmodem will then display:
  437.  
  438. *
  439. * XMODEM Version 3.6 -- UNIX-Microcomputer Remote File Transfer Facility
  440. * File filename Ready to (SEND/BATCH RECEIVE) in (binary/text/apple) mode
  441. * Estimated File Size (file size)
  442. * Estimated transmission time (time)
  443. * Send several Control-X characters to cancel
  444. *
  445.  
  446.  
  447. Hints- File transfer can be an iffy endeavor; one thing that can help is to
  448.        tell the annex box not to use flow control.  Before you do rlogin, type
  449.  
  450.  stty oflow none
  451.  stty iflow none
  452.  
  453. at the annex prompt.  This works best coming through 2-6092.
  454.  
  455.     Some special commands used during ftp session are cdup (same as cd ..) and
  456. dir (gives a detailed listing of the files).
  457.  
  458.  
  459. c:   How to tftp the Files
  460.  
  461.      tftp (Trivial File Transfer Protocol, the command is NOT in caps, because
  462. UNIX is case sensitive) is a command used to transfer files from host to host.
  463. This command is used sometimes like ftp, in that you can move around using
  464. UNIX commands.  I will not go into this part of the command, but I will go
  465. into the basic format, and structure to get files you want. Moreover, I will
  466. be covering how to flip the /etc/passwd out of remote sites.
  467.      There is a little trick that has been around a while.  It helps you to
  468. "flip" the /etc/passwd file out of different sites, which gets you the passwd
  469. file without out breaking into the system.  Then just run Brute Hacker (the
  470. latest version) on the thing and you save time and energy.  This 'hole' (not
  471. referring to the method of obtaining Unix superuser status) may can be found
  472. on SunOS 3.X, but has been fixed in 4.0.  It has sometimes appeared in
  473. System V, BSD and a few others.
  474.  
  475.      The only problem with this 'hole' is that the system manager will often
  476. realize what you are doing.  The problem occurs when attempts to tftp the
  477. /etc/passwd is happen too many times.  You may see this (or something like
  478. this) when you logon on to your account.  This was buffered off of
  479. plague.berkeley.edu.  I guess they knew what I was doing.
  480.  
  481. *
  482. * DomainOS Release 10.3 (bsd4.3) Apollo DN3500 (host name):
  483. *         This account has been deactivated due to use in system cracking
  484. * activities (specifically attempting to tftp /etc/passwd files from remote
  485. * sites) and for having been used or broken in to from <where the calls are
  486. * from>.  If the legitimate owner of the account wishes it reactivated,
  487. * please mail to the staff for more information.
  488. *
  489. * - Staff
  490. *
  491.  
  492.      The tftp is used in this format:
  493.  
  494.  tftp -<command> <any name> <Internet Address>  /etc/passwd  <netascii>
  495.  
  496. Command      -g   is to get the file, this will copy the file onto
  497.                   your 'home' directory, thus you can do anything with
  498.                   the file.
  499.  
  500. Any Name     If your going to copy it to your 'home' directory, it needs a
  501.              name.
  502.  
  503. Internet     This is the address that you want to snag the passwd file from.
  504.  Address     There are hundreds of thousands of them.
  505.  
  506. /ETC/PASSWD  THIS IS THE FILE THAT YOU WANT.  You do not want John Smith's
  507.              even though it would be trivial to retreive it.
  508.  
  509. netascii     This how you want the file to be transferred.
  510.  
  511. &            Welcome to the power of UNIX, it is multitasking, this little
  512.              symbol place at the end will allow you to do other things (such
  513.              as grab the passwd file from the UNIX that you are on).
  514.  
  515.      Here is the set up:  We want to get the passwd file from
  516. sunshine.ucsd.edu.  The file in your 'home' directory is going to be named
  517. 'asunshine'.
  518.  
  519. *
  520. * $ #tftp -g asunshine sunshine.ucsd.edu /etc/passwd &
  521. *
  522.  
  523.  
  524. d  Basic Fingering
  525.  
  526.      Fingering is a real good way to get an account on remote sites.  Typing
  527. 'who' or just 'finger <account name> <CR>' you can have names to "finger".
  528. This will give you all kinds information on the person's account.  Here is a
  529. example of how to do it:
  530.  
  531. *
  532. * % #who
  533. * joeo                 ttyp0       Jun 10 21:50   (bmdlib.csm.edu)
  534. * gatsby               ttyp1       Jun 10 22:25   (foobar.plague.mil)
  535. * ddc                  crp00       Jun 10 11:57   (aogpat.cs.pitt.edu)
  536. * liliya               display     Jun 10 19:40
  537.  
  538.                  /and fingering what you see
  539.  
  540. * % #finger bbc
  541. * Login name: ddc                     In real life: David Douglas Cornwall
  542. * Office: David C. Co
  543. * Directory: //aogpat/users_local/bdc     Shell: /bin/csh
  544. * On since Jun 10 11:57:46 on crp00 from aogpat   Phone 555-1212
  545. * 52 minutes Idle Time
  546. * Plan:  I like to eat apples and bananas.
  547. * %
  548. *
  549.  
  550.      Now you could just call (or Telnet to) 'aogpat.cs.pit.edu' and try to
  551. hack out an account.  Try the last name as the password, the first name, the
  552. middle name, and try them all backwards.  The chances are real good that you
  553. WILL get in because people are stupid.
  554.  
  555.      If there are no users online for you to type "who" you can just type
  556. "last" and all of the users who logged on will come rolling out.  Now "finger"
  557. them.  The only problem with using the "last" command is aborting it.
  558.  
  559.      You can also try telephoning individual users and tell them you are the
  560. system manager (i.e. social engineer them).  However, I have not always seen
  561. phone numbers in everyone's ".plan" file (the file you see when you finger the
  562. user).
  563.  
  564.  
  565. 8  Other Networks
  566. ~~~~~~~~~~~~~~~~~
  567. AARNet -      Australian Academic and Research Network.  This network supports
  568.               research for various Australian Universities.  This network
  569.               supports TCP/IP, DECnet, and OSI (CLNS).
  570.  
  571. ARPANET -     We've already discussed this network.
  572.  
  573. BITNET -      Because It's Time NETwork (BITNET) is a worldwide network that
  574.               connects many colleges and universities.  This network uses many
  575.               different protocols, but it dose use the TCP/IP.
  576.  
  577. CREN CSNET -  Corporation for Research and Educational Network (CREN) or
  578.               Computer + Science research NETwork (CSNET).  This network links
  579.               scientists at sites all over the world.  CSNET providing access
  580.  
  581.               to the Internet, CREN to BITNET.  CREN is the name more often
  582.               used today.
  583.  
  584. CSUNET -      California State University Network (CSUNET).  This network
  585.               connects the California State University campuses and other
  586.               universities in California.  This network is based on the CCITT
  587.               X.25 protocol, and also uses TCP/IP, SNA/DSLC, DECnet, and
  588.               others.
  589.  
  590.  
  591.  
  592. The Cypress Net - This network started as a experimental network.  The use of
  593.                   this network today is as a connection to the TCP/IP Internet
  594.                   as a cheap price.
  595.  
  596. DRI -        Defense Research Internet is a WAN that is used as a platform
  597.              from which to work from.  This network has all kind of services,
  598.              such as multicast service, real-time conference and more.  This
  599.              network uses the TCP/IP (also see RFC 907-A for more information
  600.              on this network).
  601.  
  602. ESnet -      This is the new network operated by the Department of Energy's
  603.              Office of Energy Research (DoE OER).  This net is the backbone
  604.              for all DoE OER programs.  This network replaced the High Energy
  605.              Physics DECnet (HEPnet) and also the Magnetic Fusion Energy
  606.              network (MFEnet).  The protocols offered are IP/TCP and also
  607.              DECnet service.
  608.  
  609. JANET -      JANET is a Joint Academic NETwork based in the UK, connected to
  610.              the Internet.  JANET is a PSN (information has pass through a
  611.              PAD) using the protocol X.25 though it does support the TCP/IP.
  612.              This network also connects PSS (Packet Switched Service is a PSN
  613.              that is owned and operated by British telecom).
  614.  
  615. JUNET -      Japan's university message system using UUCP, the Internet as its
  616.              backbone, and X.25 (see RFC 877).  This network is also a part of
  617.              USENET (this is the network news).
  618.  
  619. Los Nettos - Los Nettos is a high speed MAN in the Los Angeles area.  This
  620.              network uses the IP/TCP.
  621.  
  622. MILNET -     When ARPANET split, the DDN was created and MILNET (MILitary
  623.              NETwork) is also a part of the network.  MILNET is unclassified,
  624.              but there are three other classified networks that make up the
  625.              DDN.
  626.  
  627. NORDUNet -   This net is the backbone to the networks in the Nordic Countries,
  628.              Denmark (DENet), Finland (FUNET), Iceland (SURIS), Norway
  629.              (UNINETT), and Sweden (SUNET).  NORDUnet supports TCP/IP, DECNet,
  630.              and X.25.
  631.  
  632. NSN -        NASA Science Network (NSN).  This network is used by NASA to send
  633.              and relay information.  The protocols used are TCP/IP.  NSN has a
  634.              sister network called Space Physics Analysis Network (SPAN) for
  635.              DECNet.
  636.  
  637. ONet -       Ontario Network is a TCP/IP network used for research.
  638.  
  639. NSFNet -     National Science Foundation Network, this network is in the
  640.              IP/TCP family, but in any case it uses UDP (User Diagram
  641.              Protocol) and not TCP.  NSFnet is the network for the US
  642.              scientific and engineering research community.  Listed below are
  643.              all the NSFNet Sub-networks:
  644.  
  645.        BARRNet -     Bay Area Regional Research Network is located in the San
  646.                      Francisco area.  This network uses TCP/IP.
  647.  
  648.        CERFnet -     California Education and Research Federation Network is
  649.                      a research based network supporting Southern California
  650.                      Universities communication services.  This network uses
  651.                      TCP/IP.
  652.  
  653.        CICNet -      Committee on Institutional Cooperation.  This network
  654.                      services the BIG 10, and University of Chicago.  This
  655.                      network uses TCP/IP.
  656.  
  657.        JvNCnet -     John von Neumann National Supercomputer Center.  This
  658.                      network uses TCP/IP.
  659.  
  660.        Merit -       Merit connects Michigan's academic and research
  661.                      computers. This network supports TCP/IP, X.25 and
  662.                      Ethernet for LANs.
  663.  
  664.        MIDnet -      MIDnet connects 18 universities and research centers in
  665.                      the midwest United States.  The support protocols are
  666.                      TELNET, FTP and SMTP.
  667.  
  668.        MRNet -       Minnesota Regional Network, this network services
  669.                      Minnesota.  The network protocols are TCP/IP.
  670.  
  671.        NEARnet -     New England Academic and Research Network, connects
  672.                      various research/educational institutions.  You
  673.                      can get more information about this net by mailing
  674.                      'nearnet-staff@bbn.com'.
  675.  
  676.  
  677.        NCSAnet -     The National Center for Supercomputing Applications
  678.                      supports the whole IP family (TCP, UDP, ICMP, etc).
  679.  
  680.        NWNet -       North West Network provides service to the Northwestern
  681.                      United States and Alaska.  This network supports IP and
  682.                      DECnet.
  683.  
  684.        NYSERNet -    New York Service Network is a autonomous nonprofit
  685.                      network.  This network supports the TCP/IP.
  686.  
  687.        OARnet -      Ohio Academic Resources Network gives access to the
  688.                      Ohio Supercomputer Center.  This network supports TCP/IP.
  689.  
  690.        PREPnet -     Pennsylvania Research and Economic Partnership is a
  691.                      network operated and managed by Bell of Pennsylvania.  It
  692.                      supports TCP/IP.
  693.  
  694.        PSCNET -      Pittsburgh Supercomputer Center serving Pennsylvania,
  695.                      Maryland, and Ohio.  It supports TCP/IP, and DECnet.
  696.  
  697.        SDSCnet -     San Diego Super Computer Center is a network whose goal
  698.                      is to support research in the field of science.  The
  699.                      Internet address is 'y1.ucsc.edu' or call Bob at
  700.                      (619)534-5060 and ask for a account on his Cray.
  701.  
  702.        Sesquinet -   Sesquinet is a network based in Texas.  It supports
  703.                      TCP/IP.
  704.  
  705.        SURAnet -     Southeastern Universities Research Association Network
  706.                      is a network that connects institutions in the Southeast
  707.                      United States.
  708.  
  709.        THEnet -      Texas Higher Education Network is a network that is run
  710.                      by Texas A&M University.  This network connects to hosts
  711.                      in Mexico.
  712.  
  713.        USAN/NCAR -   University SAtellite Network (USAN)/National Center for
  714.                      Atmospheric Research is a network for information
  715.                      exchange.
  716.  
  717.        Westnet -     Westnet connects the western part of the United States,
  718.                      but not including California.  The network is supported
  719.                      by Colorado State University.
  720.  
  721. USENET -     USENET is the network news (the message base for the Internet).
  722.              This message base is quite large with over 400 different topics
  723.              and connecting to 17 different countries.
  724.  
  725.  
  726. 9  Internet Protocols
  727. ~~~~~~~~~~~~~~~~~~~~~
  728.      TCP/IP is a general term relating to the whole family of Internet
  729. protocols.  The protocols in this family are IP, TCP, UDP, ICMP, ROSE, ACSE,
  730. CMIP, ISO, ARP and Ethernet for LANs.  If if you want more information, get
  731. the RFCs.
  732.  
  733.       TCP/IP protocol is a "layered" set of protocols.  In this diagram taken
  734. from RFC 1180 you will see how the protocol is layered when connection is
  735. made.
  736.  
  737. Figure is of a Basic TCP/IP Network Node:
  738.  
  739.          -----------------------------------
  740.          |      Network    Application     |
  741.          |                                 |
  742.          | ... \  |  /  ..  \  |  /    ... |
  743.          |     -------      -------        |
  744.          |     | TCP |      | UDP |        |
  745.          |     -------      -------        |
  746.          |           \       /             |          % Key %
  747.          |  -------   ---------            |          ~~~~~~~
  748.          |  | ARP |   |  IP   |            |   UDP  User Diagram Protocol
  749.          |  -------   ------*--            |   TCP  Transfer Control Protocol
  750.          |     \            |              |   IP   Internet Protocol
  751.          |      \           |              |   ENET Ethernet
  752.          |       -------------             |   ARP  Address Resolution
  753.          |       |    ENET   |             |                  Protocol
  754.          |       -------@-----             |   O    Transceiver
  755.          |              |                  |   @    Ethernet Address
  756.          -------------- | ------------------   *    IP address
  757.                         |
  758. ========================O=================================================
  759.       ^
  760.       |
  761.   Ethernet Cable
  762.  
  763. TCP/IP:  If connection is made is between the IP module and the TCP module the
  764.          packets are called a TCP datagram.  TCP is responsible for making
  765.          sure that the commands get through the other end.  It keeps track of
  766.          what is sent, and retransmits anything that does not go through.  The
  767.          IP provides the basic service of getting TCP datagram from place to
  768.          place.  It may seem like the TCP is doing all the work, this is true
  769.          in small networks, but when connection is made to a remote host on
  770.          the Internet (passing through several networks) this is a complex
  771.          job. Say I am connected from a server at UCSD to LSU (SURAnet) the
  772.          data grams have to pass through a NSFnet backbone.  The IP has to
  773.          keep track of all the data when the switch is made at the NSFnet
  774.          backbone from the TCP to the UDP.  The only NSFnet backbone that
  775.          connects LSU is the University of Maryland, which has different
  776.          circuit sets.  The cable (trunk)/circuit types are the T1 (a basic
  777.          24-channel 1.544 Md/s pulse code modulation used in the US) to a
  778.          56 Kbps.  Keeping track of all the data from the switch from T1 to
  779.          56Kbs and TCP to UDP is not all it has to deal with.  Datagrams on
  780.          their way to the NSFnet backbone (at the University of Maryland) may
  781.          take many different paths from the UCSD server.
  782.  
  783.          All the TCP does is break up the data into datagrams (manageable
  784.          chunks), and keeps track of the datagrams.  The TCP keeps track of
  785.          the datagrams by placing a header at the front of each datagram.  The
  786.          header contains 160 (20 octets) pieces of information about the
  787.          datagram.  Some of this information is the FQDN (Fully Qualified
  788.          Domain Name).  The datagrams are numbers in octets (a group of eight
  789.          binary digits, say there are 500 octets of data, the numbering of the
  790.          datagrams would be 0, next datagram 500, next datagram 1000, 1500
  791.           etc.
  792.  
  793. UDP/IP:  UDP is one of the two main protocols of the IP.  In other words the
  794.          UDP works the same as TCP, it places a header on the data you send,
  795.          and passes it over to the IP for transportation throughout the
  796.          Internet.  The difference is that it offers service to the user's
  797.          network application.  It does not maintain an end-to-end connection,
  798.          it just pushes the datagrams out.
  799.  
  800. ICMP:  ICMP is used for relaying error messages.  For example you might try to
  801.        connect to a system and get a message back saying "Host unreachable",
  802.        this is ICMP in action.  This protocol is universal within the
  803.        Internet, because of its nature.  This protocol does not use port
  804.        numbers in it's headers, since it talks to the network software itself.
  805.  
  806.  
  807. Ethernet:  Most of the networks use Ethernet.  Ethernet is just a party line.
  808.            When packets are sent out on the Ethernet, every host on the
  809.            Ethernet sees them.  To make sure the packets get to the right
  810.            place, the Ethernet designers wanted to make sure that each address
  811.            is different.  For this reason 48 bits are allocated for the
  812.            Ethernet address, and a built in Ethernet address on the Ethernet
  813.            controller.
  814.  
  815.            The Ethernet packets have a 14-octet header, this includes address
  816.            "to" and "from."  The Ethernet is not too secure, it is possible to
  817.            have the packets go to two places, thus someone can see just what
  818.            you are doing.  You need to take note that the Ethernet is not
  819.            connected to the Internet.  A host on both the Ethernet and on the
  820.            Internet has to have both an Ethernet connection and an Internet
  821.            server.
  822.  
  823. ARP:  ARP translates the IP address into an Ethernet address.  A conversion
  824.       table is used (the table is called ARP Table) to convert the addresses.
  825.       Therefore, you would never even know if you were connected to the
  826.       Ethernet because you would be connecting to the IP address.
  827.  
  828.       The following is a real sketchy description of a few Internet protocols,
  829.       but if you would like to get more information you can access it via
  830.       anonymous ftp from several hosts.  Here is a list of RFCs that deal with
  831.       the topic of protocols.
  832.  
  833.       |~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  834.       |     RFC:      |       Description:                     |
  835.       |               |                                        |
  836.       |~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  837.       |   rfc1011     |  Official Protocols of the Internet    |
  838.       |   rfc1009     |  NSFnet gateway specifications         |
  839.       |   rfc1001/2   |  netBIOS: networking for PC's          |
  840.       |   rfc894      |  IP on Ethernet                        |
  841.       |   rfc854/5    |  telnet - protocols for remote logins  |
  842.       |   rfc793      |  TCP                                   |
  843.       |   rfc792      |  ICMP                                  |
  844.       |   rfc791      |  IP                                    |
  845.       |   rfc768      |  UDP                                   |
  846.       |               |                                        |
  847.       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  848.  
  849.  
  850. 10  Host Name and Address
  851. ~~~~~~~~~~~~~~~~~~~~~~~~~
  852.      Internet addresses are long and difficult hard to remember (i.e.,
  853. 128.128.57.83) so we use host names.  All hosts registered on the Internet
  854. must have names that reflect them domains under which they are registered.
  855. Such names are called Fully Qualified Domain Names (FQDNs).  Lets dissect a
  856. name and see the domains:
  857.  
  858.  lilac.berkeley.edu
  859.    ^      ^      ^
  860.    |      |      |
  861.    |      |      |____  "edu" shows that this host is sponsored by an
  862.    |      |             education related organization.  This is a top-level
  863.    |      |             domain.
  864.    |      |
  865.    |      |___________  "berkeley" is the second-level domain.  This shows
  866.    |                    that it is an organization within University of
  867.    |                    Calironia at  Berkeley.
  868.    |
  869.    |__________________  "lilac" is the third-level domain.  This indicates the
  870.                         local host name is 'lilac'.
  871.  
  872.      Common Top-Level Domains
  873.  
  874.      COM  -  commercial enterprise
  875.      EDU  -  educational institutions
  876.      GOV  -  nonmilitary government agencies
  877.      MIL  -  military (non-classified)
  878.      NET  -  networking entities
  879.      ORG  -  nonprofit intuitions
  880.  
  881.      A network address is the numerical address of a host, gateway, or TAC.
  882. The addresses are made up of four decimal numbered slots, which are separated
  883. by a period.
  884.  
  885.      There are three classes that are used most, these are Class A, Class B,
  886. and Class C.
  887.  
  888.    Class A  -  from '0'    to  '127'
  889.    Class B  -  from '128'  to  '191'
  890.    Class C  -  from '192'  to  '223'
  891.  
  892. Class A  -  Is for MILNET net hosts.  The first part of the address has the
  893.             network number.  The second is for the physical PSN port number.
  894.             The third is for the logical port number, since it is on MILNET,
  895.             it is a MILNET host.  The fourth part is for which PSN it is on.
  896.             On 29.34.0.9.  '29' is the network it is on.  '34' means it is on
  897.             port '34'.  '9' is the PSN number.
  898.  
  899. Class B  -  This is for the Internet hosts, the first two "clumps" are for the
  900.             network portion.  The second two are for the local port.
  901.  
  902.              128.28.82.1
  903.                \_/   \_/
  904.                 |     |_____ Local portion of the address
  905.                 |
  906.                 |___________ Potation address.
  907.  
  908. Class C  -  The first three "clumps" are the network portion and the last one
  909.             is the local port.
  910.  
  911.             193.43.91.1
  912.                \_|_/  |_____ Local Portation Address
  913.                  |
  914.                  |__________ Network Portation Address
  915. _______________________________________________________________________________
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.                     A TCP/IP Tutorial : Behind The Internet
  931.                                 Part One of Two
  932.  
  933.                               September 12, 1991
  934.  
  935.                                   by The Not
  936.  
  937.  
  938. Table of Contents
  939.  
  940.     1.  Introduction
  941.     2.  TCP/IP Overview
  942.     3.  Ethernet
  943.     4.  ARP
  944.  
  945. 1.  Introduction
  946.  
  947.    This tutorial contains only one view of the salient points of TCP/IP,
  948.    and therefore it is the "bare bones" of TCP/IP technology.  It omits
  949.    the history of development and funding, the business case for its
  950.    use, and its future as compared to ISO OSI.  Indeed, a great deal of
  951.    technical information is also omitted.  What remains is a minimum of
  952.    information that must be understood by the professional working in a
  953.    TCP/IP environment.  These professionals include the systems
  954.    administrator, the systems programmer, and the network manager.
  955.  
  956.    This tutorial uses examples from the UNIX TCP/IP environment, however
  957.    the main points apply across all implementations of TCP/IP.
  958.  
  959.    Note that the purpose of this memo is explanation, not definition.
  960.    If any question arises about the correct specification of a protocol,
  961.    please refer to the actual standards defining RFC.
  962.    The next section is an overview of TCP/IP, followed by detailed
  963.    descriptions of individual components.
  964.  
  965. 2.  TCP/IP Overview
  966.  
  967.    The generic term "TCP/IP" usually means anything and everything
  968.    related to the specific protocols of TCP and IP.  It can include
  969.    other protocols, applications, and even the network medium.  A sample
  970.    of these protocols are: UDP, ARP, and ICMP.  A sample of these
  971.    applications are: TELNET, FTP, and rcp.  A more accurate term is
  972.    "internet technology".  A network that uses internet technology is
  973.    called an "internet".
  974.  
  975. 2.1  Basic Structure
  976.  
  977.    To understand this technology you must first understand the following
  978.    logical structure:
  979.  
  980.                      ----------------------------
  981.                      |    network applications  |
  982.                      |                          |
  983.                      |...  \ | /  ..  \ | /  ...|
  984.                      |     -----      -----     |
  985.                      |     |TCP|      |UDP|     |
  986.                      |     -----      -----     |
  987.                      |         \      /         |
  988.                      |         --------         |
  989.                      |         |  IP  |         |
  990.                      |  -----  -*------         |
  991.                      |  |ARP|   |               |
  992.                      |  -----   |               |
  993.                      |      \   |               |
  994.                      |      ------              |
  995.                      |      |ENET|              |
  996.                      |      ---@--              |
  997.                      ----------|-----------------
  998.                                |
  999.          ----------------------o---------
  1000.              Ethernet Cable
  1001.  
  1002.                   Figure 1.  Basic TCP/IP Network Node
  1003.  
  1004.    This is the logical structure of the layered protocols inside a
  1005.    computer on an internet.  Each computer that can communicate using
  1006.    internet technology has such a logical structure.  It is this logical
  1007.    structure that determines the behavior of the computer on the
  1008.    internet.  The boxes represent processing of the data as it passes
  1009.    through the computer, and the lines connecting boxes show the path of
  1010.    data.  The horizontal line at the bottom represents the Ethernet
  1011.    cable; the "o" is the transceiver.  The "*" is the IP address and the
  1012.    "@" is the Ethernet address.  Understanding this logical structure is
  1013.    essential to understanding internet technology; it is referred to
  1014.    throughout this tutorial.
  1015.  
  1016. 2.2  Terminology
  1017.  
  1018.    The name of a unit of data that flows through an internet is
  1019.    dependent upon where it exists in the protocol stack.  In summary: if
  1020.    it is on an Ethernet it is called an Ethernet frame; if it is between
  1021.    the Ethernet driver and the IP module it is called a IP packet; if it
  1022.    is between the IP module and the UDP module it is called a UDP
  1023.    datagram; if it is between the IP module and the TCP module it is
  1024.    called a TCP segment (more generally, a transport message); and if it
  1025.    is in a network application it is called a application message.
  1026.  
  1027.    These definitions are imperfect.  Actual definitions vary from one
  1028.    publication to the next.  More specific definitions can be found in
  1029.    RFC 1122, section 1.3.3.
  1030.  
  1031.    A driver is software that communicates directly with the network
  1032.    interface hardware.  A module is software that communicates with a
  1033.    driver, with network applications, or with another module.
  1034.  
  1035.    The terms driver, module, Ethernet frame, IP packet, UDP datagram,
  1036.    TCP message, and application message are used where appropriate
  1037.    throughout this tutorial.
  1038.  
  1039. 2.3  Flow of Data
  1040.  
  1041.    Let's follow the data as it flows down through the protocol stack
  1042.    shown in Figure 1.  For an application that uses TCP (Transmission
  1043.    Control Protocol), data passes between the application and the TCP
  1044.    module.  For applications that use UDP (User Datagram Protocol), data
  1045.    passes between the application and the UDP module.  FTP (File
  1046.    Transfer Protocol) is a typical application that uses TCP.  Its
  1047.    protocol stack in this example is FTP/TCP/IP/ENET.  SNMP (Simple
  1048.    Network Management Protocol) is an application that uses UDP.  Its
  1049.    protocol stack in this example is SNMP/UDP/IP/ENET.
  1050.  
  1051.    The TCP module, UDP module, and the Ethernet driver are n-to-1
  1052.    multiplexers.  As multiplexers they switch many inputs to one output.
  1053.    They are also 1-to-n de-multiplexers.  As de-multiplexers they switch
  1054.    one input to many outputs according to the type field in the protocol
  1055.    header.
  1056.  
  1057.  
  1058.          1   2 3 ...   n                   1   2 3 ...   n
  1059.           \  |      /      |               \  | |      /       ^
  1060.            \ | |   /       |                \ | |     /        |
  1061.          -------------   flow              ----------------   flow
  1062.          |multiplexer|    of               |de-multiplexer|    of
  1063.          -------------   data              ----------------   data
  1064.               |            |                     |              |
  1065.               |            v                     |              |
  1066.               1                                  1
  1067.  
  1068.         Figure 2.  n-to-1 multiplexer and 1-to-n de-multiplexer
  1069.  
  1070.    If an Ethernet frame comes up into the Ethernet driver off the
  1071.    network, the packet can be passed upwards to either the ARP (Address
  1072.    Resolution Protocol) module or to the IP (Internet Protocol) module.
  1073.    The value of the type field in the Ethernet frame determines whether
  1074.    the Ethernet frame is passed to the ARP or the IP module.
  1075.  
  1076.    If an IP packet comes up into IP, the unit of data is passed upwards
  1077.    to either TCP or UDP, as determined by the value of the protocol
  1078.    field in the IP header.
  1079.  
  1080.    If the UDP datagram comes up into UDP, the application message is
  1081.    passed upwards to the network application based on the value of the
  1082.    port field in the UDP header.  If the TCP message comes up into TCP,
  1083.    the application message is passed upwards to the network application
  1084.    based on the value of the port field in the TCP header.
  1085.  
  1086.    The downwards multiplexing is simple to perform because from each
  1087.    starting point there is only the one downward path; each protocol
  1088.    module adds its header information so the packet can be de-
  1089.    multiplexed at the destination computer.
  1090.  
  1091.    Data passing out from the applications through either TCP or UDP
  1092.    converges on the IP module and is sent downwards through the lower
  1093.    network interface driver.
  1094.  
  1095.    Although internet technology supports many different network media,
  1096.    Ethernet is used for all examples in this tutorial because it is the
  1097.    most common physical network used under IP.  The computer in Figure 1
  1098.    has a single Ethernet connection.  The 6-byte Ethernet address is
  1099.    unique for each interface on an Ethernet and is located at the lower
  1100.    interface of the Ethernet driver.
  1101.  
  1102.    The computer also has a 4-byte IP address.  This address is located
  1103.    at the lower interface to the IP module.  The IP address must be
  1104.    unique for an internet.
  1105.  
  1106.    A running computer always knows its own IP address and Ethernet
  1107.    address.
  1108.  
  1109. 2.4  Two Network Interfaces
  1110.  
  1111.    If a computer is connected to 2 separate Ethernets it is as in Figure
  1112.    3.
  1113.  
  1114.                 ----------------------------
  1115.                 |    network applications  |
  1116.                 |                          |
  1117.                 |...  \ | /  ..  \ | /  ...|
  1118.                 |     -----      -----     |
  1119.                 |     |TCP|      |UDP|     |
  1120.                 |     -----      -----     |
  1121.                 |         \      /         |
  1122.                 |         --------         |
  1123.                 |         |  IP  |         |
  1124.                 |  -----  -*----*-  -----  |
  1125.                 |  |ARP|   |    |   |ARP|  |
  1126.                 |  -----   |    |   -----  |
  1127.                 |      \   |    |   /      |
  1128.                 |      ------  ------      |
  1129.                 |      |ENET|  |ENET|      |
  1130.                 |      ---@--  ---@--      |
  1131.                 ----------|-------|---------
  1132.                           |       |
  1133.                           |    ---o---------------------------
  1134.                           |             Ethernet Cable 2
  1135.            ---------------o----------
  1136.              Ethernet Cable 1
  1137.  
  1138.              Figure 3.  TCP/IP Network Node on 2 Ethernets
  1139.  
  1140.    Please note that this computer has 2 Ethernet addresses and 2 IP
  1141.    addresses.
  1142.  
  1143.    It is seen from this structure that for computers with more than one
  1144.    physical network interface, the IP module is both a n-to-m
  1145.    multiplexer and an m-to-n de-multiplexer.
  1146.  
  1147.          1   2 3 ...   n                   1   2 3 ...   n
  1148.           \  | |      /    |                \  | |      /       ^
  1149.            \ | |     /     |                 \ | |     /        |
  1150.          -------------   flow              ----------------   flow
  1151.          |multiplexer|    of               |de-multiplexer|    of
  1152.          -------------   data              ----------------   data
  1153.            / | |     \     |                 / | |     \        |
  1154.           /  | |      \    v                /  | |      \       |
  1155.          1   2 3 ...   m                   1   2 3 ...   m
  1156.  
  1157.         Figure 4.  n-to-m multiplexer and m-to-n de-multiplexer
  1158.  
  1159.    It performs this multiplexing in either direction to accommodate
  1160.    incoming and outgoing data.  An IP module with more than 1 network
  1161.    interface is more complex than our original example in that it can
  1162.    forward data onto the next network.  Data can arrive on any network
  1163.    interface and be sent out on any other.
  1164.  
  1165.                            TCP      UDP
  1166.                              \      /
  1167.                               \    /
  1168.                           --------------
  1169.                           |     IP     |
  1170.                           |            |
  1171.                           |    ---     |
  1172.                           |   /   \    |
  1173.                           |  /     v   |
  1174.                           --------------
  1175.                            /         \
  1176.                           /           \
  1177.                        data           data
  1178.                       comes in         goes out
  1179.                      here               here
  1180.  
  1181.             Figure 5.  Example of IP Forwarding a IP Packet
  1182.  
  1183.    The process of sending an IP packet out onto another network is
  1184.    called "forwarding" an IP packet.  A computer that has been dedicated
  1185.    to the task of forwarding IP packets is called an "IP-router".
  1186.  
  1187.    As you can see from the figure, the forwarded IP packet never touches
  1188.    the TCP and UDP modules on the IP-router.  Some IP-router
  1189.    implementations do not have a TCP or UDP module.
  1190.  
  1191. 2.5  IP Creates a Single Logical Network
  1192.  
  1193.    The IP module is central to the success of internet technology.  Each
  1194.    module or driver adds its header to the message as the message passes
  1195.    down through the protocol stack.  Each module or driver strips the
  1196.    corresponding header from the message as the message climbs the
  1197.    protocol stack up towards the application.  The IP header contains
  1198.    the IP address, which builds a single logical network from multiple
  1199.    physical networks.  This interconnection of physical networks is the
  1200.    source of the name: internet.  A set of interconnected physical
  1201.    networks that limit the range of an IP packet is called an
  1202.    "internet".
  1203.  
  1204. 2.6  Physical Network Independence
  1205.  
  1206.    IP hides the underlying network hardware from the network
  1207.    applications.  If you invent a new physical network, you can put it
  1208.    into service by implementing a new driver that connects to the
  1209.    internet underneath IP.  Thus, the network applications remain intact
  1210.    and are not vulnerable to changes in hardware technology.
  1211.  
  1212. 2.7  Interoperability
  1213.  
  1214.    If two computers on an internet can communicate, they are said to
  1215.    "interoperate"; if an implementation of internet technology is good,
  1216.    it is said to have "interoperability".  Users of general-purpose
  1217.    computers benefit from the installation of an internet because of the
  1218.    interoperability in computers on the market.  Generally, when you buy
  1219.    a computer, it will interoperate.  If the computer does not have
  1220.    interoperability, and interoperability can not be added, it occupies
  1221.    a rare and special niche in the market.
  1222.  
  1223. 2.8  After the Overview
  1224.  
  1225.    With the background set, we will answer the following questions:
  1226.  
  1227.    When sending out an IP packet, how is the destination Ethernet
  1228.    address determined?
  1229.  
  1230.    How does IP know which of multiple lower network interfaces to use
  1231.    when sending out an IP packet?
  1232.  
  1233.    How does a client on one computer reach the server on another?
  1234.  
  1235.    Why do both TCP and UDP exist, instead of just one or the other?
  1236.  
  1237.    What network applications are available?
  1238.  
  1239.    These will be explained, in turn, after an Ethernet refresher.
  1240.  
  1241. 3.  Ethernet
  1242.  
  1243.    This section is a short review of Ethernet technology.
  1244.  
  1245.    An Ethernet frame contains the destination address, source address,
  1246.    type field, and data.
  1247.  
  1248.    An Ethernet address is 6 bytes.  Every device has its own Ethernet
  1249.    address and listens for Ethernet frames with that destination
  1250.    address.  All devices also listen for Ethernet frames with a wild-
  1251.    card destination address of "FF-FF-FF-FF-FF-FF" (in hexadecimal),
  1252.    called a "broadcast" address.
  1253.  
  1254.    Ethernet uses CSMA/CD (Carrier Sense and Multiple Access with
  1255.    Collision Detection).  CSMA/CD means that all devices communicate on
  1256.    a single medium, that only one can transmit at a time, and that they
  1257.    can all receive simultaneously.  If 2 devices try to transmit at the
  1258.    same instant, the transmit collision is detected, and both devices
  1259.    wait a random (but short) period before trying to transmit again.
  1260.  
  1261. 3.1  A Human Analogy
  1262.  
  1263.    A good analogy of Ethernet technology is a group of people talking in
  1264.    a small, completely dark room.  In this analogy, the physical network
  1265.    medium is sound waves on air in the room instead of electrical
  1266.    signals on a coaxial cable.
  1267.  
  1268.    Each person can hear the words when another is talking (Carrier
  1269.    Sense).  Everyone in the room has equal capability to talk (Multiple
  1270.    Access), but none of them give lengthy speeches because they are
  1271.    polite.  If a person is impolite, he is asked to leave the room
  1272.    (i.e., thrown off the net).
  1273.  
  1274.    No one talks while another is speaking.  But if two people start
  1275.    speaking at the same instant, each of them know this because each
  1276.    hears something they haven't said (Collision Detection).  When these
  1277.    two people notice this condition, they wait for a moment, then one
  1278.    begins talking.  The other hears the talking and waits for the first
  1279.    to finish before beginning his own speech.
  1280.  
  1281.    Each person has an unique name (unique Ethernet address) to avoid
  1282.    confusion.  Every time one of them talks, he prefaces the message
  1283.    with the name of the person he is talking to and with his own name
  1284.    (Ethernet destination and source address, respectively), i.e., "Hello
  1285.    Jane, this is Jack, ..blah blah blah...".  If the sender wants to
  1286.    talk to everyone he might say "everyone" (broadcast address), i.e.,
  1287.    "Hello Everyone, this is Jack, ..blah blah blah...".
  1288.  
  1289. 4.  ARP
  1290.  
  1291.    When sending out an IP packet, how is the destination Ethernet
  1292.    address determined?
  1293.  
  1294.    ARP (Address Resolution Protocol) is used to translate IP addresses
  1295.    to Ethernet addresses.  The translation is done only for outgoing IP
  1296.    packets, because this is when the IP header and the Ethernet header
  1297.    are created.
  1298.  
  1299. 4.1  ARP Table for Address Translation
  1300.  
  1301.    The translation is performed with a table look-up.  The table, called
  1302.    the ARP table, is stored in memory and contains a row for each
  1303.    computer.  There is a column for IP address and a column for Ethernet
  1304.    address.  When translating an IP address to an Ethernet address, the
  1305.    table is searched for a matching IP address.  The following is a
  1306.    simplified ARP table:
  1307.  
  1308.                   ------------------------------------
  1309.                   |IP address       Ethernet address |
  1310.                   ------------------------------------
  1311.                   |223.1.2.1        08-00-39-00-2F-C3|
  1312.                   |223.1.2.3        08-00-5A-21-A7-22|
  1313.                   |223.1.2.4        08-00-10-99-AC-54|
  1314.                   ------------------------------------
  1315.                       TABLE 1.  Example ARP Table
  1316.  
  1317.    The human convention when writing out the 4-byte IP address is each
  1318.    byte in decimal and separating bytes with a period.  When writing out
  1319.    the 6-byte Ethernet address, the conventions are each byte in
  1320.    hexadecimal and separating bytes with either a minus sign or a colon.
  1321.  
  1322.    The ARP table is necessary because the IP address and Ethernet
  1323.    address are selected independently; you can not use an algorithm to
  1324.    translate IP address to Ethernet address.  The IP address is selected
  1325.    by the network manager based on the location of the computer on the
  1326.    internet.  When the computer is moved to a different part of an
  1327.    internet, its IP address must be changed.  The Ethernet address is
  1328.    selected by the manufacturer based on the Ethernet address space
  1329.    licensed by the manufacturer.  When the Ethernet hardware interface
  1330.    board changes, the Ethernet address changes.
  1331.  
  1332. 4.2  Typical Translation Scenario
  1333.  
  1334.    During normal operation a network application, such as TELNET, sends
  1335.    an application message to TCP, then TCP sends the corresponding TCP
  1336.    message to the IP module.  The destination IP address is known by the
  1337.    application, the TCP module, and the IP module.  At this point the IP
  1338.    packet has been constructed and is ready to be given to the Ethernet
  1339.    driver, but first the destination Ethernet address must be
  1340.    determined.
  1341.  
  1342.    The ARP table is used to look-up the destination Ethernet address.
  1343.  
  1344.    4.3  ARP Request/Response Pair
  1345.  
  1346.    But how does the ARP table get filled in the first place?  The answer
  1347.    is that it is filled automatically by ARP on an "as-needed" basis.
  1348.  
  1349.    Two things happen when the ARP table can not be used to translate an
  1350.    address:
  1351.  
  1352.      1. An ARP request packet with a broadcast Ethernet address is sent
  1353.         out on the network to every computer.
  1354.  
  1355.      2. The outgoing IP packet is queued.
  1356.  
  1357.    Every computer's Ethernet interface receives the broadcast Ethernet
  1358.    frame.  Each Ethernet driver examines the Type field in the Ethernet
  1359.    frame and passes the ARP packet to the ARP module.  The ARP request
  1360.    packet says "If your IP address matches this target IP address, then
  1361.    please tell me your Ethernet address".  An ARP request packet looks
  1362.    something like this:
  1363.  
  1364.                 ---------------------------------------
  1365.                 |Sender IP Address   223.1.2.1        |
  1366.                 |Sender Enet Address 08-00-39-00-2F-C3|
  1367.                 ---------------------------------------
  1368.                 |Target IP Address   223.1.2.2        |
  1369.                 |Target Enet Address <blank>          |
  1370.                 ---------------------------------------
  1371.                      TABLE 2.  Example ARP Request
  1372.  
  1373.    Each ARP module examines the IP address and if the Target IP address
  1374.    matches its own IP address, it sends a response directly to the
  1375.    source Ethernet address.  The ARP response packet says "Yes, that
  1376.    target IP address is mine, let me give you my Ethernet address".  An
  1377.    ARP response packet has the sender/target field contents swapped as
  1378.    compared to the request.  It looks something like this:
  1379.  
  1380.                 ---------------------------------------
  1381.                 |Sender IP Address   223.1.2.2        |
  1382.                 |Sender Enet Address 08-00-28-00-38-A9|
  1383.                 ---------------------------------------
  1384.                 |Target IP Address   223.1.2.1        |
  1385.                 |Target Enet Address 08-00-39-00-2F-C3|
  1386.                 ---------------------------------------
  1387.                      TABLE 3.  Example ARP Response
  1388.  
  1389.    The response is received by the original sender computer.  The
  1390.    Ethernet driver looks at the Type field in the Ethernet frame then
  1391.    passes the ARP packet to the ARP module.  The ARP module examines the
  1392.    ARP packet and adds the sender's IP and Ethernet addresses to its ARP
  1393.    table.
  1394.  
  1395.    The updated table now looks like this:
  1396.  
  1397.                    ----------------------------------
  1398.                    |IP address     Ethernet address |
  1399.                    ----------------------------------
  1400.                    |223.1.2.1      08-00-39-00-2F-C3|
  1401.                    |223.1.2.2      08-00-28-00-38-A9|
  1402.                    |223.1.2.3      08-00-5A-21-A7-22|
  1403.                    |223.1.2.4      08-00-10-99-AC-54|
  1404.                    ----------------------------------
  1405.                    TA
  1406. BLE 4.  ARP Table after Response
  1407.  
  1408. 4.4  Scenario Continued
  1409.  
  1410.    The new translation has now been installed automatically in the
  1411.    table, just milli-seconds after it was needed.  As you remember from
  1412.    step 2 above, the outgoing IP packet was queued.  Next, the IP
  1413.    address to Ethernet address translation is performed by look-up in
  1414.    the ARP table then the Ethernet frame is transmitted on the Ethernet.
  1415.    Therefore, with the new steps 3, 4, and 5, the scenario for the
  1416.    sender computer is:
  1417.  
  1418.      1. An ARP request packet with a broadcast Ethernet address is sent
  1419.         out on the network to every computer.
  1420.  
  1421.      2. The outgoing IP packet is queued.
  1422.  
  1423.      3. The ARP response arrives with the IP-to-Ethernet address
  1424.         translation for the ARP table.
  1425.  
  1426.      4. For the queued IP packet, the ARP table is used to translate the
  1427.         IP address to the Ethernet address.
  1428.  
  1429.      5. The Ethernet frame is transmitted on the Ethernet.
  1430.  
  1431.    In summary, when the translation is missing from the ARP table, one
  1432.    IP packet is queued.  The translation data is quickly filled in with
  1433.    ARP request/response and the queued IP packet is transmitted.
  1434.  
  1435.    Each computer has a separate ARP table for each of its Ethernet
  1436.    interfaces.  If the target computer does not exist, there will be no
  1437.    ARP response and no entry in the ARP table.  IP will discard outgoing
  1438.    IP packets sent to that address.  The upper layer protocols can't
  1439.    tell the difference between a broken Ethernet and the absence of a
  1440.    computer with the target IP address.
  1441.  
  1442.    Some implementations of IP and ARP don't queue the IP packet while
  1443.    waiting for the ARP response.  Instead the IP packet is discarded and
  1444.    the recovery from the IP packet loss is left to the TCP module or the
  1445.    UDP network application.  This recovery is performed by time-out and
  1446.    retransmission.  The retransmitted message is successfully sent out
  1447.    onto the network because the first copy of the message has already
  1448.    caused the ARP table to be filled.
  1449. _______________________________________________________________________________
  1450.  
  1451.  
  1452.                 A TCP/IP Tutorial : Behind The Internet
  1453.                             Part Two of Two
  1454.  
  1455.                            October 4th, 1991
  1456.  
  1457.                          Presented by  The Not
  1458.  
  1459. 5.  Internet Protocol
  1460.  
  1461.    The IP module is central to internet technology and the essence of IP
  1462.    is its route table.  IP uses this in-memory table to make all
  1463.    decisions about routing an IP packet.  The content of the route table
  1464.    is defined by the network administrator.  Mistakes block
  1465.    communication.
  1466.  
  1467.    To understand how a route table is used is to understand
  1468.    internetworking.  This understanding is necessary for the successful
  1469.    administration and maintenance of an IP network.
  1470.  
  1471.    The route table is best understood by first having an overview of
  1472.    routing, then learing about IP network addresses, and then looking
  1473.    at the details.
  1474.  
  1475. 5.1  Direct Routing
  1476.  
  1477.    The figure below is of a tiny internet with 3 computers: A, B, and C.
  1478.    Each computer has the same TCP/IP protocol stack as in Figure 1.
  1479.    Each computer's Ethernet interface has its own Ethernet address.
  1480.    Each computer has an IP address assigned to the IP interface by the
  1481.    network manager, who also has assigned an IP network number to the
  1482.    Ethernet.
  1483.  
  1484.                           A      B      C
  1485.                           |      |      |
  1486.                         --o------o------o--
  1487.                         Ethernet 1
  1488.                         IP network "development"
  1489.  
  1490.                        Figure 6.  One IP Network
  1491.  
  1492.    When A sends an IP packet to B, the IP header contains A's IP address
  1493.    as the source IP address, and the Ethernet header contains A's
  1494.    Ethernet address as the source Ethernet address.  Also, the IP header
  1495.    contains B's IP address as the destination IP address and the
  1496.    Ethernet header contains B's Ethernet address as the des
  1497.                 ----------------------------------------
  1498.                 |address            source  destination|
  1499.                 ----------------------------------------
  1500.                 |IP header          A       B          |
  1501.                 |Ethernet header    A       B          |
  1502.                 ----------------------------------------
  1503.        TABLE 5.  Addresses in an Ethernet frame for an IP packet
  1504.                               from A to B
  1505.  
  1506.    For this simple case, IP is overhead because the IP adds little to
  1507.    the service offered by Ethernet.  However, IP does add cost: the
  1508.    extra CPU processing and network bandwidth to generate, transmit, and
  1509.    parse the IP header.
  1510.  
  1511.    When B's IP module receives the IP packet from A, it checks the
  1512.    destination IP address against its own, looking for a match, then it
  1513.    passes the datagram to the upper-level protocol.
  1514.  
  1515.    This communication between A and B uses direct routing.
  1516.  
  1517. 5.2  Indirect Routing
  1518.  
  1519.    The figure below is a more realistic view of an internet.  It is
  1520.    composed of 3 Ethernets and 3 IP networks connected by an IP-router
  1521.    called computer D.  Each IP network has 4 computers; each computer
  1522.    has its own IP address and Ethernet address.
  1523.  
  1524.           A      B      C      ----D----      E      F      G
  1525.           |      |      |      |   |   |      |      |      |
  1526.         --o------o------o------o-  |  -o------o------o------o--
  1527.         Ethernet 1                 |  Ethernet 2
  1528.         IP network "development"   |  IP network "accounting"
  1529.                                    |
  1530.                                    |
  1531.                                    |     H      I      J
  1532.                                    |     |      |      |
  1533.                                  --o-----o------o------o--
  1534.                                   Ethernet 3
  1535.                                   IP network "factory"
  1536.  
  1537.                Figure 7.  Three IP Networks; One internet
  1538.  
  1539.    Except for computer D, each computer has a TCP/IP protocol stack like
  1540.    that in Figure 1.  Computer D is the IP-router; it is connected to
  1541.    all 3 networks and therefore has 3 IP addresses and 3 Ethernet
  1542.    addresses.  Computer D has a TCP/IP protocol stack similar to that in
  1543.    Figure 3, except that it has 3 ARP modules and 3 Ethernet drivers
  1544.    instead of 2.  Please note that computer D has only one IP module.
  1545.  
  1546.    The network manager has assigned a unique number, called an IP
  1547.    network number, to each of the Ethernets.  The IP network numbers are
  1548.    not shown in this diagram, just the network names.
  1549.  
  1550.    When computer A sends an IP packet to computer B, the process is
  1551.    identical to the single network example above.  Any communication
  1552.    between computers located on a single IP network matches the direct
  1553.    routing example discussed previously.
  1554.  
  1555.    When computer D and A communicate, it is direct communication.  When
  1556.    computer D and E communicate, it is direct communication.  When
  1557.    computer D and H communicate, it is direct communication.  This is
  1558.    because each of these pairs of computers is on the same IP network.
  1559.  
  1560.    However, when computer A communicates with a computer on the far side
  1561.    of the IP-router, communication is no longer direct.  A must use D to
  1562.    forward the IP packet to the next IP network.  This communication is
  1563.    called "indirect".
  1564.  
  1565.    This routing of IP packets is done by IP modules and happens
  1566.    transparently to TCP, UDP, and the network applications.
  1567.  
  1568.    If A sends an IP packet to E, the source IP address and the source
  1569.    Ethernet address are A's.  The destination IP address is E's, but
  1570.    because A's IP module sends the IP packet to D for forwarding, the
  1571.    destination Ethernet address is D's.
  1572.  
  1573.                 ----------------------------------------
  1574.                 |address            source  destination|
  1575.                 ----------------------------------------
  1576.                 |IP header          A       E          |
  1577.                 |Ethernet header    A       D          |
  1578.                 ----------------------------------------
  1579.        TABLE 6.  Addresses in an Ethernet frame for an IP packet
  1580.                          from A to E (before D)
  1581.  
  1582.    D's IP module receives the IP packet and upon examining the
  1583.    destination IP address, says "This is not my IP address," and sends
  1584.    the IP packet directly to E.
  1585.  
  1586.                 ----------------------------------------
  1587.                 |address            source  destination|
  1588.                 ----------------------------------------
  1589.                 |IP header          A       E          |
  1590.                 |Ethernet header    D       E          |
  1591.                 ----------------------------------------
  1592.        TABLE 7.  Addresses in an Ethernet frame for an IP packet
  1593.                          from A to E (after D)
  1594.  
  1595.    In summary, for direct communication, both the source IP address and
  1596.    the source Ethernet address is the sender's, and the destination IP
  1597.    address and the destination Ethernet addrss is the recipient's.  For
  1598.    indirect communication, the IP address and Ethernet addresses do not
  1599.    pair up in this way.
  1600.  
  1601.    This example internet is a very simple one.  Real networks are often
  1602.    complicated by many factors, resulting in multiple IP-routers and
  1603.    several types of physical networks.  This example internet might have
  1604.    come about because the network manager wanted to split a large
  1605.    Ethernet in order to localize Ethernet broadcast traffic.
  1606.  
  1607. 5.3  IP Module Routing Rules
  1608.  
  1609.    This overview of routing has shown what happens, but not how it
  1610.    happens.  Now let's examine the rules, or algorithm, used by the IP
  1611.    module.
  1612.  
  1613.      For an outgoing IP packet, entering IP from an upper layer, IP must
  1614.      decide whether to send the IP packet directly or indirectly, and IP
  1615.      must choose a lower network interface.  These choices are made by
  1616.      consulting the route table.
  1617.  
  1618.      For an incoming IP packet, entering IP from a lower interface, IP
  1619.      must decide whether to forward the IP packet or pass it to an upper
  1620.      layer.  If the IP packet is being forwarded, it is treated as an
  1621.      outgoing IP packet.
  1622.  
  1623.      When an incoming IP packet arrives it is never forwarded back out
  1624.      through the same network interface.
  1625.  
  1626.    These decisions are made before the IP packet is handed to the lower
  1627.    interface and before the ARP table is consulted.
  1628.  
  1629. 5.4  IP Address
  1630.  
  1631.    The network manager assigns IP addresses to computers according to
  1632.    the IP network to which the computer is attached.  One part of a 4-
  1633.    byte IP address is the IP network number, the other part is the IP
  1634.    computer number (or host number).  For the computer in table 1, with
  1635.    an IP address of 223.1.2.1, the network number is 223.1.2 and the
  1636.    host number is number 1.
  1637.  
  1638.    The portion of the address that is used for network number and for
  1639.    host number is defined by the upper bits in the 4-byte address.  All
  1640.    example IP addresses in this tutorial are of type class C, meaning
  1641.    that the upper 3 bits indicate that 21 bits are the network number
  1642.    and 8 bits are the host number.  This allows 2,097,152 class C
  1643.    networks up to 254 hosts on each network.
  1644.  
  1645.    The IP address space is administered by the NIC (Network Information
  1646.    Center).  All internets that are connected to the single world-wide
  1647.    Internet must use network numbers assigned by the NIC.  If you are
  1648.    setting up your own internet and you are not intending to connect it
  1649.    to the Internet, you should still obtain your network numbers from
  1650.    the NIC.  If you pick your own number, you run the risk of confusion
  1651.    and chaos in the eventuality that your internet is connected to
  1652.    another internet.
  1653.  
  1654. 5.5  Names
  1655.  
  1656.    People refer to computers by names, not numbers.  A computer called
  1657.    alpha might have the IP address of 223.1.2.1.  For small networks,
  1658.    this name-to-address translation data is often kept on each computer
  1659.    in the "hosts" file.  For larger networks, this translation data file
  1660.    is stored on a server and accessed across the network when needed.  A
  1661.    few lines from that file might look like this:
  1662.  
  1663.    223.1.2.1     alpha
  1664.    223.1.2.2     beta
  1665.    223.1.2.3     gamma
  1666.    223.1.2.4     delta
  1667.    223.1.3.2     epsilon
  1668.    223.1.4.2     iota
  1669.  
  1670.    The IP address is the first column and the computer name is the
  1671.    second column.
  1672.  
  1673.    In most cases, you can install identical "hosts" files on all
  1674.    computers.  You may notice that "delta" has only one entry in this
  1675.    file even though it has 3 IP addresses.  Delta can be reached with
  1676.    any of its IP addresses; it does not matter which one is used.  When
  1677.    delta receives an IP packet and looks at the destination address, it
  1678.    will recognize any of its own IP addresses.
  1679.  
  1680.    IP networks are also given names.  If you have 3 IP networks, your
  1681.    "networks" file for documenting these names might look something like
  1682.    this:
  1683.  
  1684.    223.1.2     development
  1685.    223.1.3     accounting
  1686.    223.1.4     factory
  1687.  
  1688.    The IP network number is in the first column and its name is in the
  1689.    second column.
  1690.  
  1691.    From this example you can see that alpha is computer number 1 on the
  1692.    development network, beta is computer number 2 on the development
  1693.    network and so on.  You might also say that alpha is development.1,
  1694.    Beta is development.2, and so on.
  1695.  
  1696.    The above hosts file is adequate for the users, but the network
  1697.    manager will probably replace the line for delta with:
  1698.  
  1699.    223.1.2.4     devnetrouter    delta
  1700.    223.1.3.1     facnetrouter
  1701.    223.1.4.1     accnetrouter
  1702.  
  1703.    These three new lines for the hosts file give each of delta's IP
  1704.    addresses a meaningful name.  In fact, the first IP address listed
  1705.    has 2 names; "delta" and "devnetrouter" are synonyms.  In practice
  1706.    "delta" is the general-purpose name of the computer and the other 3
  1707.    names are only used when administering the IP route table.
  1708.  
  1709.    These files are used by network administration commands and network
  1710.    applications to provide meaningful names.  They are not required for
  1711.    operation of an internet, but they do make it easier for us.
  1712.  
  1713. 5.6  IP Route Table
  1714.  
  1715.    How does IP know which lower network interface to use when sending
  1716.    out a IP packet?  IP looks it up in the route table using a search
  1717.    key of the IP network number extracted from the IP destination
  1718.    address.
  1719.  
  1720.    The route table contains one row for each route.  The primary columns
  1721.    in the route table are:  IP network number, direct/indirect flag,
  1722.    router IP address, and interface number.  This table is referred to
  1723.    by IP for each outgoing IP packet.
  1724.  
  1725.    On most computers the route table can be modified with the "route"
  1726.    command.  The content of the route table is defined by the network
  1727.    manager, because the network manager assigns the IP addresses to the
  1728.    computers.
  1729.  
  1730. 5.7  Direct Routing Details
  1731.  
  1732.    To explain how it is used, let us visit in detail the routing
  1733.    situations we have reviewed previously.
  1734.  
  1735.                         ---------        ---------
  1736.                         | alpha |         | beta  |
  1737.                         |    1  |         |  1    |
  1738.                         ---------         ---------
  1739.                              |               |
  1740.                      --------o---------------o-
  1741.                       Ethernet 1
  1742.                       IP network "development"
  1743.  
  1744.                Figure 8.  Close-up View of One IP Network
  1745.  
  1746.    The route table inside alpha looks like this:
  1747.  
  1748.      --------------------------------------------------------------
  1749.      |network      direct/indirect flag  router   interface number|
  1750.      --------------------------------------------------------------
  1751.      |development  direct                <blank>  1               |
  1752.      --------------------------------------------------------------
  1753.                   TABLE 8.  Example Simple Route Table
  1754.  
  1755.    This view can be seen on some UNIX systems with the "netstat -r"
  1756.    command.  With this simple network, all computers have identical
  1757.    routing tables.
  1758.  
  1759.    For discussion, the table is printed again without the network number
  1760.    translated to its network name.
  1761.  
  1762.      --------------------------------------------------------------
  1763.      |network      direct/indirect flag  router   interface number|
  1764.      --------------------------------------------------------------
  1765.      |223.1.2      direct                <blank>  1               |
  1766.      --------------------------------------------------------------
  1767.            TABLE 9.  Example Simple Route Table with Numbers
  1768.  
  1769. 5.8  Direct Scenario
  1770.  
  1771.    Alpha is sending an IP packet to beta.  The IP packet is in alpha's
  1772.    IP module and the destination IP address is beta or 223.1.2.2.  IP
  1773.    extracts the network portion of this IP address and scans the first
  1774.    column of the table looking for a match.  With this network a match
  1775.    is found on the first entry.
  1776.  
  1777.    The other information in this entry indicates that computers on this
  1778.    network can be reached directly through interface number 1.  An ARP
  1779.    table translation is done on beta's IP address then the Ethernet
  1780.    frame is sent directly to beta via interface number 1.
  1781.  
  1782.    If an application tries to send data to an IP address that is not on
  1783.    the development network, IP will be unable to find a match in the
  1784.    route table.  IP then discards the IP packet.  Some computers provide
  1785.    a "Network not reachable" error message.
  1786.  
  1787. 5.9  Indirect Routing Details
  1788.  
  1789.    Now, let's take a closer look at the more complicated routing
  1790.    scenario that we examined previously.
  1791.  
  1792.           ---------           ---------           ---------
  1793.           | alpha |           | delta |           |epsilon|
  1794.           |    1  |           |1  2  3|           |   1   |
  1795.           ---------           ---------           ---------
  1796.                |               |  |  |                |
  1797.        --------o---------------o- | -o----------------o--------
  1798.         Ethernet 1                |     Ethernet 2
  1799.         IP network "Development"  |     IP network "accounting"
  1800.                                   |
  1801.                                   |     --------
  1802.                                   |     | iota |
  1803.                                   |     |  1   |
  1804.                                   |     --------
  1805.                                   |        |
  1806.                                 --o--------o--------
  1807.                                     Ethernet 3
  1808.                                     IP network "factory"
  1809.  
  1810.              Figure 9.  Close-up View of Three IP Networks
  1811.  
  1812.    The route table inside alpha looks like this:
  1813.  
  1814.  ---------------------------------------------------------------------
  1815.  |network      direct/indirect flag  router          interface number|
  1816.  ---------------------------------------------------------------------
  1817.  |development  direct                <blank>         1               |
  1818.  |accounting   indirect              devnetrouter    1               |
  1819.  |factory      indirect              devnetrouter    1               |
  1820.  --------------------------------------------------------------------
  1821.                       TABLE 10.  Alpha Route Table
  1822.  
  1823.    For discussion the table is printed again using numbers instead of
  1824.    names.
  1825.  
  1826.   --------------------------------------------------------------------
  1827.   |network      direct/indirect flag  router         interface number|
  1828.   --------------------------------------------------------------------
  1829.   |223.1.2      direct                <blank>        1               |
  1830.   |223.1.3      indirect              223.1.2.4      1               |
  1831.   |223.1.4      indirect              223.1.2.4      1               |
  1832.   --------------------------------------------------------------------
  1833.                TABLE 11.  Alpha Route Table with Numbers
  1834.  
  1835.    The router in Alpha's route table is the IP address of delta's
  1836.    connection to the development network.
  1837.  
  1838. 5.10  Indirect Scenario
  1839.  
  1840.    Alpha is sending an IP packet to epsilon.  The IP packet is in
  1841.    alpha's IP module and the destination IP address is epsilon
  1842.    (223.1.3.2).  IP extracts th network portion of this IP address
  1843.    (223.1.3) and scans the first column of the table looking for a
  1844.    match.  A match is found on the second entry.
  1845.  
  1846.    This entry indicates that computers on the 223.1.3 network can be
  1847.    reached through the IP-router devnetrouter.  Alpha's IP module then
  1848.    does an ARP table translation for devnetrouter's IP address and sends
  1849.    the IP packet directly to devnetrouter through Alpha's interface
  1850.    number 1.  The IP packet still contains the destination address of
  1851.    epsilon.
  1852.  
  1853.    The IP packet arrives at delta's development network interface and is
  1854.    passed up to delta's IP module.  The destination IP address is
  1855.    examined and because it does not match any of delta's own IP
  1856.    addresses, delta decides to forward the IP packet.
  1857.  
  1858.    Delta's IP module extracts the network portion of the destination IP
  1859.    address (223.1.3) and scans its route table for a matching network
  1860.    field.  Delta's route table looks like this:
  1861.  
  1862.  ----------------------------------------------------------------------
  1863.  |network      direct/indirect flag  router           interface number|
  1864.  ----------------------------------------------------------------------
  1865.  |development  direct                <blank>          1               |
  1866.  |factory      direct                <blank>          3               |
  1867.  |accounting   direct                <blank>          2               |
  1868.  ----------------------------------------------------------------------
  1869.                      TABLE 12.  Delta's Route Table
  1870.  
  1871.    Below is delta's table printed again, without the translation to
  1872.    names.
  1873.  
  1874.  ----------------------------------------------------------------------
  1875.  |network      direct/indirect flag  router           interface number|
  1876.  ----------------------------------------------------------------------
  1877.  |223.1.2      direct                <blank>          1               |
  1878.  |223.1.3      direct                <blank>          3               |
  1879.  |223.1.4      direct                <blank>          2               |
  1880.  ----------------------------------------------------------------------
  1881.               TABLE 13.  Delta's Route Table with Numbers
  1882.  
  1883.    The match is found on the second entry.  IP then sends the IP packet
  1884.    directly to epsilon through interface number 3.  The IP packet
  1885.    contains the IP destination address of epsilon and the Ethernet
  1886.    destination address of epsilon.
  1887.  
  1888.    The IP packet arrives at epsilon and is passed up to epsilon's IP
  1889.    module.  The destination IP address is examined and found to match
  1890.    with epsilon's IP address, so the IP packet is passed to the upper
  1891.    protocol layer.
  1892.  
  1893. 5.11  Routing Summary
  1894.  
  1895.    When a IP packet travels through a large internet it may go through
  1896.    many IP-routers before it reaches its destination.  The path it takes
  1897.    is not determined by a central source but is a result of consulting
  1898.    each of the routing tables used in the journey.  Each computer
  1899.    defines only the next hop in the journey and relies on that computer
  1900.    to send the IP packet on its way.
  1901.  
  1902. 5.12  Managing the Routes
  1903.  
  1904.    Maintaining correct routing tables on all computers in a large
  1905.    internet is a difficult task; network configuration is being modified
  1906.    constantly by the network managers to meet changing needs.  Mistakes
  1907.    in routing tables can block communication in ways that are
  1908.    excruciatingly tedious to diagnose.
  1909.  
  1910.    Keeping a simple network configuration goes a long way towards making
  1911.    a reliable internet.  For instance, the most straightforward method
  1912.    of assigning IP networks to Ethernet is to assign a single IP network
  1913.    number to each Ethernet.
  1914.  
  1915.    Help is also available from certain protocols and network
  1916.    applications.  ICMP (Internet Control Message Protocol) can report
  1917.    some routing problems.  For small networks the route table is filled
  1918.    manually on each computer by the network administrator.  For larger
  1919.    networks the network administrator automates this manual operation
  1920.    with a routing protocol to distribute routes throughout a network.
  1921.  
  1922.    When a computer is moved from one IP network to another, its IP
  1923.    address must change.  When a computer is removed from an IP network
  1924.    its old address becomes invalid.  These changes require frequent
  1925.    updates to the "hosts" file.  This flat file can become difficult to
  1926.    maintain for even medium-size networks.  The Domain Name System helps
  1927.    solve these problems.
  1928.  
  1929. 6.  User Datagram Protocol
  1930.  
  1931.    UDP is one of the two main protocols to reside on top of IP.  It
  1932.    offers service to the user's network applications.  Example network
  1933.    applications that use UDP are:  Network File System (NFS) and Simple
  1934.    Network Management Protocol (SNMP).  The service is little more than
  1935.    an interface to IP.
  1936.  
  1937.    UDP is a connectionless datagram delivery service that does not
  1938.    guarantee delivery.  UDP does not maintain an end-to-end connection
  1939.    with the remote UDP module; it merely pushes the datagram out on the
  1940.    net and accepts incoming datagrams off the net.
  1941.  
  1942.    UDP adds two values to what is provided by IP.  One is the
  1943.    multiplexing of information between applications based on port
  1944.    number.  The other is a checksum to check the integrity of the data.
  1945.  
  1946. 6.1  Ports
  1947.  
  1948.    How does a client on one computer reach the server on another?
  1949.  
  1950.    The path of communication between an application and UDP is through
  1951.    UDP ports.  These ports are numbered, beginning with zero.  An
  1952.    application that is offering service (the server) waits for messages
  1953.    to come in on a specific port dedicated to that service.  The server
  1954.    waits patiently for any client to request service.
  1955.  
  1956.    For instance, the SNMP server, called an SNMP agent, always waits on
  1957.    port 161.  There can be only one SNMP agent per computer because
  1958.    there is only one UDP port number 161.  This port number is well
  1959.    known; it is a fixed number, an internet assigned number.  If an SNMP
  1960.    client wants service, it sends its request to port number 161 of UDP
  1961.    on the destination computer.
  1962.  
  1963.    When an application sends data out through UDP it arrives at the far
  1964.    end as a single unit.  For example, if an application does 5 writes
  1965.    to the UDP port, the application at the far end will do 5 reads from
  1966.    the UDP port.  Also, the size of each write matches the size of each
  1967.    read.
  1968.  
  1969.    UDP preserves the message boundary defined by the application.  It
  1970.    never joins two application messages together, or divides a single
  1971.    application message into parts.
  1972.  
  1973. 6.2  Checksum
  1974.  
  1975.    An incoming IP packet with an IP header type field indicating "UDP"
  1976.    is passed up to the UDP module by IP.  When the UDP module receives
  1977.    the UDP datagram from IP it examines the UDP checksum.  If the
  1978.    checksum is zero, it means that checksum was not calculated by the
  1979.    sender and can be ignored.  Thus the sending computer's UDP module
  1980.    may or may not generate checksums.  If Ethernet is the only network
  1981.    between the 2 UDP modules communicating, then you may not need
  1982.    checksumming.  However, it is recommended that checksum generation
  1983.    always be enabled because at some point in the future a route table
  1984.    change may send the data across less reliable media.
  1985.  
  1986.    If the checksum is valid (or zero), the destination port number is
  1987.    examined and if an application is bound to that port, an application
  1988.    message is queued for the application to read.  Otherwise the UDP
  1989.    datagram is discarded.  If the incoming UDP datagrams arrive faster
  1990.    than the application can read them and if the queue fills to a
  1991.    maximum value, UDP datagrams are discarded by UDP.  UDP will continue
  1992.    to discard UDP datagrams until there is space in the queue.
  1993.  
  1994. 7.  Transmission Control Protocol
  1995.  
  1996.    TCP provides a different service than UDP.  TCP offers a connection-
  1997.    oriented byte stream, instead of a connectionless datagram delivery
  1998.    service.  TCP guarantees delivery, whereas UDP does not.
  1999.  
  2000.    TCP is used by network applications that require guaranteed delivery
  2001.    and cannot be bothered with doing time-outs and retransmissions.  The
  2002.    two most typical network applications that use TCP are File Transfer
  2003.    Protocol (FTP) and the TELNET.  Other popular TCP network
  2004.    applications include X-Window System, rcp (remote copy), and the r-
  2005.    series commands.  TCP's greater capability is not without cost: it
  2006.    requires more CPU and network bandwidth.  The internals of the TCP
  2007.    module are much more complicated than those in a UDP module.
  2008.  
  2009.    Similar to UDP, network applications connect to TCP ports.  Well-
  2010.    defined port numbers are dedicated to specific applications.  For
  2011.    instance, the TELNET server uses port number 23.  The TELNET client
  2012.    can find the server simply by connecting to port 23 of TCP on the
  2013.    specified computer.
  2014.  
  2015.    When the application first starts using TCP, the TCP module on the
  2016.    client's computer and the TCP module on the server's computer start
  2017.    communicating with each other.  These two end-point TCP modules
  2018.    contain state information that defines a virtual circuit.  This
  2019.    virtual circuit consumes resources in both TCP end-points.  The
  2020.    virtual circuit is full duplex; data can go in both directions
  2021.    simultaneously.  The application writes data to the TCP port, the
  2022.    data traverses the network and is read by the application at the far
  2023.    end.
  2024.  
  2025.    As with all sliding window protocols, the protocol has a window size.
  2026.    The window size determines the amount of data that can be transmitted
  2027.    before an acknowledgement is required.  For TCP, this amount is not a
  2028.    number of TCP segments but a number of bytes.
  2029.  
  2030. 8.  Network Appliations
  2031.  
  2032.    Why do both TCP and UDP exist, instead of just one or the other?
  2033.  
  2034.    They supply different services.  Most applications are implemented to
  2035.    use only one or the other.  You, the programmer, choose the protocol
  2036.    that best meets your needs.  If you need a reliable stream delivery
  2037.    service, TCP might be best.  If you need a datagram service, UDP
  2038.    might be best.  If you need efficiency over long-haul circuits, TCP
  2039.    might be best.  If you need efficiency over fast networks with short
  2040.    latency, UDP might be best.  If your needs do not fall nicely into
  2041.    these categories, then the "best" choice is unclear.  However,
  2042.    applications can make up for deficiencies in the choice.  For
  2043.    instance if you choose UDP and you need reliability, then the
  2044.    application must provide reliability.  If you choose TCP and you need
  2045.    a record oriented service, then the application must insert markers
  2046.    in the byte stream to delimit records.
  2047.  
  2048.    What network aplications are available?
  2049.  
  2050.    There are far too many to list.  The number is growing continually.
  2051.    Some of the applications have existed since the beginning of internet
  2052.    technology: TELNET and FTP.  Others are relatively new: X-Windows and
  2053.    SNMP.  The following is a brief description of the applications
  2054.    mentioned in this tutorial.
  2055.  
  2056. 8.1  TELNET
  2057.  
  2058.    TELNET provides a remote login capability on TCP.  The operation and
  2059.    appearance is similar to keyboard dialing through a telephone switch.
  2060.    On the command line the user types "telnet delta" and receives a
  2061.    login prompt from the computer called "delta".
  2062.  
  2063.    TELNET works well; it is an old application and has widespread
  2064.    interoperability.  Implementations of TELNET usually work between
  2065.    different operating systems.  For instance, a TELNET client may be on
  2066.    VAX/VMS and the server on UNIX System V.
  2067.  
  2068. 8.2  FTP
  2069.  
  2070.    File Transfer Protocol (FTP), as old as TELNET, also uses TCP and has
  2071.    widespread interoperability.  The operation and appearance is as if
  2072.    you TELNETed to the remote computer.  But instead of typing your
  2073.    usual commands, you have to make do with a short list of commands for
  2074.    directory listings and the like.  FTP commands allow you to copy
  2075.    files between computers.
  2076.  
  2077. 8.3  rsh
  2078.  
  2079.    Remote shell (rsh or remsh) is one of an entire family of remote UNIX
  2080.    style commands.  The UNIX copy command, cp, becomes rcp.  The UNIX
  2081.    "who is logged in" command, who, becomes rwho.  The list continues
  2082.    and is referred to collectively to as the "r" series commands or the
  2083.    "r*" (r star) commands.
  2084.  
  2085.    The r* commands mainly work between UNIX systems and are designed for
  2086.    interaction between trusted hosts.  Little consideration is given to
  2087.    security, but they provide a convenient user environment.
  2088.  
  2089.    To execute the "cc file.c" command on a remote computer called delta,
  2090.    type "rsh delta cc file.c".  To copy the "file.c" file to delta, type
  2091.    "rcp file.c delta:".  To login to delta, type "rlogin delta", and if
  2092.    you administered the computers in a certain wa, you will not be
  2093.    challenged with a password prompt.
  2094.  
  2095. 8.4  NFS
  2096.  
  2097.    Network File System, first developed by Sun Microsystems Inc, uses
  2098.    UDP and is excellent for mounting UNIX file systems on multiple
  2099.    computers.  A diskless workstation can access its server's hard disk
  2100.    as if the disk were local to the workstation.  A single disk copy of
  2101.    a database on mainframe "alpha" can also be used by mainframe "beta"
  2102.    if the database's file system is NFS mounted commands to
  2103.    use the NFS mounted disk as if it were local disk.
  2104.  
  2105. 8.5  SNMP
  2106.  
  2107.    Simple Network Management Protocol (SNMP) uses UDP and is designed
  2108.    for use by central network management stations.  It is a well known
  2109.    fact that if given enough data, a network manager can detect and
  2110.    diagnose network problems.  The central station uses SNMP to collect
  2111.    this data from other computers on the network.  SNMP defines the
  2112.    format for the data; it is left to the central station or network
  2113.    manager to interpret the data.
  2114.  
  2115. 8.6  X-Window
  2116.  
  2117.    The X Window System uses the X Window protocol on TCP to draw windows
  2118.    on a workstation's bitmap display.  X Window is much more than a
  2119.    utility for drawing windows; it is entire philosophy for designing a
  2120.    user interface.
  2121.  
  2122. 9.  Other Information
  2123.  
  2124.    Much information about internet technology was not included in this
  2125.    tutorial.  This section lists information that is considered the next
  2126.    level of detail for the reader who wishes to learn more.
  2127.  
  2128.      o administration commands: arp, route, and netstat
  2129.      o ARP: permanent entry, publish entry, time-out entry, spoofing
  2130.      o IP route table: host entry, default gateway, subnets
  2131.      o IP: time-to-live counter, fragmentation, ICMP
  2132.      o RIP, routing loops
  2133.      o Domain Name System
  2134.  
  2135. 10.  References
  2136.  
  2137.    [1] Comer, D., "Internetworking with TCP/IP Principles, Protocols,
  2138.        and Architecture", Prentice Hall, Englewood Cliffs, New Jersey,
  2139.        U.S.A., 1988.
  2140.  
  2141.    [2] Feinler, E., et al, DDN Protocol Handbook, Volume 2 and 3, DDN
  2142.        Network Information Center, SRI International, 333 Ravenswood
  2143.        Avenue, Room EJ291, Menlow Park, California, U.S.A., 1985.
  2144.  
  2145.    [3] Spider Systems, Ltd., "Packets and Protocols", Spider Systems
  2146.        Ltd., Stanwell Street, Edinburgh, U.K. EH6 5NG, 1990.
  2147.  
  2148. 11.  Relation to other RFCs
  2149.  
  2150.    This RFC is a tutorial and it does not UPDATE or OBSOLETE any other
  2151.    RFC.
  2152.  
  2153. 12.  Security Considerations
  2154.  
  2155.    There are security considerations within the TCP/IP protocol suite.
  2156.    To some people these considerations are serious problems, to others
  2157.    they are not; it depends on the user requirements.
  2158.    This tutorial does not discuss these issues, but if you want to learn
  2159.    more you should start with the topic of ARP-spoofing, then use the
  2160.    "Security Considerations" section of RFC 1122 to lead you to more
  2161.    information.
  2162.  
  2163. 13.  Authors' Addresses
  2164.  
  2165.    Theodore John Socolofsky
  2166.    EMail: TEDS@SPIDER.CO.UK
  2167.  
  2168.    Claudia Jeanne Kale
  2169.    EMail: CLAUDIAK@SPIDER.CO.UK
  2170.  
  2171.    Note:  This info taken from RFC-1180.
  2172. _______________________________________________________________________________
  2173.  
  2174.  
  2175.  
  2176.