Interpretando a coluna 'métrica' na tabela de roteamento

2

Estou um pouco confuso sobre a saída que estou vendo em minha tabela de roteamento, particularmente na coluna "métrica":

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
172.16.35.0     0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.0.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0
192.168.82.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8

De acordo com a página man, a métrica indica a "distância" para o alvo. Eu estava um pouco confuso sobre o que exatamente "alvo" era. Eu assumi que era o meu roteador (ele vai para o gateway 0.0.0.0, que então vai para o meu roteador em 192.168.0.1). Assim, esperava que a métrica fosse um único salto para o meu roteador. No entanto, são 9! Por que isso é tão alto?

    
por Alexander Kohler 14.01.2017 / 14:38

1 resposta

2

De acordo com a página man, a métrica indica a 'distância' para o alvo.

I expected the metric to be a single hop to my router. However, it's 9! Why is this so number high?

O campo metric tem vários significados diferentes:

The Metric field indicates the cost of a route. If multiple routes exist to a given destination network ID, the metric is used to decide which route is to be taken. The route with the lowest metric is the preferred route. Some routing algorithms only store a single route to any Network ID in the routing table even when multiple routes exist. In this case, the metric is used by the router to decide which route to store in the routing table.

Metrics can indicate different ways of expressing a route preference:

  • Hop Count.

    A common metric. Indicates the number of routers (hops) in the path to the network ID.

  • Delay.

    A measure of time that is required for the packet to reach the network ID. Delay is used to indicate the speed of the path—local area networks (LAN) links have a low delay, wide area network (WAN) links have a high delay—or a congested condition of a path.

  • Throughput.

    The effective amount of data that can be sent along the path per second. Throughput is not necessarily a reflection of the bit rate of the link, as a very busy Ethernet link may have a lower throughput than an unutilized 64-Kbps WAN link.

  • Reliability.

    A measure of the path constancy. Some types of links are more prone to link failures than others. For example, with WAN links, leased lines are more reliable than dial-up lines.

Fonte Tabelas de roteamento

    
por 14.01.2017 / 15:12