Você está na página 1de 4

Router

A router is a device for connecting computer networks to one another, used for handling
the routing of packets between two networks, or to determine the path that a data packet
shall take.
When a user enters a URL, the Web client (the browser) queries the domain name server,
which shows it the IP address of the desired machine.
The workstation sends the request to the nearest router, i.e. to the default gateway on the
network it is located on. This router determines the next machine to which the data will
be forwarded, in such a way as to choose the best pathway possible.
To do so, the routers keep up-to-date routing tables, which are like maps showing the
paths that can be taken to get to the destination address.
There are numerous protocols designed to handle this process.

In addition to their routing function, routers are also used to manipulate data travelling in
the form of datagrams so that they can go from one kind of network to another.
As not all networks are able to handle the same size of data packets, routers are tasked
with fragmenting packets so they can travel freely.
The first routers were simply computers with multiple network cards, with each one
linked to a different network. Current routers are mostly hardware designed for routing,
generally in the form of 1U servers.

Routing protocols
There are two major types of routing protocols:
Distance vector routers generate a routing table that calculates the "cost" (in terms of the
number of hops) of each route, then sends that table to nearby routers. Each time a
connection request is made, the router chooses the least costly route.
Link state routers listen to the network continuously, in order to identify the various
elements surrounding it. With this information, each router calculates the shortest
pathway (in terms of time) to each neighboring router, and sends this information in the
form of update packets. Finally, each router builds its own routing table by calculating
the shortest pathways to all other routers (using the Dijkstra algorithm).
Routers are devices which make it possible to "choose" the path that datagrams will take
to arrive at the destination.
They are machines with several network interface cards each one of which is linked to a
different network. So, in the simplest configuration, the router only has to "look at" what
network a computer is located on to send datagrams to it from the originator.
However, on the Internet the schema is much more complicated for the following
reasons:

The number of networks to which a router is connected is generally large


The networks to which the router is linked can be linked to other networks that
the router cannot see directly

So, routers work using routing tables and protocols, according to the following model:

The router receives a frame from a machine connected to one of the networks it is
attached to

Datagrams are sent on the IP layer

The router looks at the datagram's header

If the destination IP address belongs to one of the networks to which one of the
router interfaces is attached, the information must be sent at layer 4 after the IP
header has been unencapsulated (removed)

If the destination IP address is part of a different network, the router consults its
routing table, a table which establishes the path to take for a given address.

The router sends the datagram using the network interface card linked to the
network on which the router decides to send the packet.

So, there are two scenarios, either the originator and recipient belong to the same network
in which case we talk about direct delivery, or there is at least one router between the
originator and recipient, in which case we talk about indirect delivery.
In the case of indirect delivery, the role of the router and in particular that of the routing
table is very important. So, the operation of a router is determined by the way in which
this routing table is created.

If the routing table is entered manually by the administrator, it is a static routing


(suitable for small networks)
If the router builds its own routing tables using information that it receives (via
the routing protocols), it is a dynamic routing

The routing table


The routing table is a table of connections between the target machine address and the
node according to which the router must deliver the message. In reality it is enough that
the message is delivered to the network that contains the machine, it is therefore not
necessary to store the complete IP address of the machine: only the network identifier of
the IP address
(i.e. the network ID) needs to be stored.
The routing table is therefore a table which contains address pairs:

Destination address Address of the next router directly accessible Interface


Using this table, the router knowing the address of the recipient encapsulated in the
message, will be able to find out what interface to send the message on (this comes back
to knowing which network interface card to use), and to which router, directly accessible
on the network to which this card is connected, to send the datagram.
This mechanism consisting of only knowing the address of the next link leading to the
destination is called next-hop routing.
However, it may be that the recipient belongs to a non referenced network in the routing
table. In this case, the router uses a default router (also called the default gateway).

Destination address
194.56.32.124
110.78.202.15
53.114.24.239
187.218.176.54

Address of the next router directly accessible Interface


131.124.51.108
2
131.124.51.108
2
194.8.212.6
3
129.15.64.87
1

The message is therefore sent from router to router by successive hops, until the recipient
belongs to a network directly connected to a router. This then sends the message directly
to the target machine...
In the case of static routing, it is the administrator who updates the routing table.
In the case of dynamic routing a protocol called a routing protocol enables the automatic
updating of the table so that it contains the optimal route at any time.

Routing protocols

Você também pode gostar