I know that we can use scapy to create packet but how to detect this packet in controller of mininet (It can be any controller like POX, Pyretic, Frenetic, RYU, etc). Can anyone explain this with the proper code to run in mininet environment?
Asked
Active
Viewed 1,411 times
2
-
Your question is not clear, what are you trying to do ? Capture packets in Mininet? or you want to craft packets? – OiaSam Mar 21 '16 at 15:19
-
Capture the packet – Lohit Barki Mar 23 '16 at 16:07
1 Answers
0
What you can use is to add listeners in your controller and capture packets:
core.openflow.addListenerByName("FlowStatsReceived", self._handle_flowstats_received)
core.openflow.addListenerByName("PortStatsReceived", self._handle_portstats_received)
core.openflow.addListenerByName("QueueStatsReceived", self._handle_qeuestats_received)
And in some class methods later
For a full example check https://github.com/tsartsaris/pythess-SDN/blob/master/pythess.py
Or you can execute a shell code in one host and send traffic using iperf to another host in mininet and then try to capture it using tcpprobe. This way will be much easier. Here is the pseudo code:
sudo cat /proc/net/tcpprobe > tcprobe.dat &
#get the cat process ID to later kill it
pid=$!
iperf -c [Host1 ip] -t 10 -Z reno > Raw_Goodput.dat
#kill the logger
kill $pid

Saeid
- 1,996
- 4
- 27
- 44