MAC layer relay

neel_basu
Posts: 6
Joined: Sat Jan 18, 2020 7:41 pm

MAC layer relay

Postby neel_basu » Wed Sep 09, 2020 10:23 am

My objective is to relay certain type of packets from MAC layer. I don't even need the entire IP stack. Just the ability to read the packet in MAC layer and then forward is sufficient for me.

It looks like combination of promiscuous mode sniffer and `esp_wifi_80211_tx` will do this job. But isn't it going to be costlier than doing the same as a Custom Driver ?

In ESP MESH both station and AP interfaces are used. That means the driver glues both of these interfaces. Although ultimately I want a multi hop ad hoc network ESP MESH is not suitable for my requirements. Because I want a frequently changing graph of mobile nodes, whereas ESP MESH is a dynamic (?) tree.

I have multiple options to make a custom driver.

1. Use both AP and Station interfaces and glue them in the custom driver that relays certain type of packets from Station interface to the AP interface by checking first few bits of the payload.
2. Use only the AP interface and the custom driver relays some received frames directly may be using `esp_wifi_80211_tx` instead of propagating them upwards.
3. Sniff and `esp_wifi_80211_tx`

My assumption is 3 is costlier than 1 and 2 and 3 will lead to more power consumption and low throughput. Is that true ?

How feasible is both 1 or 2 ? which one will perform better ?

So far I've found in the docs that to develop a custom driver I need to use `esp_netif_attach` that takes a `esp_netif_driver_base_t` which has a `post_attach` callback. The `post_attach` callback is supposed to `esp_netif_set_driver_config` with `esp_netif_driver_ifconfig_t` which has a `transmit` callback.

But I cannot understand how I can accomplish 1 or 2 with this.

Who is online

Users browsing this forum: Corand and 66 guests