Routing

Routing

The routing protocols use the metric to find the shortest path for the packet delivery. A metric is a unit of measurement used by the routing algorithm to determine the best path to the destination, such as hop count, bandwidth, delay, current load on the network, and so on. The routing algorithm creates and maintains the routing table for the path-finding process.

A router is a software program that selects a way for data to be transported from a source to a destination. A router is a unique device that does routing.

In the OSI paradigm, a router operates at the network layer, while in the TCP/IP model, it operates at the internet layer. A router is a networking device that forwards packets using information from the packet header and forwarding table. The packets are routed using routing techniques. The routing algorithm is simply a piece of software that determines the most efficient path for packet transmission.

A default route is always configured on a router.
If no route for a specified destination can be discovered, a default route directs the router where to send the packet.
In the event that there are many paths to the same destination, the router can make a decision based on the following data:

  • Hop Count
  • Bandwidth
  • Metric
  • Prefix-length
  • Delay

Routes can be set up statically or learned dynamically. One route can be set to take priority over others.

 

Unicast routing

The majority of internet and intranet traffic, also known as unicast data or unicast traffic, is routed to a specific destination. Unicast routing is the process of sending unicast data via the internet. Because the destination is already known, it is the simplest form of routing. As a result, all the router has to do is check the routing table and forward the packet to the next step.

Broadcast routing

Broadcast packets are not routed and forwarded by routers on any network by default. Broadcast domains are created by routers. However, under rare circumstances, it can be programmed to forward transmissions. A broadcast message is sent to all network devices at the same time.

There are two ways to route broadcasts (algorithms):

A router generates a data packet and sends it one by one to each host. The router produces numerous copies of the same data packet with distinct destination addresses in this situation. All packets are unicast, but because they are sent to everyone, the router appears to be broadcasting. This method uses a lot of bandwidth, and the router needs to know each node’s destination address.

Second, when a router receives a packet that needs to be broadcasted, it simply floods all interfaces with it.
Every router is set up in the same way.

Although this method is light on the router’s CPU, it may result in duplicate packets being received from peer routers.

Reverse path forwarding is a technique in which a router knows ahead of time where it should receive broadcasts from its predecessor. This method is used to identify and eliminate duplicates.

Multicast Routing

Multicast routing is a subset of broadcast routing, with unique characteristics and challenges. Packets are sent to all nodes via broadcast routing, even if they do not want them. However, in Multicast routing, data is only sent to nodes that desire to receive packets.

Only once the router has determined that there are nodes that want to receive multicast packets (or streams), should it forward them. To avoid looping, multicast routing uses the spanning tree protocol.

To detect and eliminate duplicates and loops, multicast routing employs the reverse path forwarding approach.

Anycast Routing

Anycast packet forwarding allows several hosts to share the same logical address. When a packet with this logical address is received, it is sent to the nearest host in the routing topology.

The DNS server is used to do anycast routing. When an Anycast packet is received, DNS is queried to determine where it should be sent. DNS returns the IP address of the nearest IP address set on the system.

Unicast Routing Protocols

Unicast packets can be routed using one of two routing protocols:

Distance Vector Routing Protocol

Distance Vector is a straightforward routing technique that bases its decisions on the number of hops between the source and the destination. The best route is one that has the fewest amount of hops. To other routers, each router presents its collection of optimal routes. Finally, all routers construct their network topologies based on peer router ads.

Routing Information Protocol, for example (RIP).

Link State Routing Protocol

The Link State protocol is a little more sophisticated than the Distance Vector protocol. It considers the states of all the routers in a network’s links. This technique aids in the creation of a network-wide shared graph. The optimum path for routing is then calculated by all routers. Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS) are two examples (ISIS).

Multicast Routing Protocols

Multicast routing methods employ trees, i.e. spanning tree, to eliminate loops, whereas Unicast routing protocols use graphs. The shortest path spanning tree is the best tree.

  • MOSPF  – Multicast Open Shortest Path First

  • DVMRP  – Distance Vector Multicast Routing Protocol

  • PIM  – Protocol Independent Multicast

  • CBT  – Core Based Tree

Protocol Independent Multicast (PIM) is currently widely utilized. It comes in two different modes:

  • PIM Dense Mode

    Source-based trees are used in this mode. It’s employed in high-density environments like LANs.

  • PIM Sparse Mode

    Shared trees are used in this manner. In a sparse setting, such as a WAN, it is employed.