简体   繁体   English

如何使用python脚本将TCP数据包从一台主机发送到mininet中的另一台主机?

[英]How to send TCP packets from one host to another in mininet by using a python script?

I am new to mininet. 我是mininet的新手。 I created a topology in mininet and want to write a python code which can help me to send 100 TCP packets from one host to another. 我在mininet中创建了一个拓扑,并希望编写一个Python代码,该代码可以帮助我将100个TCP数据包从一台主机发送到另一台主机。

any idea please? 有什么想法吗?

You can send TCP packets from one host to another using a tool such as iperf or hping . 您可以使用iperfhping等工具将TCP数据包从一台主机发送到另一台主机。 For example, type the following command in the Mininet console: 例如,在Mininet控制台中键入以下命令:

mininet> h1 hping3 -c 100 [IP_of_h2]

Option -c specifies the number of TCP packets that will be sent. 选项-c指定将发送的TCP数据包的数量。 You can see more options for hping3 here . 您可以在此处查看hping3更多选项。

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

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