[tor-commits] [ooni-probe/master] Make the blocking detection heuristics more strict

art at torproject.org art at torproject.org
Mon May 30 16:28:32 UTC 2016


commit ff77593d59dc7e25e4214e15571d616d7e374dce
Author: Arturo Filastò <arturo at filasto.net>
Date:   Mon Apr 18 18:45:09 2016 +0200

    Make the blocking detection heuristics more strict
---
 ooni/nettests/blocking/web_connectivity.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/ooni/nettests/blocking/web_connectivity.py b/ooni/nettests/blocking/web_connectivity.py
index 4b9b6c2..28ee942 100644
--- a/ooni/nettests/blocking/web_connectivity.py
+++ b/ooni/nettests/blocking/web_connectivity.py
@@ -84,7 +84,8 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
     followRedirects = True
 
     # Factor used to determine HTTP blockpage detection
-    factor = 0.8
+    # the factor 0.7 comes from http://www3.cs.stonybrook.edu/~phillipa/papers/JLFG14.pdf
+    factor = 0.7
     resolverIp = None
 
     @classmethod
@@ -296,14 +297,23 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
             self.report['dns_consistency'] = 'inconsistent'
         tcp_connect = self.compare_tcp_experiments()
 
-        if dns_consistent == True and tcp_connect == False:
+        if (dns_consistent == True and tcp_connect == False and
+                self.report['http_experiment_failure'] is not None):
             blocking = 'tcp_ip'
 
+        # XXX we may want to have different codes for these two types of
+        # blocking
         elif (dns_consistent == True and tcp_connect == True and
                       self.report['body_length_match'] == False):
             blocking = 'http'
+        elif (dns_consistent == True and tcp_connect == True and
+                self.report['http_experiment_failure'] is not None and
+                self.report['control']['http_request']['failure'] != self.report['http_experiment_failure']):
+            blocking = 'http'
 
-        elif dns_consistent == False:
+        elif (dns_consistent == False and
+                  (self.report['http_experiment_failure'] is not None or
+                   self.report['body_length_match'] == False)):
             blocking = 'dns'
 
         return blocking





More information about the tor-commits mailing list