生成固定大小的虚拟数据包 [英] generate dummy packets of fixed size

查看:58
本文介绍了生成固定大小的虚拟数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 python 生成固定大小的虚拟数据包,比如 1400 字节.生成后,我想使用 UDP 广播以及每个数据包的序列号通过网络流式传输它.有没有可能的方法来做到这一点.

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.

推荐答案

尝试使用 scapy.

一个简单的 UDP 数据包可以使用简单的 1-liner 发送,例如 send(IP(dst="192.168.0.255")/UDP(dport=0)/("X"*1400))

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

这篇关于生成固定大小的虚拟数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