1
votes

I build a custom mininet topology: 2 hosts with 2 switches between them:

 Host1====Switch1====Switch2====Host2

After filling the flowtables with ONOS, the setup works fine. But I have trouble with handling packets that are forwarded to the SDN-Controller.

As controller I use my own onos-app.

I tried some pinging and sniffed the interfaces with tcpdump. When one host pings the other host, the host sends an arp request. This request reaches the other host and it replies. Even the reply reaches correct the ping-host. But then... Nothing happens. I would expect the first host to send the ping after he had received the correct arp reply. But instead it does absolutely nothing. This even doesn't work using only one switch. Screenshot tcpdump: host1 on the upper left, host2 on the upper right, switch in the middle

Why does the ping itself doesn't start? Have you any idea what I did wrong? Thank you.

2

2 Answers

3
votes

R you using ONOS or RYU? It seems like you are using RYU.

If you are RYU: Do you have controller setup properly. Run the RYU using the provided controller code like simple_switch_13.py. See if that works.

If you are ONOS, have you installed features? Based on this tutorial you shuld install a feature. something like:

onos> feature:install onos-app-fwd

I don't know how you are programming the switches but for both controllers note that you should add flows for both directions. Also, sometimes the flows have a very short lifetime that by the time packets arrive they are expired.

If none of these helped, could you provide more details.

2
votes

OK. Problem solved :-D

This is what went wrong:

The onos-core itself places the default rules for ARP, IPv4 and IPv6, that redirect packets to the controller. Even if the onos-core writes such a default rule to the flowtable of the switch , it doesnt mean that all packets reach your app. In my case only the ARP-packets reached my app, not the IPv4-packets. Therefor I must add 3 lines to the "@Activate"-section of my app.

@Activate
    public void activate() {
    appId = coreService.registerApplication("org.onosproject.ifwd");

    packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 2);

    //***ADD THESE 3 LINES*********************************************************
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    packetService.requestPackets(selector.build(), PacketPriority.REACTIVE, appId);
    //*****************************************************************************

}