1 of 2

What is a default gateway?

by J.P. McCauley

Let's assume you have an address you want to get to, but you have no directions on how to get there. A GPS system could come in handy. But what if instead of being a human in an unfamiliar part of town, you are a data packet on a TPC/IP network looking for an address outside of your local network? Actually, things have just become much simpler for you. Now you only have to know two things in addition to the destination address:

One: You simply have to know that you don't know how to get there.
Two: Know what your Default Gateway is.

We will start our journey where every good journey begins: at the starting point. I'll assume you are using a Windows based PC. Linux and MACs have similar commands, but they are not exactly the same. Open a command prompt on your computer (Start -> Run -> cmd -> OK) and type in the following command: ipconfig <enter>

Assuming your computer is connected to a TCP/IP network, you will see a few lines of interesting information. You will see:

• Your IP address: This is the address assigned to your computer; the source address of our data packet, and the return address for the information we have requested.

• Your Subnet Mask: This group of numbers defines the size and range of your local network (follow this link for more information on networks and subnetting. If any other computers (printers, etc.) are in this same range, there is no need for your data packets to go through a gateway.

• Your Default Gateway: Without one of these, your personal Internet is very limited indeed.

So if your destination is not on the same network as you, your packet goes to the Default Gateway? Basically, yes. But let's be a little more technical. Go back to your command prompt and type the following command: route print <enter>

This will show you your routing table. Down at the bottom, you will see your Default Gateway listed again. If all of those lines above it in the routing table do not provide a match for your destination address, then the data packets go to the Default Gateway. On your PC, as on mine, this list is fairly innocuous. On network devises, or even on some Web Servers, these routing tables are far more interesting.

Now we are pretty clear on what address the Default Gateway is, and how we look for other matches before actually sending packet to the Default Gateway, but what is it, and why is it important?

A Default Gateway, sometimes referred to as a gateway of last resort, is where a packet goes when it does not know where else to go. A Default Gateway must be on the same network as your source device. If it weren't, how would your packet know how to get there? Also, the device acting as a Default Gateway must have some knowledge of networks beyond the network of the interface shared with the source device.

Typically, a Default Gateway is a network device known as a router, or it is a "routing instance" on a network device such as a switch. A Default Gateway could be simply a PC with at least two network interfaces on different networks. The whole benefit to a gateway is that it should know where to send your data packets next to get them moving toward the destination address they need to get to. Now time for one last fun command. This time, type: tracert helium.com <enter>

This command shows all of the "hops" your data packet took on its way to request this web page from helium.com. On my computer, it took fourteen "hops" to get there. You should notice that first hop is the IP address of your Default Gateway! If there is no Default Gateway, then you will never get a Helium web page (or any Internet site for that matter). Most of the "hops" you see listed are routers out in the Internet who know how to get you one step closer to your destination address.

So, why not have a GPS system for each packet and eliminate the need for all of this complex routing equipment? Simply put, it is not feasible. Once you have more than two or three networks, a distributed routing model that makes use of Default Gateways is your only reasonable option.

Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA