|
1 | 1 | # Test Data Blaster |
2 | 2 |
|
3 | | -The Test Data Blaster (T-DB) applications are: |
4 | | -- Data sender / receiver (DSR) |
5 | | -- Statistics and logging monitor |
| 3 | +The Test Data Blaster (T-DB) is an application suite that performs distributed testing, both TCP and UDP (currently the UDP portion is not implemented). There are multiple binaries in the suite: |
| 4 | +- Data sender / receiver (DSR), a TCP and (future) UDP version |
| 5 | +- Statistics and logging monitor, a C++ and (future) Python version |
6 | 6 |
|
7 | | -There are two varieties of the DSR (data sender / receiver), one for TCP/IP and one for UDP/IP. Having separate code bases (and executables) simplifies the command line parameters as well as the internal logic. There is common code, some already factored out in the `shared_test` directory, with additional common code factored out in this (`test_data_blaster`) directory. |
| 7 | +A single instance of the monitor shows statistics from the DSR instances. The monitor is also responsible for shutting down the DSRs. Multiple DSR instances are typically running at the same time. Each TCP DSR instance can be configured for multiple TCP connectors and multiple TCP acceptors at the same time. Each (future) UDP DSR can be configured for multiple senders and receivers at the same time. |
8 | 8 |
|
9 | | -The monitor application is the same for both the TCP/IP DSR and the UDP/IP DSR, and the same monitor instance can be run to monitor TCP and UDP DSR testing at the same time (to handle this use case, a protocol flag is part of the monitor message definition). |
| 9 | +The same monitor instance can be run for both TCP and UDP (the messages sent to the monitor from the DSRs specify whether the test data is being sent over TCP or UDP). |
10 | 10 |
|
11 | | -While the data sender and receiver apps are written in C++, the monitor app can be written in any language (and both a C++ and Python version is expected, with the Python version having a simple GUI display). The monitor message definition is text only, so binary endianness is not a factor. |
| 11 | +While the DSRs are written in C++, the monitor app can be written in any language (and both a C++ and Python version is expected, with the Python version having a simple GUI display). The monitor message definition is text only, so binary endianness is not a factor. |
12 | 12 |
|
13 | | -## Monitor Process |
| 13 | +## Usage |
14 | 14 |
|
15 | | -The T-DB Monitor is run as a server (only). It accepts TCP connections on one port, each connection corresponding to one instance of either a TCP T-DB sender / receiver or a UDP T-DB sender / receiver. |
| 15 | +(Fill in command line usage here - note that typically the monitor is started first.) |
16 | 16 |
|
17 | | -There are no "begin" or "end" data messages, a new incoming TCP connection is the indication that a new DSR instance has started, and the end of the TCP connection is the indication that the DSR instance has ended. |
| 17 | +(Fill in details about expected output.) |
| 18 | + |
| 19 | +(Fill in details about how to trigger shutdown through the monitor.) |
| 20 | + |
| 21 | +## Building Test Data Blaster |
| 22 | + |
| 23 | +All of the C++ components can be built using CMake. |
| 24 | + |
| 25 | +(Fill in details, including single build instructions in Linux, and future Python build instructions.) |
| 26 | + |
| 27 | +## Internals and Design |
| 28 | + |
| 29 | +Having separate code bases (and executables) for the TCP and UDP DSRs simplifies the command line parameters as well as the internal logic. There is no specific technical reason why the DSR couldn't handle both TCP and UDP, but the DSR command line is complicated enough as is |
| 30 | + |
| 31 | +There is (obviously) common code between all of the T-DB C++ components, some from the `shared_test` directory (i.e. shared with the Chops Net IP unit tests), and some factored out in this (`test_data_blaster`) directory. |
| 32 | + |
| 33 | +### Monitor Process |
| 34 | + |
| 35 | +The T-DB Monitor is run as a server (only). It accepts TCP connections on one port, each connection corresponding to one instance of either a TCP DSR or a UDP DSR. |
| 36 | + |
| 37 | +There are no "begin" or "end" data messages that the monitor has to process, a new incoming TCP connection is the indication that a new DSR instance has started, and the end of the TCP connection is the indication that the DSR instance has ended. |
18 | 38 |
|
19 | 39 | The DSR will not send a monitor message for every test message sent between DSR instances. A "modulo" command line parameter specifies how often a monitor message will be sent (for each test data set). (A modulo of 1 would generate one monitor message per test data set message.) |
20 | 40 |
|
21 | 41 | The monitor process will notify all DSR processes to shutdown by sending a shutdown message through each monitor connection. The monitor process will have a user initiated way to send the shutdown messages and end the monitor process. |
22 | 42 |
|
23 | | -### Monitor Message Definition |
| 43 | +#### Monitor Message Definition |
24 | 44 |
|
25 | | -Each message to the Monitor has the following fields: |
| 45 | +Each message from the DSRs to the monitor has the following fields: |
26 | 46 | - DSR name |
27 | 47 | - DSR protocol, either "tcp" or "udp" |
28 | 48 | - Remote endpoint (host, port) |
29 | 49 | - Data direction, either "incoming" or "outgoing" |
30 | 50 | - Current message number |
31 | | -- Total messages expected or to be sent |
32 | | --- with previous field this makes either "100th message out of 10,000 expected / sent" displays possible |
| 51 | +- Total messages expected to be sent (or 0 if incoming messages -- with the previous field this makes "100th message out of 10,000 to be sent" displays possible) |
33 | 52 | - Current message size |
34 | | -- Current message prefix |
35 | | -- Current message body character |
36 | | -- Outgoing queue size (only meaningful for outgoing data) |
| 53 | +- Current message beginning (first 15 characters) |
| 54 | +- Outgoing queue size (will always be 0 for incoming data, and 0 for outgoing data if the receiving end is keeping up) |
37 | 55 |
|
38 | | -Each of the fields is a text string, and the full message is delimited by |
| 56 | +Each of the fields is a text string, and the full message is delimited by (fill in details). |
39 | 57 |
|
40 | 58 | TODO - define a format that makes Python deserialization easy. Specifically, are each of the text fields nul character terminated, or is there a length prefix? Do we want name / value pairs instead of value only fields? Is the end of the message delimited by a LF (line feed) character or CR / LF (carriage return / line feed)? |
41 | 59 |
|
| 60 | +The shutdown message is the only message sent from the monitor to the DSRs and has the following fields: |
| 61 | + |
| 62 | +(Fill in details.) |
42 | 63 |
|
43 | | -## TCP Data Sender Receiver |
| 64 | +### TCP Data Sender Receiver |
44 | 65 |
|
45 | 66 | Each DSR instance can start multiple TCP connectors and multiple TCP acceptors as provided via the command line arguments. |
46 | 67 |
|
47 | 68 | If the DSR instance is configured to send messages (send count > 0), messages are sent when a connection is made. For TCP connectors this is when the connect succeeds. For acceptors it is when each incoming connection is made. Each connection will send out the full set of test messages. |
48 | 69 |
|
49 | | -Degenerate configurations are possible, with infinite message loops or where connection and shutdown timing is not clear. The T-DB is meant to be run by knowledgeable users, not general developers, so no special coding is in the T-DB to protect for bad configurations. |
| 70 | +Degenerate configurations are possible, with infinite message loops or where connection and shutdown timing is not clear. No special coding is in the T-DB to protect for bad configurations. |
50 | 71 |
|
51 | | -The internal data messages uses the binary marshalled message format from the `shared_test` facilities (see `msg_handling.hpp` for specific code). The monitor messages are text based messages with all fields in a string format easy to unmarshall for Python applications. |
| 72 | +The DSR internal data messages uses the binary marshalled message format from the `shared_test` facilities (see `msg_handling.hpp` for specific code). The monitor messages are text based messages with all fields in a string format easy to unmarshall for Python applications. |
52 | 73 |
|
53 | 74 | The general logic flow: |
54 | 75 | - Process command line arguments |
|
0 commit comments