<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<!-- conversion to man: 
  xsltproc  /usr/apps/docbook/xsl/1.67.2/manpages/docbook.xsl pg3.8.dbk
-->
<refentry id="pg3">
    <refentryinfo>
        <productname>Linux</productname>
        <title>System Administration</title>
        <date>27 September 2002</date>
    </refentryinfo>
	<refmeta>
		<refentrytitle>pg3</refentrytitle>
		<manvolnum>8</manvolnum>
	</refmeta>
	<refnamediv>
		<refname>pg3</refname>
		<refname>ipg</refname>
		<refname>pgset</refname>
		<refpurpose>send stream of UDP packets</refpurpose>
	</refnamediv>
	<refsynopsisdiv>
		<cmdsynopsis>
			<command>source</command> <arg choice="plain">ipg</arg>
		</cmdsynopsis>
		<cmdsynopsis>
			<command>pg</command>
		</cmdsynopsis>
		<cmdsynopsis>
			<command>pgset</command>
			<arg choice="plain">
				<replaceable>command</replaceable>
			</arg>
		</cmdsynopsis>
	</refsynopsisdiv>
	
	<refsection>
		
		<title>DESCRIPTION</title>
		
<para><command>ipg</command> is not a program, it is script which should 
be sourced to <command>bash</command>. When sourced it loads module 
<filename>pg3</filename> and exports a few of functions accessible from 
parent shell. These macros are <command>pg</command> to start packet
injection and to get the results of run; and
<command>pgset</command> to setup packet generator.</para>
	
<para><command>pgset</command> can send the following commands to 
module <filename>pg3</filename>:</para>
	
		<variablelist>
			<varlistentry>
				<term>
					<option>odev</option> <replaceable
					>device</replaceable>
				</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</option> <replaceable
					>bytes</replaceable>
				</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</option> <replaceable
					>number</replaceable>
				</term>
				<listitem>
<para>Each packet will contain <replaceable>number</replaceable> 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</replaceable>
					</option>
				</term>
				<listitem>
<para>Send stream of <replaceable>number</replaceable> of packets and
stop after this.</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<option>ipg</option> <replaceable>time</replaceable>
				</term>
				<listitem>
<para>Introduce artificial delay between packets of <replaceable
>time</replaceable> microseconds.</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<option>dst</option> <replaceable
					>ip_address</replaceable>
				</term>
				<listitem>
<para>Select IP destination where the stream is sent to.
Beware, never set this address at random. <command>pg3</command> is not a 
toy, it creates really tough stream. Default value is 0.0.0.0.</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<option>dst</option> <replaceable
					>max_address</replaceable>
				</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>
	</refsection>
	
	<refsection id="pg3.warning">
		
		<title>WARNING</title>
		
<para>When output device is set to some random device different of
hardware Ethernet device, <command>pg3</command> 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>
	</refsection>
	
	<refsection>
		
		<title>AUTHOR</title>
		
<para><command>pg3</command> was written by <address
><firstname>Robert</firstname> <surname>Olsson</surname
><email>robert.olsson@its.uu.se</email></address></para>
	</refsection>
	
	<refsection>
		
		<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>
	</refsection>
	
	<refsection>
		
		<title>AVAILABILITY</title>
		
<para><command>pg3</command> is part 
of <application>iputils</application> package and the latest
versions are available in source form for anonymous
via <ulink
url="ftp://ftp.inr.ac.ru/ip-routing/iputils-current.tar.gz"/>.</para>
	</refsection>
</refentry>

