Ask Your Question
0

Pointers to examples of sending arbitrary packet out

asked 2014-09-06 11:48:09 -0700

anonymous user

Anonymous

Hello,

I am new with both Java and ODL. I'm trying to figure out how to send an arbitrary packet. After some failed attempts based on reviewing here: http://sdnhub.org/tutorials/opendaylight/ coming here.

Is there any place to see an example of using the IDataPacketService to generate a packet. For example to to send a packet-out message with IP source 10.0.0.1, IP dst 10.0.0.2, mac src....etc....

Thanks!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-09-08 08:04:37 -0700

Hi,

This example works for me. My understanding is that, once the Packet arrives at switch IDataPacketService can encode/decode packet and can transmit provided it has outgoingconnector node. IDataPacketService cannot generate packet. Use iPerf or any other similar tool out there to send packet from ip source 10.0.0.1 to dst 10.0.0.2.

Hope this helps.

Cheers!!

edit flag offensive delete publish link more
0

answered 2015-02-03 14:38:47 -0700

v1t3x gravatar image

Hi,

check out method sendEchoReply in https://github.com/fredhsu/odl-apps/blob/master/icmpreply/src/main/java/com/example/icmpreply/ICMPReply.java

Ethernet ethernet = new Ethernet();
ethernet.setSourceMACAddress(sourceMAC)
        .setDestinationMACAddress(destinationMAC)
        .setEtherType(EtherTypes.IPv4.shortValue())
        .setPayload(payload);

RawPacket rawPacket = dataPacketService.encodeDataPacket(ethernet);
rawPacket.setOutgoingNodeConnector(nodeConnector);

dataPacketService.transmitDataPacket(rawPacket);

May the Flow be with you

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Stats

Asked: 2014-09-06 11:48:09 -0700

Seen: 209 times

Last updated: Feb 03 '15