简体   繁体   English

OSPF如何绑定到多个网络接口?

[英]How does OSPF bind to multiple network interfaces?

The routing protocol OSPF has a configuration command as "network " to help determine which network interface to operate on. 路由协议OSPF的配置命令为“网络”,以帮助确定要在哪个网络接口上运行。 And this command can be used to multiple times on different networks. 并且此命令可以在不同的网络上多次使用。 My question is if this means the OSPF socket, or, raw socket, can bind to multiple addresses? 我的问题是这是否意味着OSPF套接字或原始套接字可以绑定到多个地址? Per my understanding, each socket has only one protocol control block(PCB), and each PCB has only one address. 据我了解,每个插槽只有一个协议控制块(PCB),每个PCB只有一个地址。 I'm only looking for high level explanation. 我只是在寻找高级解释。 For example, if OSPF socket can have multiple PCBs, or, OSPF's PCB can have multiple addresses. 例如,如果OSPF套接字可以具有多个PCB,或者OSPF的PCB可以具有多个地址。

That depends on the implementation. 这取决于实现方式。

You don't need customized sockets to use different interfaces and you don't need to work only with one socket. 您不需要定制的套接字即可使用不同的接口,也不需要仅使用一个套接字。 The implementation can use N raw sockets each one bound to one of N interfaces. 该实现可以使用N个原始套接字,每个原始套接字绑定到N个接口之一。 Then the implementation can have one or N threads handling those N sockets. 然后,该实现可以具有一个或N个线程来处理这N个套接字。

Also it could use packet sockets but it doesn't make much sense. 它还可以使用数据包套接字,但没有太大意义。

Additionally it could use libpcap for receiving messages and sending messages. 另外,它可以使用libpcap接收消息和发送消息。

Look at Quagga: https://en.wikipedia.org/wiki/Quagga_(software) 查看Quagga: https ://zh.wikipedia.org/wiki/Quagga_(软件

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

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