generate dummy packets of fixed size

2019-08-12 23:03发布

问题:

Hi I would like to generate dummy packets of fixed size say 1400 bytes using python. After generation I would like to stream it over the network using UDP broadcast along with the sequence numbers for each packet. Is there any possible ways to do this.

回答1:

Try using 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))