| 1 |
'\" t |
| 2 |
.\" Title: traffic_learner |
| 3 |
.\" Author: [see the "AUTHOR" section] |
| 4 |
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> |
| 5 |
.\" Date: 05/28/2026 |
| 6 |
.\" Manual: User Commands |
| 7 |
.\" Source: Samba 4.23.8 |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "TRAFFIC_LEARNER" "7" "05/28/2026" "Samba 4\&.23\&.8" "User Commands" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
traffic_learner \- Samba tool to assist with traffic generation\&. |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.HP \w'\ 'u |
| 34 |
traffic_learner {\-o\ OUTPUT_FILE\ \&.\&.\&.} [\-h] [\-\-dns\-mode\ {inline|count}] [SUMMARY_FILE] [SUMMARY_FILE\ \&.\&.\&.] |
| 35 |
.SH "DESCRIPTION" |
| 36 |
.PP |
| 37 |
This tool is part of the |
| 38 |
\fBsamba\fR(7) |
| 39 |
suite\&. |
| 40 |
.PP |
| 41 |
This tool assists with generation of Samba traffic\&. It takes a traffic\-summary file (produced by |
| 42 |
traffic_summary\&.pl) as input and produces a traffic\-model file that can be used by |
| 43 |
traffic_replay |
| 44 |
for traffic generation\&. |
| 45 |
.PP |
| 46 |
The model file summarizes the types of traffic (\*(Aqconversations\*(Aq between a host and a Samba DC) that occur on a network\&. The model file describes the traffic in a way that allows it to be scaled so that either more (or fewer) packets get sent, and the packets can be sent at a faster (or slower) rate than that seen in the network\&. |
| 47 |
.SH "OPTIONS" |
| 48 |
.PP |
| 49 |
\-h|\-\-help |
| 50 |
.RS 4 |
| 51 |
Print a summary of command line options\&. |
| 52 |
.RE |
| 53 |
.PP |
| 54 |
SUMMARY_FILE |
| 55 |
.RS 4 |
| 56 |
File containing a network traffic\-summary\&. The traffic\-summary file should be generated by |
| 57 |
traffic_summary\&.pl |
| 58 |
from a packet capture of actual network traffic\&. More than one file can be specified, in which case the traffic will be combined into a single traffic\-model\&. If no SUMMARY_FILE is specified, this tool will read the traffic\-summary from STDIN, i\&.e\&. you can pipe the output from traffic_summary\&.pl directly to this tool\&. |
| 59 |
.RE |
| 60 |
.PP |
| 61 |
\-o|\-\-out OUTPUT_FILE |
| 62 |
.RS 4 |
| 63 |
The traffic\-model that is produced will be written to this file\&. The OUTPUT_FILE can then be passed to |
| 64 |
traffic_replay |
| 65 |
to generate (and manipulate) Samba network traffic\&. |
| 66 |
.RE |
| 67 |
.PP |
| 68 |
\-\-dns\-mode [inline|count] |
| 69 |
.RS 4 |
| 70 |
How DNS traffic should be handled by the model\&. |
| 71 |
.RE |
| 72 |
.SH "EXAMPLES" |
| 73 |
.PP |
| 74 |
To take a traffic\-summary file and produce a traffic\-model file, use: |
| 75 |
.PP |
| 76 |
traffic_learner traffic\-summary\&.txt \-o traffic\-model\&.txt |
| 77 |
.PP |
| 78 |
To generate a traffic\-model from a packet capture, you can pipe the traffic summary to STDIN using: |
| 79 |
.PP |
| 80 |
tshark \-r capture\&.pcapng \-T pdml | traffic_summary\&.pl | traffic_learner \-o traffic\-model\&.txt |
| 81 |
.SH "OUTPUT FILE FORMAT" |
| 82 |
.PP |
| 83 |
The output model file describes a Markov model estimating the probability of a packet occurring given the last two packets\&. |
| 84 |
.PP |
| 85 |
The count of each continuation after a pair of successive packets is stored, and the ratios of these counts is used to calculate probabilities for the next packet\&. |
| 86 |
.PP |
| 87 |
The model is stored in JSON format, and also contains information about the packet rate and DNS traffic rate\&. |
| 88 |
.SS "Example ngram listing" |
| 89 |
.PP |
| 90 |
The following listing shows a contrived example of a single ngram entry\&. |
| 91 |
.sp |
| 92 |
.if n \{\ |
| 93 |
.RS 4 |
| 94 |
.\} |
| 95 |
.nf |
| 96 |
"ngrams": { |
| 97 |
"ldap:0\etdcerpc:11": { |
| 98 |
"lsarpc:77": 1, |
| 99 |
"ldap:2": 370, |
| 100 |
"ldap:3": 62, |
| 101 |
"wait:3": 2, |
| 102 |
"\-": 1 |
| 103 |
}, [\&.\&.\&.] |
| 104 |
} |
| 105 |
.fi |
| 106 |
.if n \{\ |
| 107 |
.RE |
| 108 |
.\} |
| 109 |
.PP |
| 110 |
This counts the observed continuations after an ldap packet with opcode 0 (a bind) followed by a dcerpc packet with opcode 11 (also a bind)\&. The most common next packet is "ldap:2" which is an unbind, so this is the most likely packet type to be selected in replay\&. At the other extreme, lsarpc opcode 77 (lookup names) has been seen only once, and it is unlikely but possible that this will be selected in replay\&. |
| 111 |
.PP |
| 112 |
There are two special packet types here\&. "wait:3" refers to a temporary pause in the conversation, where the "3" pseudo\-opcode indicates the length of the wait on an exponential scale\&. That is, a "wait:4" pause would be about 2\&.7 times longer that a "wait:3", which in turn would be similarly longer than a "wait:2"\&. |
| 113 |
.PP |
| 114 |
The other special packet is "\-", which represents the limit of the conversation\&. In the example, this indicates that one observed conversation ended after this particular ngram\&. This special opcode is also used at the beginning of conversations, which are indicated by the ngram "\-\et\-"\&. |
| 115 |
.SH "VERSION" |
| 116 |
.PP |
| 117 |
This man page is complete for version 4\&.23\&.8 of the Samba suite\&. |
| 118 |
.SH "SEE ALSO" |
| 119 |
.PP |
| 120 |
\fBtraffic_replay\fR(7)\&. |
| 121 |
.SH "AUTHOR" |
| 122 |
.PP |
| 123 |
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&. |
| 124 |
.PP |
| 125 |
The traffic_learner tool was developed by the Samba team at Catalyst IT Ltd\&. |
| 126 |
.PP |
| 127 |
The traffic_learner manpage was written by Tim Beale\&. |