views:

147

answers:

4

Hi,

I have a bug which is caused by fragmented packets. I would like test this bug by creating a fragmented packet in the test and sending it to the software containing the bug.

How would I go about doing this?

Any guidance or alternative approaches appreciated, thanks.

+3  A: 

If you're talking about TCP fragments, those should be hidden (reassembled) by the OS upon receipt, unless you use a low level packet capture facility e.g. Ethereal

To force sending of TCP fragments, decrease the maximum packet/segment size on some router, and/or configure the sending OS to use a larger MSS than will fit.

wrang-wrang
+1  A: 

In windows, you can change the MTU size in the registry. Don't know about other platforms.

JRL
A: 

Do the frags need to be part of a TCP stream? Or would any IP frag do? They are easily generated for UDP simply by making the datagram bigger than the MTU. Usually, 2k will do fine but if your LAN has jumbo frames enabled 10k or 20k will still produce frags.

DigitalRoss
A: 

It's easy to fragment packet with UDP. If you send a UDP datagram larger than the MTU, it will be fragmented. It's not so easy with TCP, OS will not knowingly fragment packet. Changing host or router MTU doesn't help either because most OSes will do MTU discovery and find the smallest one.

You should use some thing like Packet Generator to simulate fragmented TCP packets.

ZZ Coder