" from the
command line. This overrides compiled-in defaults and options
read from the configuration file.
realm=REALM
Set the realm name
-V|version
Prints the program version number.
Credential Options
simple-bind-dn=DN
DN to use for a simple bind
password=PASSWORD
Password
-U USERNAME|username=USERNAME
Username
-W WORKGROUP|workgroup=WORKGROUP
Workgroup
-k|kerberos
Try to authenticate with kerberos. Only useful in an Active
Directory environment.
ipaddress=IPADDRESS
IP address of the server
-P|machine-pass
Use stored machine account password.
OPERATIONS
Generating a traffic-summary file
To use this tool, you need either a traffic-summary file or a
traffic-model file. To generate either of these files, you will need a
packet capture of actual Samba activity on your network.
Use Wireshark to take a packet capture on your network of the traffic
you want to generate. For example, if you want to simulate lots of
users logging on, then take a capture at 8:30am when users are logging
in.
Next, you need to convert your packet capture into a traffic summary
file, using trafficsummary.pl. Basically this removes any sensitive
information from the capture and summarizes what type of packet was
sent and when.
Refer to the trafficsummary.pl help help for more details, but the
basic command will look something like:
tshark -r capture.pcapng -T pdml | trafficsummary.pl >
traffic-summary.txt
Replaying a traffic-summary file
Once you have a traffic-summary file, you can use it to generate
traffic. The trafficreplay tool gets passed the traffic-summary file,
along with the full DNS hostname of the DC being tested. You also need
to provide some user credentials, and possibly the Samba realm and
workgroup (although the realm and workgroup may be determined
automatically, for example from the /etc/smb.conf file, if one is
present). E.g.
trafficreplay traffic-summary.txt my-dc.samdom.example.com
-UAdmin%password -W samdom realm=samdom.example.com
fixed-password=blahblah123!
This simply regenerates Samba activity seen in the traffic summary. The
traffic is grouped into 'conversations' between a host and the DC. A
user and machine account is created on the DC for each conversation, in
order to allow logon and other operations to succeed. The script
generates the same types of packets as those seen in the summary.
Creating users can be quite a time-consuming process, especially if a
lot of conversations are being generated. To save time, the test users
remain on the DC by default. You will need to run the clean-up option
to remove them, once you have finished generating traffic. Because the
same test users are used across multiple runs of the tool, a consistent
password for these users needs to be used - this is specified by the
fixed-password option.
The benefit of this tool over simply using tcprelay is that the traffic
generated is independent of any specific network. No setup is needed
beforehand on the test DC. The traffic no longer contains sensitive
details, so the traffic summary could be potentially shared with other
Samba developers.
However, replaying a traffic-summary directly is somewhat limited in
what you can actually do. A more flexible approach is to generate the
traffic using a model file.
Generating a traffic-model file
To create a traffic-model file, simply pass the traffic-summary file to
the trafficlearner script. E.g.
trafficlearner traffic-summary.txt -o traffic-model.txt
This generates a model of the Samba activity in your network. This
model-file can now be used to generate traffic.
Replaying the traffic-model file
Packet generation using a traffic-model file uses the same command as a
traffic-summary file, e.g.
trafficreplay traffic-model.txt my-dc.samdom.example.com
-UAdmin%password
By default, this will generate 60 seconds worth of traffic based on the
model. You can specify longer using the duration parameter.
The traffic generated is an approximation of what was seen in the
network capture. The traffic generation involves some randomness, so
running the same command multiple times may result in slightly
different traffic being generated.
As well as changing how long the model runs for, you can also change
how many conversations get generated and how fast the traffic gets
replayed. To roughly double the number of conversations that get
replayed, use scale-traffic=2 or to approximately halve the number
use scale-traffic=0.5. To approximately double how quickly the
conversations get replayed, use replay-rate=2, or to halve this use
replay-rate=0.5
For example, to generate approximately 10 times the amount of traffic
seen over a two-minute period (based on the network capture), use:
trafficreplay traffic-model.txt my-dc.samdom.example.com
-UAdmin%password fixed-password=blahblah123! scale-traffic=10
duration=120
Scaling the number of users
The performance of a Samba DC running a small subset of test users will
be different to a fully-populated Samba DC running in a network. As the
number of users increases, the size of the DB increases, and a very
large DB will perform worse than a smaller DB.
To increase the size of the Samba DB, this tool can also create extra
users and groups. These extra users are basically 'filler' for the DB.
They won't actually be used to generate traffic, but they may slow down
authentication of the test users.
For example, to populate the DB with an extra 5000 users (note this
will take a while), use the command:
trafficreplay my-dc.samdom.example.com -UAdmin%password
generate-users-only fixed-password=blahblah123!
number-of-users=5000
You can also create groups and assign users to groups. The users can be
randomly assigned to groups - this includes any extra users created as
well as the users that map to conversations. Use either
average-groups-per-user or group-memberships to specify how many
group memberships should be assigned to the test users.
For example, to assign the users in the replayed conversations into 10
groups on average, use a command like:
trafficreplay traffic-model.txt my-dc.samdom.example.com
-UAdmin%password fixed-password=blahblah123! generate-users-only
number-of-groups=25 average-groups-per-user=10
The users created by the test will have names like STGU-0-xyz. The
groups generated have names like STGG-0-xyz.
VERSION
This man page is complete for version 4.8.3 of the Samba suite.
SEE ALSO
trafficlearner(7).
AUTHOR
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.
The trafficreplay tool was developed by the Samba team at Catalyst IT
Ltd.
The trafficreplay manpage was written by Tim Beale.
Samba 4.8.3 10/30/2018 TRAFFICREPLAY(7)