Problems with netmap pkt-gen (ip range and packet counter)

Olivier Cochard-Labbé olivier at cochard.me
Mon Dec 23 10:16:30 UTC 2013


Hi,

I've got a first problem using IP source/destination range with netmap
pkt-gen: Only packet that are using the first IP in the range have a
correct checksum.

For example with this command declaring only a range of 2 IP addresses as
destination:
#pkt-gen -f tx -i ix0 -n 10000000 -l 60 -d 2.3.3.1-2.3.3.2 -D
a0:36:9f:1e:28:14 -s 1.3.3.1 -w 8

The receiver machine (just on the other side of a cross-over cable) see
good packet only if destination IP is 2.3.3.1 (the first of the range) and
not 2.3.3.2.

[# tcpdump -pni ix0 -c 10 -v
tcpdump: listening on ix0, link-type EN10MB (Ethernet), capture size 65535
bytes
09:57:03.986224 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986225 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46)
    1.3.3.1.0 > 2.3.3.1.0: UDP, length 18
09:57:03.986226 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986227 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986228 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986228 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986229 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986229 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986230 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46, bad cksum 31a8 (->31a7)!)
    1.3.3.1.0 > 2.3.3.2.0: UDP, length 18
09:57:03.986231 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP
(17), length 46)
    1.3.3.1.0 > 2.3.3.1.0: UDP, length 18


My second problem is with the latest -current version of pkt-gen only: The
first time (and only the first time) I'm using the pk-gen in sender mode
with a max number of packet (-n option) to send: It doesn't stop and
doesn't exit automatically when counter is reached.

Example:

# pkt-gen -f tx -i ix0 -n 1000000000 -l 60 -d 2.3.3.1:2000-2.3.3.1:4000 -D
a0:36:9f:1e:28:14 -s 1.3.3.1 -w 8
extract_ip_range [149] extract IP range from 1.3.3.1
extract_ip_range [196] range is 1.3.3.1:0 to 1.3.3.1:0
extract_ip_range [149] extract IP range from 2.3.3.1:2000-2.3.3.1:4000
extract_ip_range [196] range is 2.3.3.1:2000 to 2.3.3.1:4000
extract_mac_range [203] extract MAC range from a0:36:9f:1e:1e:d8
extract_mac_range [218] a0:36:9f:1e:1e:d8 starts at a0:36:9f:1e:1e:d8
extract_mac_range [203] extract MAC range from a0:36:9f:1e:28:14
extract_mac_range [218] a0:36:9f:1e:28:14 starts at a0:36:9f:1e:28:14
main [1729] mapping 334980 Kbytes
Sending on ix0: 4 queues, 1 threads and 1 cpus.
1.3.3.1 -> 2.3.3.1 (a0:36:9f:1e:1e:d8 -> a0:36:9f:1e:28:14)
main [1788] Sending 512 packets every  0.000000000 s
main [1790] Wait 8 secs for phy reset
main [1792] Ready...
start_threads [1270] memsize is 327 MB
start_threads [1273] nifp flags 0x0
sender_body [901] start
sender_body [978] drop copy
main_thread [1335] 12754188 pps (12772733 pkts in 1001454 usec)
main_thread [1335] 12829290 pps (12854961 pkts in 1002001 usec)
main_thread [1335] 12833261 pps (12846107 pkts in 1001001 usec)
main_thread [1335] 12833273 pps (12858914 pkts in 1001998 usec)
main_thread [1335] 12829813 pps (12849135 pkts in 1001506 usec)
main_thread [1335] 12831922 pps (12851093 pkts in 1001494 usec)
main_thread [1335] 12835398 pps (12861094 pkts in 1002002 usec)
(...)
main_thread [1335] 12830105 pps (12850736 pkts in 1001608 usec)
main_thread [1335] 12828343 pps (12846187 pkts in 1001391 usec)
main_thread [1335] 12823898 pps (13221464 pkts in 1031002 usec)
main_thread [1335] 12835396 pps (12848206 pkts in 1000998 usec)
main_thread [1335] 12828231 pps (12841085 pkts in 1001002 usec)
main_thread [1335] 12831354 pps (12856978 pkts in 1001997 usec)
main_thread [1335] 8336696 pps (8345099 pkts in 1001008 usec)
main_thread [1335] 0 pps (0 pkts in 1034995 usec)
main_thread [1335] 0 pps (0 pkts in 1040276 usec)
main_thread [1335] 0 pps (0 pkts in 1063222 usec)
main_thread [1335] 0 pps (0 pkts in 1000508 usec)
main_thread [1335] 0 pps (0 pkts in 1055996 usec)
main_thread [1335] 0 pps (0 pkts in 1063497 usec)
main_thread [1335] 0 pps (0 pkts in 1000499 usec)
main_thread [1335] 0 pps (0 pkts in 1001006 usec)
main_thread [1335] 0 pps (0 pkts in 1014997 usec)
^C
=> And it continue forever displaying "0 pps"
But if I break it and re-start it: it will stop correctly the next times.

My hardware is: Intel 10-Gigabit X540-AT on 11.0-CURRENT r259646M.

Regards,

Olivier


More information about the freebsd-net mailing list