質問

I am using RTI DDS Spy to debug a DDS application. I have noticed odd messages in the Spy tool that I believe are not coming from my application.

The question is how do I take a Src HostId and figure out the IP address of the sender? (Wireshark is not an option.)

役に立ちましたか?

解決

The fields in the Src HostId are normally a hexadecimal version of the source IP address. For example take the following output of Spy:

source_timestamp   Info  Src HostId  topic               type              
-----------------  ----  ----------  ------------------  ------------------  
1369074721.938245  R +N  C0A80103    CellTopic           life::CellType    
1369074721.937270  W +N  C0A80103    CellTopic           life::CellType    
1369074721.938615  D +N  C0A80103    CellTopic           life::CellType    
1369074721.938726  D +N  C0A80103    CellTopic           life::CellType    

Looking at the four bytes in the third column C0 A8 01 03, translating them from hexadecimal into decimal one by one results in 192.168.1.3 (because C0 is 192 in decimal, A8 is 168, and obviously 01 is 1 and 03 is 3).

By the way, for more details on the Src HostId, also check out the help using rtiddsspy -hOutput:

Src HostId         :   Contains the sourceId part of the Global Unique 
                       IDentifier (GUID) of the writer that sent the sample.
                       This value is formatted as an IP address because this
                       is the default setting for NDDS. Consequently this
                       column will match the IP address of the sender
                       of the message provided that: (1) the application is
                       running on an IP network, (2) it has not disabled the
                       UDPv4 transport and (3) it has not explicitly 
                       overridden the 'appId'
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top