Ejemplo n.º 1
0
 def reset_flowtable(self, datapath):
     
     # drop arp requests to avoid arp storm
     match_arp_req = parser13.OFPMatch(eth_type = ETH_TYPE_ARP, arp_op = ARP_REQUEST)
     of_func.ofDelFlow(datapath, match_arp_req)
     
     # forward arp replies to the controller
     match_arp_rep = parser13.OFPMatch(eth_type = ETH_TYPE_ARP, arp_op = ARP_REPLY)
     of_func.ofDelFlow(datapath, match_arp_rep)
Ejemplo n.º 2
0
 def broadcast_arp(self):
         
     switch_list = get_switch(self, None)
     
     # modify flows to drop temporarily arp request
     match = parser13.OFPMatch(eth_dst = BROADCAST_STR, eth_type = ETH_TYPE_ARP)     
     actions = []
     for switch in switch_list:
         of_func.ofAddFlow(switch.dp, match, actions, self.ARP_BROADCAST_PRIORITY)
         
     for switch in switch_list: 
         of_func.ofPckOut(self.current_msg, ofproto13.OFPP_FLOOD)
     
     # del flows to drop arp request
     for switch in switch_list:
         of_func.ofDelFlow(switch.dp, match, self.ARP_BROADCAST_PRIORITY)