LAN protocol using LifxNet

I am trying to understand how the protocol works. I am a professional developer. But I am not very familiar with UDP packets.

I tried downloading the LifxNet nuget package. And now I cloned the project and I am running the sample project.

My problem is that packets are going out but I am not getting a response back from my light-bulb. I have a UDP monitor on my phone that allows me to see the packets sent from my computer.

Here is where it’s intriguing for me. The packet sniffer needs a port number to listen, and then it sees packets with a different port number, which are clearly coming from my own phone lifx app, and my computer. But some sources come with a different port number.

If I then set the UDP monitor to that different port. Then I can see the messages coming from my lightbulb.

Is that “other” port something normal on UDP? I don’t see anything about that in the LAN protocol documentation. I feel that if I understand what is going on at the protocol level. I’ll be able to fix the problem.

@dotmorten I’m not getting any reply. Could you post a two line reply?

Anybody, please. Just need a little bit off direction if possible.

Could you provide more details about what you’re seeing, including the specific port numbers? As many specific details and numbers as possible, the better.

When you send packets to the bulb, if you set the source header to a non-zero value (which you should) the bulb will return the packets to the address which sent it. So when you bind a UDP socket you might let the operating system choose a port of say 23419 to bind to. This means that packets destined to your phones ip with a destination port of 23419 will arrive at that socket.

Now you send some messages to the bulb through that socket. They get sent with a destination port of 56700 as defined in the protocol documentation and a source port of 23419. These packets reach the bulb, and it replies by sending the reply to port 23419 and your phones ip address.

This is why you are seeing another port number. I’m not sure if this helps. If it doesn’t I’ll need more information to help you.