<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "/usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd" []>

<refentry id="tgn">

  <refentryinfo>
    <date>09 September 2009</date>
  </refentryinfo>

  <refmeta>
    <refentrytitle>tgn</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>tgn</refname>
    <refpurpose>
      a network traffic generator
    </refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>tgn</command>
      <arg choice="opt"><option>-V</option></arg>
      <arg choice="opt"><option>-v</option></arg>
      <arg choice="opt"><option>-l</option></arg>
      <arg choice="opt"><option>-s</option> <replaceable class="option">random seed</replaceable></arg>
      <arg choice="opt"><option>-w</option> <replaceable class="option">PCAP filename</replaceable></arg>
      <arg choice="opt"><option>-o</option> <replaceable class="option">output speaker</replaceable></arg>
      <arg choice="opt"><option>-c</option> <replaceable class="option">packet count</replaceable></arg>
      <arg choice="opt"><option>-h</option></arg>
      <arg choice="opt"><replaceable class="option">PDU definition</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>DESCRIPTION</title>

    <para>
      <command>tgn</command> is a network traffic generator. It is
      command-line interface (CLI) program that does the same
      thing as the <command>send_network</command> command of the <command>Network Expect</command>
      framework. Refer to nexp<manvolnum>1</manvolnum> for additional details
      regarding the <command>send_network</command> command.
    </para>

    <para>
      The only mandatory option is a PDU definition.
    </para>

    <para>
      The <option>-c</option> switch allows to specify the number of packets
      to send. If <option>-c</option> is not provided then the number of
      packets to send is calculated automatically based on the PDU definition.
    </para>

    <para>
      <option>-V</option> causes <command>tgn</command> to
       print its version number and exit.
    </para>

    <para>
      The <option>-s</option> flag allows to specify a random seed
      that will cause predicatibility of pseudo-random numbers
      generated by <command>tgn</command> during execution
      of a script. In cases where <command>tgn</command> is
      used as a protocol fuzzer, this option is useful to be able to
      re-generate a specific test case.
    </para>

    <para>
      <option>-v</option> increases the verbosity level. Additional information
      may be displayed when the verbosity level is higher.
    </para>

    <para>
      The <option>-l</option> flag causes <command>tgn</command> to
      display all available network speakers and exit. See
      nexp<manvolnum>1</manvolnum> for a discussion of network speakers.
    </para>

    <para>
      The <option>-o</option> flag allows to select a specific network
      speaker for output. Use the <option>-l</option> option to list
      available speakers. By default, the "ip" speaker (kernel-routed
      IP packet delivery) is tried first and if it is not available,
      which can happen if <command>tgn</command> is not run with
      root privileges, the "hex" speaker is used.
    </para>

    <para>
      The PDU definition is a string that defines a PDU. It uses
      libpbuild PDU syntax.
    </para>

  </refsect1>

  <refsect1>
    <title>EXAMPLES</title>

        <programlisting>
shell# tgn -o eth0 "ip(dst = 192.168.1.1)/icmp-echo(id = &#0039;random&#0039;)"</programlisting>

        <programlisting>
shell# tgn "ip(src = 192.168.0.1, dst = &lt;192.168.0.10, 192.168.0.11>,ttl = &lt;1, 2>)/" \
"tcp(src = &#0039;random&#0039;, dst = 22..25, window = 16384,syn, seq = &#0039;random&#0039;, ack-seq = 0)"</programlisting>

	<programlisting>
shell# tgn -w /tmp/cap -c 5 "ether()/ip(dst = 1.2.3.4++)/icmp-echo(seq = 0++)" \
&amp;&amp; wireshark /tmp/cap</programlisting>
  </refsect1>

  <refsect1>
    <title>BUGS</title>

    <para>
      <command>tgn</command> has not been ported to
      Microsoft Windows.
    </para>

  </refsect1>

  <refsect1>
    <title>VERSION</title>

    <para>This man page is correct for version 1.0 of <command>tgn</command>.
    </para>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>
    
    <para>
      nexp-numspec<manvolnum>1</manvolnum>,
      nexp-payload<manvolnum>1</manvolnum>,
      nexp-ether<manvolnum>5</manvolnum>,
      nexp-gre<manvolnum>5</manvolnum>,
      nexp-ip<manvolnum>5</manvolnum>,
      nexp-mpls<manvolnum>5</manvolnum>,
      nexp<manvolnum>1</manvolnum>
    </para>
  </refsect1>

  <refsect1>
    <title>AUTHOR</title>
	
    <para>
      <command>Network Expect</command> was written by Eloy Paris
      &lt;peloy@netexpect.org&gt;. However, <command>Network
      Expect</command> borrows ideas from lots of Open Source tools
      like Nemesis, Packit, hping, Expect, and Scapy. The
      <command>Network Expect</command> author is indebted to the
      authors of these tools for their contribution.
    </para>
	
    <para>
      This man page was written by Eloy Paris.
    </para>
  </refsect1>

</refentry>
