Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

How to parse OpenFlow message.

Hi, I have a simple mininet network. I found the application that handle a packets when I ping from one host to another. This work properly (IP addres is displaying). Now I want to change this program to handle a OpenFlow message when for eg. link between switches goes down. In wireshark I see that switch sended a OFPTPORTSTATUS message. How to handle this message (maybe use diffrent interface than IListenDataPacket and reciveDataPacket() functions)? How to get this message type? Below I attachedreceiveDataPacket code. Thanks for help.

@Override public PacketResult receiveDataPacket(RawPacket inPkt) { log.trace("Received data packet.");

    // The connector, the packet came from ("port")
    NodeConnector ingressConnector = inPkt.getIncomingNodeConnector();
    // The node that received the packet ("switch")
    Node node = ingressConnector.getNode();

    // Use DataPacketService to decode the packet.
    Packet l2pkt = dataPacketService.decodeDataPacket(inPkt);

    if (l2pkt instanceof Ethernet) {
        Object l3Pkt = l2pkt.getPayload();
        if (l3Pkt instanceof IPv4) {
            IPv4 ipv4Pkt = (IPv4) l3Pkt;
            int dstAddr = ipv4Pkt.getDestinationAddress();
            InetAddress addr = intToInetAddress(dstAddr);
            System.out.println("Pkt. to " + addr.toString()
                    + " received by node " + node.getNodeIDString()
                    + " on connector "
                    + ingressConnector.getNodeConnectorIDString());
            return PacketResult.KEEP_PROCESSING;
        }
    }
    // We did not process the packet -> let someone else do the job.
    return PacketResult.IGNORED;
}

How to parse handle/parse OpenFlow message.

Hi, I have a simple mininet network. I found the application that handle a packets when I ping from one host to another. This work properly (IP addres is displaying). Now I want to change this program to handle a OpenFlow message when for eg. link between switches goes down. In wireshark I see that switch sended a OFPTPORTSTATUS message. How to handle this message (maybe use diffrent interface than IListenDataPacket and reciveDataPacket() functions)? How to get this message type? Below I attachedreceiveDataPacket code. Thanks for help.

@Override public PacketResult receiveDataPacket(RawPacket inPkt) { log.trace("Received data packet.");

    // The connector, the packet came from ("port")
    NodeConnector ingressConnector = inPkt.getIncomingNodeConnector();
    // The node that received the packet ("switch")
    Node node = ingressConnector.getNode();

    // Use DataPacketService to decode the packet.
    Packet l2pkt = dataPacketService.decodeDataPacket(inPkt);

    if (l2pkt instanceof Ethernet) {
        Object l3Pkt = l2pkt.getPayload();
        if (l3Pkt instanceof IPv4) {
            IPv4 ipv4Pkt = (IPv4) l3Pkt;
            int dstAddr = ipv4Pkt.getDestinationAddress();
            InetAddress addr = intToInetAddress(dstAddr);
            System.out.println("Pkt. to " + addr.toString()
                    + " received by node " + node.getNodeIDString()
                    + " on connector "
                    + ingressConnector.getNodeConnectorIDString());
            return PacketResult.KEEP_PROCESSING;
        }
    }
    // We did not process the packet -> let someone else do the job.
    return PacketResult.IGNORED;
}

//EDIT Hi, I found that is an interface IMessageListener which allow to hande OFMessages. I make a dependecies in pom file and implement this interface. I build a bundle succesufully. I install it on controller, but when I try to start this an error is displaying: Reason: Missing Constraint: Import-Package: org.opendaylight.controller.protocol_plugin.openflow13.core; version="0.0.0" What can I do with this? Thanks for help.

How to handle/parse OpenFlow message.

Hi, I have a simple mininet network. I found the application that handle a packets when I ping from one host to another. This work properly (IP addres is displaying). Now I want to change this program to handle a OpenFlow message when for eg. link between switches goes down. In wireshark I see that switch sended a OFPTPORTSTATUS message. How to handle this message (maybe use diffrent interface than IListenDataPacket and reciveDataPacket() functions)? How to get this message type? Below I attachedreceiveDataPacket code. Thanks for help.

@Override public PacketResult receiveDataPacket(RawPacket inPkt) { log.trace("Received data packet.");

    // The connector, the packet came from ("port")
    NodeConnector ingressConnector = inPkt.getIncomingNodeConnector();
    // The node that received the packet ("switch")
    Node node = ingressConnector.getNode();

    // Use DataPacketService to decode the packet.
    Packet l2pkt = dataPacketService.decodeDataPacket(inPkt);

    if (l2pkt instanceof Ethernet) {
        Object l3Pkt = l2pkt.getPayload();
        if (l3Pkt instanceof IPv4) {
            IPv4 ipv4Pkt = (IPv4) l3Pkt;
            int dstAddr = ipv4Pkt.getDestinationAddress();
            InetAddress addr = intToInetAddress(dstAddr);
            System.out.println("Pkt. to " + addr.toString()
                    + " received by node " + node.getNodeIDString()
                    + " on connector "
                    + ingressConnector.getNodeConnectorIDString());
            return PacketResult.KEEP_PROCESSING;
        }
    }
    // We did not process the packet -> let someone else do the job.
    return PacketResult.IGNORED;
}

//EDIT Hi, I found that is an interface IMessageListener which allow to hande OFMessages. I make a dependecies in pom file and implement this interface. I build a bundle succesufully. I install it on controller, but when I try to start this an error is displaying: Reason: Missing Constraint: Import-Package: org.opendaylight.controller.protocol_plugin.openflow13.core; version="0.0.0" What can I do with this? Thanks for help.

//EDIT Anybody can help me?