title: How to assign PacketIDs to keep track of packets over an unreliable network using UDP in C?
body: <p>I'm sorry if the question seems odd. Right now, I have a client sending packets to a server over a reliable network using UDP. For my project, I have to send these packets over an unreliable network using UDP. In order to emulate the unreliable network, I am running <code>sudo tc qdisc add dev lo root netem delay 100ms 20ms 25% loss 0.5% duplicate 1% reorder 25% 50%</code>. </p>
  
  <p>Since packets are being dropped and duplicated, I want to assign each packet a PacketID in order to keep track of each packet. If PacketID 5 is skipped, for example, no other packets will be sent until 5 is properly sent. If PacketID 5 is being duplicated, it won't accept the duplicated version.</p>
  
  <p>I feel like I understand the methodology for assigning a PacketID, but I'm fairly new to socket programming and I don't know if there's a more efficient way of doing it. I'm not asking for answers (as this is a project for class), but for some advice and tips as to how I should go about this</p>