promiscuos mode

31 views
Skip to first unread message

Fabio Tag

unread,
May 17, 2024, 5:16:33 PMMay 17
to ns-3-users

Good morning,

I have developed my own routing protocol by extending Ipv4RoutingProtocol class...

Now, I want all the nodes in the network to be able to listen to what their neighbors are sending.

 Is there a method to activate this mode and detect only the packets sent by neighbors on a specific port, or do I need to filter all the packets I receive?

Is it possible to achieve this outside my routing protocol class, perhaps by extending another class or using a different approach?

Thank you.

Tommaso Pecorella

unread,
May 18, 2024, 4:50:33 AMMay 18
to ns-3-users
It depends on what you mean by "what their neighbors are sending". You want all the packets (regardless of protocol, ports, destination) or you want to listen to specific packets (e.g., the packets that the routing protocol is broadcasting)?

In the first case you'll have to use IPraw sockets, but filtering is up to you. Plus, at the time of writing, IPraw doesn't reassemble fragmented packets (this might change in the future).

In the second case, you can take a look at the RIP implementation - it does it.

Fabio Tag

unread,
May 19, 2024, 9:43:40 AMMay 19
to ns-3-users
Thank you for your reply.

I want to listen to specific packets.

My routing protocol uses a specific port, and every node in the wireless network has its own IP address.

There are two different kinds of messages in my network:

1. "Data packets" (standard data, such as files, text, images, etc.)
2. "Control packets" (routing packets used by the routing protocol to build routing tables and so on).

I’m trying to find a way to put my nodes in promiscuous mode so that they can listen when either a data packet or a control packet is sent, but perform different actions based on the type of packet received.

For example, if A sends a data packet to C, and A has Z and U as neighbors, I want Z and U to receive the packet without broadcasting it.

Thank you,
I appreciate your help.

Tommaso Pecorella

unread,
May 19, 2024, 3:54:17 PMMay 19
to ns-3-users
For control packets open a socket - like every routing protocol does.

For overhearing data packets, check NetDevice::SetPromiscReceiveCallback (but you'll have to deserialize the L3 protocol manually).

Note that if you (by chance) are trying to calculate the number of packets forwarded by a node... you'll fail. The reason is obvious and I'm tired to explain why again.


Fabio Tag

unread,
May 19, 2024, 4:35:47 PMMay 19
to ns-3-users
Thank you, 

I'm not attempting to count the quantity of packets forwarded by a node through this approach. 
Instead, I'm testing a solution for what concern the security aspect of ad-hoc networks, such as those in the network that drop packets instead of forwarding them.
Consequently, neighboring nodes must recognize such actions and take appropriate measures accordingly and so on...

For that reason I need to put nodes in promiscuous mode to build this kind of "watchdog" system. 

Thank you for your help 
Reply all
Reply to author
Forward
0 new messages