1
votes

I have an network topology using mininet.The topology is connected to RYU simple_switch.py program.I have 6 switches and 6 hosts on my network.

The contents of the Flow Table on the 6 swtiches are given below.

TABLE FOR s1
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=10.97s, table=0, n_packets=11, n_bytes=561, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:51
TABLE FOR s2
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=10.947s, table=0, n_packets=11, n_bytes=561, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:51
TABLE FOR s3
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=10.921s, table=0, n_packets=11, n_bytes=561, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:51
TABLE FOR s4
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=10.893s, table=0, n_packets=11, n_bytes=561, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:51
TABLE FOR s5
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=10.86s, table=0, n_packets=11, n_bytes=561, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:51
TABLE FOR s6
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=10.834s, table=0, n_packets=11, n_bytes=561, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:51

What does action=CONTROLLER:51 mean? Does this mean that send all packets as PACKET_IN to the controller?

2

2 Answers

2
votes

It means that the switch should send only the first 51 bytes of the packet to the controller. Look at the max_len field in ofp_output_action for details.

0
votes

Yes. When an action is set to 'CONTROLLER', when packets don't match to any flow table entry, the packets are instead sent to the controller.

I use POX and the below peice of code in my controller, installs default entry as " forward all packets to controller"

 def insertDefaultFlow(self,connection):
        """ method to insert default flow of send to controller , called in connectionup handler"""
    msg = of.ofp_flow_mod()
    msg.actions.append(of.ofp_action_output(port=of.OFPP_CONTROLLER))
    connection.send(msg)


dpctl dump-flows output as below:

s3 ------------------------------------------------------------------------

in_port(2),eth(src=de:37:0c:3b:64:cf,dst=33:33:00:00:00:02),
eth_type(0x86dd),
         ipv6(src=fe80::dc37:cff:fe3b:64cf,dst=ff02::2,label=0,proto=58,tclass=0,hlimit=255,frag=no,icmpv6(type=133,code=0), 
    packets:2, 
    bytes:140, 
    used:1.516s, 
    **actions**:userspace(pid=4294960954,**controller**,length=4294901762)

as it can be seen, a flow entry instructing all packets to be forwarded to the controller has been installed.