Routing
Routing is the process of moving data from one device to another device. In most cases, routing is performed by a networking device called a router. In the OSI model, the network layer is responsible for performing routing.
We can classify routing into three categories: static, default, and dynamic.
Static routing is a nonadaptive type where the administrator adds and defines the route the data needs to follow in order to reach the destination from the source.
In default routing, all the packet takes a predefined default path. It’s helpful in bulk data transmission and networks with a single exit point.
Finally, dynamic routing, also known as adaptive routing, uses dynamic protocols to find new routes to reach the receiver.
Routing is sometimes referred to as forwarding, but it’s important to note that routing is a different process from forwarding.
Forwarding
Process of collecting data from one device and sending it to another device. This process differs from routing because it doesn’t manage moving data from one device to another. Unlike the routing process, forwarding performs some actions and simply forwards the packets which arrive in intermediate routers.
Both routing and forwarding are performed by the network layer. The device that collects data and sends it to another device is known as the forwarding device.
Switching
Switching is the process of collecting data coming from one port and sending it to another port toward the destination. Switching can be connectionless as well as connection-oriented. In connectionless switching, connection establishment using handshaking is not required. The packets received in a port are sent based on the forwarding table. On the other hand, a connection-oriented switching process uses a predefined circuit along with intermediate nodes ID between the sender and receiver.
We can classify switching techniques into three categories: circuit, message, and packet switching. In circuit switching, we need to establish a circuit before sending the data. In the case of message switching, the whole received data is treated as a message and sent to the intermediate switching devices. Finally, packet switching breaks the data into small chunks called packets. The packets are transmitted independently.