Hi, First, could you confirm on which point you get captures? On your host? Or on your switch?
If you get these DHCP packets were captured on your host or switch, please confirm that the sent packet data to the controller is NOT truncated by "output" action in your flows. If "max_len" is other than "OFPCML_NO_BUFFER", the packet data sent to the controller might be truncated by switches. http://ryu.readthedocs.io/en/latest/ofproto_v1_3_ref.html#ryu.ofproto.ofproto_v1_3_parser.OFPActionOutput FYI, on my environment, DHCP packets in your pcapng file could be decoded. # Note: I converted pcapng file into pcap file for convenience $ python print_pcap_data.py 1-dhcp_discover_packet.pcap *** 1, 1481953420.361685 ethernet(dst='ff:ff:ff:ff:ff:ff',ethertype=2048,src='00:00:00:00:00:01'), ipv4(csum=14742,dst='255.255.255.255',flags=0,header_length=5,identification=0,offset=0,option=None,proto=17,src='0.0.0.0',tos=16,total_length=328,ttl=128,version=4), udp(csum=34166,dst_port=67,src_port=68,total_length=308), dhcp(boot_file=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',chaddr='00:00:00:00:00:01',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=6,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[option(length=1,tag=53,value=b'\x01'), option(length=8,tag=12,value=b'sdnhubvm'), option(length=13,tag=55,value=b'\x01\x1c\x02\x03\x0f\x06w\x0c,/\x1ay*')],options_len=64),secs=0,siaddr='0.0.0.0',sname='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',xid=559339326,yiaddr='0.0.0.0') *** 2, 1481953470.988880 ethernet(dst='ff:ff:ff:ff:ff:ff',ethertype=2048,src='00:00:00:00:00:01'), ipv4(csum=14742,dst='255.255.255.255',flags=0,header_length=5,identification=0,offset=0,option=None,proto=17,src='0.0.0.0',tos=16,total_length=328,ttl=128,version=4), udp(csum=52048,dst_port=67,src_port=68,total_length=308), dhcp(boot_file=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',chaddr='00:00:00:00:00:01',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=6,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[option(length=1,tag=53,value=b'\x01'), option(length=8,tag=12,value=b'sdnhubvm'), option(length=13,tag=55,value=b'\x01\x1c\x02\x03\x0f\x06w\x0c,/\x1ay*')],options_len=64),secs=0,siaddr='0.0.0.0',sname='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',xid=2491751989,yiaddr='0.0.0.0') *** 3, 1481953473.204261 ethernet(dst='ff:ff:ff:ff:ff:ff',ethertype=2048,src='00:00:00:00:00:01'), ipv4(csum=14742,dst='255.255.255.255',flags=0,header_length=5,identification=0,offset=0,option=None,proto=17,src='0.0.0.0',tos=16,total_length=328,ttl=128,version=4), udp(csum=52045,dst_port=67,src_port=68,total_length=308), dhcp(boot_file=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',chaddr='00:00:00:00:00:01',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=6,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[option(length=1,tag=53,value=b'\x01'), option(length=8,tag=12,value=b'sdnhubvm'), option(length=13,tag=55,value=b'\x01\x1c\x02\x03\x0f\x06w\x0c,/\x1ay*')],options_len=64),secs=3,siaddr='0.0.0.0',sname='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',xid=2491751989,yiaddr='0.0.0.0') So I guess Ryu got the truncated packets and failed to decode them... Thanks, Iwase On 2016年12月17日 14:59, Munther Numan wrote: > Dear Mr.Olivier Desnoë > > I hope you're fine and well, > > > > At first thank you very much for your fast response , actually I am just > start with Ryu . > > > > The issue : > > 1- The host send DHCP discover packet , I capture the packet you can > find it in the attached of this e-mail. > > 2- The DHCP discover packet content 4 protocols ( Ethernet , IPv4 , UDP > , DHCP-discover ) > > 3- The Ryu controller when received the DHCP discover packet see the > packet content only 3 protocols ( Ethernet , IPv4 ,UDP ), you can see the > message received by Ryu controller in attached file of this e-mail. > > 4- Therefor I cannot parsing the DHCP discover packet and > simple_dhcp_server is not work. > > > > I hope my explain for the issue is clear , and I do not why this happen , is > the issue form controller ? or from me ? > > > > Thank you very much > > > > Best Regards > > Munther Numan > Master Student > Faculty of Engineering > University Putra Malaysia > > *From:*Olivier Desnoë [mailto:olivier.des...@gmail.com] > *Sent:* Friday, December 16, 2016 9:23 PM > *To:* Munther Numan; Ryu-devel > *Subject:* Re: [Ryu-devel] bug in parsing dhcp packet > > > > Have you tried to put some debug prints in the parsing function of dhcp.py? > > > > Le ven. 16 déc. 2016 à 12:28, Munther Numan <munpro...@gmail.com > <mailto:munpro...@gmail.com>> a écrit : > > Dear all , Greeting .. > > > > I get error when I run simple dhcp server , I capture the packet in > wireshark and I see the packet is content 4 protocols ( Ethernet , ipv4 , udp > , dhcp discover ) but in Ryu framework I see only 3 protocols such as below : > > > > msg =ev.msg > > pkt =packet.Packet(msg.data) > > printpkt.protocols > > """ outputs: > > > [ethernet(dst='ff:ff:ff:ff:ff:ff',ethertype=2048,src='a0:36:9f:2d:a7:f9'), > > > ipv4(csum=14742,dst='255.255.255.255',flags=0,header_length=5,identification=0,offset=0, > > > option=None,proto=17,src='0.0.0.0',tos=16,total_length=328,ttl=128,version=4), > > udp(csum=39669,dst_port=67,src_port=68,total_length=308), > > > '\x01\x01\x06\x00F\x08\x9f\x06\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 > > > \x00\xa06\x9f-\xa7\xf9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 > > > \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 > > \x00\x00\x00\x00\x00\x04\n\x00\xaa\x00\x00\x00\x00'] > > """ > > I know this packet is dhcp discover becoues as you see in udp src_port is > 68 and dst_port is 67 but how can I parsing this packet when I write the code > below I did nt get any thing : > > > > dhcpPacket = pkt.get_protocol(dhcp.dhcp) > > print dhcppacket > > > > ''' output : > > None > > ''' > > > > Please if you can help me to solve this issue . > > > > > > Best Regards > > Munther Numan > Master Student > Faculty of Engineering > University Putra Malaysia > > > > > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! > http://sdm.link/slashdot_______________________________________________ > Ryu-devel mailing list > Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/ryu-devel > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > > _______________________________________________ > Ryu-devel mailing list > Ryu-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ryu-devel >
1-dhcp_discover_packet.pcap
Description: application/vnd.tcpdump.pcap
#!/usr/bin/env python import argparse from ryu.lib import pcaplib from ryu.lib.packet import packet parser = argparse.ArgumentParser( description='Print packet data from pcap file.') parser.add_argument('file', metavar='FILE', type=str, help='File to print') args = parser.parse_args() frame_count = 0 for ts, buf in pcaplib.Reader(open(args.file, 'rb')): frame_count += 1 pkt = packet.Packet(buf) print("*** %d, %f\n%s\n" % (frame_count, ts, pkt))
------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/intel
_______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel