
commit ee4d719b3dcd99ab60c6d1db14302abe62667959 Author: aagbsn <aagbsn@extc.org> Date: Mon Jan 9 11:04:17 2012 -0800 4297 - Warn about bridge pools + dynamic filtering If using dynamic bridge filtering, the IPBasedDistributor must be suppled wth a filtering function that will select the correct pool for the requesting IP. The filter could be implemented in a similar fashion as the existing approach, which is to map the requesting ip address to an area and assign then map the areas to pools of bridges. An alternate approach would define bridge pools by a set of corresponding country codes. The pools may either be of roughly equal size to simplify bridge assignment, or weighted by the aggregate bridge users from those countries. Presently, BridgeDB does neither. There are very few IPv6 bridges, so bypassing bridge clustering should be OK for the short term. Deliverables for Sponsor E require that BridgeDB be able to reassign blocked bridges to other countries; the extensions to BridgeDB required to implement this policy will replace the current clusters with bridge pools that correspond to geographic regions and address the current filter limitations. --- lib/bridgedb/Dist.py | 4 ++++ lib/bridgedb/Server.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index afc3592..6a459be 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -123,8 +123,12 @@ class IPBasedDistributor(bridgedb.Bridges.BridgeHolder): return ring.getBridges(pos, N, countryCode) # dynamic filter construction + #XXX: may bypass clusters! front-end must supply clustering function + # or provide another mechanism (perhaps geoip based) to sort and select + # bridges from separate pools. if bridgeFilterRules: logging.debug("bridgeFilterRules: %s" % bridgeFilterRules) + #XXX: is there a better way to cache by ruleset signature? ruleset = frozenset(bridgeFilterRules) if ruleset in self.splitter.filterRings.keys(): logging.debug("Cache hit %s" % ruleset) diff --git a/lib/bridgedb/Server.py b/lib/bridgedb/Server.py index 45cbee0..6db4522 100644 --- a/lib/bridgedb/Server.py +++ b/lib/bridgedb/Server.py @@ -154,9 +154,13 @@ class WebResource(twisted.web.resource.Resource): if ip: if ipv6: + #XXX: this ruleset bypasses areamapper and bridge clusters. + # for now, there are very few IPv6 bridges. rules=[filterBridgesByIP6] else: - rules=[filterBridgesByIP4] + #XXX: default to areamapper + cluster, does not use oraddress + rules = None + #rules=[filterBridgesByIP4] bridges = self.distributor.getBridgesForIP(ip, interval, self.nBridgesToGive,