How to get the name of a submodule

36 views
Skip to first unread message

Moussa ABOUBAKAR

unread,
Jul 20, 2020, 9:10:06 AM7/20/20
to OMNeT++ Users
Hello fellow OMNeT++ users,

I am simulating an UDPBasicAPP on OMNETP 5.4.1. I would like to log the name of the submodule (node) that send a packet to the sink node.

Could you please explain me how to proceed.

Thank you

Best regards


Alfonso Ariza Quintana

unread,
Jul 20, 2020, 11:08:13 AM7/20/20
to omn...@googlegroups.com
If you know the ip address of the sender you can use L3AddressResolver

L3AddressResolver().findHostWithAddress(src)->getFullName()

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Moussa ABOUBAKAR <abaka...@gmail.com>
Enviado: lunes, 20 de julio de 2020 15:10
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] How to get the name of a submodule
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/8b7a2d35-6b95-4a69-9e72-6f35b6e4df6fo%40googlegroups.com.

Moussa ABOUBAKAR

unread,
Jul 20, 2020, 11:13:31 AM7/20/20
to OMNeT++ Users
Thank you for your response.

However, I have only the adress of the last hop.

I would like to obtain the address (name) of the initial sender of the packet.

Could you tell me how can I proceed ?

Best regards



Le lundi 20 juillet 2020 17:08:13 UTC+2, Alfonso Ariza Quintana a écrit :
If you know the ip address of the sender you can use L3AddressResolver

L3AddressResolver().findHostWithAddress(src)->getFullName()

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Moussa ABOUBAKAR <abaka...@gmail.com>
Enviado: lunes, 20 de julio de 2020 15:10
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] How to get the name of a submodule
 
Hello fellow OMNeT++ users,

I am simulating an UDPBasicAPP on OMNETP 5.4.1. I would like to log the name of the submodule (node) that send a packet to the sink node.

Could you please explain me how to proceed.

Thank you

Best regards


--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

Alfonso Ariza Quintana

unread,
Jul 20, 2020, 11:16:03 AM7/20/20
to omn...@googlegroups.com
The address of the sender is in the controlInfo associated, you can extract it

Enviado: lunes, 20 de julio de 2020 17:13
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] How to get the name of a submodule
 
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/c7c80993-7d30-4bbc-9265-c293e48d8498o%40googlegroups.com.

Moussa ABOUBAKAR

unread,
Jul 20, 2020, 11:59:22 AM7/20/20
to OMNeT++ Users
Could you please suggest me a syntax to perform that ?

Alfonso Ariza Quintana

unread,
Jul 20, 2020, 1:06:28 PM7/20/20
to omn...@googlegroups.com

Check the code, UDPSocket::getReceivedPacketInfo(PK(msg)) print the src address, in this method you can see how to extract the address

 

Enviado desde Correo para Windows 10

 


Enviado: Monday, July 20, 2020 5:59:22 PM
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/ce631ffc-1d67-44e2-a780-7e76be4362dco%40googlegroups.com.

Moussa ABOUBAKAR

unread,
Jul 21, 2020, 6:14:22 AM7/21/20
to OMNeT++ Users
Thank you for your suggestion,it helps me to solve my problem.
Reply all
Reply to author
Forward
0 new messages