Socket Output Format

This forum is for users who are developing applications (or resources) to work alongside BaseStation (i.e. add-ons) and who wish to discuss development techniques.

Moderators: KineticChris, KineticDavid, Moderators

edgy31

Postby edgy31 » August 1st, 2009, 5:22 pm

All times in the socket data are local time, and the delimeters should always be a ',' and the dates should have a '/' and ':'. You must prevent your OS locale settings from messing the output up.

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 1st, 2011, 1:37 am

I wasn't sure if I should start a new thread or not :)

Has anyone else noticed that you can get duplicate messages on port 30003?

For you Unix folks, that means if you have a file of data and you say:

Code: Select all

% sort data | uniq -c | awk '{if ($1>1) print}'


... you get output.

edgy31

Re: Socket Output Format

Postby edgy31 » February 1st, 2011, 5:04 am

It is one of the reasons why many different "feeder" type programs have been written. The socket is very raw. In my case I throw out the MSG,8 messages, as they don't contain any new data, and would just consume CPU time processing them. Like you, I have noticed many duplicates as aircraft tend to spray out a lot of identical poop in the same second.

I create tracks out of the socket data using the ICAO ID, and only update the tracks if a stored value changes to a different value. Otherwise, I just update the time heard. This really drops the bandwidth required for exchange via the internet or radio.

DaveReid
Posts: 5911
Joined: July 2nd, 2005, 8:25 am
Location: Reading, Berks
Contact:

Re: Socket Output Format

Postby DaveReid » February 1st, 2011, 8:11 am

edgy31 wrote:Like you, I have noticed many duplicates as aircraft tend to spray out a lot of identical poop in the same second.

I agree. Here in the UK, with lots of EHS interrogators, it's not unusual to get as many as 25 transmissions per second, mostly DF20s, though that won't necessarily result in the same number of socket messages.

Here's a typical example:

1 x DF4
1 x DF11
2 x DF17 AP
3 x DF17 AV
2 x DF20 BDS??
2 x DF20 BDS40
5 x DF20 BDS50
6 x DF20 BDS60
3 x DF21 BDS40

That doesn't include DF0s/DF16s since the SBS doesn't (yet) decode those.

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 1st, 2011, 2:53 pm

DaveReid wrote:it's not unusual to get as many as 25 transmissions per second

Yeahbut: since the timestamps in the socket output are relative to the box, shouldn't at least the timestamp be different? I mean, they go to the trouble to output milliseconds ...

While I have you here, have we covered the difference between "generated" and "logged" for the timestamps ...?

DaveReid
Posts: 5911
Joined: July 2nd, 2005, 8:25 am
Location: Reading, Berks
Contact:

Re: Socket Output Format

Postby DaveReid » February 1st, 2011, 3:00 pm

jmhayes wrote:Yeahbut: since the timestamps in the socket output are relative to the box, shouldn't at least the timestamp be different? I mean, they go to the trouble to output milliseconds ...

While I have you here, have we covered the difference between "generated" and "logged" for the timestamps ...?

In my experience, the timestamps in the socket messages are pretty meaningless.

If you're running another task that's grabbing CPU cycles, BaseStation often buffers a load of socket messages and outputs them with the same timestamp regardless of when the packets were received.

My stats are based on capturing raw data direct from the SBS, without BaseStation running.

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 1st, 2011, 3:08 pm

DaveReid wrote:If you're running another task that's grabbing CPU cycles, BaseStation often buffers a load of socket messages and outputs them with the same timestamp regardless of when the packets were received.

It sounds like you're saying that the timestamp is generated on the way out; so then why are there two timestamps, and why are they (mostly) different from each other?

Here's a message I got 27 times yesterday:

Code: Select all

MSG,5,4,1161,A381B1,19180,2011/01/31,23:58:17.423,2011/01/31,23:58:17.425,,11700,,,,,,,0,,0,0

DaveReid
Posts: 5911
Joined: July 2nd, 2005, 8:25 am
Location: Reading, Berks
Contact:

Re: Socket Output Format

Postby DaveReid » February 1st, 2011, 3:40 pm

jmhayes wrote:It sounds like you're saying that the timestamp is generated on the way out; so then why are there two timestamps, and why are they (mostly) different from each other?

Well the reason for there being two timestamps is historical, dating from the time that ADS-B socket messages were delayed 5 minutes and so had the received time and output time:

SEL,,5,143,4CA223,19150,2006/03/12,15:40:39,2006/03/12,15:40:39,RYR1647
MSG,4,5,143,4CA223,19150,2006/03/12,15:36:01,2006/03/12,15:41:02,,,342.546347229101,326.913023668401,,,-1216,,,,,
MSG,3,5,143,4CA223,19150,2006/03/12,15:36:01,2006/03/12,15:41:02,,17800,,,0,0,,,0,0,0,0
MSG,4,5,938,3414CA,19151,2006/03/12,15:36:01,2006/03/12,15:41:02,,,0,0,,,-832,,,,,
MSG,4,5,581,3410CC,19152,2006/03/12,15:36:01,2006/03/12,15:41:02,,,0,0,,,-320,,,,,
MSG,1,5,143,4CA223,19150,2006/03/12,15:36:02,2006/03/12,15:41:03,RYR1647,,,,,,,,,,,
MSG,5,5,938,3414CA,19151,2006/03/12,15:36:03,2006/03/12,15:41:03,,450,,,,,,,0,,0,0

Now that there is no delay, I agree that there isn't any logical reason why the two times shouldn't be the same (but they aren't).

I don't think the socket output is meant for precision applications, but it's good enough for most purposes.

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 1st, 2011, 4:05 pm

DaveReid wrote:I agree that there isn't any logical reason why the two times shouldn't be the same (but they aren't).

If only there was someone here who understands the code enough to answer riddles like these. :|

edgy31

Re: Socket Output Format

Postby edgy31 » February 1st, 2011, 6:38 pm

jmhayes wrote:If only there was someone here who understands the code enough to answer riddles like these. :|


In this case, the timestamps are not that important since the 5 minute delay was deleted. As the socket data comes in you can stamp it yourself. It's not going to be far enough off for most applications. In the case, where you are wanting to do multilateration, then you wouldn't use Basestation output anyway.

Since the time is "local" time, therein lies another reason not to use it. I just input each line of data, stamp it with UTC time and push it onto the queue/database. That way if someone in another time-zone exchanges data, we don't have to do any time conversions. Pretty much the whole header is not very useful on the socket. If it would just output the ICAO code and the real associated data, it would be fine with me :-)
Last edited by edgy31 on February 1st, 2011, 6:43 pm, edited 1 time in total.

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 1st, 2011, 6:42 pm

edgy31 wrote:the timestamps are not that important.

I think you're missing my point.

User avatar
KineticChris
Site Admin
Posts: 2553
Joined: July 29th, 2005, 8:14 am

Re: Socket Output Format

Postby KineticChris » February 1st, 2011, 10:22 pm

Not sure what you are after JMayes

Send me an email outlining it and I will ask the guys


Regards
Chris Taylor

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 1st, 2011, 10:55 pm

KineticChris wrote:Not sure what you are after ...

How about:

- A description of the semantics of the two timestamps in the post-5-minute-delay-world

- Some discussion about why I might see 30+ copies of an identical message ...

Thanks!

User avatar
KineticChris
Site Admin
Posts: 2553
Joined: July 29th, 2005, 8:14 am

Re: Socket Output Format

Postby KineticChris » February 1st, 2011, 11:31 pm

I think the time stamps are time generated and time received and they can be very close
I will check in the morning but I think the duplicates may be similar but ever so slightly different so all shown

If you can screenshot some for me it may help

Regards
Chris Taylor

User avatar
jmhayes
Posts: 188
Joined: September 16th, 2005, 9:03 pm
Location: San Francisco CA, US

Re: Socket Output Format

Postby jmhayes » February 2nd, 2011, 12:27 am

KineticChris wrote:I think ...

I will check in the morning ...

Ok, thanks.
If you can screenshot some for me it may help


I got this message 27 times:

Code: Select all

MSG,5,4,1161,A381B1,19180,2011/01/31,23:58:17.423,2011/01/31,23:58:17.425,,11700,,,,,,,0,,0,0


Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest