Conquering Routing


Welcome to the cavernous room of Krazy Dan's cave dedicated to routing. Routing refers to the way TCP/IP networking moves packets from their source to their destination. Each packet has a source and destination address. To deal effectively with routing, the first thing you need to know is what these ip addresses correspond to. If you think that each computer on the net has an ip address, you've got it WRONG and you need to go study that wall of the cave labelled TCP/IP Interfaces.

Once you have deciphered the ancient symbols on the interface wall, the next step toward victory over routing problems is to memorize the TCP/IP routing mantra. This provides the basic steps that TCP/IP goes through to route a packet. We call this a mantra because every time we encounter a routing problem, or explain how routing works, we are going to repeat these rules.

To introduce you to the way routing is set up and subsequently works, let's consider what happens on a functioning TSX-Online system which is connected to the net via a serial modem. Phonenet is in use and the connection between the modem and the provider is established through the SERVICE PROVIDER block in SY:SERVICES.PTY. This means that the TCP/IP interface is going to be PTA1:. Somehow, through the magic of Phonenet, that gets connected to a physical line with a modem but as far as TCP/IP knows, the serial device is PTA1:. Let us further assume that the IP address of the PTA1: interface is 200.5.5.5.5, and that a user on this system is attempting to connect to S&H, 204.181.142.11. Let's recite our mantra:

What happened here is that TCP/IP decided to send a packet to S&H through the PTA1: interface because there was a routing entry for 0.0.0.0 which tells the system that PTA1: is the gateway to the world. How did this entry get inserted into the routing tables, anyway? The short answer to the question is, "The PTYMAKE program did that because it saw the SERVICE PROVIDER block and realized that this TSX system was going to frustrate folks unless it made that routing entry for them. In the olden days, we would have required you to make your own routing entries by putting SET NETROUTE commands in your SY:NETLOGON.CMD file, but we try to make things a little more automatic these days.

So if the wildcard routing entry is created automatically, and the packets go out to the net, what's the problem? Why would we devote so much effort to explain something that works, perfectly and automatically, every time? The answer is that more complex configurations have more complex routing problems and may require manual intervention by you. Let's consider some of these topics now.

ARP Overrides for Pass-through SLIP/PPP lines

Let's consider a system that uses ethernet to connect to the internet, and has dial-up serial modem lines which users place in pass-through PPP mode for their web surfing pleasure. The IP address of the ethernet interface is 200.5.5.5 and the IP address on the remote end of a user's PTY connection -- the IP address assigned to his home computer for the duration of his session -- is 200.5.5.20. In considering routing, you have to remember that packets flow in both directions. Home user of interface PTA5: begins by trying to make a connection to 204.181.142.11, since he wants to read up on S&H's newest product. So a packet comes into the TSX system destined for 204.181.142.11. As we just discussed, a wildcard entry is found for 0.0.0.0 which specifies the ethernet card. This is a little different than the last case we considered, which used a modem to connect to the internet, but the mechanism is the same. A SERVICE PROVIDER block in the SY:SERVICES.PTY file specified "DEVICE ENA0:" so outgoing packets not otherwise known get sent out the ethernet. This gets the packets OUT, so S&H hears the connect request and sends a packet all the way back into the TSX system. What's it going to do with it, how is it going to route it? Let's chant our routing mantra:

What happened here, in our routing mantra, is a snag caused by trying to carve up a block of IP addresses between ethernet and serial interfaces. One can well imagine that the designers of the mantra figured people would be using one or the other, but not both in the same address block. Since no ethernet card responded to the ARP request, no ARP entry got created, and the packet went nowhere. Yet TSX-Online does work in this configuration, so how? Once again, it's that sneaky PTYMAKE program. Upon seeing that you were creating a PASSTHRU type PTY in conjunction with the DEVICE ENA0: you specified in the SERVICE PROVIDER block, he created an ARP entry for you. Since the ARP entry directing TCP/IP where to send packets for 200.200.200.20 already existed, no ARP broadcast and wait for response was needed. The ARP entry was already there, and it told TCP/IP to send the packet... you guessed it... out PTA5:, the PTY line being used by our hero, your customer.

Useful commands related to routing

Before we proceed with more configurations and their routing implications, let's review three very useful ways to get information related to routing: