Revert "pidl: Use non-existent function dissect_ndr_int64()"
[Samba.git] / docs-xml / manpages / traffic_learner.7.xml
blobb921035e4bd865aaab44148971db19f32fe66f47
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="traffic_learner.7">
5 <refmeta>
6         <refentrytitle>traffic_learner</refentrytitle>
7         <manvolnum>7</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">User Commands</refmiscinfo>
10         <refmiscinfo class="version">&doc.version;</refmiscinfo>
11 </refmeta>
14 <refnamediv>
15         <refname>traffic_learner</refname>
16         <refpurpose>Samba tool to assist with traffic generation.
17         </refpurpose>
18 </refnamediv>
20 <refsynopsisdiv>
21         <cmdsynopsis>
22                 <command>traffic_learner</command>
23                 <arg choice="req">-o OUTPUT_FILE ...</arg>
24                 <arg choice="opt">-h</arg>
25                 <arg choice="opt">--dns-mode {inline|count}</arg>
26                 <arg choice="opt">SUMMARY_FILE</arg>
27                 <arg choice="opt">SUMMARY_FILE ...</arg>
28         </cmdsynopsis>
29 </refsynopsisdiv>
31 <refsect1>
32         <title>DESCRIPTION</title>
33         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
34         <manvolnum>7</manvolnum></citerefentry> suite.</para>
36         <para>This tool assists with generation of Samba traffic.
37         It takes a traffic-summary file (produced by
38         <command>traffic_summary.pl</command>) as input and produces a
39         traffic-model file that can be used by <command>traffic_replay</command>
40         for traffic generation.</para>
42         <para>The model file summarizes the types of traffic ('conversations'
43         between a host and a Samba DC) that occur on a network. The model file
44         describes the traffic in a way that allows it to be scaled so that
45         either more (or fewer) packets get sent, and the packets can be sent at
46         a faster (or slower) rate than that seen in the network.</para>
47 </refsect1>
49 <refsect1>
50         <title>OPTIONS</title>
52         <variablelist>
54         <varlistentry>
55         <term>-h|--help</term>
56         <listitem><para>
57         Print a summary of command line options.
58         </para></listitem>
59         </varlistentry>
61         <varlistentry>
62         <term>SUMMARY_FILE</term>
63         <listitem><para>
64         File containing a network traffic-summary. The traffic-summary file
65         should be generated by <command>traffic_summary.pl</command> from a
66         packet capture of actual network traffic.
67         More than one file can be specified, in which case the traffic will
68         be combined into a single traffic-model. If no SUMMARY_FILE is
69         specified, this tool will read the traffic-summary from STDIN, i.e.
70         you can pipe the output from traffic_summary.pl directly to this tool.
71         </para></listitem>
72         </varlistentry>
74         <varlistentry>
75         <term>-o|--out OUTPUT_FILE</term>
76         <listitem><para>
77         The traffic-model that is produced will be written to this file. The
78         OUTPUT_FILE can then be passed to <command>traffic_replay</command>
79         to generate (and manipulate) Samba network traffic.
80         </para></listitem>
81         </varlistentry>
83         <varlistentry>
84         <term>--dns-mode [inline|count]</term>
85         <listitem><para>
86         How DNS traffic should be handled by the model.
87         </para></listitem>
88         </varlistentry>
90         </variablelist>
91 </refsect1>
93 <refsect1>
94         <title>EXAMPLES</title>
96         <para>To take a traffic-summary file and produce a traffic-model
97         file, use:</para>
99         <para><command>traffic_learner traffic-summary.txt
100         -o traffic-model.txt</command></para>
102         <para>To generate a traffic-model from a packet capture, you can
103         pipe the traffic summary to STDIN using:</para>
105         <para><command>tshark -r capture.pcapng -T pdml |
106         traffic_summary.pl | traffic_learner -o traffic-model.txt</command></para>
107 </refsect1>
109 <refsect1>
110         <title>OUTPUT FILE FORMAT</title>
112         <para>The output model file describes a Markov model estimating the
113         probability of a packet occurring given the last two packets.</para>
115         <para>The count of each continuation after a pair of
116         successive packets is stored, and the ratios of these counts
117         is used to calculate probabilities for the next packet.
118         </para>
120         <para>The model is stored in JSON format, and also contains
121         information about the packet rate and DNS traffic rate.</para>
124 <refsect2>
125         <title>Example ngram listing</title>
126         <para>The following listing shows a contrived example of a single ngram entry.
127         </para>
129         <programlisting>
130           "ngrams": {
131              "ldap:0\tdcerpc:11": {
132                  "lsarpc:77": 1,
133                  "ldap:2": 370,
134                  "ldap:3": 62,
135                  "wait:3": 2,
136                  "-": 1
137              }, <lineannotation>[...]</lineannotation>
138           }
139         </programlisting>
140         <para> This counts the observed continuations after an ldap
141         packet with opcode 0 (a bind) followed by a dcerpc packet with
142         opcode 11 (also a bind). The most common next packet is
143         "<code>ldap:2</code>" which is an unbind, so this is the most
144         likely packet type to be selected in replay. At the other
145         extreme, lsarpc opcode 77 (lookup names) has been seen only
146         once, and it is unlikely but possible that this will be
147         selected in replay.
148         </para>
149         <para> There are two special packet types here.
150         "<code>wait:3</code>" refers to a temporary pause in the
151         conversation, where the "<code>3</code>" pseudo-opcode indicates
152         the length of the wait on an exponential scale. That is, a
153         "<code>wait:4</code>" pause would be about 2.7 times longer that
154         a "<code>wait:3</code>", which in turn would be similarly longer
155         than a "<code>wait:2</code>".
156         </para>
158         <para>The other special packet is "-", which represents the
159         limit of the conversation. In the example, this indicates that
160         one observed conversation ended after this particular ngram.
161         This special opcode is also used at the beginning of
162         conversations, which are indicated by the ngram "<code>-\t-</code>".
163         </para>
166 </refsect2>
167 </refsect1>
169 <refsect1>
170         <title>VERSION</title>
172         <para>This man page is complete for version &doc.version; of the Samba
173         suite.</para>
174 </refsect1>
176 <refsect1>
177         <title>SEE ALSO</title>
178         <para>
179         <citerefentry>
180         <refentrytitle>traffic_replay</refentrytitle><manvolnum>7</manvolnum>
181         </citerefentry>.
182         </para>
183 </refsect1>
185 <refsect1>
186         <title>AUTHOR</title>
188         <para>The original Samba software and related utilities
189         were created by Andrew Tridgell. Samba is now developed
190         by the Samba Team as an Open Source project similar
191         to the way the Linux kernel is developed.</para>
193         <para>The traffic_learner tool was developed by the Samba team at
194         Catalyst IT Ltd.</para>
196         <para>The traffic_learner manpage was written by Tim Beale.</para>
197 </refsect1>
199 </refentry>