Ask Your Question
0

Unable to get packet data from packetIn

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

ODLer gravatar image

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

  Hi,

    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 = '8.4.2.1'
    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
    s.send(PACKETDATA)

    # close the socket

    Thanks
edit retag flag offensive close merge delete

Comments

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 -0700 )edit

Hi, I am using ODL Helium SR3.

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

1 answer

Sort by ยป oldest newest most voted
1

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

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

Comments

Yes this is what I wanted. Thanks !

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

Question Tools

Follow
1 follower

Stats

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

Seen: 82 times

Last updated: Nov 23 '15