Meter packet protocol

  • 1
  • Question
  • Updated 3 years ago
  • Answered
For no other reason than that it's an interesting project, I am writing my own SSDR API library in Delphi XE7. The discovery protocol and IP stuff turns out to be fairly straightforward and I am slowly conquering streaming UDP. As this topic seems not to have received much comment in recent times, this is in part a brain dump of what I've found so far and in part a request for updated information.

Initially I "Wiresharked" the UDP datagrams and this enabled me to determine that discovery packets (only) are on port 4992 and streaming data is on port 4991. The former is documented reasonably well but it was difficult to find information regarding the streaming port.

Wiresharking the streaming meter packets, I discovered that the Wiki page is out of date, in that after the Class identifier the packets now contain 4 byte time stamp and 8 byte fractional time stamp fields, although all these bytes are set to zero. Thus, payload data starts at byte 28, not 16 as shown. The discovery protocol description correctly shows this.

Next I got all confused about the packet size field at bytes 2..3. It turns out that this is the size in 4-byte words. Didn't expect that!

So I think I am more or less set to start decoding meter packets. The FFT packets will, no doubt be another ball game altogether.

And so, to my question:

The Wiki suggests that meter context packets are sent via UDP but I have not managed to capture one out in the wild yet. I do get meter context data via TCP and it seems that these are sent whenever the context changes. So... are meter context packets actually sent over UDP? If so, why would I use those data instead of the IP data?

73, John, G3WGV
Photo of John G3WGV

John G3WGV

  • 199 Posts
  • 37 Reply Likes
  • My brain hurts but it's fascinating stuff

Posted 3 years ago

  • 1
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 915 Posts
  • 343 Reply Likes
Official Response

You have made good progress.  Thanks for sharing your experience.  A couple of things:

1. The streaming UDP port can actually move around.  This is because you can have multiple clients on the same machine talking to the same radio.  Thus, we needed a way to differentiate which stream goes to which client.  As such, there is a radio command for directing the UDP streaming to the port the client has opened for listening.  This command is:

client udpport

If not specified, the radio will default to using 4991.  In FlexLib, we try sequential numbers going up from 4991.  If the port is in use, we try the next one until we find an open one to use.

2. Use the packet definitions in the Vita C# project in FlexLib to help understand the details of the vita packets we use.  This should help with the details in addition to the wiki.

3. We don't actually use any context packets in SmartSDR yet.  We may use them at some point, but for now, we use status messages over the TCP command port for this kind of data and leave the streaming data for UDP.

I hope this helps.  Please feel free to ask additional questions.