<refentry id="pg3">

<refmeta>
<refentrytitle>pg3</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>iputils-&snapshot;</refmiscinfo>
</refmeta>


<refnamediv>
<refname>pg3, ipg, pgset</refname>
<refpurpose>send stream of UDP packets</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>source ipg</command>
</cmdsynopsis>
<cmdsynopsis>
<command>pg</command>
</cmdsynopsis>
<cmdsynopsis>
<command>pgset</command>
<arg choice="req"><replaceable/COMMAND/</arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsect1><title>DESCRIPTION</title>
<para>
<command/ipg/ is not a program, it is script which should be sourced
to <command/bash/. When sourced it loads module <filename/pg3/ and
exports a few of functions accessible from parent shell. These macros
are <command/pg/ to start packet injection and to get the results of run;
and <command/pgset/ to setup packet generator.
</para>

<para>
<command/pgset/ can send the following commands to module <filename/pg3/:
</para>
</refsect1>

<refsect1><title>COMMAND</title>

<variablelist>

 <varlistentry>
  <term><option>odev <replaceable/DEVICE/</option></term>
  <listitem><para>
Name of Ethernet device to test. See
<link linkend="pg3.warning">warning</link> below.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>pkt_size <replaceable/BYTES/</option></term>
  <listitem><para>
Size of packet to generate. The size includes all the headers: UDP, IP,
MAC, but does not account for overhead internal to medium, i.e. FCS
and various paddings.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>frags <replaceable/NUMBER/</option></term>
  <listitem><para>
Each packet will contain <replaceable/NUMBER/ of fragments.
Maximal amount for linux-2.4 is 6. Far not all the devices support
fragmented buffers.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>count <replaceable/NUMBER/</option></term>
  <listitem><para>
Send stream of <replaceable/NUMBER/ of packets and stop after this.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>ipg <replaceable/TIME/</option></term>
  <listitem><para>
Introduce artificial delay between packets of <replaceable/TIME/
microseconds.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>dst <replaceable/IP_ADDRESS/</option></term>
  <listitem><para>
Select IP destination where the stream is sent to.
Beware, never set this address at random. <command/pg3/ is not a toy,
it creates really tough stream. Default value is 0.0.0.0.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>dst <replaceable/MAC_ADDRESS/</option></term>
  <listitem><para>
Select MAC destination where the stream is sent to.
Default value is 00:00:00:00:00:00 in hope that this will not be received
by any node on LAN.
  </para></listitem>
 </varlistentry>

 <varlistentry>
  <term><option>stop</option></term>
  <listitem><para>
Abort packet injection.
  </para></listitem>
 </varlistentry>

</variablelist>
</refsect1>

<refsect1 id="pg3.warning"><title>WARNING</title>
<para>
When output device is set to some random device different
of hardware Ethernet device, <command/pg3/ will crash kernel.
</para>
<para>
Do not use it on VLAN, ethertap, VTUN and other devices,
which emulate Ethernet not being real Ethernet in fact.
</para>
</refsect1>

<refsect1><title>AUTHOR</title>
<para>
<command/pg3/ was written by <ulink url="mailto:robert.olsson@its.uu.se">
Robert Olsson &lt;robert.olsson@its.uu.se&gt;</ulink>.
</para>
</refsect1>

<refsect1><title>SECURITY</title>
<para>
This can be used only by superuser.
</para>
<para>
This tool creates floods of packets which is unlikely to be handled
even by high-end machines. For example, it saturates gigabit link with
60 byte packets when used with Intel's e1000. In face of such stream
switches, routers and end hosts may deadlock, crash, explode.
Use only in test lab environment.
</para>
</refsect1>

<refsect1><title>AVAILABILITY</title>
<para>
<command/pg3/ is part of <filename/iputils/ package
and the latest versions are  available in source form at
<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
</para>
</refsect1>

<![IGNORE[
<refsect1><title>COPYING</title>
<para>
<literallayout>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License Version 2.

This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
 
For more details see the file COPYING in the source
distribution of Linux kernel of version 2.4.
</literallayout>
</para>
</refsect1>
]]>

</refentry>
