ipgen - Interactive Packet Generator
https://github.com/iij/ipgen/
This presentation material was written by
ryo@iij.ad.jp
Presented by msaitoh@n.oWhat is ipgen?
• ipgen is a packet generator, benchmark,performance measurement tool.

Motivation• We are developing router.
• We must do performance test over and overto tuning IP forwarding and to do tests.
• in so doing, we use various benchmark
programs/boxes.

• ftp, ping –f, iperf, ttcp, nuttcp, etc...
– simple and convenient :-)– sometime they cannot achieve enoughperformance depending on hardware and/ornetwork stack implementation :-(– cannot get good accuracy and detailed
information of results :-(• Proprietary router tester products (SPIRENTcommunications, Ixia, Artiza Networks, etc...)– High reliable benchmarks :-)– very expensive :-(– device busy. most of the time, someone use it.
(EBUSY) :-(• Want to test easily on my desk!
– It’s required to speed-up NetBSD MP network
stack project.

• with reasonable performance, good accuracy
and detailed information of results

ryo@ made it.

exampleloopback test

bridge test (L2 forwarding)# ipgen -T igb1,66:77:88:99:aa:bb -R igb2,00:11:22:33:44:55

exampleL3 forwarding test

# ipgen -T igb1,198.18.0.2,198.18.0.1/24 -R igb2,192.18.1.2,192.18.1.1/24

using FreeBSD netmap
Luigi-san has already written simple 'pkt-gen'program in FreeBSD:tools/tools/netmap

I wrote using examples from it :)copy and paste is the best way toprogramming.

Features• Interactive UI• Drop/Duplicate/Reorder counter• Multiple flows support• Inter Packet Gap support• RFC2544 test
• IPv6 support

drop/duplicate/reorder counter
each packet has a sequence.
ipgen has a bitmap flag internally.
#seq received bitmap--- ------------------------------------------------0: 1111111111111111111111111111111111111111111111111
50: 1111111111111111111111111111111111111111111111111
100: 1111111111111111111100000000000000000000000000000
150: 0000000000000000000000000000000000000000000000000
200: 0000000000000000000000000000000000000000000000000
250: 0000000000000000000000000000000000000000000000000::

#105→#106→#108→#109→#110→

100: 1111111011111000000000000000000000000000000000000^#107 dropped?

#105→#106→#108→#109→#110→#107→#111…
~~~~
100: 1111111111111000000000000000000000000000000000000^#107 not droped. (reordered)#105→#106→#108→#109→#110→#107→#111→#108→~~~~~~~~
100: 1111111111110000000000000000000000000000000000000^#108 duplicate!

ipgen check reordering withconsidering each flow
[A→B #1][A→C #2][A→B #3][A→C #4][A→B #5][A→C #6]

→

[DUT]

→

[A→B #1][A→B #3][A→B #5][A→C #2][A→C #4][A→C #6]#1→#3→#5→#2→#4→#6 ... is this reordered?
this is reordered totally, but
this is not reordered per flow.

ipgen check reordering withconsidering each flow
[A→B #1 ##1]
[A→C #2 ##1]
[A→B #3 ##2] → [DUT][A→C #4 ##2]
[A→B #5 ##3]
[A→C #6 ##3]

[A→B #1 ##1]
[A→B #3 ##2]
→ [A→B #5 ##3]
[A→C #2 ##1]
[A→C #4 ##2]
[A→C #6 ##3]##1→##2→##3→##1→##2→##3
for each flow, not reordered.

Burst transmission problem• E.g., sending packets with 1,000 pps– if the granularity of the internal timer is 1 sec., 1,000 packets are sentin bulk at the beginning in each time slot and remaining period of theslot will be idle

• Finer timer solves the problem?
– No. 1,000 Hz timer can solve the problem on 1,000 pps, but cannot
solve on 100,000 pps• More finer timer?

Inter Packet Gap(aka Inter Frame Gap)
• What is IPG?

Ethernet devices must allow a minimum idle
period between transmission of Ethernet packets.
(from wikipedia)
Inter Packet Gap is the idle period.

on most ethernet device, IPG is configurable.
also Intel's GbE can!

but no API to configure IPG from userland.
I wrote small patch!

This patch can control IPG by sysctl(8)# sysctl dev.igb | grep tipg
dev.igb.5.tipg: 8
dev.igb.4.tipg: 8
dev.igb.3.tipg: 8
dev.igb.2.tipg: 8
dev.igb.1.tipg: 8
dev.igb.0.tipg: 8

Controlling IPG can provide steadytraffic

RFC2544 test
Q. What is RFC2544 test?
A. SEE RFC2544 :)The objective of the test is to determine
the minimum interval between bursts which
the DUT can process with no frame loss.

ipgen supports RFC2544 test mode.
It does binary search to avoid measuring withevery traffic (pps)

An example of binary search. If packet drops
happen, the offered traffic decreases. If nopacket is lost, the offered traffic increases.

Result of ipgen RFC2544 test mode
# ipgen --rfc2544 -T igb2,00:60:e0:5c:4e:e7 ＼-R igb4,00:60:e0:5c:4e:e5

CONCLUSION• We made easy-to-use packet generator• RFC2544 test supported• netmap is very cool!
I hope someone to port netmap to NetBSD :)