Some more notes on the TCP/IP suite:

Applications and security

Application addresses Application Ports Machine Naming Service Naming  

IP Routing

Please read chapter 8 to help understand this material. Also, please read sections 10.6 through 10.14 to help understand subnet masks.

Note: for most machines, a single default entry is all you need.

For example:

          A B C  D  E F G H 
          | | | / \ | | | |
         -------   ---------

 Machines A, B, C, E, F, G, and H all have a default route in their routing table, specifying D as the default router (A, B, and C specify the first interface of D. Machines E, F, G, and H specify the second interface of D).

Each entry in the routing table contains the following:

Before IP attempts to do any routing, it will do the following: If the destination is not on a directly attached network, then do the following: The table is populated one of three ways: Let's look at an example:

               A   B   C   D   E  F G H   I   J   K  L    M    N   O   P
      |   |   |  / \  |  | | |  / \  |   |  |    / \  |   |   |
     ------------   ------------  --------------   -------------
     198.11.109.0   198.34.15.0    201.21.192.0     199.23.115.0

 We'll assign the following IP addresses:

A: 198.11.109.1
B: 198.11.109.2
C: 198.11.109.3
D (interface 1): 198.11.109.4

D (interface 2): 198.34.15.1
E: 198.34.15.2
F: 198.34.15.3
G: 198.34.15.4
H: 198.34.15.5
I (interface 1): 198.34.15.6

I (interface 2): 201.21.192.1
J: 201.21.192.2
K: 201.21.192.3
L: 201.21.192.4
M (interface 1): 201.21.192.5

M (interface 2): 199.23.115.1
N: 199.23.115.2
O: 199.23.115.3
P: 199.23.115.4

The routing table for A is the following:

198.11.109.0 198.11.109.1 N interface_1
0.0.0.0      198.11.109.4 N interface_1

The first line of the table means if the destination address has 198.11.109.0 as the network number, deliver it directly out the network (note that A's address is in the second field, and that means deliver it directly). The "N" means the first field is a network number (as opposed to a full IP address).

The second line is the default entry. The "0.0.0.0" in a routing table means "the default route". As you can see, the routing table says deliver all other destinations to machine D.

Very important: Every router must be on a directly-attached network. You cannot specify a router on another network. For example, machine A could
not have a table entry like the following:

0.0.0.0    198.34.15.1 N interface_1
because 198.34.15.1 is not on A's network!

The routing table for machine F would be the following:

198.34.15.0   198.34.15.3   N interface_1
198.11.109.0  198.34.15.1   N interface_1
0.0.0.0       198.34.15.6   N interface_1

Note that every router is on F's network. Also, machine I is the best machine for a default router. If we made machine D the default router, the routing table for F would be the following:

198.34.15.0   198.34.15.3   N interface_1
201.21.192.0  198.34.15.6   N interface_1
199.23.115.0  198.34.15.6   N interface_1
0.0.0.0       198.34.15.1   N interface_1

 ...and, that routing table has four entries instead of three, so it's not as good as the previous entry.

 let's look at the routing table for machine M:

201.21.192.0   201.21.192.5  N interface_1
199.23.115.0   199.23.115.1  N interface_2
0.0.0.0        201.21.192.1  N interface_1

And finally the routing table for I:

198.34.15.0    198.34.15.6  N interface_1
201.21.192.0   201.21.192.1 N interface_2
198.11.109.0   198.34.15.1  N interface_1
199.23.115.0   201.21.192.5 N interface_2

Note that I does not have a default route in this case. BUT, if machine P had a second interface that was connected to the internet, the routing table for I would be:

198.34.15.0     198.34.15.6  N interface_1
201.21.192.0    201.21.192.1 N interface_2
198.11.109.0    198.34.15.1  N interface_1
0.0.0.0         201.21.192.5 N interface_2