As @mikeperry commented in IRC, we could deploy the bandwidth scanner (sbws or onbasca) in a testing machine to check that congestion control is negotiated to 2nd hop and not the 1st, since C-Tor negotiates it to the last Exit hop, but the bandwidth scanners are building the circuits themselves with the EXTENDCIRCUIT control port command.
For this, we would need to:
force bwscanner >= 1 in the bandwidth scanner code
@mikeperry would have a C-Tor branch with extra logging enabled
@gk I think this issues is not specific to any of the 2 bandwidth scanners, so i'm creating it here, but feel free to move it to onbasca if you think we could do this as part of it.
@gk I think this issues is not specific to any of the 2 bandwidth scanners, so i'm creating it here, but feel free to move it to onbasca if you think we could do this as part of it.
jugachanged title from Deploy a bandwidth scanner that support congestion control to check that it's used properly to the 2nd hop to Deploy a bandwidth scanner that supports congestion control to check that it's used properly to the 2nd hop
changed title from Deploy a bandwidth scanner that support congestion control to check that it's used properly to the 2nd hop to Deploy a bandwidth scanner that supports congestion control to check that it's used properly to the 2nd hop
That branch has notice and warn level logs for various things. From my read of the code, and initial testing, we're definitely gonna find bugs with this, so we should try to do this next week, as soon as possible.
There are logs at notice that are "normal" when CC is enabled. There are some warns that can happen from directory activity. There's some more notice logs that contain BAD_IF_CC_DISABLED that are bad if sbws sees them when it is not operating in bwscanner_cc=1 mode.
So, we have two sets of tests:
A run with this binary that behaves as if bwscanner_cc=1 is set
A run with this binary that behaves as if bwscanner_cc=1 is not set
These should be run on a test scan, and not a real sbws instance. We need notice and above level logs in both cases. We should not need info level logs.
I will explain more in the s61 sync, and we can discuss. Some details are already on the pad.
May 02 14:29:28.453 [warn] Edge FC CIRC=13 CC circ, purpose 5 controller 1 1, len 2
This log is due to a missing check for the CC object. Fixed in fixup d1a43ef1e18b9e00f7fb6d69f2fd9981b6d2e7f1 of sbws_cc_logs. Sorry.
May 02 14:40:03.231 [warn] One-hop CC for CIRC=11, purpose 5, controller 1 1
These logs are interesting, but only if the same circuit id (11 in this case) shows up as using congestion control when it is disabled, or not using congestion control when it is enabled.
So we should run this again with the fixup, and then I can do some grepping on the full logs. So far it actually looks OK, though.
This log (sha256sum 39dfd57a75a4cea379089dc1f6188e4ee537fc6f4fb66e9cf5b300d6ad4c5f49) contains several lines like:
BAD_IF_CC_DISABLED: Got CC for sbws CIRC=
This means that this sbws instances was using FlowCtrl=1-2 exits for the second hop, which should not happen if bwscanner_cc=1 is not set. sbws should have only chosen FlowCtrl=1 exits in this case. This may be an sbws bug?
This log (sha256sum 119b8b2b30d0b974a8a5f742b437a01d85cf9d37ec310628fcb0d161cc8be92e) contains several lines like:
Got CC=0 circ for sbws exit-hop CIRC=.
This means that sbws instances were not picking FlowCtrl=1-2 Exits for the second hop, which is the opposite of what we expect.
I would guess that perhaps you reversed the two logs, but this second log also has BAD_IF_CC_DISABLED: Got CC for sbws CIRC=, which means that it did pick a FlowCtrl=1-2 Exit for the second hop, at least once.
So something seems broken here, wrt sbws path building :/
@mikeperry your tor logs are being very useful to find sbws bugs.
First i found sbws#40134 (closed), which was not the issue in the previous logs since i had already applied the patch.
Now i found sbws#40136 (closed). I hoped i'd just add one more condition and the rest would magically work, but it was more complex, and here was a bit tricky to modify sbws to support the other cases.
In the new logs, i've wait until it was measuring an exit without 2 in FlowCtrl in the case bwscanner is not 1 or greater and an exit with 2 in FlowCtrl in the case bwscanner>=1.
The logs:
without bwscanner_cc=1: notice.log
Now there is not any line with Got CC=1 nor BAD_IF_CC_DISABLED.
with bwscanner_cc=1: notice.log
Now there is not any line with Got CC=0.
They both have lines like Got first-hop CC for sbws CIRC= and One-hop CC for CIRC=. I guess that's ok even in the 1st case?
They both have lines like Got first-hop CC for sbws CIRC= and One-hop CC for CIRC=. I guess that's ok even in the 1st case?
Yes, this is OK. This is a side-effect of the control port negotiating congestion control at every hop. I believe it is OK, since the ccontrol on the first hop cpath should not be used for streams attached to a two-hop circuit. And from the rest of the logs, it looks like these circuits are not using congestion control when it is off, and are when it is on.