From owner-freebsd-net@FreeBSD.ORG Mon Dec 23 10:16:30 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56C0D754 for ; Mon, 23 Dec 2013 10:16:30 +0000 (UTC) Received: from mail-vc0-x22a.google.com (mail-vc0-x22a.google.com [IPv6:2607:f8b0:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12AB11DD7 for ; Mon, 23 Dec 2013 10:16:29 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id la4so2753389vcb.15 for ; Mon, 23 Dec 2013 02:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=ivEhfPzfpgNP6IQojSdOQb6l5KDcacJ80dDBF67yolQ=; b=dFdVab9ObISSrtjSBWLCD1OkONP78lX5f0oBlL2Mx3QgkxEs/8NvjecGVIyGS8B5Zj fhO24V7kiHIIOCZCDgg7O/r0/sXydK5fQ9NfhkU5Bce/LGONsJEOI6+jk7wQ1+2Owfw/ wTmcOZx4/WIbITf7xSO38XMDlsXeK/u7KEEz9z8a5fItusAjpzSqlPk3mvDraXYjoCHS cDQwloAP8MKDZApSSN3X2iZB4bLIgvBsft36vysHhqoxbHzKU6h9O/OdepFuK2/XJEng GJAdQQ06s92+0DT795shmYBzZFvMV3JcYyFa0rGWZm1QvbeD9dso3UuEeEy5Xlj9sxv8 Mbbw== X-Received: by 10.220.159.4 with SMTP id h4mr13017711vcx.1.1387793789159; Mon, 23 Dec 2013 02:16:29 -0800 (PST) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.58.123.5 with HTTP; Mon, 23 Dec 2013 02:16:09 -0800 (PST) From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Date: Mon, 23 Dec 2013 11:16:09 +0100 X-Google-Sender-Auth: Hgva0vM6Cy1GbZbXZMbGuzomDEo Message-ID: Subject: Problems with netmap pkt-gen (ip range and packet counter) To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 10:16:30 -0000 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