[Ryu-devel] Understanding ARP Request Handling by Ryu controller
Brought to you by:
nz_gizmoguy
|
From: Ruchika L. <h20...@pi...> - 2015-02-23 13:30:20
|
Hello, I am a newbie to Ryu SDN Controller. I am trying to understand the handling of ARP Requests and generation of ARP Replies by RYU controller. As per my understanding: 1.When ARP request arrives at the switch, there is no flow registrations in switch to forward ARP Packets. 2. ARP Packets are then sent to the controller. 3. Now at the controller side, I found this code for handling the ARP requests: *def _handle_arp(self, datapath, port, pkt_ethernet, pkt_arp):* *if pkt_arp.opcode != arp.ARP_REQUEST:* *return* *pkt = packet.Packet()* *pkt.add_protocol(ethernet.ethernet(ethertype=pkt_ethernet.ethertype,* *dst=pkt_ethernet.src,* *src=self.hw_addr))* *pkt.add_protocol(arp.arp(opcode=arp.ARP_REPLY,* *src_mac=self.hw_addr,* *src_ip=self.ip_addr,* *dst_mac=pkt_arp.src_mac,* *dst_ip=pkt_arp.src_ip))* *self._send_packet(datapath, port, pkt)* where it is constructing ARP replies. Now my question is, when and where is the mapping between IP and MAC stored at the controller side. When does the controller figure out the mapping, at ARP request or is it known already to the controller? And which data structure is used to store this mapping? ** If you can point out the exact structure to represent ARP Cache, it would be great** Thank you Ruchika Luthra |