Ref: 99980080
Title: Internetwork Routing with TCP/IP
Date: 4/1/87

Copyright 3Com Corporation, 1991.  All rights reserved.

.h1;Internet Protocol, IP

IP was developed for ARPANET, Advanced Research Projects Agency
Network, and was standardized by the Department of Defense (DoD).
IP developed in response to the need for internetwork routing
independent of network architecture and intranetwork protocol.

To get every branch, agency, and department of the Federal
Governement to standardize on one network protocol or network
interface would be practically impossible.  Rather than make
every part of government conform, ARPA designed an internetwork
protocol that could handle differences in addressing schemes,
packet sizes, and network interfaces.

.h1;Internetworking Requirements

Internetworking involves layer three of the Open Systems
Interconnect (OSI) model.  The basic requirements of
internetworking are:

    *   A data link between networks.

    *   Routing and delivery of data.

    *   Audit trail service for internetwork traffic.

    *   All of the above services in spite of:

        -   Different network interfaces
        -   Different routing techniques
        -   Different access control
        -   Different addresssing schemes
        -   Different maximum packet size
        -   Different time outs
        -   Different types of error recovery schemes
        -   Different status reporting
        -   Different connection services (datagram versus virtual circuit)

These requirements cover the four basic internetworking situations:

*   Point-to-point links between homogeneous LANs (e.g., via GS/3-
IP to GS/3-IP)

*   Point-to-point links between heterogeneous LANs (e.g., via GS/
6-IP)

*   Network links (e.g., PDN) between LANs

*   LAN to non-LAN (e.g., host) links


In the first case, a data link level bridge with special
adaptation to handle long haul network protocols (e.g., the
Bridge GS/3-M) serves to logically extend a network.  However, an
internetwork router could also serve when network management
needs (e.g., special routing of certain traffic, isolation of
certain network segments) supersede the advantages of data link
level bridges.

.h1;The IP Catenet*

The following example shows how a datagram is sent between two
hosts using IP.  The process begins with a node attempting to
send a message to another node via the network.  The IP module in
the node constructs the datagram with a global network address
(IP header) and recognizes that the destination is on another
network.  The network module in the node than packages the IP
datagram into a network packet with the internetwork router
(gateway) as its destination.  This packet goes through the
network to the gateway, which strips off the network header and
analyzes the IP header.  The gateway first checks to see if the
datagram was intended for the gateway (e.g., control information)
or for a node on another network.  If it is intended for another
network, there are four possibilities:

1.  The destination node is attached directly to one of the
networks services by the gateway.

2.  The destination node is on a neighboring gateway.

3.  The destination node is on a remote network serviced by
one or more additional gateways (hops).

4.  The destination is unknown.

Depending on which possibility arises, the gateway will either
route the datagram to (1) the destination node address or the
(2,3) gateway address, or will (4) return an error message to the
source.  All of this depends on the IP destination address and
what the gateway knows ( in its routing tables).  Now, how to
dissect the IP address.


* Catenet: a term referring to a collection of packet switching
networks that are connected by gateways.


.h2;IP Addressing Scheme

With the 48-bit, global host addressing scheme used by Ethernet,
there are over 100,000,000,000,000 unique addresses; over 20,000
for every human on earth.  Why not just use the Ethernet address
for all routing?  First, IP was defined before Ethernet.  Second,
not every network is an Ethernet network.  Another reason
Ethernet addresses have not been adopted for other networking
schemes is the size of the address, six bytes.  When these
addressing schemes were conceived, computing power was a a
premium and memory was expensive.  The overhead of a six-byte
address was considered to be more than 1970's technology could
reasonably support.  The four-byte, IP Internet address offered a
reasonable alternative.

The IP Internet address is 32 bits broken into four groups.  It
is typically represented by twelve decimal digits separated into
decimal triads by decimal points; for example, 221.008.100.012.
This is known as "dotted decimal" notation.  Each triad
represents one eight-bit byte and therefore, has a range of
values between 0 and 255.  0 and 255 are exception cases*.  An IP
address such as 345.987.555.256 would not be valid, for each
triad's value is greater than 2**8-1.  The value of the first
triad defines the class of the internet address.  This class
determines which triads are treated as the network portion and
the host portion of the address.  This is broken down as:

Address     Decimal      HEX        Binary          IP AddressFORMAT
 Class       Range      Range    Representation     n=network,h=host
--------   ---------   -------  -----------------   -----------------
   A        0 to 127   00 - 7F  00000000-011111111   nnn.hhh.hhh.hhh
   B      128 to 191   80 - 8B  10000000-101111111   nnn.nnn.hhh.hhh
   C      192 to 223   C0 - DF  11000000-110111111   nnn.nnn.nnn.hhh

