Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chitsukhin opened this issue Oct 14, 2020 · 0 comments

Comments

@chitsukhin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant