>>348865086
Having a sequence number in your packets a la TCP is a common technique detect and and reject out of order updates. It's hard to say whether it'll work for your design though without you posting the code. Distributed systems in general are tricky to implement. Welcome to computer science.