Hi
I am trying to put mpls flows in the some topology where shortest path is
selected. for selecting the path I am using the networkx and output be the
list.
LOG = logging.getLogger(__name__)
class SwitchEventHandler(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
_CONTEXTS={ 'dpset': dpset.DPSet,}
list={'00:00:00:00:00:01':1,'00:00:00:00:00:02':2,'00:00:00:00:00:03':3}
def __init__(self, *args, **kwargs):
super(SwitchEventHandler, self).__init__(*args, **kwargs)
self.mac_to_port = {}
self.dpset = kwargs['dpset']
self.link_list = []
self.s=[]
@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
match = parser.OFPMatch()
actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
ofproto.OFPCML_NO_BUFFER)]
self.add_flow(datapath, 0, match, actions)
def add_flow(self, datapath, priority, match, actions):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
match=match, instructions=inst)
datapath.send_msg(mod)
@set_ev_cls(ofp_event.EventOFPErrorMsg, [HANDSHAKE_DISPATCHER,
CONFIG_DISPA$
def error_msg_handler(self, ev):
msg = ev.msg
self.logger.debug('OFPErrorMsg received: type=0x%02x code=0x%02x
''mess$
@handler.set_ev_cls(event.EventLinkAdd)
def link_add_handler(self, ev):
self.s.append((ev.link.src.dpid,ev.link.src.port_no,ev.link.dst.dpid,ev))
for i in self.s:
self.link_list.append(i)
here i can get the dpid and port no.
but I am missing host connecting port. how do I get this?
second the shortest path will be like x=[1,2,5].
then how to get the associate port_no.?
again I have to split the path for adding seperate flows like
(in_port,1,out_port that is connected to 2),(in_port connected to
1,2,out_port connected to 5) and so on for adding flows.
how can i break and retrieve information?
thank you
--
Best regards
Sujit Pandey
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel