Sending a packet back to its sender

1,056 views
Skip to first unread message

Osama Abu Hamdan

unread,
Jun 29, 2022, 7:22:33 PM6/29/22
to ONOS Developers
Greetings,
I installed a rule to my switch to send and packet sent by a certain host back to that host. I am seeing that the rule is matching the packets, but the host is not capturing the returned packets.

Using Wireshark, I can see the packet going out the interface, but I can't see the packet coming back to the host.

Any thoughts?

Best

Osama Abu Hamdan

unread,
Jun 29, 2022, 7:26:06 PM6/29/22
to ONOS Developers, Osama Abu Hamdan
EDIT: I installed a rule to my switch to send any** packet sent by ...

Desmond Kang

unread,
Jun 30, 2022, 2:28:53 AM6/30/22
to ONOS Developers, oabuh...@nevada.unr.edu
Hi, may I have a look at the flow rule you installed?

Osama Abu Hamdan

unread,
Jun 30, 2022, 2:34:54 AM6/30/22
to ONOS Developers, desmon...@gmail.com, Osama Abu Hamdan
Hi Desmon,

    id=b00000f81cc28a, state=ADDED, bytes=61, packets=1, duration=28046, liveType=UNKNOWN, priority=50, tableId=0, appId=edu.unr.hpclab.flowcontrol, selector=[ETH_TYPE:ipv4, IP_PROTO:17, IPV4_SRC:10.0.0.0/8], treatment=DefaultTrafficTreatment{immediate=[OUTPUT:1, IPV4_SRC:10.0.0.6, IPV4_DST:10.0.0.1, ETH_DST:00:00:00:00:00:01, ETH_SRC:00:00:00:00:00:06], deferred=[], transition=None, meter=[], cleared=false, StatTrigger=null, metadata=null}

I tried many protocols and many ways. Note that Host 1 is sending the packet and it's connected to port#1. This is why I am outputting to it.

Thx

Eder Ollora

unread,
Jun 30, 2022, 4:53:36 AM6/30/22
to ONOS Developers, oabuh...@nevada.unr.edu, desmon...@gmail.com
Hi,

I am not sure what is going on. I can say that it seems to have matched 1 packet I believe. So not sure if this is the example you wanted to show. In any way you match UDP in your rule so be sure that you are actually sending the correct packets.

I will try to test it myself. There might be something in the treatment that does not work or that the packets are dropped and not shown in Wireshark (these are just guesses).

Let's see,

Osama Abu Hamdan

unread,
Jun 30, 2022, 2:59:56 PM6/30/22
to ONOS Developers, Eder Ollora, Osama Abu Hamdan, desmon...@gmail.com
Hi Eder,
This matched packet is the packet I sent, I sent multiple packets and all of them are matched but the treatment is not being applied.
Yeah, I think for some reason I can sniff the packets neither in Wireshark nor by using Scapy.
Thanks

Osama Abu Hamdan

unread,
Jun 30, 2022, 8:46:07 PM6/30/22
to ONOS Developers, Osama Abu Hamdan, Eder Ollora, desmon...@gmail.com
I noticed this now

This is my treatment

TrafficTreatment treatment = DefaultTrafficTreatment.builder()
.setOutput(PortNumber.portNumber(2))
.setIpSrc(IpAddress.valueOf("10.0.0.5"))
.setIpDst(IpAddress.valueOf("10.0.0.2"))
.setEthSrc(MacAddress.valueOf("00:00:00:00:00:05"))
.setEthDst(MacAddress.valueOf("00:00:00:00:00:02"))
.build();


So I want to change the IPSrcand Dst and the same for Mac addresses as well as divert the traffic to port two (Host 2 is connected there).

I created a packet using scapy in host 1 with dst IP 10.0.0.6 and dst Mac "00:00:00:00:00:06".
I receive the packet at host two but when I print the src IP it shows 10.0.0.1 and dst IP shows 10.0.0.6

The number of matched packets is increasing in the switch.
    ADDED, bytes=183, packets=3, table=0, priority=50, selector=[ETH_TYPE:ipv4, IP_PROTO:17, IPV4_SRC:10.0.0.0/8], treatment=[immediate=[OUTPUT:2, IPV4_SRC:10.0.0.5, IPV4_DST:10.0.0.2, ETH_SRC:00:00:00:00:00:05, ETH_DST:00:00:00:00:00:02]]

Any thoughts?
Reply all
Reply to author
Forward
0 new messages