For example, 001.000.000.001 through 127.255.255.254 are Class A
addresses.  128.001.000.001 through 191.254.255.254 are Class B
addresses.  And 192.000.001.001 through 223.255.254.254 are Class
C addresses.  009.000.000.001 through 009.255.255.254 would be
all the nodes on a Class C network with a network number of 009.
and, 203.100.231.001 through 203.100.231.

This means that the first three bits in the IP address indicate
whether you have a big network, Class A with up to 16,516,350
(255**2*254) "host" nodes; a medium network, Class B with up to
64,770 (255*254) "host" nodes; or a small network, Class C with
254 "host" nodes.  It also means that there are 127 possible
Class A networks, 16,002 (63*254) possible Class B networks, and
1,999,996 (31*254**2) possible Class C networks.  All totaled,
that is about two billion unique addresses, or slightly less than
half of the 2**32 possible four, eight-bit bytes.  This is
significantly less than the over one-hundred trillion Ethernet
addresses.

Two billion might still seem to be a huge number of addresses,
until the Network Information Center (NIC) assigns you to a Class
C address for a network with 1,000 nodes, each with 32 ports.
This means you have 254 host addresses for 32,000 addressable
points to cover.  SUBNET MASKING may be a solution to this
problem.

*  In certain contexts, certain fixed addresses have specific
functional significance.  For example, the address 0 is to be
interpreted as meaning "this", as in "this network."  The
address of all 1s means "all", as in "all hosts".  For
example, the address consisting of 114.015.255.255 can be
interpreted as all the hosts on network 114.016.  Or, the
address 000.000.000.037 can be interpreted as meaning host 37
on this network.


.h2;Subnet Masking

An obvious limitation to IP addressing is the potentially small
number of addresses available.  The problem is compounded by the
fact that every addressable port on every node must have a
separate IP address.  In many cases, Class C addresses are
assigned to those who have several "small" segments and have
Internet Routers (e.g., GS/3-IPs) linking them together.  The
reasoning behind this is the limited number of Class A and Class
B addresses.  The Network Information Center (NIC) asks "why give
out a Class B network address when a few Class C addresses might
do?"  Because a few Class C addresses may not no, either now or
soon (if your network is growing fast).

Don't get your hopes up, however.  Subnet masking does not extend
the IP address.  Subnet masking makes a Class B address in a
group of Class C addresses (soft of) or a Class A address into a
group of Class B addresses (again, sort of).  So, instead of
being assigned a few Class C addresses, you can argue to get a
Class B address and do your own subnet masking.  This give you
the latitude to hae more than 254 host addresses on a segment and
still have your internet routers do their job.

The way you use subnets is by specifying them in your Internet
Router sysgen.  On the Bridge GS/3-IP, this is done in the IP
Parameters Menu (menu 4.4).


.h2;Specifying a Subnet Mask

As stated above, the IP address is either "nnn.hhh.hhh.hhh",
"nnn.nnn.hhh.hhh", "nnn.nnn.nnn.hhh".  When an Internetwork
Router (i.e., GS/3-IP) gets a packet with one of these addresses
to forward, it masks out the Internet (nnn) portion of the
address.  Depending on the address class, the mask varies from
eight to 24 bits.  With subnet masking, you effectively make the
first part of the host (hhh) portion of the address into a part
of the Internet (subnetwork) address.

Example 1: Class A Internet Address

This example is of a large company that has been assigned one
Class A address, 078.  They have fourteen large local area
networks (LAN) spread over seven cities, tied together by GS/3-
IPs on leased (56K bps) phone lines.  Each LAN has thousands of
nodes.  The following mask is assigned:

    255.240.000.000

This creates a subnet mask of:

    (11111111) (11110000) (00000000) (00000000)

And the possible subnetwork address of:

---------------   078.016.000.000   078.032.000.000   078.048.000.000
078.064.000.000   078.080.000.000   078.096.000.000   078.112.000.000
078.128.000.000   078.144.000.000   078.160.000.000   078.176.000.000
078.192.000.000   078.208.000.000   078.224.000.000   ---------------

So, if a plain IP address looked like "nnn.hhh.hhh.hhh" then a
subnet IP would be "nnn.ssh.hhh.hhh" where "ss" represents the
subnet.  Wonder why the first and last addrsses are crossed out?
It is because subnet values 000 and 240 have the same functional
significance as network and host addresses of 000 and 255 (see
above).  This means a subnet decimal value of 240 would mean "all
subnets" and 000 would mean "this subnet".  Admittedly, using
decimal notation for the octets obscures the meaning.  Translated
to binary:

