This set of web pages describes my Router, which is an essential piece of electronics in my home office network. Hopefully your router will be similar and you can learn from my example.
When I got DSL, I could stop using all of my modems, and I could connect all the computers to the internet all at the same time. Without the router, only one machine at a time could be connected.
I already had an Ethernet in the apartment, connecting all the machines together, but no bits could get out to the internet. If you get a router with a "four-port hub", you can plug in up to four machines. If you only have one machine, you don't need a router and you don't need to read these pages.
You can use a router with a cable modem, too, or even with a regular modem. The router is the way to connect several machines to the internet when you only have one IP address, which is usually the case.
My setup is more elaborate because I have more machines and a printer, and these old machines use different Ethernet connectors... long story. Here goes.
The Internet is based on "IP", which stands for Internet Protocol. It's a bunch of rules for computers to talk among themselves over a network.
One of the rules of IP is that everybody MUST have an IP address, and everyone's IP address must be different from everybody else's. It's a little bit like a telephone number for the Internet. Everybody has to have their own unique IP address.
An IP address is four numbers that run from 0 to 255. They broke it up into four numbers, because one big number would have been too hard. Each one identifies a computer on the Internet, from 0.0.0.0 through 255.255.255.255. There are a total of more than 4 billion IP addresses.
My IP address on the internet is 64.249.203.40. This is what my DSL company got me. Unfortunately I have more than one computer, and we all have to share the same IP address on the internet. This is doable. You need a Router, like I have. Read on.
To better understand what's going on, let's watch a typical page downloaded while websurfing. We're going to see what goes on at the IP level.
You type in "apple.com" into your web browser. Your browser just sortof assumes that this means:
http://apple.com:80/
First it uses DNS to turn apple.com into 17.254.3.183, which is the actual IP address for apple.com, at least on October 27, 2000 when I wrote this. DNS is like the phone book of the internet.
An IP address defines a computer on the internet, but each computer can have more than one thing going on. Packets are sent to ports on a particular IP address. The ports are numbers from 1 through 32,768. Or maybe up to 65,536, not sure. The numbers from 1 to 1024 are special.
In this case, your web browser sends a packet to 17.254.3.183, port 80, that's
17.254.3.183:80
80 is the special port for http; if you were doing email or FTP it would be a different number.
In the packet, there's all sorts of information, such as your return IP address, infomation about what kind of computer you have, and other things. In particular, there's a command that says "get /". Over at 17.254.3.183, they interpret that as get /index.html, a file to be sent back. If you had typed in "apple.com/quicktime/download/requirements.html" then the get command would say
get /quicktime/download/requirements.html
So over at 17.254.3.183, which is a computer at Apple somewhere, there's a program called a web server, listening for packets sent to port 80. It gets the packet, retrieves the file index.html, or whatever, and sends it back. It sends it to 64.249.203.40, port 1067. That's my browser. I forgot to mention before, but my browser set up a port, numbered 1067, on my machine, specifically to listen for this reply data. This information was sent along with the return IP address in the "get" packet.
This process is repeated for every web page I surf to, whether it's from my typing in a URL or from a click on a hotlink. Each graphic file, each .gif or .jpeg file, also goes through this process, too. Each file that's downloaded from apple.com gets a new return IP port to return its data on. The next file will use port 1168, then 1169, the file after that uses port 1170. This way all the data from each file can be downloaded all at the same time; these are all parallel conversations happening at the same time. When your computer boots up, it starts at 1024 and keeps on adding 1 each time it needs a new number. Your browser keeps it all straight.
The way the Router works is this: There are really two different internets:
the Local Area Network, which has all of the computers I have on my network in my apartment.
the Wide Area Network, otherwise known as The Internet.
The router has TWO internet connections, one to the WAN (through my DSL modem), and one to the LAN (my in-house network). On the WAN, it pretends to be just one computer.
On the LAN, however, things are different. I have my own internet, but I only have a handful of computers. I don't need all 4 billion possible IP addresses, I'll be happy with just a few. The router lets me use 250 of them.
So the job of the router is to:
1) take packets on the LAN that are trying to get out to the internet, and repackage them with different IP addresses and send them out
2) take packets sent to it from the internet, figure out which IP address on the LAN they are supposed to go to, and send them there, after repackaging them with LAN ip addresses.
This can all be a little bit tricky but in practice it works well. This repackaging is called NAT or Network Address Translation.
You can see how I have this set up in the Setup page of the router.
When they invented IP addresses, they reserved a few for magical purposes. Here's the important ones to remember:
127.0.0.1 always points to yourself, no matter what your real number is.
192.168.1.0 through .255 is reserved for subnets like I have in my office. That's 256 different IP numbers. All network equipment is preprogrammed to never let these addresses get out into the internet at large. Usually your router is set up to use this for your local area network.
10.0.0.0 through 10.255.255.255 are also reserved for subnets; this space has 16 million IP addresses. I like these numbers better so my LAN uses the addresses 10.10.10.0 through 10.10.10.255.
The IP addresses on my LAN look like this. DON'T GET INTIMIDATED, this is only a few machines, most of them are off at any given time.
10.10.10.255 - reserved for magic IP stuff, don't use
Go back to Allan's Help Desk.