0

I am trying to create a generic matching function in Ryu with OFv1.3 which will take an action if a match is found, in accordance with structure:

class Action:
    match_ : OFPMatch or dict
    action : Callable
    payload: (args, kwargs)

For example, on receiving from Packet-In messages for packets destined to an unknown host, I want to:

  • store switch-wise IP headers
  • send an ARP request
  • wait for an ARP reply and when the reply is received:
    • install flow rules for the IP headers on the switches which are waiting for a reply which matches a specified OFPMatch object.

The Action object for the above may look like:

Action(
    match_ = OFPMatch(eth_type=ether_types.ETH_TYPE_ARP, arp_op=arp.ARP_REPLY, arp_spa=<ip-addr>),
    action = InstallFlowRule
    payload= ((datapath), {'type': ether_types.ETH_TYPE_IP, 'pkt': ip_pkt})

So, I want to match an ARP reply received as a Packet-In on the controller and install the flow rule for a previously received IP packet. This scenario is especially useful when controller goes down and comes back up.

I couldn't find any function or member that could match packet with OFPMatch automatically for me.

Himanshu Tanwar
  • 198
  • 1
  • 11

0 Answers0