1
votes

How can I run a scapy script inside mininet to generate custom packets? I know I could generate traffic using iperf ,netperf etc.But I need to customize the packets and then use them in mininet. Thanks, Regards, Sushmita

3
when you generate traffic with iperf, did u observed that more than one packet in message is coming from same switch for the same flowVinay

3 Answers

1
votes

You can generate trafic from hosts. You can run cli commands using xterm. I think that using dpkg-name -v you can see what version is emulated by host. So, you can customize ping or whatever you want from the emulated host!

Here you can see how to run commands in hosts setting a simulation from python script. E.g.

h1 = net.get('h1')    
result = h1.cmd('ifconfig')
print result
1
votes

Scapy needs root authentication to run.It is difficult to use in the mininet environment. But you can use nat in mininet, then build packets in your machine and then send to hosts in miininet.

0
votes

Currently, the best way to achieve this is to use containernet, an actively developed fork of mininet that allow integration of Docker containers. Just use a container that includes Scapy and you are good to go.