How to listen to ICMPv6 packets in JAVA?

152 Views Asked by At

To be specific, I'm trying to write an application to serve as both a router and a DHCPv6 server in IPv6 with Java.

The application periodically sends router advertisement(RA) and also responds to router solicitation packets from the client. Then it can in turn respond to the DHCP request information.

I know that in DHCPv4, the DHCP discover, request... packets are all on UDP and with a specific port so that I can open a UDP socket to listen to those packets. But UDP socket can't capture the ICMPv6 packets used by the communication between routers and hosts.

Therefore, I'm wondering how can I listen to ICMPv6 packets or IPv6 multicast on JAVA (because the target packets are with destination address:FF01:0:0:0:0:0:0:2)

Note: After searching for a while, I realize that pure JAVA only supports network interface down to transport layer (TCP, UDP). I'm now wondering if there is any way to solve this problem?

0

There are 0 best solutions below