Routing achieved commercial popularity in the mid-1980s – at a time when large-scale internetworking began to replace the fairly simple, homogeneous environments that had been the norm hitherto. Routing is the act of moving information across an internetwork from a source to a destination. It is often contrasted with bridging, which performs a similar function. The primary difference between the two is that bridging occurs at Layer 2 (the link layer) of the OSI reference model, whereas routing occurs at Layer 3 (the network layer). This distinction provides routing and bridging with different information to use in the process of moving information from source to destination, so the two functions accomplish their tasks in different ways.
Routers use information within each packet to route it from one LAN to another, and communicate with each other and share information that allows them to determine the best route through a complex network of many LANs. To do this, routers build and maintain routing tables, which contain various items of route information – depending on the particular routing algorithm used. For example, destination/next hop associations tell a router that a particular destination can be gained optimally by sending the packet to a particular router representing the next hop on the way to the final destination. When a router receives an incoming packet, it checks the destination address and attempts to associate this address with a next hop.