Class ArpHandler


  • public class ArpHandler
    extends SegmentRoutingNeighbourHandler
    Handler of ARP packets that responses or forwards ARP packets that are sent to the controller.
    • Constructor Detail

      • ArpHandler

        public ArpHandler​(SegmentRoutingManager srManager)
        Creates an ArpHandler object.
        Parameters:
        srManager - SegmentRoutingManager object
    • Method Detail

      • processPacketIn

        public void processPacketIn​(org.onosproject.net.neighbour.NeighbourMessageContext pkt,
                                    org.onosproject.net.host.HostService hostService)
        Processes incoming ARP packets. If it is an ARP request to router itself or known hosts, then it sends ARP response. If it is an ARP request to unknown hosts in its own subnet, then it flood the ARP request to the ports. If it is an ARP response, then set a flow rule for the host and forward any IP packets to the host in the packet buffer to the host.

        Note: We handles all ARP packet in, even for those ARP packets between hosts in the same subnet. For an ARP packet with broadcast destination MAC, some switches pipelines will send it to the controller due to table miss, other switches will flood the packets directly in the data plane without packet in. We can deal with both cases.

        Parameters:
        pkt - incoming ARP packet and context information
        hostService - the host service
      • sendArpRequest

        public void sendArpRequest​(org.onosproject.net.DeviceId deviceId,
                                   org.onlab.packet.IpAddress targetAddress,
                                   org.onosproject.net.ConnectPoint inPort)
        Sends an APR request for the target IP address to all ports except in-port.
        Parameters:
        deviceId - Switch device ID
        targetAddress - target IP address for ARP
        inPort - in-port