Hi
I haven't read your project, so I will just put in a common reason for the first packet to fail.
When the packet arrives to the router, the router will forward it out towards the destination.
To do so it have to rewrite the headers, with a new mac address for the destination.
If the router do not have this information in it's arp table, it has to do an arp request to find out the mac address to the destination.
When this arp process is ongoing, the router drops the packet that was intended to be send.
Next time a packet arrives to the router, it again looks in its arp table, and now there is an entry for the destination. So the router can successfully built a correct header for the outgoing packet and send it.
/Mikael