Skip to content

add a flow entry together with table miss entry in every switch in the topology when starting the ryu controller. #4

Open
@chitsukhin

Description

@chitsukhin

Hello! everyone advise me plz....
I wanna to add flow entry together with table miss entry in every switch in the topology when starting the ryu controller.
the flow entry that i want to added is

match = parser.OFPMatch(in_port=in_port, eth_dst=('33:33:00:00:00:fb'))
actions = drop

I edit the code to add a flow in simple-switch_13.py

_@set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
def switch_features_handler(self, ev):
datapath = ev.msg.datapath
ofproto = datapath.ofproto
parser = datapath.ofproto_parser

# install the table-miss flow entry.
match = parser.OFPMatch()
matchmulti = parser.OFPMatch(in_port=in_port, eth_dst=('33:33:00:00:00:fb'))
actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
                                  ofproto.OFPCML_NO_BUFFER)]
actionsmulti = [parser.OFPActionOutput(ofproto.OFPP_FLOOD)]        
self.add_flow(datapath, 0, match, actions)
self.add_flow(datapath, 0, matchmulti, actionsmulti)_

/home/chitsu/Pictures/1.jpg

but It's not okay the code.
plz, give me the correct code.
I'm poor in coding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions