如何配置DDS以使用多個網絡接口?How do I configure DDS to work with multiple network interfaces?

最近在使用OpenDDS的時候遇到一個問題:存在多個虛擬網卡時,發布(訂閱)端重新連接時會阻塞幾分鐘,在外網找到一篇與此相關的文章。

You cannot specify which NICs DDS will use to send data. You can restrict the NICs that DDS can use to receive data by configuring Participant properties in the QoS on the DataReader, but you cannot tell DDS to use one NIC or another to send the DataWriter data. Rather, the DataWriter will try to send data to all of the addresses that a DataReader announces when subscribing to data using the interfaces that the Operating System selects.

您無法指定DDS將用于發送數據的NIC。 您可以通過在DataReader上的QoS中配置Participant屬性來限制DDS可用于接收數據的NIC,但您無法告訴DDS使用一個NIC或另一個NIC來發送DataWriter數據。 相反,DataWriter將嘗試將數據發送到DataReader在使用操作系統選擇的接口訂閱數據時宣布的所有地址。

In other words, it is up to the routing table on the Operating System (OS) to decide which NICs are used to send the UDP/IP packets.

換句話說,由操作系統(OS)上的路由表決定使用哪些NIC來發送UDP / IP數據包。

For example:

  • DataReader1 is on a node with single NIC, IP address 10.30.1.100
  • DataReader2 is on a node with single NIC, IP address 10.10.100.120
  • DataReader3 is on a node with two NICs, IP addresses 10.30.1.101 and 10.10.100.121
  • The DataWriter1 is on a node with two NICs, IP addresses 10.30.1.191 and 10.10.100.188
  • The netmask for all networks is 255.255.255.0.
  • The DataWriter and DataReaders are for the same topic and have compatible QoS. Assume that the DataReaders are NOT subscribing to data using multicast.

例如:

  • DataReader1位于具有單個NIC的節點上,IP地址為10.30.1.100
  • DataReader2位于具有單個NIC的節點上,IP地址為10.10.100.120
  • DataReader3位于具有兩個NIC的節點上,IP地址為10.30.1.101和10.10.100.121
  • DataWriter1位于具有兩個NIC的節點上,IP地址為10.30.1.191和10.10.100.188
  • 所有網絡的網絡掩碼是255.255.255.0。
  • DataWriter和DataReader用于相同主題并具有兼容的QoS。 假設DataReader不使用多播訂閱數據。

In this scenario when DataWriter1 sends data to DataReader1, it will send a packet using the address 10.30.1.100. When sending data to DataReader2, it will send a packet using the address 10.10.100.120. When sending data to DataReader3, it will send 2 packets using the addresses 10.30.1.101 and 10.10.100.121.

在這種情況下,當DataWriter1向DataReader1發送數據時,它將使用地址10.30.1.100發送數據包。 向DataReader2發送數據時,它將使用地址10.10.100.120發送數據包。 向DataReader3發送數據時,它將使用地址10.30.1.101和10.10.100.121發送2個數據包。

The NIC used by the OS to send the data from DataWriter1 to a particular destination depends on the network routing table for the machine where DataWriter1 is running. Absent strange OS configurations, packets destined to the 10.30.1.x network should be sent through the NIC with address 10.30.1.191, and packets destined to the 10.10.100.x network should be sent through the NIC with address 10.10.100.188.

操作系統用于將數據從DataWriter1發送到特定目標的NIC取決于運行DataWriter1的計算機的網絡路由表。 如果沒有奇怪的操作系統配置,發往10.30.1.x網絡的數據包應通過地址為10.30.1.191的NIC發送,發往10.10.100.x網絡的數據包應通過地址為10.10.100.188的NIC發送。

For example, the routing table (use netstat -r to see the routing table, example below is output on Windows) may be:

例如,路由表(使用netstat -r查看路由表,以下示例在Windows上輸出)可能是:
這里寫圖片描述
Which supports the scenario as described above.
這支持如上所述的場景。

Restricting interfaces on the DomainParticipant

With the Property DomainParticipantQos, you can modify the default
NICs that the DomainParticipant is allowed to use (or denied), for
example:

限制DomainParticipant上的接口
使用Property DomainParticipantQos,您可以修改允許DomainParticipant使用(或拒絕)的默認NIC,例如:

<participant_qos><property><value><element><name>dds.transport.UDPv4.builtin.parent.allow_interfaces</name><value>192.168.0.1,192.168.1.2</value></element><element><name>dds.transport.UDPv4.builtin.parent.deny_interfaces</name><value>192.168.2.3 </value></element>                   </value></property>
</participant_qos>

How restricting interfaces on the DomainParticipant affect the DataReader Absent further configuration, a DataReader will only advertise the interfaces that its DomainParticipant has been allowed to use as addresses where it can receive data. So for example, if DataReader3’s participant is restricted to use only the NIC with IP address 10.10.100.121, then this will be the only NIC advertised by DataReader3 and therefore a DataWriter will only send data to the DataReader3 at address 10.10.100.121. However, the DataWriter may still use its 10.10.100.188 NIC when sending data to DataReader2, which is on the same subnet as DataReader3.

DomainParticipant上的限制接口如何影響DataReader如果沒有進一步的配置,DataReader只會通告其DomainParticipant被允許用作可以接收數據的地址的接口。 因此,例如,如果DataReader3的參與者被限制為僅使用IP地址為10.10.100.121的NIC,那么這將是DataReader3通告的唯一NIC,因此DataWriter將僅將數據發送到地址10.10.100.121的DataReader3。 但是,在將數據發送到與DataReader3位于同一子網的DataReader2時,DataWriter仍可能使用其10.10.100.188 NIC。

How restricting interfaces on the DomainParticipant affect the DataWriter Restricting interfaces has no effect on DataWriters as far as unicast data is concerned. As mentioned earlier for unicast data, an application cannot control which NIC card is used by a DataWriter to send data. Generally speaking and independently of DDS, there is no way to control which interface IP data is sent at the application level. This is entirely controlled by the OS routing table.

就單播數據而言,限制DomainParticipant上的接口如何影響DataWriter限制接口對DataWriters沒有影響。 如前面提到的單播數據,應用程序無法控制DataWriter使用哪個NIC卡發送數據。 一般而言,與DDS無關,無法控制在應用程序級別發送哪個接口IP數據。 這完全由OS路由表控制。

For multicast data, the DomainParticipant will only send out multicast packets using the interfaces that it’s been allowed to use.

對于組播數據,DomainParticipant將僅使用允許使用的接口發送組播數據包。

NOTE: by default, a DomainParticipant is only able to announce the first 4 interfaces that it finds as the default set of addresses to which other DomainParticipants should send it data.

注意:默認情況下,DomainParticipant只能宣告它找到的前4個接口作為其他DomainParticipants應向其發送數據的默認地址集。

Hope this helps clarify how DDS works with multiple NICs and the controls that users have.

希望這有助于闡明DDS如何與多個NIC以及用戶擁有的控件配合使用。

原網站地址:https://community.rti.com/forum-topic/how-do-i-configure-dds-work-multiple-network-interfaces

****** 有對DDS技術了解,學習,開發和培訓需求的,請加入QQ群:707895641(DDS專業技術輔導) ******

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/448264.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/448264.shtml
英文地址,請注明出處:http://en.pswp.cn/news/448264.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

oracle賦予一個用戶查詢另一個用戶中所有表

說明&#xff1a;讓用戶selame能夠查詢用戶ame中的所有表&#xff08;不能添加和刪除&#xff09;1.創建用戶selamecreate user selame identified by Password;2.設置用戶selame系統權限grant connect,resource to selame; 3.設置用戶selame對象權限 grant select any table t…

使用可靠多播與OPENDDS進行數據分發

介紹 也許應用程序設計人員在創建分布式系統時面臨的最關鍵決策之一是如何在感興趣的各方之間交換數據。通常&#xff0c;這涉及選擇一個或多個通信協議并確定向每個端點分派數據的最有效手段。實現較低級別的通信軟件可能是耗時的&#xff0c;昂貴的并且容易出錯。很多時候&a…

考試 駕校

您的孩子在車里安全么&#xff1f;兒童座椅那點事兒 兒童安全座椅用最最普通的話來解釋就是一種系于汽車座位上,供小童乘坐,有束縛設備,并能在發生車禍時,束縛著小童以保障小童安全的座椅。 兒童安全座椅在歐美發達國家已經得到了普遍使用&#xff0c;這些國家基本上都制定了相…

margin為負值的幾種情況

1、margin-top為負值像素 margin-top為負值像素&#xff0c;偏移值相對于自身&#xff0c;其后元素受影響&#xff0c;見如下代碼&#xff1a; 1 <!DOCTYPE html>2 <html lang"zh">3 <head>4 <meta charset"UTF-8" />5 &l…

事件EVENT,WaitForSingleObject(),WaitForMultipleObjecct()和SignalObjectAndWait() 的使用(上)

用戶模式的線程同步機制效率高&#xff0c;如果需要考慮線程同步問題&#xff0c;應該首先考慮用戶模式的線程同步方法。但是&#xff0c;用戶模式的線程同步有限制&#xff0c;對于多個進程之間的線程同步&#xff0c;用戶模式的線程同步方法無能為力。這時&#xff0c;只能考…

axios 中文文檔、使用說明

以下內容全文轉自 Axios 文檔&#xff1a;https://www.kancloud.cn/yunye/axios/234845 ##Axios Axios 是一個基于 promise 的 HTTP 庫&#xff0c;可以用在瀏覽器和 node.js 中。 Features 從瀏覽器中創建 XMLHttpRequests從 node.js 創建 http 請求支持 Promise API攔截請…

汽車熄火是什么原因?

