summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-12-23netsniff-ng 0.5.8-rc5v0.5.8-rc5Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-12-18debian: compile fix for programs using ncursesJesper Dangaard Brouer3-6/+9
For some reason the Debian ncurses version does not contain a ncurses.pc pkg-config file. Fix this by echoing "-lncurses" if the command fails: pkg-config --libs ncurses This fix will make ifpps compile on Debian Squeeze 6.0.8. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-12-18debian: define SPEED_UNKNOWN if missing in linux/ethtool.hJesper Dangaard Brouer1-0/+4
Debian's version of linux/ethtool.h seems to be outdated and does not contain define SPEED_UNKNOWN, fix this by a manual define. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-12-12trafgen: take advantage of PACKET_QDISC_BYPASS sock optionJesper Dangaard Brouer5-2/+40
Since Linux 3.14, the kernel supports a socket option PACKET_QDISC_BYPASS, which trafgen enables by default. That allow us to bypass the kernels normal qdisc (traffic control) layer. An option -q, --qdisc-path is added to allow enabling the qdisc path explicity, useful for testing purposes. This will be avail in kernels >= 3.14 via commit d346a3fae3 (packet: introduce PACKET_QDISC_BYPASS socket option). Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-12-11trafgen: speedup TX only path by avoiding kernel packet_rcv() callJesper Dangaard Brouer7-6/+20
The tool trafgen is used in a pktgen style transmit only scenario. We discovered a performance bottleneck in the kernel, when running trafgen, where the kernel stalled on a lock in packet_rcv(). This call is unnecessary for trafgen given its transmit only nature. This packet_rcv() call can, easily be avoided by instructing the RAW/PF_PACKET socket, to not listen to any protocols (by passing protocol argument zero, when creating the socket). The performance gain is huge, increasing performance from approx max 2Mpps to 12Mpps, basically causing trafgen to scale with the number of CPUs. Following tests were run on a 2xCPU E5-2650 with Intel 10Gbit/s ixgbe: Trafgen using sendto() syscall via parameter -t0: * # CPUs -- *with* -- *without* packet_rcv() call * 1 CPU == 1,232,244 -- 1,236,144 pkts/sec * 2 CPUs == 1,592,720 -- 2,593,620 pkts/sec * 3 CPUs == 1,635,623 -- 3,692,216 pkts/sec * 4 CPUs == 1,567,768 -- 4,102,866 pkts/sec * 5 CPUs == 1,700,270 -- 5,151,489 pkts/sec * 6 CPUs == 1,762,392 -- 6,124,512 pkts/sec * 7 CPUs == 1,850,139 -- 7,120,496 pkts/sec * 8 CPUs == 1,770,909 -- 8,058,710 pkts/sec * 9 CPUs == 1,721,072 -- 8,963,192 pkts/sec * 10 CPUs == 1,359,157 -- 9,584,535 pkts/sec * 11 CPUs == 1,175,520 -- 10,498,038 pkts/sec * 12 CPUs == 1,075,867 -- 11,189,292 pkts/sec * 13 CPUs == 1,012,602 -- 12,048,836 pkts/sec * [...] * 20 CPUs == 1,030,446 -- 11,202,449 pkts/sec Trafgen using mmap() TX tpacket_v2 (default) * # CPUs -- *with* -- *without* packet_rcv() call * 1 CPU == 920,682 -- 927,984 pkts/sec * 2 CPUs == 1,607,940 -- 2,061,406 pkts/sec * 3 CPUs == 1,668,488 -- 2,979,463 pkts/sec * 4 CPUs == 1,423,066 -- 3,169,565 pkts/sec * 5 CPUs == 1,507,708 -- 3,910,756 pkts/sec * 6 CPUs == 1,555,616 -- 4,625,844 pkts/sec * 7 CPUs == 1,560,961 -- 5,298,441 pkts/sec * 8 CPUs == 1,596,092 -- 6,000,465 pkts/sec * 9 CPUs == 1,575,139 -- 6,722,130 pkts/sec * 10 CPUs == 1,311,676 -- 7,114,202 pkts/sec * 11 CPUs == 1,157,650 -- 7,859,399 pkts/sec * 12 CPUs == 1,060,366 -- 8,491,004 pkts/sec * 13 CPUs == 1,012,956 -- 9,269,761 pkts/sec * [...] * 20 CPUs == 955,716 -- 8,653,947 pkts/sec It is fairly strange that the mmap() version runs slower than the sendto() version. This is likely another performance problem related to mmap() which seems worth fixing. Note, that the mmap() version speed can be improved by reducing the default --ring-size to around 1-2 MiB. But this does not fix general trend with mmap() performance. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-11-25trafgen: inherit netsniff-ng's -H -Q optionsDaniel Borkmann3-3/+32
Also make these options available to trafgen. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-11-25trafgen: Check return value of system()Tobias Klauser1-1/+2
Check the return value of system() when invoking CPP in the BPF parser and bail out in case of an error. This fixes the following compiler warning: trafgen_parser.y:598:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-11-25bpfc: Check return value of system()Tobias Klauser1-1/+2
Check the return value of system() when invoking CPP in the BPF parser and bail out in case of an error. This fixes the following compiler warning: bpf_parser.y:754:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-11-24man: bpfc: corrected sentence by adding the word "other"Jon Schipp1-2/+2
When viewing the bpfc man page I noticed a mistake saying that the BPF compiler included in the pcap library is the *only* compiler. I changed it to say the *only other* compiler since bpfc is also a BPF compiler. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-11-24ifpps, flowtop: Fix DSO ncurses terminal interface linking problemTeguh2-1/+3
Add LDFLAGS for libtinfo for cases where it is separate from ncurses. [tklauser: Whitespace fixes in ifpps/Makefile and added patch description] Signed-off-by: Teguh <info@egeektronic.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-11-18trafgen: don't bother about device going down, just continue sendingDaniel Borkmann1-2/+2
If we loose carrier, don't bother about panic'ing, but continue sending! Only exit in case we're doing a smoke test. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-10-15trafgen: set interpacket gap in time units (s/ms/us/ns)Jon Schipp3-21/+51
Add ability to set IGP in time units in seconds, milliseconds, microseconds, and nanoseconds by appending a postfix to --gap e.g. --gap 100ms. Also, update the man page and trafgen.zsh to reflect the changes. [Fix whitespaces, coding style and minor wording changes -- tklauser] Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-11bpfc: alias xt_bpf to tcDaniel Borkmann1-2/+3
Alias output format for tc/xt_bpf. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-10-10netsniff-ng: Don't modify optarg/argvTobias Klauser1-2/+0
We shouldn't modify optarg (and thus argv) since it's e.g. used to display the commandline string in `ps'. Since strtoul() reads until it encounters the first non-numeric character and ignores the rest, we can just revert from setting a NULL byte after the numeric part of the string. Reported-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-10netsniff-ng: Use strtoul() instead of strtol() for unsigned longTobias Klauser1-4/+4
If setting an unsigned long variable, use strtoul() instead of strtol(). Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-07build: Create GPG signatures as part of release targetTobias Klauser2-1/+10
Create detached ASCII format GPG signatures for the to be released tarballs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-07netsniff-ng 0.5.8-rc4v0.5.8-rc4Tobias Klauser1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-02ifpps: Simplify logic wrt. omit_header in term_main()Tobias Klauser1-6/+3
We can reuse the omit_header variable to get rid of the existing variable 'first', which was used to make sure the header gets only printed once at the beginning. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-02ifpps: Mark omit_header parameter to screen_main() as unusedTobias Klauser1-1/+1
Otherwise we get a warning when compiling with "-W -Wall". Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-02ifpps: min: minor: Keep options sorted alphabeticallyTobias Klauser2-6/+6
Keep the options sorted alphabetically, argument options first. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-02ifpps: zsh: Add -o optionTobias Klauser1-0/+1
Add the -o/--omit-header option to ZSH autocompletion. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-02netsniff-ng: modify mmap option in usage to be grammatically correctJon Schipp1-1/+1
Incorrect usage of "i.e." leads one to believe that replaying is possible only. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-02ifpps: man: grammar and typo editsJon Schipp1-3/+3
Removed, word "be", which was seen twice and removed unnecessary comma. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-10-02ifpps: man: document new option to omit CSV headerJon Schipp1-0/+3
Manual page entry for option -c|--omit-header. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-10-02ifpps: add option that omits CSV headerJon Schipp1-6/+16
Adds option -o|--omit-header which does not print the CSV header e.g. when the user does not need it. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-30netsniff-ng: Display pcap I/O method in verbose modeTobias Klauser2-3/+6
If a user accidentially specifies more than one of --mm/--sg/--clrw, the option specified last will be used - as expected from standard command line tools. In order to still prevent users from being confused by this, explicitely display the pcap I/O method used in verbose mode. In order for the output to be more user-friendly, actually write out the method names in const char *pcap_ops_group_to_str, which isn't used anywhere else anyway. Suggested-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-09-23trafgen: remove inner loopDaniel Borkmann1-31/+31
Get rid of inner loop in fast path. This simplifies code and readability. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-19doc: readme: give note about what tools are still experimentalDaniel Borkmann1-2/+5
We still have to get curvetun and mausezahn in line with the rest of the landscape, as they are not ready and in a quality we wish they would be. Therefore, mark and document them as experiemental for now until they are fixed up. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-19doc: authors: moved Tobias one upDaniel Borkmann1-1/+1
Nothing changes in that regard, Tobias and myself are both maintaining and continue to do so on one and the same level. Tobias does an awesome job, so this should be credited to him right here! Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-12trafgen: combine likely conditionsDaniel Borkmann1-2/+2
Combine multiple likely conditions into one. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-09ifpps: correct calculation of line rate percentageTobias Klauser1-2/+2
The line rate is given in Mbit rather than MiB (in which {rx,tx}_bytes were converted). Correct the calculation by converting {rx,tx}_bytes to Mbit: (n bytes * 8 bits per byte) / 1000^2 = (n bytes) / 125000 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-09-06bpfc: add gnu as style %-register prefixDaniel Borkmann3-3/+71
Let a and x register also be addressed as %x and %a. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-05ifpps: zsh: add -P optionDaniel Borkmann1-0/+1
Add an entry for autocompletion support. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-05ifpps: man: add -P optionDaniel Borkmann1-0/+3
Add a man page entry for the new -P option. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-05ifpps: make display of line rate percentage optionalTobias Klauser1-4/+11
In order to not to clutter the display too much, make the display of the percentage of the theoretical line rate dependent on a command line option. Suggested-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-09-04ifpps: show percentage of theoretical line-rateTobias Klauser1-0/+17
Also show the percentage of the (theoretical) line rate, not just the current rate. Suggested-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-09-04ifpps: Reuse device bitrate for screen_header()Tobias Klauser1-3/+2
Instead of issuing another call to device_bitrate(), reuse the the value acquired in screen_update() and pass it to screen_header(). Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-09-03bpf: ldi,ldxi: allow for '#' prefix in numbersDaniel Borkmann1-2/+6
For consistency, allow for '#' prefix in numbers, which we currently do not do. So keep old mode as compatibility to not break current programs, and add new one with '#' prefix. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-09-02netsniff-ng: Remove unnecessary fmemset() of struct statTobias Klauser1-1/+0
The struct stat is filled by the call to stat(2) in the next line, so there is no need to explicitely set it to 0 before. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-09-01man: netsniff-ng: add note about netsniffJon Schipp1-0/+4
Add a note to the man-page that there's a other tool that is unrelated to netsniff-ng. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-08-30netsniff-ng: Simplify dump file creation logicTobias Klauser1-9/+5
Instead of using goto, just check stats if stat() returned 0 and used ctx->dump_dir afterwards. This makes the logic a bit easier to follow. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-30ifpps: Skip reading IRQ number from /proc/interruptsTobias Klauser1-7/+5
We don't use the IRQ number we read from /proc/interrupts, so just skip it while reading. This also allows us to drop the irq_nr member from struct ifstat. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-29ifpps: Don't bug out if interface went downTobias Klauser1-2/+5
In case the interface ifpps is running on went down, ifpps bugged out because the stats didn't look plausible anymore, due to the IRQ count being reset: ifpps: ifpps.c:563: stats_diff: Assertion `!((new->irqs[i] - old->irqs[i]) > (new->irqs[i]))' failed Fix this by setting the difference to 0 in this case. ifpps will thus display a irqs/t value of 0 instead of bugging out. This fixes #74. Reported-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-29ifpps: Use unsigned int to store number of cpusTobias Klauser1-23/+24
The number of CPUs can never be negative and get_number_cpus() returns unsigned int too, so consistently conver all variables holding a CPU number or number of CPUs to type unsigned int. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-23conf: oui: update oui.confTobias Klauser1-131/+325
Update OUI entries using oui-update.py Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-23oui-update: minor: Fix typo in error messageTobias Klauser1-1/+1
s/Eror/Error/ Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-21build: announcement: also add v prefix to checkout commandDaniel Borkmann1-1/+1
We also need to add a v prefix for the version tag to the checkout command, as similarly done for the GPG verification. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-08-21netsniff-ng 0.5.8-rc3v0.5.8-rc3Tobias Klauser1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-21ring_{rx,tx}: verbose: output version and v3 specific infoDaniel Borkmann2-4/+10
Kevin says: With netsniff-ng 0.5.8-rc2+, when I run the below packet capture session, the output seems to imply that 64K of memory is being allocated per frame, which does not look like what I want since my interface MTU is only 1500. This appears to be severely limiting the number of frames I can fit into my packet capture ring. As TPACKET_V3 is used in capturing to pcap files, frames are written continuously to the ring, thus the above will give a wrong impression to the user. Therefore, output such information in verbose mode differently when TPACKET_V3 is being used, as it works block-wise. Reported-by: Kevin Branch <branchnetconsulting@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-08-21build: minor: Mention proper versioned tag in release announcementTobias Klauser1-1/+1
The tags created by the 'release' target have a 'v' prefix, so add it to the verification command mentioned in the generated release message. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>