sdnfv / openNetVM

A high performance container-based NFV platform from GW and UCR.
http://sdnfv.github.io/onvm/
Other
263 stars 135 forks source link

Incorrect packet information being printed by UDP helper function #203

Closed rohit-mp closed 4 years ago

rohit-mp commented 4 years ago

Bug Report

Current Behavior On generating UDP packets using Pktgen, the src_port and dst_port values do not match as depicted by an NF (do_stats_display) and Pktgen.

Expected behavior/code The src_port and dst_port values should be consistent.

Steps to reproduce Generate UDP packets using Pktgen on one node and run simple_forward NF with service ID 1 on the other node. The config used to generate packets in the lua script:

pktgen.set_mac("0", "00:00:00:00:01:02"); 
pktgen.set_ipaddr("0", "dst", "10.0.1.2");
pktgen.set_ipaddr("0", "src", "10.0.1.1/24");
pktgen.set_proto("all", "udp");
pktgen.set_type("all", "ipv4");

pktgen.set("all", "size", 64)
pktgen.set("all", "burst", 32);
pktgen.set("all", "sport", 1234);
pktgen.set("all", "dport", 1234);
pktgen.set("all", "count", 100000000);
pktgen.set("all", "rate",100);

pktgen.vlan_id("all", "start", 1);

Environment

Possible Solution The values passed to the print statements in the following lines should be converted from big endian to CPU order. https://github.com/sdnfv/openNetVM/blob/440ac6b28ac91d6e9e68e67f9465001dcf77c4af/onvm/onvm_nflib/onvm_pkt_helper.c#L270-L273

Additional context/Screenshots

Screenshot from 2020-04-08 19-11-39

The Pktgen output is seen on the left side and the simple_forward output on the right. The src_port and dst_port denoted by both are not the same.

dennisafa commented 4 years ago

Thanks, good find!

Yongeverhuang commented 4 years ago

Hello, i meet another question in this. Environment

OS: Ubuntu onvm version: latest dpdk version: v18.11 other info:

when i config the lua script:

pktgen.set_mac("0", "6c:92:bf:ba:95:6f"); pktgen.set_ipaddr("0", "dst", "10.100.3.10"); pktgen.set_ipaddr("0", "src", "10.100.3.1");

pktgen.set_proto("all", "UDP"); pktgen.set_type("all", "ipv4");

pktgen.set("all", "size", 64) pktgen.set("all", "burst", 32); pktgen.set("all", "sport", 1234); pktgen.set("all", "dport", 5678); pktgen.set("all", "count", 100000000); pktgen.set("all", "rate",100);

pktgen.vlan_id("all", "start", 1);

Then run ./run-pktgen.sh 1 ,get the result :

捕获

There is difference in Red circled place, no mac and ip address. how to correct it?