<sod>{{refimprove section|date=June 2014}}<eod>
<sod>The main purpose of a router is to connect multiple networks and forward packets destined either for its own networks or other 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,{{citation needed|date=June 2014}} 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 (computer science)|state]] information associated with individual packets.<ref>{{cite web|last1=Roberts|first1=Lawrence|title=The Next Generation of IP - Flow Routing|url=http://www.packet.cc/files/FlowPaper/NextGenerationofIP-FlowRouting.htm|accessdate=22 February 2015|date=22 July 2003}}</ref> Once a packet is forwarded, the router does not retain any historical information about the packet.{{efn|The forwarding action can be collected into the statistical data, if so configured.}}<eod>