The Internet is a network built by physically connecting other networks. To connect our networks together, we use a special device called a gateway. Any Ethernet node can conceivably act as a gateway, though many do not. Gateways have two or more physical network interfaces and do a particular job, just as their name implies: they relay packets destined for other networks, and they receive packets destined for nodes on one of their own networks.
Gateways are also routers
Gateways can also be called routers, since they route packets from one net- work to another. If you consider that all networks are equal, then the notion of transmitting packets from one to the other becomes a little easier. No longer is it necessary for our network nodes to understand how to find every other node on remote networks. Maintaining that amount of ever-changing information on every computer connected to every network would be impossible. Instead, nodes on our local network only need to know the address of the gateway. That is, local nodes only need to know which node is the “exit” or “gate” to all other networks. The gateway takes on the task of correctly routing packets with foreign destinations to either the remote network itself or another gateway.
Gateways route packets based on destination networks
Gateways seem simple, but as we’ve mentioned, asking one device to keep track of the information for every network that’s connected to every other net- work is impossible. So how do our gateways do their job without becoming hopelessly buried by information? The gateway rule is critical: network gateways route packets based on destination networks, not destination nodes.
Gateways don't have to know how to reach every node
Thus, our gateways aren’t required to know how to reach every node on all the networks that might be connected. A particular set of networks might have thousands of nodes on it, but the gateway doesn’t need to keep track of all of them. Gateways only need to know which node on their own network will move packets from their network to some other network. Eventually, the packets reach their destination network. Since all devices on a particular network check all packets to see if the packets are meant for them, the packets sent by the gateway will automatically get picked up by the destination host without the sender needing to know any specifics except the address of its own gateway. In short, a node sending data needs to decide one thing: whether the data is destined for a local network node or remote network node. If local, the data is sent between the two nodes directly. If remote, the data is sent to the gateway, which in turn makes the same decision until the data eventually gets picked up by the recipient.
Published on Thu 29 March 2012 by Daisy Batty in Networking with tag(s): gateway