简体   繁体   English

如何查看 Linux 操作系统中的转发表和路由表及其差异?

[英]How to view forwarding and routing tables in a Linux OS and differences?

Just reading about the concept of the routing table and forwarding table through the packet switching approach in Computer Networks.只是通过计算机网络中的数据包交换方法阅读路由表和转发表的概念

The forwarding table summarizes information on the routing table, mentioning that the network is a dynamic existing.转发表总结了路由表上的信息,提到网络是动态存在的。

Besides, The IP Layer suggests methods for finding the shortest path to the destination.此外,IP 层提出了寻找到目的地的最短路径的方法。

Routers do routing and forwarding.路由器进行路由和转发。 First, the Router route for maximum reliability in the way and finding the best path.首先,Router 在路由中寻求最大可靠性并找到最佳路径。 Second, the router forwards the packet from the suitable interface via summarized routing table information.其次,路由器通过汇总的路由表信息从合适的接口转发数据包。

Let's see;让我们来看看; How do packets determine which way they should go?数据包如何确定它们应该走的路? So there should be a routing table and forwarding table at each router.所以在每个路由器上都应该有一个路由表和转发表。

It seems when routing is happening.似乎在路由发生时。 A router creates a routing table with a built-in forwarding procedure.路由器创建具有内置转发过程的路由表。 So the router sends a virtual packet (I think so, but I don't know what it is?) on each interface for finding the available paths and streams.所以路由器会在每个接口上发送一个虚拟数据包(我想是的,但我不知道它是什么?),以查找可用的路径和流。 There would be a question if the router first does routing and then forwarding?路由器先做路由再转发会有问题吗? What would happen with the routing procedure (like there is implicit forwarding in the routing process)?路由过程会发生什么(例如路由过程中存在隐式转发)?

Does each router use the forwarding table originates from the first router, or does it change each router?每个路由器都使用源自第一个路由器的转发表,还是更改每个路由器? If so, there should be lots of processing on each node?如果是这样,每个节点上应该有很多处理? ( as we know, processes in the IP layer should be as light as possible, but it seems we do have lots of them ) (我们知道,IP 层中的进程应该尽可能轻,但似乎我们确实有很多)

Maybe someone could help me with that.也许有人可以帮助我。

Thanks.谢谢。

In a nutshell:简而言之:

All routes (destination networks) learned from all routing protocols (EIGRP, OSPF, BGP etc.) are stored in the routing table.从所有路由协议(EIGRP、OSPF、BGP 等)学习的所有路由(目标网络)都存储在路由表中。 From these routes, the best routes are placed in the forwarding table (based first on administrative distance, then metric).从这些路由中,最佳路由被放置在转发表中(首先基于管理距离,然后是度量)。

根据https://ubuntu.com/core/docs/networkmanager/routing-tables ,可以使用ip route命令查看内核路由表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM