title: How to set the UDP packet reassembly timeout in Windows 10
body: <p>I am currently developing an image aquisition application in Visual C++ that receives image data from an UDP hardware device with limited capabilities (i.e. no UDP checksum). The device has a GBit connection to a dedicated switch and the PC uses a dedicated NIC and a 10GBit connection to this switch.</p>
  
  <p>The transmitted image data consists of packets with a size ranging from 6528 to 19680 bytes. These packets are fragmented by the hardware device and reconstructed by the network stack on the PC. </p>
  
  <p>Sometimes a packet (call it packet #4711) is lost and the PC side tries to reconstruct it for a long time. Within this timespan a new packet with the same packed id is sent by the hardware device because of an overflow of the 16-bit packet id. Now the PC receives new fragments for (a new) packet #4711 and uses it to complete the old, still unassembled packet and <strong>assembles a damaged packet</strong>. To top it, the remaining fragments of the new #4711 packet are stored and combined with the next #4711 (which will be received a few seconds later). So the longer the system runs, the more packet ids will be compromised until no communication is possible at all.</p>
  
  <p><em>We cannot calculate the UDP checksum</em> on the hardware device because of it's limited capabilities.</p>
  
  <p><em>We cannot use IPv6</em> (which would offer bigger packet ids) because there is no support for the hardware device.</p>
  
  <p>We will have to implement our own protocol on top of UDP and "manually" fragment and reconstruct the data, but we could avoid this if we could find a way to reduce the packet reconstruction timeout on Windows to 500ms or less.</p>
  
  <p>I searched Google and Stackoverflow for information, but there are not many results and none of them was of much help.</p>
  
  <p>Hence the question: Is there a way to reduce the reconstruction timeout for IPv4 UDP fragments on Windows 10 via Registry, Windows API or any other magic or do you have a better suggestion?</p>