078.000.000.000         =      01001110.00000000.00000000.00000000
(11111111)  (11110000)  =      01001110.11110000.00000000.00000000
nnn.ssh.hhh.hhh         =      nnnnnnnn.sssshhhh.hhhhhhhh.hhhhhhhh

Any IP address having a value whose binary interpretation
overlays the masked bits will be interpreted as being on the
subnet.  Four masked bits means you have 2**4 combinations.  When
you set this up on your networks, the high four bits of the host
address will be masked off and that will designate which
subnetwork you are on.  Address 078.071.012.134 would be on
subnet 078.064.000.000:

078.071.012.134         =      01001110.01001011.00001100.10000110
(11111111)  (11110000)  =      11111111.11110000.00000000.00000000
078.064.000.000         =      01001110.01000000.00000000.00000000

The above is done by ANDing the IP address to the mask and
parsing out the subnet number.  Remember, nothing happens to the
IP address, the indentity of the source or destination, or
connection service.  It just gives the GS/3-IPs a larger network
number for more specific network routing.

Example 2: Class B Internet Address

This example is of a college campus that has been assigned one
Class B address, 128.042.  They have six local area networks
(LAN) in three buildings, tied together by GS/3-IPs on private
(56K bps) phone and PBX lines.  Each LAN has hundreds of nodes.
The following mask is assigned:

     255.255.224.000

This creates a subnet mask of:

     (11111111) (11111111) (11100000) (00000000)

And the possible subnetwork addresses of:

---------------   128.042.032.000   128.042.064.000   128.042.096.000
128.042.128.000   128.042.160.000   128.042.192.000   ---------------

The GS/3-IP would know this is a Class B address and that the
subnet mask was (11100000) because it is specified in the sysgen.
Once again, the first and alst addresses are crossed out because
they are special cases.

To the rest of the world, 128.042.097.012 just specifies a node
on Internet address 128.042.  Only the network using the subnets
use the masking.  Subnet masking has no effect on Internet
Routing Tables.

.h2;Address Resolution Protocol (ARP), IP to Ethernet

At the network level, IP handles routing with the four-byte IP
address.  Once the packet gets to the network (i.e., Ethernet
network), there must be some way to translate this address to the
Ethernet address of the destination.  The Ethernet address is not
in the datagram, therefore the IP to Ethernet address translation
must be resolved by something on the network.  The University of
California, Berkeley (UCB) addressed this problem for its
Berkeley UNIX with the Address Resolution Protocol (ARP).  ARP is
now the standard for IP/Ethernet address translation.

The following is an example of how ARP resolves the Internet
address to an Ethernet address, a basic algorithm in which the
Network ID is not the same as local box -

1.  Check internal IP cache on local Communications Server
(e.g., CS/1 for the IP address.  There will be an entry
in this cache if this IP address was connected to by this
CS/1 recently.  This table entry tells the CS/1 which
destination Ethernet address (i.e., the address of the
Internet Router) to use to send packets.  The CS/1 will
begin immediately sending packets to the destination via
the Internet Router (end of algorithm).  If the CS/1 has
not been connected to this IP destination recently, then
the algorithm continues.

2.  If there was no IP address entry on the CS/1, then it
checks to see if a default gateway (e.g., GS/3-IP) is
defined (e.g., Default Gateway = 197.098.012.123).  If an
address is defined, then the CS/1 will transmit the
packet out to the gateway.

3.  The default GS/3-IP has access to destination (in its
routing table), it will transmit the packet across.  If
it has an entry in its routing table that tells it that
there is another gateway on the local network that will
handle it, the default GS/3-IP will send an ICMP redirect
telling the CS/1 to use the other gateway.

If the default GS/3-IP's routing table has no routing
information on how to get to the destination (either
directly or alternately) then the packet will be
discarded.

4.  If no default GS/3-IP is defined (i.e., DefaultGateway =
0.0.0.0) then the CS/1 will send out an ARP request using
the destination address in the request.  If the GS/3-IP
has extended ARP requested turned ON and can get to that
remote network, it will direct the CS/1 to send the
packets to it.

This holds true if there are two devices (e.g., CS/1) on
the same local cable taht have two different network
numbers.  If no default gateway is defined, the ARP
request will be sent and the CS/1 with the other network
IP address will respond.

NOTE: The IP cache on the local CS/1 has an entry for a full IP
address (not just the network number).  So if you have connected
to 192.009.111.023, for example, then this mapping will be in the
cache.  But if you then try to connect to 192.009.111.010, for
example, the CS/1 will check the cache and will look specifically
for that address (host number and all).  If you haven't connected
to this before, the CS/1 will go to step two of the algorithm.

