Search code examples
windowsnetwork-programmingfragmentation

Easy way to create fragmented IPv4 packets


I'm working on a network stack at the moment, and I'm trying to implement IPv4 fragmentation. Whilst I have an implementation which works in theory, I would like to actually test that it works by throwing actual fragmented packets at it.

Is there any software or perhaps an easy way to write code to do this? I'd rather not go and modify MTUs on the hosts I'm testing with just to get this working. My development environment is Windows.


Solution

  • I think the simplest way is to use ping:

        ping -l 2000 192.168.0.1
    

    for linux, it should be:

        ping -s 2000 192.168.0.1