ARTICLE

Ask Dr. UN*X Continued
Contributed by Brian Wilson in Network on 2006-03-13 16:04:08
Page 2 of 8

Just what is routing?

I like to compare network packet routing with the post office. Let's say that you and a friend play chess by sending postcards to each other. Each postcard has a source and a destination address (From: and To: addresses) and a small amount of information, the next move in your game. You send a postcard with your move on it, then you wait for a reply to come back with your friend's next move. The game progresses as a series of transmissions and replies; the whole thing routed through any number of post offices without your knowledge. Under ordinary circumstances, to tap into this vast network, all you have to need to know are the addresses and how to find your mailbox.

Each postcard is like a network packet. With the postal system, you could send a letter if your information doesn't fit on a card. With a network, you just send more packets instead because you can't (normally) change the packet size; your operating system handles the task of breaking down large messages into small packets for transmission; likewise it reassembles incoming packets for you. This is what happens when you request a web page; you enter one address (the URL) and the network coordinates the exchange of hundreds of packets unbenownst to you. To learn about routing though, you can ignore this fact and concentrate only on the routing of a single packet.

After you drop your postcard into a mailbox, a system for routing it to its destination takes over; the reply comes back the same way. You only care about this routing mechanism when something changes, for example, if you move to a new address and want things forwarded. Otherwise it all remains invisible to you.

With the Internet, you normally only deal with one connection to this invisible network; the router provided to you by your Internet Service Provider (ISP) is your connection.

If you have one computer and one network connection, this is just about all you need to know about routing. Any packet leaving your computer heads out to the Internet, and any reply coming back from the Internet is destined for your one computer.

More complexity

Continuing with the postal analogy, if you work in the mailroom for a large company, you still generally only have one connection to the outside world, but there is an internal mailbox for each employee. As the clerk in the mailroom, you decide based on the To: address to either route a letter internally (delivering it to its local mailbox) or as before, you throw it into an outgoing pile for your connection to the world.

When you add a second computer in your office, each of your computers will have addresses indicating they are connected to the same LAN (local area network). The routing table in each of your computers has to know the correct LAN address range so that they can talk to each other.

With additional equipment, network complexity grows and things become progressively more complicated and much more interesting (to me anyway); there can be many routes in your computer's routing table. We are not getting into that here.

In the simple set up we are doing here, you only have to recognize two types of address, internal (LAN) or external (Internet).



Article Index
Ask Dr. UN*X Continued
Just what is routing?
Where do the IP addresses come from?
Revealing your routing tables
Adding the second line
How can I have two default routes?
Making the new commands sticky
Further resources
 
Discussion(s)
Great intro - but I've having an annoyi
Written by brighton36 on 2006-03-18 00:52:00
I've been using a multipath routing setup for my office for a while now. SO far, its been largely ok. The problem is that with some types of traffic my connections that should be established, oddly cease to be . SSH and IM are the two biggies. Its very frustrating. My guess is that the route tables are cleaned up, and the existing , established connection is attempted to connect out the alternate line that it was previously set at. Does anyone have this problem? Any ideas as to how to fix this? I've seen a number of other people ask in different forums, but no great solutions have been forthcoming.
Discuss! Reply!

thanks!
Written by kris on 2006-04-07 18:16:47
I just want to thank you people for writing so comprehensive and knowledgeable. All the other guides have been great; will read this one in a bit.

thanks for the effort! :)
Discuss! Reply!

good, simple info
Written by richard on 2006-03-27 20:36:27
Good to see a simple exlanation of what's going on. I'm setting up two ADSL connections to service my network through a router running FC4. I've got the routes part working (i hope) but I'm wondering how I can firewall both connections. I get the second ADSL modem today so I can see if the routing is working but I would appreciate some help on what I need to do re the firewall. I'm currently using firewall=iptables which is working fine but only has settings for one external and one internal interface. Can I set up a second external interface in the one script and duplicate the rules as required or should I set up a second firewall script? Any tips welcome
Discuss! Reply!