Page 1 of 1

How do we get the packets that are not sent to local device from the application layer through the promiscuous mode?

Posted: Thu Apr 19, 2018 1:39 am
by jason2
I have read:
The promiscuous model, also known as sniffer, is also called the sniffer model. It is to receive all packets that pass through the NIC, including the packets that are not sent to the local device. By default, the network card only transfers the packets sent to the local device(including broadcast packets) to the upper program, and the other packets are discarded. To put it simply, promiscuous mode means that NIC can accept all data flows through it, no matter what format and address. In fact, when the device receives a packet, it is judged by the network layer, determining whether to submit the upper (transport layer) or discarding or forwarding the lower layer (the data link layer, the MAC sublayer). ESP32 can provide a promiscuous mode to sniff the air message and process it.
Can application layer get packets that are not sent to the local deviece? If application layer can,how to achive?

Re: How do we get the packets that are not sent to local device from the application layer through the promiscuous mode?

Posted: Thu Apr 19, 2018 6:47 am
by jason2
Please reply if you have seen it ! Thank you!

Re: How do we get the packets that are not sent to local device from the application layer through the promiscuous mode?

Posted: Thu Apr 19, 2018 6:51 am
by ESP_Angus
jason2 wrote: Can application layer get packets that are not sent to the local deviece? If application layer can,how to achive?
Only via the promiscuous mode. To push these to the application layer (ie via the TCP/IP stack) would break the TCP/IP model.

If you need to send data to multiple devices on the network simultaneously, you may want to consider using UDP broadcast or multicast packets. These will be sent to the local device, so can be received via normal means.

Please note also that promiscuous mode can only see packets which are received by the WiFi interface of the ESP32 (NIC, in the documentation). For WPA/WPA2 protected networks, this is only unicast traffic which is sent to the device or broadcast traffic. This is because in WPA/WAP2 mode each client of the AP has a unique session key for security.