Computer networking is a fairly complex but logical system of interconnecting protocols. One of the core features of the Internet is that it isn’t just one big network. It’s a conglomeration of a vast number of networks. Getting these smaller networks to communicate internally and with each other is a tricky problem. This problem is what networking protocols and hardware are designed to address. One essential part of this is the gateway.
In computer networking, a gateway serves the same purpose as the gateway to your yard. It is the route in and out of the network. Routers have always performed the job in their very early phase called gateways. You can still see this legacy in many devices’ network configuration options. The router, and thus the only way to connect to other networks, is often referred to as the “default gateway.”
Within a single network, a LAN, each device should be able to know the identity of every other connected device. Host discovery protocols allow devices to communicate their presence to others and for devices to ask if others are online. If the network at large is aware of a route to the destination, it will forward it on the route. Managing this is relatively simple; it’s comparable to ensuring that a letter, delivered to your home, gets handed to the person whose name is on the envelope.
Why Is a Gateway Needed?
Though, things get a little more complicated if the address on the packet isn’t in the network. Sometimes, it may be intended for another known network, so the packet can be routed along a known path to get there. This resembles walking to your neighbor’s house to drop off a misdelivered envelope. But if you don’t have any rules to know where to route a packet, you have two options. You could drop it or have a default route used for any traffic where no route is known to the destination. Dropping the packet would be quick and easy but would likely result in much of the internet not working or devices needing huge routing tables. A default route is also easy to configure and much more robust as a solution.
The default gateway is like the post service. If you don’t know precisely how to drop off a letter at the right place, you can give it to them, and they’ll send it on. If the system works, the letter will eventually reach its destination. The default gateway is simply the last rule in a routing table. A packet can be sent on a specific route if the destination address is known. If a route to the destination is unknown, it needs to be forwarded up the chain eventually to a network that does know where to send it. Many other networking protocols may be involved behind the scenes, but the concept is relatively simple.
Other Uses for Gateways
While in modern parlance, a gateway is essentially just a router, that isn’t necessarily the only thing it does. The first gateways weren’t just a router between networks but between protocol types. While the Internet Protocol (IP) suite of protocols may be dominant now, when networks were taking off, there were other protocols with different addressing systems and functionality. These networks could only communicate through a gateway as the gateway could speak both protocols.
This specific use has been obsolete for a long time, but there is a slight resurgence under different names. Internet of Things (IoT) devices often need some communications hub to connect to your network. This is because they use distinct communication protocols that most computers don’t understand. In many cases, computers lack the hardware to connect with IoT protocols. This essentially places IoT hubs in the same position as classic gateways, enabling communication between devices that don’t share the same protocols.
Conclusion
A gateway is a communication route between two networks. In modern parlance, it’s essentially just a router, with the default gateway being the default route for any traffic for which the route to the destination is unknown. Historically the term has been more specific, referring to devices that support two or more incompatible communications technologies. While this specific use has dropped off, thanks to the dominance of the IP protocol suite, IoT hubs are a modern equivalent. Share your thoughts in the comments below.