Sniffing IPv6 traffic to the Greenwave Reality Bulb Network
How to see what’s going on behind the scenes.
Network Stack and Topology
In order to sniff the network, we need to understand the stack and topology for a simple JenNet-IP (JIP) network, as provided by NXP’s documentation. Then we can see how it maps to the solution Greenwave has provided.
I’ve also written a step-by-step TL;DR at the bottom if you want to just jump right in.
NXP Reference Design
This reference design is what NXP provides as a sample design. On the left is an application stack residing on a large network (Local Area Network or Internet). The center is the gateway, which sits at the edge of the LAN and the Wireless Personal Area Network. On the right, the WPAN is the network of nodes (bulbs).
The border-route translates IPv4 commands into IPv6, and sends that traffic across the WPAN network. According to the documentation, the WPAN interface could be implemented in separate hardware from the border router, attached by a serial connection (e.g. USB).
Greenwave Implementation
The product being sold is close, but not exactly the same as the reference design. Here’s what the high level connections look like at home.
From left to right, we have the LAN/WAN device (controlling the network from the internet). The gateway is in communication with Greenwave servers on the internet (that, as an aside, happen to run on Amazon AWS) so that the network can be controlled from anywhere in the world. Per the TCP privacy policy, apparently they collect information about usage, room names, and more.
In the center/right, we have the Gateway. The WiFi router is the connection to devices on internet/local area network, and it is plugged directly into the gateway via ethernet. One distinction, however, is that the phone and laptop in this setup do not run a native JIP stack with the Greenwave application. They are actually communicating with an HTTP server that runs on the gateway, which if you reference the picture up above, is the application layer on the left of the blue box.
Finally, on the right, we have the 802.15.4 interface and the bulbs, which make up our WPAN network.
Notice that we don’t use a serial connection for the WAN/LAN — WPAN connection. In fact, everything is implemented in one box, so most of the right within the blue box is irrelevant. Also, since I don’t have iOS or Android, I can’t presently use the Greenwave servers to communicate, so my communications are wholly using the LAN.
The left side of the network is a management application, from the internet or from a remote place on the network. The center is the gateway. The right is the lightbulb.
The internet side of things is mostly irrelevant for us — I think this is more applicable with multiple gateways that can be controlled remotely, and natively (you see it is running the application layer directly on it).
Likewise, the right side of the blue diagram is mostly irrelevant too — the gateway implements everything from application to 802.15.4 radio, and there is no serial connection between devices (say a router to a dongle). Further inspecting the running daemons on the Greenwave server, it’s easy to see that the 6loWPANd service communicates directly to the 802.15.4 interface. Here’s a simplified architecture that is much closer to what we have. It’s probably not 100% accurate, but it’s close enough.
Sniffing Traffic
What you sniff depends on what you want to learn about. In earlier posts, I have written about HTTP POST and HTTP GET commands which the iOS and Android applications utilize to control the bulb network. There are more than I have written about, but without any devices running either of those operating systems, I’m unable to generate or observe those commands. Regardless, the best place to sniff that traffic is somewhere along the WLAN Device -> Border-Router connection, and that should be fairly trivial for anyone who knows how to use Wireshark.
What is a little more interesting to me is the traffic being sent directly to the bulbs. Why sniff these packets though? The protocols observed could be used to generate a new application layer without using official APIs. Or they could be used to spoof traffic on the network, either at the gateway or wirelessly using an 802.15.4 radio. The network could also be expanded with new devices beyond light bulbs.
What and Where to Sniff
We could monitor the traffic coming in over the ethernet cable to the gateway. But, the eth0 interface will only give network traffic destined for, or originating from the HTTP server, and will not contain any of the IPv6 traffic of the WPAN network.
Get Brian’s stories in your inbox
Join Medium for free to get updates from this writer.
We could monitor the data being sent to the RX/TX pins of the 802.15.4 radio. Or we could even try to set up another 802.15.4 radio to receive this traffic. But that traffic is likely to be encrypted, and frankly, there’s an easier way.
As we know, the WPAN runs on IPv6. All of the commands we send the gateway are IPv4. Somewhere inside of the gateway, commands are being translated from IPv4 to IPv6 — and this is the exact point we intend to observe.
ifconfig shows us three interfaces. eth0, lo, and tun0.
- eth0 is our ethernet interface from the router.
- lo is the loopback interface.
- tun0 is a virtual network interface in the kernel which connects with user space applications. This is what we want.
Interface parameters report that it is not in promiscuous mode by default. We’ll need to turn on promiscuous mode if we intend to sniff the traffic with the command ifconfig tun0 promisc. It can likewise be turned off with ifconfig tun0 -promisc. A second inspection of the interface parameters should reveal PROMISC when it is turned on.
How to Sniff
With knowledge of the gateway’s hardware, it should be fairly obvious that we don’t want to capture a network trace on the device itself. There’s little memory (64 MB) and even less flash (32 MB). If the network is a particularly active one, we could run out of space quickly.
Instead of doing a local capture, ssh, tcpdump, and wireshark can be combined for a remote capture from your laptop. In the following command [gateway] can be the IP address, “lighting” on Windows or Linux, or “lighting.local” on a Mac.
ssh root@[gateway] “tcpdump -ni tun0 -s0 -w — “ | wireshark -k -i -
Provide the root password thinkgreen, and you’re in business! Start sending some commands to the network and watch them appear in Wireshark.
Here’s the payload of several “turn on” and “turn off” commands. Notice the byte at the end changing. The earlier byte changing is just a packet ID that increments with each command sent.
So far I have observed that commands that have 0x0F04 in the 8th and 9th bytes are “on” and “off” (the 10th byte being 0x00 or 0x01), and commands that have 0xBF04 in the 8th and 9th bytes are used to set brightness (the 10th byte, from 0x02 — 0xFF, incrementing by 3 and 2 alternatively — e.g. 0x2, 0x05, 0x07, 0x0A, 0x0C, … 0xFF). I haven’t done extensive analysis yet, so your mileage may vary. I indend to dig deeper to get a better understanding.
What’s Next
Analysis! I need to go back and read about packet addressing, observe various commands, and other random traffic as it occurs to better understand what is being said. I might even write my own protocol decoder for wireshark to make analysis a little easier. Eventually, I would also like to install netcat and try to spoof some commands directly.
Hope you found this useful for hacking your own TCP Connected / Greenwave setup. Until next post, happy hacking!
TL;DR
If you don’t like the jibber jabber and want to get straight to it:
- Install wireshark on your local computer
- SSH into the gateway using username root and password thinkgreen and turn on promiscuous mode on the tun0 interface:
ifconfig tun0 promisc - Pipe tcpdump on the gateway to wireshark on your local machine:
ssh root@[gateway] “tcpdump -ni tun0 -s0 -w — “ | wireshark -k -i -
4. Send commands to the network using the browser, an iPhone, an Android device, or something else you’ve created yourself.


![Greenwave/TCP Connected Lightbulb Update [Updated]](https://miro.medium.com/v2/resize:fit:1358/format:webp/1*oXQmIOTC-b1AZcbBG0MVyQ.jpeg)




