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


Unable to get packet data from packetIn

asked 2015-11-18 10:49:52 -0800

ODLer gravatar image

updated 2015-11-18 12:04:27 -0800


    I am sending UDP packets from mininet hosts with some data/payload. How to parse the packetIn in the controller to get the packet data ? I am only able to parse the packet to get UDP headers but not the actual data.

    Below is the program that sends UDP packets from mininet hosts

    # addressing information of target
    IPADDR = ''
    PORTNUM = 10000

    # enter the data content of the UDP packet as hex
    PACKETDATA = 'packet data'

    # initialize a socket, think of it as a cable
    # SOCK_DGRAM specifies that this is UDP
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)

    # connect the socket, think of it as connecting the cable to the address location
    s.connect((IPADDR, PORTNUM))

    # send the command

    # close the socket

edit retag flag offensive close merge delete


Answer depends on which version of ODL you're using. If you can share that, I can point to relevant code you can refer.

Vishal Thapar ( 2015-11-23 06:01:41 -0800 )edit

Hi, I am using ODL Helium SR3.

ODLer ( 2015-11-23 08:33:11 -0800 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-11-23 20:18:36 -0800

Vishal Thapar gravatar image

Take a look at L2Switch handler code. It should give you a good idea on how to write an application that receives and decodes packets. Let me know if this works or you want more information.

edit flag offensive delete publish link more


Yes this is what I wanted. Thanks !

ODLer ( 2015-11-24 19:29:53 -0800 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-11-18 10:49:52 -0800

Seen: 101 times

Last updated: Nov 23 '15