汽車熄火是什么原因&#xff1f; 近來看見很多車主被車子熄火所困擾&#xff0c;駕校一點通幫助您從以下也許可以找出原因。 1、自動檔車型&#xff1a; 自動檔的車型不會輕易出現熄火的現象&#xff0c;而手動檔的車型由于駕駛水平不高&#xff0c;可能會經常出現熄火的現象。…

數據庫 -- 02

引擎介紹 1.什么是引擎 MySQL中的數據用各種不同的技術存儲在文件&#xff08;或者內存&#xff09;中。這些技術中的每一種技術都使用不同的存儲機制、索引技巧、鎖定水平并且最終提供廣泛的不同的功能和能力。通過選擇不同的技術&…

事件EVENT,WaitForSingleObject(),WaitForMultipleObjecct()和SignalObjectAndWait() 的使用(下)

注意&#xff1a;當WaitForMultipleObjects等待多個內核對象的時候&#xff0c;如果它的bWaitAll 參數設置為false。其返回值減去WAIT_OBJECT_0 就是參數lpHandles數組的序號。如果同時有多個內核對象被觸發&#xff0c;這個函數返回的只是其中序號最小的那個。 如果bWaitAll …

設置 shell 腳本中 echo 顯示內容帶顏色

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 shell腳本中echo顯示內容帶顏色顯示,echo顯示帶顏色&#xff0c;需要使用參數 -e 格式如下&#xff1a; echo -e "\033[字背景顏…

Visual C++ 編譯器選項 /MD、/ML、/MT、/LD

前段時間編譯一個引用自己寫的靜態庫的程序時老是出現鏈接時的多個重定義的錯誤&#xff0c;而自己的代碼明明沒有重定義這些東西&#xff0c;譬如&#xff1a; LIBCMT.lib(_file.obj) : error LNK2005: ___initstdio already defined in libc.lib(_file.obj) LIBCMT.lib(_fi…

Delphi面向對象編程的20條規則

Delphi面向對象編程的20條規則 作者簡介 Marco Cantu是一個知名的Delphi專家&#xff0c;他曾出版過《精通Delphi》系列叢書&#xff0c;《Delphi開發手冊》以及電子書《精通Pascal》(該電子書可在網上免費獲得)。他講授的課題是Delphi基礎和高級開發技巧。你可以通過他…

制動失靈怎么辦?

定義 制動過程中&#xff0c;由于制動器某些零部件的損壞或發生故障&#xff0c;使運動部件(或運動機械)不能保持停止狀態或不能按要求停止運動的現象。 制動失靈的原因 制動失靈的關鍵在于制動系統無法對汽車施加足夠的制動力&#xff0c;包括制動液管路液位不足或進入空氣、制…

OpenDDS用idl生成自定義數據類型時遇到的一個問題

問題&#xff1a;這里會提示LNK2005重復定義的錯誤 解決方案&#xff1a; 解決后&#xff1a;

解決:Connect to xx.xx.xxx.xx :8081 [/xx.xx.xx.xx] failed: Connection refu sed: connect -> [H

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 1. 自行啟動了個 Nenux 服務。想把本地工程推送到 個人私服&#xff0c;執行命令&#xff1a;mvn deploy 報錯&#xff1a; Failed to…

ADOQuery 查詢 刪除 修改 插入

//利用combobox組件查詢數據庫表procedure TForm1.Button1Click(Sender: TObject);beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add(select * from trim(ComboBox2.Text));ADOQuery1.Active:true;end&#xff1b; //查詢記錄procedure TForm1.Button1Click(Sender…

防爆胎,有妙招

對于大多數人來說&#xff0c;買車難,養車更難。許多人擁有了新車&#xff0c;卻沒有足夠的知識去好好保養汽車&#xff0c;這實在是非常可惜。如何做好汽車的保養工作,讓我們的愛車更好的為我們工作&#xff1f;夏天熾熱的天氣&#xff0c;是否讓你為爆胎煩惱不已&#xff1f;…

Qt之QProcess(一)運行cmd命令

Qt提供了QProcess類&#xff0c;QProcess可用于完畢啟動外部程序&#xff0c;并與之交互通信。 一、啟動外部程序的兩種方式&#xff1a; &#xff08;1&#xff09;一體式&#xff1a;void QProcess::start(const QString & program, const QStringList & arguments…

Docker 方式安裝 Nexus 私服

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 1. 從Docker 官方倉庫查找鏡像&#xff1a; docker search nexus 2. 拉取鏡像&#xff1a; docker pull 你選中的鏡像的名字  pull…

shader飛線改進版

項目github地址&#xff1a;https://github.com/ecojust/flyline 前面寫過一個飛線(基于THREE.Line進行的顏色變化)&#xff0c;只是簡單地將可視區片元顏色的alpha通道值設為1.0&#xff0c;不在可視區的設為0.0。效果是這樣的&#xff1a; 做得很粗糙&#xff0c;而且因為線是…