udp packet fragmentation for raw sockets

假如想象 提交于 2019-12-01 11:26:14

Yes, you need to prepare two packets, each with their own IP header.

If you put 1480 bytes of data in the first packet and 276 in the second, then the IP headers should be identical, except for these fields:

  • Fragment Offset: set to 0 in the first packet, and 1480 in the second;
  • Total Length: set to 1480 plus the header length in the first packet, and 276 plus the header length in the second packet;
  • MF flag: set to 1 in the first packet and 0 in the second;
  • Header Checksum: Recalculated over the different headers as appropriate.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!