ESP-NOW: What happens if all peers are given the same MAC address?

chromebin
Posts: 77
Joined: Wed Feb 07, 2018 3:53 pm

ESP-NOW: What happens if all peers are given the same MAC address?

Postby chromebin » Fri Jun 29, 2018 5:41 pm

I'd like to give all devices in my ESPNOW network the same MAC address, so all devices would receive all messages. This would constitute a private broadcast (so packets can be shorter). Crucially, LMK encryption would work (as I understand it).

So, is this viable? I don't think ESPNOW will cause problems, but Wifi may? What does Wifi do while ESPNOW is active?

I reused the title of this question: https://bbs.espressif.com/viewtopic.php?t=3227. Hope this time round there are more answers. Thanks.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby WiFive » Fri Jun 29, 2018 6:30 pm

What is length difference for unicast and broadcast packets?

chromebin
Posts: 77
Joined: Wed Feb 07, 2018 3:53 pm

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby chromebin » Fri Jun 29, 2018 9:53 pm

WiFive wrote:What is length difference for unicast and broadcast packets?
When using broadcast packets, packets are received from _all_ devices, including those not belonging to the network. So a field must be allocated stating to which network the transmission belongs, and that field must be verified to discard messages not from devices on the network.

When using unicast, a specific MAC address is chosen instead of the generic broadcast address. That address differentiates the network from any other, so only packets from the network are received by the devices on the network, (ideally) no others.

So using "unicast" (really private broadcast) means:
- a smaller packet
- fewer callbacks (potentially many)

I want to use broadcasts, because that allows devices to snoop on transmission for content of interest (taking advantage of the nature of the medium, broadcast, not unicast). That will reduce the overall number of transmissions.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby WiFive » Fri Jun 29, 2018 11:07 pm

Broadcasts are not encrypted and devices don't have to use same PMK to communicate?

chromebin
Posts: 77
Joined: Wed Feb 07, 2018 3:53 pm

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby chromebin » Sat Jun 30, 2018 12:37 pm

WiFive wrote:Broadcasts are not encrypted and devices don't have to use same PMK to communicate?
I'm afraid I don't fully understand your question/suggestion.

The terminology seems lacking. I speak of private broadcasts, which espnow sees as unicasts.

It's hard to find info on what PMK and LMK actually do, and therefore the requirements for them to work. For all I know they may not work in private broadcasts.

I want to know if there are any impediments to using the same mac. I want to snoop on traffic so content can go to multiple devices at once, which is not possible if I give them different macs, unless I use the "broadcast" mac. But that has its own downsides.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby WiFive » Sat Jun 30, 2018 3:57 pm

Ok I found
Do not support encrypting multicast vendor-specific action frame.
This could be supported with Robust Management Frame Protection?

Esp-now should add support for multicast groups

chromebin
Posts: 77
Joined: Wed Feb 07, 2018 3:53 pm

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby chromebin » Sun Jul 01, 2018 6:18 pm

WiFive wrote: This could be supported with Robust Management Frame Protection?
I'm out of my league when it comes to radio (types of packets, encryption, authentication etc).

I intend to implement a non-trivial protocol with some obfuscation to prevent casual eaves dropping. But if there are existing solutions, I'm all ears :)

biterror
Posts: 31
Joined: Thu Apr 30, 2020 11:00 am

Re: ESP-NOW: What happens if all peers are given the same MAC address?

Postby biterror » Tue Dec 12, 2023 7:44 pm

I'm also interested in using the same MAC for all nodes, but is it possible to use encryption with this system? Does the encryption system have some kind of a separate counter or state machine for each node, so it would break if there were multiple nodes with the same MAC address?

Besides, I haven't been able the change the MAC address (esp_wifi_set_mac(ESP_IF_WIFI_STA, network_mac)) yet - the call returns 0, but the MAC address doesn't change. I'm using idf v4.4.6.

I need more than 6 or 10 or 20 nodes with encryption and I can put my own addresses in the esp-now payload, but how to get encryption working with an "unlimited" number of nodes? It's not supposed to work with broadcast addresses, so maybe it doesn't work with all nodes using the same MAC, either?

I really wish the documentation was better. Lots of time is being wasted googling, testing, guessing, ripping hair...

Who is online

Users browsing this forum: Bing [Bot] and 103 guests