Delivery-Date: Sun, 29 Mar 2015 05:39:41 -0400
Return-Path: <tor-talk-bounces@lists.torproject.org>
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on moria.seul.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,
	DKIM_SIGNED,FREEMAIL_FROM,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,
	T_RP_MATCHES_RCVD autolearn=ham version=3.3.1
X-Original-To: archiver@seul.org
Delivered-To: archiver@seul.org
Received: from eugeni.torproject.org (eugeni.torproject.org [38.229.72.13])
	(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by khazad-dum.seul.org (Postfix) with ESMTPS id C70951E0058
	for <archiver@seul.org>; Sun, 29 Mar 2015 05:39:38 -0400 (EDT)
Received: from eugeni.torproject.org (localhost [127.0.0.1])
	by eugeni.torproject.org (Postfix) with ESMTP id BD256341B8;
	Sun, 29 Mar 2015 09:39:33 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by eugeni.torproject.org (Postfix) with ESMTP id 936FD341B1
 for <tor-talk@lists.torproject.org>; Sun, 29 Mar 2015 09:39:30 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at 
Received: from eugeni.torproject.org ([127.0.0.1])
 by localhost (eugeni.torproject.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 12JtRqQO1ycn for <tor-talk@lists.torproject.org>;
 Sun, 29 Mar 2015 09:39:30 +0000 (UTC)
Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com
 [IPv6:2607:f8b0:4003:c06::22c])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (not verified))
 by eugeni.torproject.org (Postfix) with ESMTPS id 4D32E33FC9
 for <tor-talk@lists.torproject.org>; Sun, 29 Mar 2015 09:39:30 +0000 (UTC)
Received: by oifl3 with SMTP id l3so106638985oif.0
 for <tor-talk@lists.torproject.org>; Sun, 29 Mar 2015 02:39:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=YgD09mK4wQkQkX1HGEjeCT4UP5bI3GU9aV4ZG/Z3sUo=;
 b=EamyZMbXWAzsq/VQcVqJSeVHWtJPBWl+Dfr5DeiXapGDCDjCMlldOKkXbg9duhXny+
 RcUCJsOOM1+UTlh2FHDtj08XX/I5xRZSZeq5xlhgOT7iQEn1qITfvzgfYBdyDxJBUZkO
 gM0dYoIKTM8oF4yCmILaW+yXLQ5qB6/WW6Bjwf8gcX9j4TYMyBSDmLk9DE/MSkNd2o38
 T9cEOOwhYGUpUxXosiwqzO8wghCrqlMl3UCs28womkmPbmbEn2/q5v1fghTgMbNnMEYP
 XdHz4wPxwdG/p5kM08bC70b85n2T7dYwmDPvooicxh5rjhwr4NfZ52EIjpwVDNQL4KXg
 s9kg==
MIME-Version: 1.0
X-Received: by 10.202.202.146 with SMTP id a140mr1999591oig.5.1427621967804;
 Sun, 29 Mar 2015 02:39:27 -0700 (PDT)
Received: by 10.202.64.5 with HTTP; Sun, 29 Mar 2015 02:39:27 -0700 (PDT)
Date: Sun, 29 Mar 2015 18:39:27 +0900
Message-ID: <CALRdebwtsHCr2HrTga_D3sb=Vi1MBUp2Q+Ooy++3idpGtNitiw@mail.gmail.com>
From: Anonymous Kyoto <anonymous.kyoto@gmail.com>
To: tor-talk@lists.torproject.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [tor-talk] Why is there a huge gap between Total BW retrieved
 by Stem, Total shown on Tor Metrics and in http://torstatus.blutmagie.de/?
X-BeenThere: tor-talk@lists.torproject.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: tor-talk@lists.torproject.org
List-Id: "all discussion about theory, design,
 and development of Onion Routing" <tor-talk.lists.torproject.org>
List-Unsubscribe: <https://lists.torproject.org/cgi-bin/mailman/options/tor-talk>, 
 <mailto:tor-talk-request@lists.torproject.org?subject=unsubscribe>
List-Archive: <http://lists.torproject.org/pipermail/tor-talk/>
List-Post: <mailto:tor-talk@lists.torproject.org>
List-Help: <mailto:tor-talk-request@lists.torproject.org?subject=help>
List-Subscribe: <https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk>, 
 <mailto:tor-talk-request@lists.torproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: tor-talk-bounces@lists.torproject.org
Sender: "tor-talk" <tor-talk-bounces@lists.torproject.org>

Thank you Dr. Karsten for your answer.
Following your instruction, I am now understanding meaning of three terms:
"advertised bandwidth", "bandwidth history", and "consensus weight" on
Metrics. So please let me link those term with terms in Stem, and please
correct me if I am wrong cos I am using Stem Library so I really need to
know which term in Metrics is associated with which term in Stem:
Syntax: <term in Metrics = term in Stem>

1. advertised bandwidth = observed_bandwidth

> (observed_bandwidth function is in:
> https://stem.torproject.org/api/descriptor/server_descriptor.html)

to check it: I look at atlas of the IP: 94.198.68.13, and found advertised
> bandwidth = 70.72 KB/s, and also using desc.observed_bandwidth in stem to
> fetch the same IP, and got 70720 (B/s) by using these code lines:

from stem.descriptor.remote import DescriptorDownloader
> downloader = DescriptorDownloader()
> try:

  for desc in downloader.get_server_descriptors().run():

 print '%s %i' %(IP, desc.observed_bandwidth)


2. bandwidth history = Not Available (?)

> I cannot find what function should be used in Stem to retrieve the
> bandwidth history value.


3. consensus weight = bandwidth or = measured

This one maybe the weirdest one, but please correct me if I misunderstand
> the terms. As I look at the consensus file @
> http://86.59.21.38/tor/status-vote/current/consensus
> and look at the specification for "w" line @
> https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt#n1768
> I found they wrote that "w line is An estimate of the bandwidth of this
> relay, in an arbitrary unit (currently kilobytes per second)", in stead
> of unit-less as you answered and written in Stem @
> https://stem.torproject.org/api/descriptor/router_status_entry.html


Next what I tried to figure out the question myself by writing these code
lines:

from stem.descriptor.remote import DescriptorDownloader
> downloader = DescriptorDownloader()

try:

  for desc in downloader.get_consensus().run():

 print '%s %i' %(IP, desc.measured)


and get

95.215.44.189 None
> 73.15.150.172 None
> 162.247.72.201 None ...and so on


While if I use this code lines:

from stem.descriptor.remote import DescriptorDownloader
> downloader = DescriptorDownloader()

try:

  for desc in downloader.get_consensus().run():

 print '%s %i' %(IP, desc.bandwidth)


I would get this result:

 95.215.44.189 323
> 73.15.150.172 14
> 162.247.72.201 6240


which is exactly the same with values in consensus file @
http://86.59.21.38/tor/status-vote/current/consensus
Therefore, I am confused about consensus weight (in metrics VS in directory
specification) VS bandwidth and measured (in Stem). Which of them is
unit-less, and which of them is in B/s or KB/s. And, which value one should
use to calculate probability of a relay in path selection in proportion to
its bandwidth.

I am so sorry if the way I raise and organize the question make you
confused or hard to understand. Especially to Dr. Karsten, I am so sorry to
ask you about Stem in related to Metrics cos I am aware that Stem in not
under your management.
Yours Sincerely!
-- 
tor-talk mailing list - tor-talk@lists.torproject.org
To unsubscribe or change other settings go to
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk

