0

Let's take a random Tor relay: privater

Tor Metrics says that it has a speed of 30 MiB/s: https://metrics.torproject.org/rs.html#details/57A295377F3167AD554B521F4615184943C39CE1

Looking this relay information in cached-microdesc-consensus file there is:

r privater V6KVN38xZ61VS1IfRhUYSUPDnOE 2022-09-20 09:42:36 135.181.213.167 9000 0
a [2a01:4f9:3a:2b96::2]:9000
m 7CS8bNPTtPdgx1Dlo7J+rJdyKHtTtowCHmAUNjfV8Ic
s Fast Guard Running Stable V2Dir Valid
v Tor 0.4.7.10
pr Cons=1-2 Desc=1-2 DirCache=2 FlowCtrl=1-2 HSDir=2 HSIntro=4-5 HSRend=1-2 Link=1-5 LinkAuth=1,3 Microdesc=1-2 Padding=2 Relay=1-4
w Bandwidth=71000

Bandwidth field is "71000", nothing related with advertised bandwidth in Tor Metrics relay page.

My question is:

How can I pick up the advertised bandwidth of a Tor relay by looking at cached-microdesc-consensus file?

PS: I need to know that because I'm writing a shell script that select Tor relays by their bandwidth.

1 Answer 1

1

How can I pick up the advertised bandwidth of a Tor relay by looking at cached-microdesc-consensus file?

You can't directly since this information is not contained in the microdescriptor. The microdescriptors contain only the information needed for the client to build circuits, and the advertised bandwidth isn't needed for that. You will need to download the larger server descriptor if you want this information. Tor clients do not download this server descriptor by default, but I think this can be enabled with the FetchUselessDescriptors option.

For example:

router privater 135.181.213.167 9000 0 0
identity-ed25519
-----BEGIN ED25519 CERT-----
AQQABw7PAYMbb9KFcgEg7Gsl/htuz0AgGtdlKgA7G6t93rWowDNKAQAgBAADCGVm
oBu2q31EVkGpNo8bYsDcJOKJJZGSv7bukEVkt3I0ZDuV07vWO0pgNVRlJwQQgCMn
OffN0dnwxcGUwGdfirXMLoRgQL7InFy2rl4qiMLudQvskpyEZohYBD/PJgU=
-----END ED25519 CERT-----
master-key-ed25519 AwhlZqAbtqt9RFZBqTaPG2LA3CTiiSWRkr+27pBFZLc
or-address [2a01:4f9:3a:2b96::2]:9000
platform Tor 0.4.7.10 on Linux
proto Cons=1-2 Desc=1-2 DirCache=2 FlowCtrl=1-2 HSDir=2 HSIntro=4-5 HSRend=1-2 Link=1-5 LinkAuth=1,3 Microdesc=1-2 Padding=2 Relay=1-4
published 2022-09-20 09:42:36
fingerprint 57A2 9537 7F31 67AD 554B 521F 4615 1849 43C3 9CE1
uptime 2
bandwidth 31457280 1073741824 41959424
extra-info-digest 4BFE0FF549703B8D72D3199B398404B176D5633B WKIRVM/PrRj3aA8QpM67lwpIBxnfgKuYz+YHFpcZXws
[...]

https://github.com/torproject/torspec/blob/79da008392caed38736c73d839df7aa80628b645/dir-spec.txt#L534

"bandwidth" bandwidth-avg bandwidth-burst bandwidth-observed NL

[Exactly once]

Estimated bandwidth for this router, in bytes per second. The "average" bandwidth is the volume per second that the OR is willing to sustain over long periods; the "burst" bandwidth is the volume that the OR is willing to sustain in very short intervals. The "observed" value is an estimate of the capacity this relay can handle. The relay remembers the max bandwidth sustained output over any ten second period in the past 5 days, and another sustained input. The "observed" value is the lesser of these two numbers.

Tor versions released before 2018 only kept bandwidth-observed for one day. These versions are no longer supported or recommended.

1
  • I didn't know the option FetchUselessDescriptors, thank you! This extended information can also be obtained if UseMicrodescriptors is set to 0 as I have been reading Tor manual. Sep 22, 2022 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .