routing is the process of selecting a path for traffic in a network or between or across multiple networks. broadly, routing is performed in many types of networks, including circuit-switched networks, such as the public switched telephone network (pstn), and computer networks, such as the internet.
in packet switching networks, routing is the higher-level decision making that directs network packets from their source toward their destination through intermediate network nodes by specific packet forwarding mechanisms. packet forwarding is the transit of network packets from one network interface to another. intermediate nodes are typically network hardware devices such as routers, gateways, firewalls, or switches. general-purpose computers also forward packets and perform routing, although they have no specially optimized hardware for the task.
the routing process usually directs forwarding on the basis of routing tables. routing tables maintain a record of the routes to various network destinations. routing tables may be specified by an administrator, learned by observing network traffic or built with the assistance of routing protocols.
routing, in a narrower sense of the term, often refers to ip routing and is contrasted with bridging. ip routing assumes that network addresses are structured and that similar addresses imply proximity within the network. structured addresses allow a single routing table entry to represent the route to a group of devices. in large networks, structured addressing (routing, in the narrow sense) outperforms unstructured addressing (bridging). routing has become the dominant form of addressing on the internet. bridging is still widely used within local area networks.