Skip to content

Conversation

hrfarmer
Copy link
Member

Summary

Adds a 1 byte number to the header of packets that identifies the message it came from. Receive will bounce any packets that don't match the identifier it's looking for. Should be a good start for adding retry logic in the future.

How was this tested

  • Added new unit tests
  • Ran code on hardware (screenshots are helpful)
  • Other (Please describe)

@hrfarmer hrfarmer requested a review from nateinaction July 14, 2025 23:57
@Mikefly123
Copy link
Member

Hey @hrfarmer I was wondering, since the unique identifier is only 1 Byte (256 possible options) is the idea here that it is statistically unlikely that two packets sent at a random time will have the same unique identifier?

My thought here is mainly like, what if we are sending a packet stream of more than 256 unique packets (i.e. if we are transferring a file or something) wouldn't we run the risk of rolling over the counter and having replication? I suppose the 2 byte sequence number when sending a stream of packets could also alleviate that

@hrfarmer
Copy link
Member Author

The number is incremented on each unique message sent, so unless we have a situation where there's over 255 things pending to be sent at a time, it shouldn't be an issue.

Also yes for things like file transfer the sequence number should be able to handle that.

Copy link
Member

@nateinaction nateinaction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Captura de pantalla 2025-07-15 a la(s) 19 01 45 Looks like we need a test for if we get another message while receiving a message.

Copy link

@hrfarmer hrfarmer merged commit 1cd711e into main Jul 16, 2025
5 checks passed
@hrfarmer hrfarmer deleted the identifiable-packets branch July 16, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants