A router is a physical or virtual appliance that passes information between two or more packet-switched computer networks -- analyzing a given data packet's destination IP address, calculating the best way for it to reach that destination and then forwarding it accordingly.
A router is a common type of gateway -- positioned where two or more networks meet, including at each point of presence on the internet. Hundreds of routers might forward a single packet as it moves from one network to the next on the way to its final destination.
Traditional routers are stand-alone computing devices made up of proprietary software loaded onto dedicated hardware. A virtual router is a software instance that performs the same functions as a physical router, while running on white-box gear -- either alone or packaged with other virtual network functions, like firewall packet filtering, load balancing and wide area network (WAN) optimization capabilities. Other devices, such as wireless access points and network switches, can also include built-in router functionality.
How a router works
In the Open Systems Interconnection (OSI) model, routers are associated with the network layer (Layer 3), as they connect separate networks via the Internet Protocol (IP).
A router examines a packet header's destination IP address and compares it against a routing table to determine the packet's best next hop. Routing tables list directions for forwarding data to particular network destinations, sometimes in the context of other variables, like cost. They amount to an algorithmic set of rules that calculate the best way to transmit traffic toward any given IP address.
A routing table often specifies a default route, which the router uses whenever it fails to find a better forwarding option for a given packet. For example, the typical home office router directs all outbound traffic along a single default route to its internet service provider (ISP).
Routing tables can be static -- i.e., manually configured -- or dynamic. Dynamic routers automatically update their routing tables based on network activity, exchanging information with other devices via routing protocols. These include: Border Gateway Protocol (BGP), Enhanced Interior Gateway Routing Protocol (EIGRP), Exterior Gateway Protocol (EGP), Interior Gateway Routing Protocol (IGRP), Open Shortest Path First (OSPF) and Routing Information Protocol (RIP).
Many routers also perform network address translation (NAT), shielding the private IP addresses of a local area network (LAN) by readdressing all outgoing traffic with a single shared public IP address. NAT helps both conserve globally valid IP addresses and improve network security.
Types of routers
There are several different types of routers. Core routers -- primarily the purview of ISPs -- are the fastest and most powerful, sitting at the center of the internet and forwarding information along the main fiber optic backbone. Enterprise routers connect large organizations' networks to these core routers.
An edge router, also known as an access router, is a lower-capacity device located at the boundary of a LAN -- connecting it to a WAN, the internet and/or external LANs. Home and small office routers are considered subscriber edge routers.
Branch routers link an organization's remote office locations to its WAN, connecting to the primary campus network's edge routers. Branch routers often provide additional features, like time-division multiplexing, wireless LAN management capabilities and WAN application acceleration.