简体   繁体   English

使用c#,java或c ++创建数据包生成器

[英]Create a packet generator using c#,java or c++

i want to create my own packet generator, so that i am able to create packets of TCP,ICMP (ping, echo), UDP. 我想创建自己的数据包生成器,以便我能够创建TCP,ICMP(ping,echo),UDP的数据包。 I also want to set all the headers of packet and control all the flags my self, i mean i want to turn on the flags like SYN,FIN etc. I don't have any idea how to start it.. 我也想设置数据包的所有标题并控制我自己的所有标志,我的意思是我想打开像SYN,FIN等标志。我不知道如何启动它..

Any help/suggestions will be appreciated.. 任何帮助/建议将不胜感激..

PS : i don't have any problem with C#,c++ or java, i am comfortable with all of them, so u can give implementation suggestions regarding to any of the above languages.. Thanks PS:我对C#,c ++或java没有任何问题,我对所有这些都很满意,所以你可以给出任何上述语言的实现建议..谢谢

regards 问候

usama 乌萨马·本

There are a bunch of headers you can use to create your functions for creating packets: 您可以使用一堆标头来创建用于创建数据包的函数:

#include<linux/if_ether.h>
#include<linux/ip.h>
#include<linux/udp.h>

Once the packets have been created use the following to transmit over the interface: 创建数据包后,使用以下内容通过接口进行传输:

socket() bind() socket() bind()

Hope this helps to start! 希望这有助于开始!

Take a look at the source for JPerf . 看一下JPerf的来源。 It uses Java to create packets for bandwidth monitoring. 它使用Java来创建用于带宽监视的数据包。 Also http://iperf.sourceforge.net/ 另外http://iperf.sourceforge.net/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM