home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / phrack2 / phrack34.008 < prev    next >
Encoding:
Text File  |  2003-06-11  |  33.7 KB  |  728 lines

  1.                             ==Phrack Inc.==
  2.  
  3.               Volume Three, Issue Thirty-Four, File #8 of 11
  4.   
  5.                 A TCP/IP Tutorial : Behind The Internet
  6.                             Part Two of Two
  7.  
  8.                            October 4th, 1991
  9.  
  10.                          Presented by  The Not
  11.  
  12. 5.  Internet Protocol
  13.  
  14.    The IP module is central to internet technology and the essence of IP
  15.    is its route table.  IP uses this in-memory table to make all
  16.    decisions about routing an IP packet.  The content of the route table
  17.    is defined by the network administrator.  Mistakes block
  18.    communication.
  19.  
  20.    To understand how a route table is used is to understand
  21.    internetworking.  This understanding is necessary for the successful
  22.    administration and maintenance of an IP network.
  23.  
  24.    The route table is best understood by first having an overview of
  25.    routing, then learing about IP network addresses, and then looking
  26.    at the details.
  27.  
  28. 5.1  Direct Routing
  29.  
  30.    The figure below is of a tiny internet with 3 computers: A, B, and C.
  31.    Each computer has the same TCP/IP protocol stack as in Figure 1.
  32.    Each computer's Ethernet interface has its own Ethernet address.
  33.    Each computer has an IP address assigned to the IP interface by the
  34.    network manager, who also has assigned an IP network number to the
  35.    Ethernet.
  36.  
  37.                           A      B      C
  38.                           |      |      |
  39.                         --o------o------o--
  40.                         Ethernet 1
  41.                         IP network "development"
  42.  
  43.                        Figure 6.  One IP Network
  44.  
  45.    When A sends an IP packet to B, the IP header contains A's IP address
  46.    as the source IP address, and the Ethernet header contains A's
  47.    Ethernet address as the source Ethernet address.  Also, the IP header
  48.    contains B's IP address as the destination IP address and the
  49.    Ethernet header contains B's Ethernet address as the des 
  50.                 ----------------------------------------
  51.                 |address            source  destination|
  52.                 ----------------------------------------
  53.                 |IP header          A       B          |
  54.                 |Ethernet header    A       B          |
  55.                 ----------------------------------------
  56.        TABLE 5.  Addresses in an Ethernet frame for an IP packet
  57.                               from A to B
  58.  
  59.    For this simple case, IP is overhead because the IP adds little to
  60.    the service offered by Ethernet.  However, IP does add cost: the
  61.    extra CPU processing and network bandwidth to generate, transmit, and
  62.    parse the IP header.
  63.  
  64.    When B's IP module receives the IP packet from A, it checks the
  65.    destination IP address against its own, looking for a match, then it
  66.    passes the datagram to the upper-level protocol.
  67.  
  68.    This communication between A and B uses direct routing.
  69.  
  70. 5.2  Indirect Routing
  71.  
  72.    The figure below is a more realistic view of an internet.  It is
  73.    composed of 3 Ethernets and 3 IP networks connected by an IP-router
  74.    called computer D.  Each IP network has 4 computers; each computer
  75.    has its own IP address and Ethernet address.
  76.  
  77.           A      B      C      ----D----      E      F      G
  78.           |      |      |      |   |   |      |      |      |
  79.         --o------o------o------o-  |  -o------o------o------o--
  80.         Ethernet 1                 |  Ethernet 2
  81.         IP network "development"   |  IP network "accounting"
  82.                                    |
  83.                                    |
  84.                                    |     H      I      J
  85.                                    |     |      |      |
  86.                                  --o-----o------o------o--
  87.                                   Ethernet 3
  88.                                   IP network "factory"
  89.  
  90.                Figure 7.  Three IP Networks; One internet
  91.  
  92.    Except for computer D, each computer has a TCP/IP protocol stack like
  93.    that in Figure 1.  Computer D is the IP-router; it is connected to
  94.    all 3 networks and therefore has 3 IP addresses and 3 Ethernet
  95.    addresses.  Computer D has a TCP/IP protocol stack similar to that in
  96.    Figure 3, except that it has 3 ARP modules and 3 Ethernet drivers
  97.    instead of 2.  Please note that computer D has only one IP module.
  98.  
  99.    The network manager has assigned a unique number, called an IP
  100.    network number, to each of the Ethernets.  The IP network numbers are
  101.    not shown in this diagram, just the network names.
  102.  
  103.    When computer A sends an IP packet to computer B, the process is
  104.    identical to the single network example above.  Any communication
  105.    between computers located on a single IP network matches the direct
  106.    routing example discussed previously.
  107.  
  108.    When computer D and A communicate, it is direct communication.  When
  109.    computer D and E communicate, it is direct communication.  When
  110.    computer D and H communicate, it is direct communication.  This is
  111.    because each of these pairs of computers is on the same IP network.
  112.  
  113.    However, when computer A communicates with a computer on the far side
  114.    of the IP-router, communication is no longer direct.  A must use D to
  115.    forward the IP packet to the next IP network.  This communication is
  116.    called "indirect".
  117.  
  118.    This routing of IP packets is done by IP modules and happens
  119.    transparently to TCP, UDP, and the network applications.
  120.  
  121.    If A sends an IP packet to E, the source IP address and the source
  122.    Ethernet address are A's.  The destination IP address is E's, but
  123.    because A's IP module sends the IP packet to D for forwarding, the
  124.    destination Ethernet address is D's.
  125.  
  126.                 ----------------------------------------
  127.                 |address            source  destination|
  128.                 ----------------------------------------
  129.                 |IP header          A       E          |
  130.                 |Ethernet header    A       D          |
  131.                 ----------------------------------------
  132.        TABLE 6.  Addresses in an Ethernet frame for an IP packet
  133.                          from A to E (before D)
  134.  
  135.    D's IP module receives the IP packet and upon examining the
  136.    destination IP address, says "This is not my IP address," and sends
  137.    the IP packet directly to E.
  138.  
  139.                 ----------------------------------------
  140.                 |address            source  destination|
  141.                 ----------------------------------------
  142.                 |IP header          A       E          |
  143.                 |Ethernet header    D       E          |
  144.                 ----------------------------------------
  145.        TABLE 7.  Addresses in an Ethernet frame for an IP packet
  146.                          from A to E (after D)
  147.  
  148.    In summary, for direct communication, both the source IP address and
  149.    the source Ethernet address is the sender's, and the destination IP
  150.    address and the destination Ethernet addrss is the recipient's.  For
  151.    indirect communication, the IP address and Ethernet addresses do not
  152.    pair up in this way.
  153.  
  154.    This example internet is a very simple one.  Real networks are often
  155.    complicated by many factors, resulting in multiple IP-routers and
  156.    several types of physical networks.  This example internet might have
  157.    come about because the network manager wanted to split a large
  158.    Ethernet in order to localize Ethernet broadcast traffic.
  159.  
  160. 5.3  IP Module Routing Rules
  161.  
  162.    This overview of routing has shown what happens, but not how it
  163.    happens.  Now let's examine the rules, or algorithm, used by the IP
  164.    module.
  165.  
  166.      For an outgoing IP packet, entering IP from an upper layer, IP must
  167.      decide whether to send the IP packet directly or indirectly, and IP
  168.      must choose a lower network interface.  These choices are made by
  169.      consulting the route table.
  170.  
  171.      For an incoming IP packet, entering IP from a lower interface, IP
  172.      must decide whether to forward the IP packet or pass it to an upper
  173.      layer.  If the IP packet is being forwarded, it is treated as an
  174.      outgoing IP packet.
  175.  
  176.      When an incoming IP packet arrives it is never forwarded back out
  177.      through the same network interface.
  178.  
  179.    These decisions are made before the IP packet is handed to the lower
  180.    interface and before the ARP table is consulted.
  181.  
  182. 5.4  IP Address
  183.  
  184.    The network manager assigns IP addresses to computers according to
  185.    the IP network to which the computer is attached.  One part of a 4-
  186.    byte IP address is the IP network number, the other part is the IP
  187.    computer number (or host number).  For the computer in table 1, with
  188.    an IP address of 223.1.2.1, the network number is 223.1.2 and the
  189.    host number is number 1.
  190.  
  191.    The portion of the address that is used for network number and for
  192.    host number is defined by the upper bits in the 4-byte address.  All
  193.    example IP addresses in this tutorial are of type class C, meaning
  194.    that the upper 3 bits indicate that 21 bits are the network number
  195.    and 8 bits are the host number.  This allows 2,097,152 class C
  196.    networks up to 254 hosts on each network.
  197.  
  198.    The IP address space is administered by the NIC (Network Information
  199.    Center).  All internets that are connected to the single world-wide
  200.    Internet must use network numbers assigned by the NIC.  If you are
  201.    setting up your own internet and you are not intending to connect it
  202.    to the Internet, you should still obtain your network numbers from
  203.    the NIC.  If you pick your own number, you run the risk of confusion
  204.    and chaos in the eventuality that your internet is connected to
  205.    another internet.
  206.  
  207. 5.5  Names
  208.  
  209.    People refer to computers by names, not numbers.  A computer called
  210.    alpha might have the IP address of 223.1.2.1.  For small networks,
  211.    this name-to-address translation data is often kept on each computer
  212.    in the "hosts" file.  For larger networks, this translation data file
  213.    is stored on a server and accessed across the network when needed.  A
  214.    few lines from that file might look like this:
  215.  
  216.    223.1.2.1     alpha
  217.    223.1.2.2     beta
  218.    223.1.2.3     gamma
  219.    223.1.2.4     delta
  220.    223.1.3.2     epsilon
  221.    223.1.4.2     iota
  222.  
  223.    The IP address is the first column and the computer name is the
  224.    second column.
  225.  
  226.    In most cases, you can install identical "hosts" files on all
  227.    computers.  You may notice that "delta" has only one entry in this
  228.    file even though it has 3 IP addresses.  Delta can be reached with
  229.    any of its IP addresses; it does not matter which one is used.  When
  230.    delta receives an IP packet and looks at the destination address, it
  231.    will recognize any of its own IP addresses.
  232.  
  233.    IP networks are also given names.  If you have 3 IP networks, your
  234.    "networks" file for documenting these names might look something like
  235.    this:
  236.  
  237.    223.1.2     development
  238.    223.1.3     accounting
  239.    223.1.4     factory
  240.  
  241.    The IP network number is in the first column and its name is in the
  242.    second column.
  243.  
  244.    From this example you can see that alpha is computer number 1 on the
  245.    development network, beta is computer number 2 on the development
  246.    network and so on.  You might also say that alpha is development.1,
  247.    Beta is development.2, and so on.
  248.  
  249.    The above hosts file is adequate for the users, but the network
  250.    manager will probably replace the line for delta with:
  251.  
  252.    223.1.2.4     devnetrouter    delta
  253.    223.1.3.1     facnetrouter
  254.    223.1.4.1     accnetrouter
  255.  
  256.    These three new lines for the hosts file give each of delta's IP
  257.    addresses a meaningful name.  In fact, the first IP address listed
  258.    has 2 names; "delta" and "devnetrouter" are synonyms.  In practice
  259.    "delta" is the general-purpose name of the computer and the other 3
  260.    names are only used when administering the IP route table.
  261.  
  262.    These files are used by network administration commands and network
  263.    applications to provide meaningful names.  They are not required for
  264.    operation of an internet, but they do make it easier for us.
  265.  
  266. 5.6  IP Route Table
  267.  
  268.    How does IP know which lower network interface to use when sending
  269.    out a IP packet?  IP looks it up in the route table using a search
  270.    key of the IP network number extracted from the IP destination
  271.    address.
  272.  
  273.    The route table contains one row for each route.  The primary columns
  274.    in the route table are:  IP network number, direct/indirect flag,
  275.    router IP address, and interface number.  This table is referred to
  276.    by IP for each outgoing IP packet.
  277.  
  278.    On most computers the route table can be modified with the "route"
  279.    command.  The content of the route table is defined by the network
  280.    manager, because the network manager assigns the IP addresses to the
  281.    computers.
  282.  
  283. 5.7  Direct Routing Details
  284.  
  285.    To explain how it is used, let us visit in detail the routing
  286.    situations we have reviewed previously.
  287.  
  288.                         ---------        ---------
  289.                         | alpha |         | beta  |
  290.                         |    1  |         |  1    |
  291.                         ---------         ---------
  292.                              |               |
  293.                      --------o---------------o-
  294.                       Ethernet 1
  295.                       IP network "development"
  296.  
  297.                Figure 8.  Close-up View of One IP Network
  298.  
  299.    The route table inside alpha looks like this:
  300.  
  301.      --------------------------------------------------------------
  302.      |network      direct/indirect flag  router   interface number|
  303.      --------------------------------------------------------------
  304.      |development  direct                <blank>  1               |
  305.      --------------------------------------------------------------
  306.                   TABLE 8.  Example Simple Route Table
  307.  
  308.    This view can be seen on some UNIX systems with the "netstat -r"
  309.    command.  With this simple network, all computers have identical
  310.    routing tables.
  311.  
  312.    For discussion, the table is printed again without the network number
  313.    translated to its network name.
  314.  
  315.      --------------------------------------------------------------
  316.      |network      direct/indirect flag  router   interface number|
  317.      --------------------------------------------------------------
  318.      |223.1.2      direct                <blank>  1               |
  319.      --------------------------------------------------------------
  320.            TABLE 9.  Example Simple Route Table with Numbers
  321.  
  322. 5.8  Direct Scenario
  323.  
  324.    Alpha is sending an IP packet to beta.  The IP packet is in alpha's
  325.    IP module and the destination IP address is beta or 223.1.2.2.  IP
  326.    extracts the network portion of this IP address and scans the first
  327.    column of the table looking for a match.  With this network a match
  328.    is found on the first entry.
  329.  
  330.    The other information in this entry indicates that computers on this
  331.    network can be reached directly through interface number 1.  An ARP
  332.    table translation is done on beta's IP address then the Ethernet
  333.    frame is sent directly to beta via interface number 1.
  334.  
  335.    If an application tries to send data to an IP address that is not on
  336.    the development network, IP will be unable to find a match in the
  337.    route table.  IP then discards the IP packet.  Some computers provide
  338.    a "Network not reachable" error message.
  339.  
  340. 5.9  Indirect Routing Details
  341.  
  342.    Now, let's take a closer look at the more complicated routing
  343.    scenario that we examined previously.
  344.  
  345.           ---------           ---------           ---------
  346.           | alpha |           | delta |           |epsilon|
  347.           |    1  |           |1  2  3|           |   1   |
  348.           ---------           ---------           ---------
  349.                |               |  |  |                |
  350.        --------o---------------o- | -o----------------o--------
  351.         Ethernet 1                |     Ethernet 2
  352.         IP network "Development"  |     IP network "accounting"
  353.                                   |
  354.                                   |     --------
  355.                                   |     | iota |
  356.                                   |     |  1   |
  357.                                   |     --------
  358.                                   |        |
  359.                                 --o--------o--------
  360.                                     Ethernet 3
  361.                                     IP network "factory"
  362.  
  363.              Figure 9.  Close-up View of Three IP Networks
  364.  
  365.    The route table inside alpha looks like this:
  366.  
  367.  ---------------------------------------------------------------------
  368.  |network      direct/indirect flag  router          interface number|
  369.  ---------------------------------------------------------------------
  370.  |development  direct                <blank>         1               |
  371.  |accounting   indirect              devnetrouter    1               |
  372.  |factory      indirect              devnetrouter    1               |
  373.  --------------------------------------------------------------------
  374.                       TABLE 10.  Alpha Route Table
  375.  
  376.    For discussion the table is printed again using numbers instead of
  377.    names.
  378.  
  379.   --------------------------------------------------------------------
  380.   |network      direct/indirect flag  router         interface number|
  381.   --------------------------------------------------------------------
  382.   |223.1.2      direct                <blank>        1               |
  383.   |223.1.3      indirect              223.1.2.4      1               |
  384.   |223.1.4      indirect              223.1.2.4      1               |
  385.   --------------------------------------------------------------------
  386.                TABLE 11.  Alpha Route Table with Numbers
  387.  
  388.    The router in Alpha's route table is the IP address of delta's
  389.    connection to the development network.
  390.  
  391. 5.10  Indirect Scenario
  392.  
  393.    Alpha is sending an IP packet to epsilon.  The IP packet is in
  394.    alpha's IP module and the destination IP address is epsilon
  395.    (223.1.3.2).  IP extracts th network portion of this IP address
  396.    (223.1.3) and scans the first column of the table looking for a
  397.    match.  A match is found on the second entry.
  398.  
  399.    This entry indicates that computers on the 223.1.3 network can be
  400.    reached through the IP-router devnetrouter.  Alpha's IP module then
  401.    does an ARP table translation for devnetrouter's IP address and sends
  402.    the IP packet directly to devnetrouter through Alpha's interface
  403.    number 1.  The IP packet still contains the destination address of
  404.    epsilon.
  405.  
  406.    The IP packet arrives at delta's development network interface and is
  407.    passed up to delta's IP module.  The destination IP address is
  408.    examined and because it does not match any of delta's own IP
  409.    addresses, delta decides to forward the IP packet.
  410.  
  411.    Delta's IP module extracts the network portion of the destination IP
  412.    address (223.1.3) and scans its route table for a matching network
  413.    field.  Delta's route table looks like this:
  414.  
  415.  ----------------------------------------------------------------------
  416.  |network      direct/indirect flag  router           interface number|
  417.  ----------------------------------------------------------------------
  418.  |development  direct                <blank>          1               |
  419.  |factory      direct                <blank>          3               |
  420.  |accounting   direct                <blank>          2               |
  421.  ----------------------------------------------------------------------
  422.                      TABLE 12.  Delta's Route Table
  423.  
  424.    Below is delta's table printed again, without the translation to
  425.    names.
  426.  
  427.  ----------------------------------------------------------------------
  428.  |network      direct/indirect flag  router           interface number|
  429.  ----------------------------------------------------------------------
  430.  |223.1.2      direct                <blank>          1               |
  431.  |223.1.3      direct                <blank>          3               |
  432.  |223.1.4      direct                <blank>          2               |
  433.  ----------------------------------------------------------------------
  434.               TABLE 13.  Delta's Route Table with Numbers
  435.  
  436.    The match is found on the second entry.  IP then sends the IP packet
  437.    directly to epsilon through interface number 3.  The IP packet
  438.    contains the IP destination address of epsilon and the Ethernet
  439.    destination address of epsilon.
  440.  
  441.    The IP packet arrives at epsilon and is passed up to epsilon's IP
  442.    module.  The destination IP address is examined and found to match
  443.    with epsilon's IP address, so the IP packet is passed to the upper
  444.    protocol layer.
  445.  
  446. 5.11  Routing Summary
  447.  
  448.    When a IP packet travels through a large internet it may go through
  449.    many IP-routers before it reaches its destination.  The path it takes
  450.    is not determined by a central source but is a result of consulting
  451.    each of the routing tables used in the journey.  Each computer
  452.    defines only the next hop in the journey and relies on that computer
  453.    to send the IP packet on its way.
  454.  
  455. 5.12  Managing the Routes
  456.  
  457.    Maintaining correct routing tables on all computers in a large
  458.    internet is a difficult task; network configuration is being modified
  459.    constantly by the network managers to meet changing needs.  Mistakes
  460.    in routing tables can block communication in ways that are
  461.    excruciatingly tedious to diagnose.
  462.  
  463.    Keeping a simple network configuration goes a long way towards making
  464.    a reliable internet.  For instance, the most straightforward method
  465.    of assigning IP networks to Ethernet is to assign a single IP network
  466.    number to each Ethernet.
  467.  
  468.    Help is also available from certain protocols and network
  469.    applications.  ICMP (Internet Control Message Protocol) can report
  470.    some routing problems.  For small networks the route table is filled
  471.    manually on each computer by the network administrator.  For larger
  472.    networks the network administrator automates this manual operation
  473.    with a routing protocol to distribute routes throughout a network.
  474.  
  475.    When a computer is moved from one IP network to another, its IP
  476.    address must change.  When a computer is removed from an IP network
  477.    its old address becomes invalid.  These changes require frequent
  478.    updates to the "hosts" file.  This flat file can become difficult to
  479.    maintain for even medium-size networks.  The Domain Name System helps
  480.    solve these problems.
  481.  
  482. 6.  User Datagram Protocol
  483.  
  484.    UDP is one of the two main protocols to reside on top of IP.  It
  485.    offers service to the user's network applications.  Example network
  486.    applications that use UDP are:  Network File System (NFS) and Simple
  487.    Network Management Protocol (SNMP).  The service is little more than
  488.    an interface to IP.
  489.  
  490.    UDP is a connectionless datagram delivery service that does not
  491.    guarantee delivery.  UDP does not maintain an end-to-end connection
  492.    with the remote UDP module; it merely pushes the datagram out on the
  493.    net and accepts incoming datagrams off the net.
  494.  
  495.    UDP adds two values to what is provided by IP.  One is the
  496.    multiplexing of information between applications based on port
  497.    number.  The other is a checksum to check the integrity of the data.
  498.  
  499. 6.1  Ports
  500.  
  501.    How does a client on one computer reach the server on another?
  502.  
  503.    The path of communication between an application and UDP is through
  504.    UDP ports.  These ports are numbered, beginning with zero.  An
  505.    application that is offering service (the server) waits for messages
  506.    to come in on a specific port dedicated to that service.  The server
  507.    waits patiently for any client to request service.
  508.  
  509.    For instance, the SNMP server, called an SNMP agent, always waits on
  510.    port 161.  There can be only one SNMP agent per computer because
  511.    there is only one UDP port number 161.  This port number is well
  512.    known; it is a fixed number, an internet assigned number.  If an SNMP
  513.    client wants service, it sends its request to port number 161 of UDP
  514.    on the destination computer.
  515.  
  516.    When an application sends data out through UDP it arrives at the far
  517.    end as a single unit.  For example, if an application does 5 writes
  518.    to the UDP port, the application at the far end will do 5 reads from
  519.    the UDP port.  Also, the size of each write matches the size of each
  520.    read.
  521.  
  522.    UDP preserves the message boundary defined by the application.  It
  523.    never joins two application messages together, or divides a single
  524.    application message into parts.
  525.  
  526. 6.2  Checksum
  527.  
  528.    An incoming IP packet with an IP header type field indicating "UDP"
  529.    is passed up to the UDP module by IP.  When the UDP module receives
  530.    the UDP datagram from IP it examines the UDP checksum.  If the
  531.    checksum is zero, it means that checksum was not calculated by the
  532.    sender and can be ignored.  Thus the sending computer's UDP module
  533.    may or may not generate checksums.  If Ethernet is the only network
  534.    between the 2 UDP modules communicating, then you may not need
  535.    checksumming.  However, it is recommended that checksum generation
  536.    always be enabled because at some point in the future a route table
  537.    change may send the data across less reliable media.
  538.  
  539.    If the checksum is valid (or zero), the destination port number is
  540.    examined and if an application is bound to that port, an application
  541.    message is queued for the application to read.  Otherwise the UDP
  542.    datagram is discarded.  If the incoming UDP datagrams arrive faster
  543.    than the application can read them and if the queue fills to a
  544.    maximum value, UDP datagrams are discarded by UDP.  UDP will continue
  545.    to discard UDP datagrams until there is space in the queue.
  546.  
  547. 7.  Transmission Control Protocol
  548.  
  549.    TCP provides a different service than UDP.  TCP offers a connection-
  550.    oriented byte stream, instead of a connectionless datagram delivery
  551.    service.  TCP guarantees delivery, whereas UDP does not.
  552.  
  553.    TCP is used by network applications that require guaranteed delivery
  554.    and cannot be bothered with doing time-outs and retransmissions.  The
  555.    two most typical network applications that use TCP are File Transfer
  556.    Protocol (FTP) and the TELNET.  Other popular TCP network
  557.    applications include X-Window System, rcp (remote copy), and the r-
  558.    series commands.  TCP's greater capability is not without cost: it
  559.    requires more CPU and network bandwidth.  The internals of the TCP
  560.    module are much more complicated than those in a UDP module.
  561.  
  562.    Similar to UDP, network applications connect to TCP ports.  Well-
  563.    defined port numbers are dedicated to specific applications.  For
  564.    instance, the TELNET server uses port number 23.  The TELNET client
  565.    can find the server simply by connecting to port 23 of TCP on the
  566.    specified computer.
  567.  
  568.    When the application first starts using TCP, the TCP module on the
  569.    client's computer and the TCP module on the server's computer start
  570.    communicating with each other.  These two end-point TCP modules
  571.    contain state information that defines a virtual circuit.  This
  572.    virtual circuit consumes resources in both TCP end-points.  The
  573.    virtual circuit is full duplex; data can go in both directions
  574.    simultaneously.  The application writes data to the TCP port, the
  575.    data traverses the network and is read by the application at the far
  576.    end.
  577.   
  578.    As with all sliding window protocols, the protocol has a window size.
  579.    The window size determines the amount of data that can be transmitted
  580.    before an acknowledgement is required.  For TCP, this amount is not a
  581.    number of TCP segments but a number of bytes.
  582.  
  583. 8.  Network Appliations
  584.  
  585.    Why do both TCP and UDP exist, instead of just one or the other?
  586.  
  587.    They supply different services.  Most applications are implemented to
  588.    use only one or the other.  You, the programmer, choose the protocol
  589.    that best meets your needs.  If you need a reliable stream delivery
  590.    service, TCP might be best.  If you need a datagram service, UDP
  591.    might be best.  If you need efficiency over long-haul circuits, TCP
  592.    might be best.  If you need efficiency over fast networks with short
  593.    latency, UDP might be best.  If your needs do not fall nicely into
  594.    these categories, then the "best" choice is unclear.  However,
  595.    applications can make up for deficiencies in the choice.  For
  596.    instance if you choose UDP and you need reliability, then the
  597.    application must provide reliability.  If you choose TCP and you need
  598.    a record oriented service, then the application must insert markers
  599.    in the byte stream to delimit records.
  600.  
  601.    What network aplications are available?
  602.  
  603.    There are far too many to list.  The number is growing continually.
  604.    Some of the applications have existed since the beginning of internet
  605.    technology: TELNET and FTP.  Others are relatively new: X-Windows and
  606.    SNMP.  The following is a brief description of the applications
  607.    mentioned in this tutorial.
  608.  
  609. 8.1  TELNET
  610.  
  611.    TELNET provides a remote login capability on TCP.  The operation and
  612.    appearance is similar to keyboard dialing through a telephone switch.
  613.    On the command line the user types "telnet delta" and receives a
  614.    login prompt from the computer called "delta".
  615.  
  616.    TELNET works well; it is an old application and has widespread
  617.    interoperability.  Implementations of TELNET usually work between
  618.    different operating systems.  For instance, a TELNET client may be on
  619.    VAX/VMS and the server on UNIX System V.
  620.  
  621. 8.2  FTP
  622.  
  623.    File Transfer Protocol (FTP), as old as TELNET, also uses TCP and has
  624.    widespread interoperability.  The operation and appearance is as if
  625.    you TELNETed to the remote computer.  But instead of typing your
  626.    usual commands, you have to make do with a short list of commands for
  627.    directory listings and the like.  FTP commands allow you to copy
  628.    files between computers.
  629.  
  630. 8.3  rsh
  631.  
  632.    Remote shell (rsh or remsh) is one of an entire family of remote UNIX
  633.    style commands.  The UNIX copy command, cp, becomes rcp.  The UNIX
  634.    "who is logged in" command, who, becomes rwho.  The list continues
  635.    and is referred to collectively to as the "r" series commands or the
  636.    "r*" (r star) commands.
  637.  
  638.    The r* commands mainly work between UNIX systems and are designed for
  639.    interaction between trusted hosts.  Little consideration is given to
  640.    security, but they provide a convenient user environment.
  641.  
  642.    To execute the "cc file.c" command on a remote computer called delta,
  643.    type "rsh delta cc file.c".  To copy the "file.c" file to delta, type
  644.    "rcp file.c delta:".  To login to delta, type "rlogin delta", and if
  645.    you administered the computers in a certain wa, you will not be
  646.    challenged with a password prompt.
  647.  
  648. 8.4  NFS
  649.  
  650.    Network File System, first developed by Sun Microsystems Inc, uses
  651.    UDP and is excellent for mounting UNIX file systems on multiple
  652.    computers.  A diskless workstation can access its server's hard disk
  653.    as if the disk were local to the workstation.  A single disk copy of
  654.    a database on mainframe "alpha" can also be used by mainframe "beta"
  655.    if the database's file system is NFS mounted commands to
  656.    use the NFS mounted disk as if it were local disk.
  657.  
  658. 8.5  SNMP
  659.  
  660.    Simple Network Management Protocol (SNMP) uses UDP and is designed
  661.    for use by central network management stations.  It is a well known
  662.    fact that if given enough data, a network manager can detect and
  663.    diagnose network problems.  The central station uses SNMP to collect
  664.    this data from other computers on the network.  SNMP defines the
  665.    format for the data; it is left to the central station or network
  666.    manager to interpret the data.
  667.  
  668. 8.6  X-Window
  669.  
  670.    The X Window System uses the X Window protocol on TCP to draw windows
  671.    on a workstation's bitmap display.  X Window is much more than a
  672.    utility for drawing windows; it is entire philosophy for designing a
  673.    user interface.
  674.  
  675. 9.  Other Information
  676.  
  677.    Much information about internet technology was not included in this
  678.    tutorial.  This section lists information that is considered the next
  679.    level of detail for the reader who wishes to learn more.
  680.  
  681.      o administration commands: arp, route, and netstat
  682.      o ARP: permanent entry, publish entry, time-out entry, spoofing
  683.      o IP route table: host entry, default gateway, subnets
  684.      o IP: time-to-live counter, fragmentation, ICMP
  685.      o RIP, routing loops
  686.      o Domain Name System
  687.  
  688. 10.  References
  689.  
  690.    [1] Comer, D., "Internetworking with TCP/IP Principles, Protocols,
  691.        and Architecture", Prentice Hall, Englewood Cliffs, New Jersey,
  692.        U.S.A., 1988.
  693.  
  694.    [2] Feinler, E., et al, DDN Protocol Handbook, Volume 2 and 3, DDN
  695.        Network Information Center, SRI International, 333 Ravenswood
  696.        Avenue, Room EJ291, Menlow Park, California, U.S.A., 1985.
  697.  
  698.    [3] Spider Systems, Ltd., "Packets and Protocols", Spider Systems
  699.        Ltd., Stanwell Street, Edinburgh, U.K. EH6 5NG, 1990.
  700.  
  701. 11.  Relation to other RFCs
  702.  
  703.    This RFC is a tutorial and it does not UPDATE or OBSOLETE any other
  704.    RFC.
  705.  
  706. 12.  Security Considerations
  707.  
  708.    There are security considerations within the TCP/IP protocol suite.
  709.    To some people these considerations are serious problems, to others
  710.    they are not; it depends on the user requirements.
  711.    This tutorial does not discuss these issues, but if you want to learn
  712.    more you should start with the topic of ARP-spoofing, then use the
  713.    "Security Considerations" section of RFC 1122 to lead you to more
  714.    information.
  715.  
  716. 13.  Authors' Addresses
  717.  
  718.    Theodore John Socolofsky
  719.    EMail: TEDS@SPIDER.CO.UK
  720.  
  721.    Claudia Jeanne Kale
  722.    EMail: CLAUDIAK@SPIDER.CO.UK
  723.  
  724.    Note:  This info taken from RFC-1180.
  725. _______________________________________________________________________________
  726.  
  727.  
  728.