Package org.onosproject.segmentrouting
Class IpHandler
- java.lang.Object
-
- org.onosproject.segmentrouting.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}.
-
-
Constructor Summary
Constructors Constructor Description IpHandler(SegmentRoutingManager srManager)Creates an IpHandler object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToPacketBuffer(org.onlab.packet.IPv4 ipPacket)Adds the IP packet to a buffer.voidaddToPacketBuffer(org.onlab.packet.IPv6 ipPacket)Adds the IPv6 packet to a buffer.voiddequeuePacket(org.onlab.packet.IP ipPacket, org.onlab.packet.IpAddress destinationAddress)Dequeues the packet using the destination address as key.voidforwardPackets(org.onosproject.net.DeviceId deviceId, org.onlab.packet.Ip4Address destIpAddress)Forwards IP packets in the buffer to the destination IP address.voidforwardPackets(org.onosproject.net.DeviceId deviceId, org.onlab.packet.Ip6Address destIpAddress)Forwards IP packets in the buffer to the destination IP address.voidprocessPacketIn(org.onlab.packet.IPv4 pkt, org.onosproject.net.ConnectPoint connectPoint)Processes incoming IP packets.voidprocessPacketIn(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 removedestinationAddress- 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 packetconnectPoint- 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 IDdestIpAddress- 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 packetconnectPoint- 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 devicedestIpAddress- the destination ip address
-
-