What are source routing packets

How does routing work

Router and routing - finding the way in the network. This article describes what routers are and which processes are used to find the right path in a network (static or dynamic routing)

Routers and the routing they perform to find the way are very fundamental to large networks. Routers connect different networks with one another and can make decisions about how to forward data.

What is a router

A router is a device that can couple separate networks with one another or divide large networks into subnetworks. The router works on layer 3 of the OSI model and can therefore use the logical IP addresses to forward data. The simplest form of a router is a computer with several network cards, each of which is connected to different networks.

Since routers work on layer 3, they can connect networks with different topologies to one another. However, routers are slower than switches or bridges because they have to unpack the data packets down to layer 3 in order to find out the destination address.

But in addition to the pure forwarding of data, routers have other tasks: They expand a network in terms of the length and number of connected stations. They connect different subnets that are created through subnetting. Routers enable the implementation of various protocols, e.g. IP to IPX, by interpreting received data packets with regard to their protocol and converting them accordingly.

They also enable filters to protect against unauthorized access. In this way you can restrict the direction, e.g. employees of a company can communicate with the outside world while no one can enter the company network. You can filter by protocol and thus only allow traffic via certain protocols (e.g. prohibit FTP, but allow SMTP). In addition, access to certain WWW or FTP servers can be restricted and access can even be restricted to certain times (days of the week, times of day). Finally, routers enable a complex route finding method.

What is routing

Routing is a basic property of every network. This term is used to describe the process by which the best route from a source computer to the target computer is found. Routing consists of two sub-processes, which are generally summarized under the term routing:

  • Routing: The route through the entire network via several network nodes is determined.
  • Forwarding: A node decides how to forward a packet.

It must be possible for data to be sent within a network without affecting other networks and for data to be sent to the correct target network via several networks. With the latter, the data is sent via many different routers, each of which has to make a decision as to which neighbors to forward the data to.

Routing can be done in two ways:

The routing tables

The decisions are always made on the basis of so-called routing tables. The entries in the routing table indicate to which neighboring router the data must be forwarded in order to reach a specific destination. The tables consist of the following entries:

  • Destination network address
  • Subnet mask of the target network
  • The next hop, i.e. the IP address of the router via which the packet must be forwarded for this destination
  • Metric: Information about the accessibility of the network. They map the forwarding costs and only play a role if a destination can be reached via several routes.

The more entries a routing table has, the longer it takes to forward packets. The aim is therefore to minimize the size of the table as much as possible. You can display the routing tables using the following commands:

Static routing

Static routing is based on static routing tables. These are entered manually by the administrator and must also be adjusted manually if the network changes. Thus, the administrator has to define every possible route, which of course means a high administrative burden if the network exceeds a certain size. Even if networks change frequently, manual management is no longer possible.

Dynamic routing

In large networks it is of course not possible to enter the routing tables manually. Therefore, a much more complex method, dynamic routing, has to be used. The routers do not make decisions based on a static table, but can dynamically adapt and expand their routing table.

Of course, the routers also have static routing tables with dynamic routing. However, these only contain the best possible paths that do not change frequently. If the router finds the destination in its table, it can immediately forward on this route. Otherwise it sends the packet on using the standard route. All data traffic to the destination unknown to the sending router is forwarded via the standard router (also: gateway).

This can then decide on the next path. If it cannot find a suitable entry in its own routing table either, it also forwards it to a standard router. This results in a standard route on which packets with an unknown destination are sent. At some point a router will know how to handle the packet and how to deliver it correctly.

Even if a router makes the wrong decision and does not send the packet to its optimal neighbor, it will eventually arrive. With dynamic routing, routing information is also exchanged between the routers. Since this exchange of information means a further load on the network, there are various methods:

  • Link state routing
  • Distance vector routing

Link-state routing works according to the principle of “share the world with who your neighbors are”. After a while, each router knows all the other routers in the network and can calculate the shortest routes for itself.

Distance vector routing works differently. It works on the principle of “share the world with what the world looks like to you”. The routers tell each other how well they are connected to different destination nodes. The problem of calculating the shortest route is thus distributed over several routers.

Category: Technology Tag: Computer, Internet, NetworksLeave a comment