i wanted to count number of UDP packets that achieve to switch using pox and openflow.
this is the topology that i use:
#!/usr/bin/python
"""
Script created by VND - Visual Network Description (SDN version)
"""
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSKernelSwitch, IVSSwitch, UserSwitch
from mininet.link import Link, TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel
def topology():
"Create a network."
net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )
print "*** Creating nodes"
c1 = net.addController( 'c1' )
s2 = net.addSwitch( 's2', protocols='OpenFlow13', listenPort=6673, mac='00:00:00:00:00:02' )
h4 = net.addHost( 'h4', mac='00:00:00:00:00:04', ip='10.0.0.4/8' )
h5 = net.addHost( 'h5', mac='00:00:00:00:00:05', ip='10.0.0.5/8' )
h6 = net.addHost( 'server', mac='00:00:00:00:00:06', ip='10.0.0.6/8' )
print "*** Creating links"
net.addLink(s2, h6)
net.addLink(s2, h4)
net.addLink(s2, h5)
print "*** Starting network"
net.build()
c1.start()
s2.start( [c1] )
print "*** Running CLI"
CLI( net )
print "*** Stopping network"
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
topology()
i want to count the number of udp packets that "h4" sends to server through the switch and also the number of udp packets that "h5" sends to server through switch.