简体   繁体   English

生成固定大小的虚拟包

[英]generate dummy packets of fixed size

Hi I would like to generate dummy packets of fixed size say 1400 bytes using python. 嗨,我想使用python生成固定大小的伪数据包,例如1400字节。 After generation I would like to stream it over the network using UDP broadcast along with the sequence numbers for each packet. 在生成之后,我想使用UDP广播以及每个数据包的序列号在网络上传输它。 Is there any possible ways to do this. 有没有可行的方法来做到这一点。

Try using scapy . 尝试使用scapy

A simple UDP packet can be sent using a simple 1-liner such as send(IP(dst="192.168.0.255")/UDP(dport=0)/("X"*1400)) 可以使用简单的1-liner发送简单的UDP数据包,例如send(IP(dst="192.168.0.255")/UDP(dport=0)/("X"*1400))

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

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