A router is connected to two or more data lines from different IP networks. When a data packet comes in on a line, the router reads the network address information in the packet header to determine the ultimate destination. Then, using information in its routing table or routing policy, it directs the packet to the next network on its journey. Data packets are forwarded from one router to another through an internetwork until it reaches its destination node.[5]
The most familiar type of IP routers are home and small office routers that forward IP packets between the home computers and the Internet. More sophisticated routers, such as enterprise routers, connect large business or ISP networks to powerful core routers that forward data at high speed along the optical fiber lines of the Internet backbone.
When multiple routers are used in interconnected networks, the routers can exchange information about destination addresses using a routing protocol. Each router builds up a routing table, a list of routes, between two computer systems on the interconnected networks.[6][7]
The software that runs the router is composed of two functional processing units that operate simultaneously, called planes:[8]
Control plane: A router maintains a routing table that lists which route should be used to forward a data packet, and through which physical interface connection. It does this using internal pre-configured directives, called static routes, or by learning routes dynamically using a routing protocol. Static and dynamic routes are stored in the routing table. The control-plane logic then strips non-essential directives from the table and builds a forwarding information base (FIB) to be used by the forwarding plane.
Forwarding plane: This unit forwards the data packets between incoming and outgoing interface connections. It reads the header of each packet as it comes in, matches the destination to entries in the FIB supplied by the control plane, and directs the packet to the outgoing network specified in the FIB.
Applications
A router may have interfaces for multiple types of physical layer connections, such as copper cables, fiber optic, or wireless transmission. It can also support multiple network layer transmission standards. Each network interface is used to enable data packets to be forwarded from one transmission system to another. Routers may also be used to connect two or more logical groups of computer devices known as subnets, each with a unique network prefix.
Routers may provide connectivity within enterprises, between enterprises and the Internet, or between internet service providers' (ISPs') networks, they are also responsible for directing data between different networks.[9] The largest routers (such as the Cisco CRS-1 or Juniper PTX) interconnect the various ISPs, or may be used in large enterprise networks.[10] Smaller routers usually provide connectivity for typical home and office networks.
All sizes of routers may be found inside enterprises.[11] The most powerful routers are usually found in ISPs, academic and research facilities. Large businesses may also need more powerful routers to cope with ever-increasing demands of intranet data traffic. A hierarchical internetworking model for interconnecting routers in large networks is in common use.[12] Some routers can connect to Data service units for T1 connections[13][14][15] via serial ports.[16][17]
Access routers, including small office/home office (SOHO) models, are located at home and customer sites such as branch offices that do not need hierarchical routing of their own. Typically, they are optimized for low cost. Some SOHO routers are capable of running alternative free Linux-based firmware like Tomato, OpenWrt, or DD-WRT.[18]
Distribution routers aggregate traffic from multiple access routers. Distribution routers are often responsible for enforcing quality of service across a wide area network (WAN), so they may have considerable memory installed, multiple WAN interface connections, and substantial onboard data processing routines. They may also provide connectivity to groups of file servers or other external networks.[19]
In enterprises, a core router may provide a collapsed backbone interconnecting the distribution tier routers from multiple buildings of a campus, or large enterprise locations. They tend to be optimized for high bandwidth but lack some of the features of edge routers.[20]
Security
External networks must be carefully considered as part of the overall security strategy of the local network. A router may include a firewall, VPN handling, and other security functions, or they may be handled by separate devices. Routers also commonly perform network address translation which restricts connections initiated from external connections but is not recognized as a security feature by all experts.[21] Some experts argue that open source routers are more secure and reliable than closed source routers because errors and potentially exploitable vulnerabilities are more likely to be discovered and addressed in an open-source environment.[22][23]
Routing different networks
Routers are also often distinguished on the basis of the network in which they operate. A router in a local area network (LAN) of a single organization is called an interior router. A router that is operated in the Internet backbone is described as exterior router. While a router that connects a LAN with the Internet or a wide area network (WAN) is called a border router, or gateway router.[24]
Internet connectivity and internal use
Routers intended for ISP and major enterprise connectivity usually exchange routing information using the Border Gateway Protocol (BGP). RFC4098 defines the types of BGP routers according to their functions:[25]
Edge router or inter-AS border router: Placed at the edge of an ISP network, where the router is used to peer with the upstream IP transit providers, bilateral peers through IXP, private peering (or even settlement-free peering) through Private Network Interconnect (PNI) via the extensive use of Exterior Border Gateway Protocol (eBGP).[26]
Provider Router (P): A Provider router is also called a transit-router, it sits in an MPLS network and is responsible for establishing label-switched paths between the PE routers.[27]
Provider edge router (PE): An MPLS-specific router in the network's access layer that interconnects with customer edge routers to provide layer 2 or layer 3 VPN services.[27]
Customer edge router (CE): Located at the edge of the subscriber's network, it interconnects with the PE router for L2VPN services, or direct layer 3 IP hand-off in the case of Dedicated Internet Access, if IP Transit services are provided through an MPLS core, the CE peers with the PE using eBGP with the public ASNs of each respective network. In the case of L3VPN services the CE can exchange routes with the PE using eBGP. It is commonly used in both service provider and enterprise or data center organizations.[27]
Core router: Resides within an Autonomous System as a backbone to carry traffic between edge routers.[28]
Within an ISP: In the ISP's autonomous system, a router uses internal BGP to communicate with other ISP edge routers, other intranet core routers, or the ISP's intranet provider border routers.
Internet backbone: The Internet no longer has a clearly identifiable backbone, unlike its predecessor networks. See default-free zone (DFZ). The major ISPs' system routers make up what could be considered to be the current Internet backbone core.[29] ISPs operate all four types of the BGP routers described here. An ISP core router is used to interconnect its edge and border routers. Core routers may also have specialized functions in virtual private networks based on a combination of BGP and Multiprotocol Label Switching protocols.[30]
Port forwarding: In some networks, that rely on legacy IPv4 and NAT, routers (often labeled as NAT boxes) are also used for port forwarding configuration between RFC1918 address space and their publicly assigned IPv4 address.[11]
Voice, data, fax, and video processing routers: Commonly referred to as access servers or gateways, these devices are used to route and process voice, data, video and fax traffic on the Internet. Since 2005, most long-distance phone calls have been processed as IP traffic (VOIP) through a voice gateway. Use of access server-type routers expanded with the advent of the Internet, first with dial-up access and another resurgence with voice phone service.
Larger networks commonly use multilayer switches, with layer-3 devices being used to simply interconnect multiple subnets within the same security zone, and higher-layer switches when filtering, translation, load balancing, or other higher-level functions are required, especially between zones.
Wi-Fi routers combine the functions of a router with those of a wireless access point. They are typically devices with a small form factor, operating on the standard electric power supply for residential use. Connected to the Internet as offered by an Internet service provider, they provide Internet access through a wireless network for home or office use.
The idea for a router (called a gateway at the time) initially came about through an international group of computer networking researchers called the International Network Working Group (INWG).[39] These gateway devices were different from most previous packet switching schemes in two ways. First, they connected dissimilar kinds of networks, such as serial lines and local area networks. Second, they were connectionless devices, which had no role in assuring that traffic was delivered reliably, leaving that function entirely to the hosts.[40] This particular idea, the end-to-end principle, was pioneered in the CYCLADES network.[41]
The idea was explored in more detail, with the intention to produce a prototype system as part of two contemporaneous programs. One was a program at Xerox PARC to explore new networking technologies, which produced the PARC Universal Packet system. Some time after early 1974, the first Xerox routers became operational. Due to corporate intellectual property concerns, it received little attention outside Xerox for years.[42] The other was the DARPA-initiated program, which created the TCP/IP architecture in use today.[43] The first true IP router was developed by Ginny Travers at BBN, as part of that DARPA-initiated effort, during 1975–1976.[44][45] By the end of 1976, three PDP-11-based routers were in service in the experimental prototype Internet.[46] Mike Brecia, Ginny Travers, and Bob Hinden received the IEEE Internet Award for early IP routers in 2008.[47]
The first multiprotocol routers were independently created by staff researchers at MIT and Stanford in 1981 and both were also based on PDP-11s. Stanford's router program was led by William Yeager and MIT's by Noel Chiappa.[48][49][50][51] Virtually all networking now uses TCP/IP, but multiprotocol routers are still manufactured. They were important in the early stages of the growth of computer networking when protocols other than TCP/IP were in use. Modern routers that handle both IPv4 and IPv6 are multiprotocol but are simpler devices than ones processing AppleTalk, DECnet, IPX, and Xerox protocols.
From the mid-1970s and in the 1980s, general-purpose minicomputers served as routers. Modern high-speed routers are network processors or highly specialized computers with extra hardware acceleration added to speed both common routing functions, such as packet forwarding, and specialized functions such as IPsec encryption. There is substantial use of Linux and Unix software-based machines, running open source routing code, for research and other applications. The Cisco IOS operating system was independently designed. Major router operating systems, such as Junos and NX-OS, are extensively modified versions of Unix software.
The main purpose of a router is to connect multiple networks and forward packets destined either for directly attached networks or more remote networks. A router is considered a layer-3 device because its primary forwarding decision is based on the information in the layer-3 IP packet, specifically the destination IP address. When a router receives a packet, it searches its routing table to find the best match between the destination IP address of the packet and one of the addresses in the routing table. Once a match is found, the packet is encapsulated in the layer-2 data link frame for the outgoing interface indicated in the table entry. A router typically does not look into the packet payload,[52] but only at the layer-3 addresses to make a forwarding decision, plus optionally other information in the header for hints on, for example, quality of service (QoS). For pure IP forwarding, a router is designed to minimize the state information associated with individual packets.[53] Once a packet is forwarded, the router does not retain any historical information about the packet.[b]
The routing table itself can contain information derived from a variety of sources, such as a default or static routes that are configured manually, or dynamic entries from routing protocols where the router learns routes from other routers. A default route is one that is used to route all traffic whose destination does not otherwise appear in the routing table; it is common – even necessary – in small networks, such as a home or small business where the default route simply sends all non-local traffic to the Internet service provider. The default route can be manually configured (as a static route); learned by dynamic routing protocols; or be obtained by DHCP.[c][54]
A router can run more than one routing protocol at a time, particularly if it serves as an autonomous system border router between parts of a network that run different routing protocols; if it does so, then redistribution may be used (usually selectively) to share information between the different protocols running on the same router.[55]
Besides deciding to which interface a packet is forwarded, which is handled primarily via the routing table, a router also has to manage congestion when packets arrive at a rate higher than the router can process. Three policies commonly used are tail drop, random early detection (RED), and weighted random early detection (WRED). Tail drop is the simplest and most easily implemented: the router simply drops new incoming packets once buffer space in the router is exhausted. RED probabilistically drops datagrams early when the queue exceeds a pre-configured portion of the buffer, until reaching a pre-determined maximum, when it drops all incoming packets, thus reverting to tail drop. WRED can be configured to drop packets more readily dependent on the type of traffic.
Another function a router performs is traffic classification and deciding which packet should be processed first. This is managed through QoS, which is critical when Voice over IP is deployed, so as not to introduce excessive latency.[56]
Yet another function a router performs is called policy-based routing where special rules are constructed to override the rules derived from the routing table when a packet forwarding decision is made.[57]
Some of the functions may be performed through an application-specific integrated circuit (ASIC) to avoid the overhead of scheduling CPU time to process the packets. Others may have to be performed through the CPU as these packets need special attention that cannot be handled by an ASIC.[58]
^In some router implementations, the forwarding action can increment a counter associated with the routing table entry for the collection of statistical data.
^A router can serve as a DHCP client or as a DHCP server.
^"What Is Routing?". Cisco. 2022-04-10. Retrieved 2024-03-25. Routing tables can be created manually and "learned" by software as it observes network traffic, or they can be built according to routing protocols.
^"Virtual Backbone Routers"(PDF). IronBridge Networks, Inc. September, 2000. Archived(PDF) from the original on 16 July 2011. Retrieved 15 January 2011.
^E. Rosen; Y. Rekhter (April 2004). BGP/MPLS VPNs.
^Roberts, Dr. Lawrence G. (May 1995). "The ARPANET & Computer Networks". Archived from the original on 24 March 2016. Retrieved 13 April 2016. Then in June 1966, Davies wrote a second internal paper, "Proposal for a Digital Communication Network" In which he coined the word packet,- a small sub part of the message the user wants to send, and also introduced the concept of an interface computer to sit between the user equipment and the packet network.
^John S, Quarterman; Josiah C, Hoskins (1986). "Notable computer networks". Communications of the ACM. 29 (10): 932–971. doi:10.1145/6617.6618. S2CID25341056. The first packet-switching network was implemented at the National Physical Laboratories in the United Kingdom. It was quickly followed by the ARPANET in 1969.
^Scantlebury, Roger (2001). A Brief History of the NPL Network. Symposium of the Institution of Analysts & Programmers 2001. Archived from the original on 2003-08-07. Retrieved 2024-06-13. The system first went 'live' early in 1969
^Haughney Dare-Bryan, Christine (June 22, 2023). Computer Freaks (Podcast). Chapter Two: In the Air. Inc. Magazine. 35:55 minutes in. Leonard Kleinrock: Donald Davies ... did make a single node packet switch before ARPA did
^Davies, Shanks, Heart, Barker, Despres, Detwiler and Riml, "Report of Subgroup 1 on Communication System", INWG Note No. 1.
^Edmondson-Yurkanan, Chris (2007). "SIGCOMM's archaeological journey into networking's past". Communications of the ACM. 50 (5): 63–68. doi:10.1145/1230819.1230840. ISSN0001-0782. INWG#1: Report of Subgroup 1 on Communication System Requirements by Davies, Shanks, Heart, Barker, Despres, Detwiler, and Riml. They wrote: "It was agreed that interworkingbetween packet switching networks should not add complications to the hosts, considering that networks will probably be different and thus gateways between networks will be required. These gateways should be as uncomplicated as possible, whilst allowing as much freedom as possible for the design of individual networks". INWG#1 clarified that gateways and simplicity were accepted concepts when INWG was formed.
^David Boggs, John Shoch, Edward Taft, Robert Metcalfe, "Pup: An Internetwork Architecture", IEEE Transactions on Communications, Volume 28, Issue 4, April 1980, pp. 612- 624.