Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better documentation for the TGen state machine and timings #30

Open
robgjansen opened this issue Feb 18, 2022 · 0 comments
Open

Add better documentation for the TGen state machine and timings #30

robgjansen opened this issue Feb 18, 2022 · 0 comments

Comments

@robgjansen
Copy link
Member

robgjansen commented Feb 18, 2022

TGen reports transfer successes and failures in the log files using the stream-success and stream-failure keywords. These log messages report several timestamps that we use to compute download time and other metrics (e.g., circuit build times when downloading through Tor).

We should better document the steps of the state machine and clearly describe the times.

Here is a quick dump. From the TGen client's perspective, here is the transfer process when using Tor:

Step Log file timestamp key Description
1. usecs-to-socket-create Open's socket
2. usecs-to-socket-connect Connect to Tor’s socks server port
3. usecs-to-proxy-init Client initiates SOCKS handshake
4. usecs-to-proxy-choice SOCKS server responds to handshake
5. usecs-to-proxy-request Tell Tor to open connection to a tgen server
6. usecs-to-proxy-response Tor says OK connection opened
7. usecs-to-command TGen client sends (through Tor) command to tell the TGen server what to do
8. usecs-to-response Client received initial TGen server response to command
A9. usecs-to-first-byte-send Client sent first byte of transfer
A10. usecs-to-last-byte-send Client sent last byte of transfer
A11. usecs-to-checksum-send Client sent checksum computed over sent data
B9. usecs-to-first-byte-recv Client received first byte of transfer from server
B10. usecs-to-last-byte-recv Client received last byte of transfer from server
B11. usecs-to-checksum-recv Client received server's checksum computed over received data

The "A" and "B" phases happen concurrently as the client sends data to and receives data from the server, respectively.

The "transfer" time starts when the command is sent (step 7), and ends when checksums are both sent and received (after steps A11 and B11).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant