Hi,

I'm trying to build Ryu application, and in one part of my application I
need to make the controller sends ICMP Unreachable to the host whenever the
controller receive PACKET_IN contain ICMP Echo request.

The problem is in the source host prompt, it will never show the
destination IP address is unreachable, but I check the source host using
tcpdump and I found that it indeed received the ICMP Unreachable message
but the problem is the IP listed in that message is NOT the destination IP
in the ping, I already try ping from h1 to h2 and also h3 to h4, the IP
address listed in the ICMP unreachable message is the same which is
16.17.18.19, I don't know this IP address at all.

[image: Inline image 1]

I want to ask how to set the destination IP in the ICMP Destination
Unreachable message?
I'm sure the ICMP is received by the source host as shown by tcpdump, but
didn't shown in the terminal because the IP listed (16.17.18.19) isn't the
same with the destination IP the source host want to ping.

Let say I want ping to IP address 10.0.0.2, the message I want to receive
in terminal will be:
>From 10.0.0.2 icmp_seq=<seq_number> Destination Host Unreachable

because I see in the function below, the data parameter is assigned with
pkt_icmp.data while pkt.icmp = pkt.get_protocol(icmp.icmp), I don't find
any documentation about how to set the data in order to set the correct
destination IP.

    def _handle_icmp(self, datapath, port, pkt_ethernet, pkt_ipv4,
pkt_icmp):
     ....
        pkt.add_protocol(icmp.icmp(type_=icmp.ICMP_DEST_UNREACH,
                                   code=1,
                                   csum=0,
                                   data=pkt_icmp.data
                                   ))
        self._send_packet(datapath, port, pkt)

when I try to print the data / pkt_icmp.data , following is the result:

echo(data='\x16AjW\x00\x00\x00\x00\x11\'\x0f\x00\x00\x00\x00\x00\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f
!"#$%&\'()*+,-./01234567',id=23419,seq=24)

how can I set the data, or more precisely the destination IP address the
source host intend to ping?

Thanks & Best Regards,
Johanes.
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to