[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #22122 [Metrics/metrics-lib]: Add support for six new key-value pairs added by OnionPerf
#22122: Add support for six new key-value pairs added by OnionPerf
---------------------------------+-----------------------------------
Reporter: karsten | Owner: metrics-team
Type: enhancement | Status: needs_review
Priority: Medium | Milestone: metrics-lib 1.7.0
Component: Metrics/metrics-lib | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
---------------------------------+-----------------------------------
Comment (by robgjansen):
They look good at a high level. I'm not sure how many details you want to
include in the comments, so instead of editing your code comments
directly, I will just give some explanation below and allow you to curate
the details.
{{{
/**
* Return the TGen client socket name, IP address, and port, formatted
as
* <code>name:ip:port</code>, or <code>null</code> if the OnionPerf line
* didn't contain that information. */
public String getEndpointLocal();
}}}
The local endpoint is the TGen's client side socket. If a proxy is in use,
which is always the case in OnionPerf when downloading over Tor, then the
client side socket is the socket that is used to connect to the SOCKS
proxy server that Tor runs. The `name:ip:port` may be `NULL:0.0.0.0:0` if
TGen was not able to find the info using `getaddrinfo()` and
`getnameinfo()`.
{{{
/**
* Return the proxy socket name, IP address, and port, formatted as
* <code>name:ip:port</code>, or <code>null</code> if the OnionPerf line
* didn't contain that information. */
public String getEndpointProxy();
}}}
The proxy endpoint is the information that the TGen client uses to connect
to the SOCKS proxy server that Tor runs. The `name:ip:port` may be
`NULL:0.0.0.0:0` if TGen was not able to find the info using
`getaddrinfo()` and `getnameinfo()`. In OnionPerf, the SOCKS proxy is run
on localhost at a well-known SOCKS port that was configured with Tor's
`SocksPort` config option.
{{{
/**
* Return the TGen server host name, IP address, and port, formatted as
* <code>hostname:ip:port</code>, or <code>null</code> if the OnionPerf
line
* didn't contain that information. */
public String getEndpointRemote();
}}}
The remote endpoint is the information that the TGen client uses to
connect to the remote server. This is the information that allows the
SOCKS proxy to create a TCP connection from the exit relay to the TGen
server. The `name:ip:port` may be `NULL:0.0.0.0:0` if TGen was not able to
find the info using `getaddrinfo()` and `getnameinfo()`, although in that
case the download would not have succeeded because the exit relay would
not know where to connect.
{{{
/**
* Return the client machine hostname, or <code>null</code> if the
OnionPerf
* line didn't contain that information. */
public String getHostnameLocal();
}}}
This is the value returned by calling `gethostname()` on the TGen client.
If that call failed, then I believe GLib uses `(NULL)` as the string.
{{{
/**
* Return the server machine hostname, or <code>null</code> if the
OnionPerf
* line didn't contain that information. */
public String getHostnameRemote();
}}}
This is the value returned by calling `gethostname()` on the TGen server.
The TGen server gets this value on its machine and sends it to the client
as part of the header to the response to the clients transfer request. If
that call failed, then I believe GLib uses `(NULL)` as the string.
{{{
/**
* Return the source IP address, or <code>null</code> if the OnionPerf
line
* didn't contain that information. */
public String getSourceAddress();
}}}
This is collected by OnionPerf itself. This is the best guess of the
public IP address of the OnionPerf client machine. This is collected by
connecting to https://check.torproject.org/ and finding the IP address in
the result. If that fails, the backup method is to connect to Google DNS
server 8.8.8.8 on port 53, and then check the IP address listed on the
client side socket of that connection. If both of those fail, then
OnionPerf returns a string "unknown".
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22122#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs