Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for out of order packets #208

Open
leskerr opened this issue Dec 26, 2020 · 8 comments
Open

Check for out of order packets #208

leskerr opened this issue Dec 26, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@leskerr
Copy link
Collaborator

leskerr commented Dec 26, 2020

UDP packets are not guaranteed to arrive in order. Although out of order packets seem to happen very rarely, I have evidence that this may have occurred while I was monitoring wire 105 just now. The string MPH, decoded as MPH * H * ,. Here are the packets that were received by MKOB:

{"ts": 1608933090574, "w": 113, "s": "Beaufort Scale, 30 wpm, AC", "o": 2, "c": [-306, 120, -40, 120]}
{"ts": 1608933091088, "w": 113, "s": "Beaufort Scale, 30 wpm, AC", "o": 2, "c": [-153, 40, -40, 40, -40, 40, -40, 40, -40, 40]}
{"ts": 1608933091521, "w": 113, "s": "Beaufort Scale, 30 wpm, AC", "o": 2, "c": [-153, 40, -40, 40, -40, 40, -40, 40]}
{"ts": 1608933091826, "w": 113, "s": "Beaufort Scale, 30 wpm, AC", "o": 2, "c": [-32767, 40, -40, 40, -40, 40, -40, 40]}
{"ts": 1608933092269, "w": 113, "s": "Beaufort Scale, 30 wpm, AC", "o": 2, "c": [-32767, 40, -40, 120, -40, 40, -40, 120]}

The 'H' code sequence appears twice. The -32767 elements indicate what pykob/internet.py perceived as gaps in the sequence numbers of the received packets. MKOB clients always send each packet twice, with the same sequence number, to guard against single missing packets. In this case, it appears the first packet for the comma arrived before the second packet of the 'H'.

[Thank you again, @AESilky, for the incredibly useful Record/Play feature. Having it enabled by default allowed me to analyze this unexpected event after the fact.]

It would also be useful to log single missing packets. Although single missing packets don't interfere with the operation of the program, knowing that they're happening can provide a warning that the internet connection is less than solid.

@leskerr leskerr added the enhancement New feature or request label Dec 26, 2020
@jchausler
Copy link

jchausler commented Dec 26, 2020 via email

@AESilky
Copy link
Collaborator

AESilky commented Dec 28, 2020

@leskerr, I'm glad it has proven helpful once again. I think that it is helpful to have it enabled, but I would like to make saving the file an option. That way, the folder doesn't fill up with a bunch of session recordings that you don't care about (and many people might not even know about).

@leskerr
Copy link
Collaborator Author

leskerr commented Dec 28, 2020

@leskerr, I'm glad it has proven helpful once again. I think that it is helpful to have it enabled, but I would like to make saving the file an option. That way, the folder doesn't fill up with a bunch of session recordings that you don't care about (and many people might not even know about).

Yes, I agree. Saving the JSON file should be an option. (@pwdirks, take note for the options dialog.)

@AESilky
Copy link
Collaborator

AESilky commented Dec 28, 2020

@leskerr, @pwdirks, It might not need to be an 'option' in the dialog. I think it could be in the 'File' menu for now ('Save current session recording') and in the 'Record/Play GUI' once we have that implemented. That GUI section is what we have been talking about that would have the 'typical' VCR type controls for record and playback.

I could generate the name as I do now, but actually save to a temp file. Only if they say to save would I save the file to the generated name (by default) or to a name they choose. On exit, the temp file would be deleted.

I'll create an issue for that.

@pwdirks
Copy link
Collaborator

pwdirks commented Dec 28, 2020 via email

@leskerr
Copy link
Collaborator Author

leskerr commented Dec 28, 2020

These are good ideas, Patrick. Kind of like a black box flight recorder, always running in the background but available to provide recent history if and when it's needed.

~Les

@AESilky
Copy link
Collaborator

AESilky commented Dec 29, 2020

The current 'Play' functionality provides pause, skip back n seconds, skip forward n seconds, go to the beginning of the current sender, go to the end of the current sender, while playing a recording. It would be possible to play the current recording while it is being recorded - which is basically what the DVR or Digital Radio is doing when it allows you to pause, move about, and resume 'live' broadcasts.

There are a few things that I think are higher priority - a reliable install, a Raspberry Pi mode, multiple configurations - but most of what is needed is already there.

Currently the code activity is always being recorded, so it is already there. It is just that it is currently being saved to a permanent file as it is being recorded. My first change would be to create a temporary file and write the activity to it and only make it permanent if the user chooses to save it.

@pwdirks
Copy link
Collaborator

pwdirks commented Dec 29, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants