Routers accept data packets and forward them to a list of destinations it knows about. These destinations can be other routers, or the intended destination of a computer communicating through the router. The routers help connect business networks geographically -- separate sites, as well as Internet-connected devices.
Routers and IP
Routers are designed to worry only about IP-based information. This means that each device needs to include an IP header before it can communicate with a router. The IP headers contain information including the source IP address and the destination IP address. When a port on a router receives this information, it forwards that information out of the port to where it knows the destination can be found. A router can forward that packet directly to the destination, if attached, or onto another router which will perform the same analysis.
Router to Router
In environments with multiple routers, those routers communicate with each other. This communication allows each router to tell one another where different networks are located. Routers tell surrounding routers about the network directly attached to their interfaces, as well a non-directly-attached network which it has learned from other routers. This is done through a routing protocol. One of the original protocols was the Routed Information Protocol, or RIP, but the most common such protocol is the Interior Gateway Routing Protocol, or IGRP. IGRP goes beyond RIP to include information about the speed of connection to the network, so that an IP packet can find the best path through a series of routers.
Computer to Router
Computers need routers to connect to other computers. A computer, however, does not maintain the complex routing tables needed to know exactly how to get to any device on the Internet or directly connected. When computers need to communicate with another computer outside of its immediate network, it relies on a default gateway. A default gateway is where a computer sends information when it doesn’t know the best path. Default gateways are common in home Internet connections, when all communication to the Internet is sent to the home router. The home router in that setup typically uses its own default gateway to send the information to the ISP.
Switches and IP Address
Switches do not function on IP addresses. Switches use hardware-based address, called “MAC addresses” to handle communication between devices on the same network. Two confusing aspects of switches include layer-3 switching and the IP addresses assigned to a manageable switch. The IP address of a switch has nothing to do with routing data; it is actually a small computer within the switch, which can be accessed remotely to make changes to the switch’s configuration. A router does not communicate with a switch’s IP the way two routers would communicate. Some switches, however, are designed as “Layer 3” switches. Layer 3 is an industry term referring to the ability to route based on IP addresses. These complicated switches include a router component that communicates internally with the switch programming to allow for communication between virtual local area networks, or VLANs. VLANs are a way for switches to group separate networks according to individual ports, instead of separate switches. Though this blurs the line, a switch does not make meaningful communication with a router, but rather only forwards information from devices which do.
- Thinkstock/Comstock/Getty Images