Routing and Routing Table

  • Routing is a process of selecting a path for traffic in a network or between or across the network.
  • When a packet comes to a networking nodes, be it a switch, computer host or a router, it needs to be forwarded to its destination, choosing the correct path/route to do so is called routing.

There can be Direct Delivery or an Indirect Delivery of packet

Direct Delivery:

  • This means the final destination of the packet is a host that lies on the same network or a router which is the last that is delivery is between last router and final destination.
  • The sender can easily determine if the delivery is direct. It can extract the network address of the destination (using the mask) and compare this address with the addresses of the networks to which it is connected. If a match is found, the delivery is direct.

Indirect Delivery:

  • This means that final destination of the packet is a host that lies on a different network, the packet is delivered indirectly. The packet goes form router to router until it reaches the final destination.
  • The networking device which is used for indirect delivery is called router, its a Layer3 device

Router:

  • It is a Layer3 device which helps in forwarding of packet, if the destination of the packet is a lost which lies on different network that is helpful in indirect delivery.
  • It helps in communication across networks, with the help of table called routing table.

Routing Table:

  • It is a table maintained by a router or a host , helps in forwarding of packet across network.
  • It maintains a entry for each destination, or a combination of destinations, to route the IP packets.
  • It can be either static or dynamic.

Static Routing Table:

  • It contains information that is entered manually that is routes for each destination is entered by administrator.
  • This table does not get updated automatically, if there is any change in network as it does not run any routing protocol.
  • It can be used in small network which does not change very often.

Dynamic Routing Table:

  • It uses any routing protocol such as RIP, OSPF, BGP to update the entries in the table.
  • There is no manual intervention.

Format of Routing Table:

Any routing table must have minimum four fields: mask, network address, next hop and interface

untitled image

Common fields in routing table as as follows, it can even be more depending upon the implementation by each vendor.

Network Address: This field defines the network address to which the packet is finally delivered. Again this address can either be network address or the host address itself. This is determined by flags.

Mask: This field defines the mask applied for this entry.

Next-Hop: This field defines the address of the next hop which the packets takes to reach the specified network address.

Interface: This gives the name of the interface which the packet takes to reach its next hop.

Metric:

This defines the cost of a route. This cost depends upon the type of routing protocol used. It can either be determined in terms of link speed, hop count or time delay. For direct connected, metric is 0.

Reference Count:

This gives the number of user active for this route.For example, if five people at the same time are connecting to the same host from this router, the value of this column is 5.

Use:

This field shows the number of packets transmitted through this router for the corresponding destination.

Flags:

Some of the common flags are:

  • U(up): This flag indicates that route is up and running. If its not there, this route is not active, packets will be discarded/dropped.
  • G(gateway): This means that destination host in in another network. The packet is forwarded to next hop for delivery(Indirect Delivery). If this flag is missing, it means destination is on this network(direct delivery).
  • H(host-specific): This flag defines that entry in the network address is the address of the destination host itself. It missing, means that address is only the network address of the destination.
  • D(added by redirection):

This field defines that this route is added because of redirection message from ICMP.

  • M(modified by redirection):

This flag defines that routing information for this destination has been modified by redirection message from ICMP.

Redirection Concepts:

Source Redirect:

  • Suppose the source does not take part in routing update because of efficiency and it has a route as next hop “R1” to reach destination.
  • Source sends the packet to “R1”, and “R1” finds in its routing table that there is best path to reach destination that is via “R4”.
  • So it forwards the packet to “R2”, but at the same time also sends a message to source that there exist a better path via “R4” to reach destination.
  • Once source gets this message, it updates its routing table with a new route and flag set for this route is “D”.
  • This complete process is known as source redirect.

once the route is added by a redirect and if there is any further modification because of redirect, then flag is set to “M”.

Routing Table Utilities: There are several utilities to find the routing information and its content

On UNIX or Linux, it is “netstat” which can help in getting the routing information and on windows its “route print”

untitled image


Categories: Networking

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: