Class IpHandler


  • public class IpHandler
    extends Object
    Handler of IP packets that forwards IP packets that are sent to the controller, except the ICMP packets which are processed by @link{IcmpHandler}.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addToPacketBuffer​(org.onlab.packet.IPv4 ipPacket)
      Adds the IP packet to a buffer.
      void addToPacketBuffer​(org.onlab.packet.IPv6 ipPacket)
      Adds the IPv6 packet to a buffer.
      void dequeuePacket​(org.onlab.packet.IP ipPacket, org.onlab.packet.IpAddress destinationAddress)
      Dequeues the packet using the destination address as key.
      void forwardPackets​(org.onosproject.net.DeviceId deviceId, org.onlab.packet.Ip4Address destIpAddress)
      Forwards IP packets in the buffer to the destination IP address.
      void forwardPackets​(org.onosproject.net.DeviceId deviceId, org.onlab.packet.Ip6Address destIpAddress)
      Forwards IP packets in the buffer to the destination IP address.
      void processPacketIn​(org.onlab.packet.IPv4 pkt, org.onosproject.net.ConnectPoint connectPoint)
      Processes incoming IP packets.
      void processPacketIn​(org.onlab.packet.IPv6 pkt, org.onosproject.net.ConnectPoint connectPoint)
      Processes incoming IPv6 packets.
    • Constructor Detail

      • IpHandler

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

      • dequeuePacket

        public void dequeuePacket​(org.onlab.packet.IP ipPacket,
                                  org.onlab.packet.IpAddress destinationAddress)
        Dequeues the packet using the destination address as key.
        Parameters:
        ipPacket - the ip packet to remove
        destinationAddress - the destination address
      • processPacketIn

        public void processPacketIn​(org.onlab.packet.IPv4 pkt,
                                    org.onosproject.net.ConnectPoint connectPoint)
        Processes incoming IP packets. If it is an IP packet for known host, then forward it to the host. If it is an IP packet for unknown host in subnet, then send an ARP request to the subnet.
        Parameters:
        pkt - incoming packet
        connectPoint - the target device
      • addToPacketBuffer

        public void addToPacketBuffer​(org.onlab.packet.IPv4 ipPacket)
        Adds the IP packet to a buffer. The packets are forwarded to corresponding destination when the destination MAC address is known via ARP response.
        Parameters:
        ipPacket - IP packet to add to the buffer
      • forwardPackets

        public void forwardPackets​(org.onosproject.net.DeviceId deviceId,
                                   org.onlab.packet.Ip4Address destIpAddress)
        Forwards IP packets in the buffer to the destination IP address. It is called when the controller finds the destination MAC address via ARP responses.
        Parameters:
        deviceId - switch device ID
        destIpAddress - destination IP address
      • processPacketIn

        public void processPacketIn​(org.onlab.packet.IPv6 pkt,
                                    org.onosproject.net.ConnectPoint connectPoint)
        Processes incoming IPv6 packets. If it is an IPv6 packet for known host, then forward it to the host. If it is an IPv6 packet for unknown host in subnet, then send an NDP request to the subnet.
        Parameters:
        pkt - incoming packet
        connectPoint - the target device
      • addToPacketBuffer

        public void addToPacketBuffer​(org.onlab.packet.IPv6 ipPacket)
        Adds the IPv6 packet to a buffer. The packets are forwarded to corresponding destination when the destination MAC address is known via NDP response.
        Parameters:
        ipPacket - IP packet to add to the buffer
      • forwardPackets

        public void forwardPackets​(org.onosproject.net.DeviceId deviceId,
                                   org.onlab.packet.Ip6Address destIpAddress)
        Forwards IP packets in the buffer to the destination IP address. It is called when the controller finds the destination MAC address via NDP replies.
        Parameters:
        deviceId - the target device
        destIpAddress - the destination ip address