Layer 1 and 2 only communication

Layer 1 and 2 only communication

This one is for those of you who (like me) are interested in electronics as well. And by electronics I mainly mean SBCs and microcontrollers (Raspberry Pi, Arduino, ESP32, etc). Lately people are talking everywhere about ESP-NOW and there is something interesting about it and a little bit of misinformation going on as well.

So, what is ESP-NOW? It's a wireless communication protocol developed by Espressif for peer-to-peer communication WITHOUT traditional Wi-Fi. And that widespread definition is already what makes ESP-NOW somehow "magical" to many people. Especially the "without Wi-Fi" bit. Seeing this people are usually like "wooow, how does it work without Wi-Fi then?!". Well, the truth is that there are many other commonly known wireless communication protocols such as Bluetooth, LoRa or Zigbee - so ESP-NOW isn't really anything magical.

Can't really blame anyone for that confusion though. I guess it just comes from the fact that all those microcontrollers TRADITIONALLY communicate with each other over Wi-Fi. But anyway, since I'm writing about it already, may as well give you some actual useful information :)


What's the big deal with ESP-NOW then and how does it work "without Wi-Fi" one may ask?

Well, the "big deal" with ESP-NOW is that it's much much faster (in terms of latency) and lighter than Wi-Fi. It basically doesn't have the "Wi-Fi" overhead. It's a protocol designed for simplicity, low overhead, and direct communication, so features like IP addressing (Network Layer) or end-to-end transport mechanisms (Transport Layer) are not inherent to ESP-NOW itself.

Some articles state that the difference between ESP-NOW and Wi-Fi is that ESP-NOW operates only on Layer 1 and 2 while Wi-Fi also operates on Layer 3 and higher. Well, it may come as a surprise to some of you but that's only partially true. Yes, ESP-NOW only operates on L1 and L2 but SO IS THE WI-FI. Technically speaking, Wi-Fi protocol primarily concerns Layers 1 and 2. Yes, most of the time it's used TOGETHER with IP (Layer 3) but the Wi-Fi protocol itself is focused on the Physical and Data Link layers. The IP protocol is just one of many protocols (but the most commonly used one, of course ) that can be transported over Wi-Fi.

So technically speaking ESP-NOW could as well be called something like "Wi-Fi Light", but don't quote me on that. The bottom line is that ESP-NOW encapsulates data directly in the MAC frames of the IEEE 802.11 standard but bypasses the traditional network association process.

And overall it really does make a lot of sense. If you only need a simple connection to send sensor data from one device to another you really don't need 90% of Wi-Fi protocol stuff. In simple terms ESP-NOW is like working at a startup and Wi-Fi is big corpo - there's much much more "bureaucracy" with Wi-Fi from network radio/processor point of view :)