0

I am working on a customized relay node for a research project (currently runs very slow), but I am having a hard time testing it because it does not seem to be able to be part of the circuit. I set up a virtual Tor network using Chutney. My relay node opened an OR listener at port 5009. This is what I see using tshark:

  762 36.846905659    127.0.0.1 → 127.0.0.1    TCP 74 48415 → 5009 [SYN] Seq=0 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=58259382 TSecr=0 WS=128
  763 36.846911763    127.0.0.1 → 127.0.0.1    TCP 74 5009 → 48415 [SYN, ACK] Seq=0 Ack=1 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=58259382 TSecr=58259382 WS=128
  764 36.846918438    127.0.0.1 → 127.0.0.1    TCP 66 48415 → 5009 [ACK] Seq=1 Ack=1 Win=43776 Len=0 TSval=58259382 TSecr=58259382
  765 36.847048758    127.0.0.1 → 127.0.0.1    TLSv1 291 Client Hello
  766 36.847052490    127.0.0.1 → 127.0.0.1    TCP 66 5009 → 48415 [ACK] Seq=1 Ack=226 Win=44800 Len=0 TSval=58259382 TSecr=58259382
 2383 110.992165202    127.0.0.1 → 127.0.0.1    TCP 74 48526 → 5009 [SYN] Seq=0 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=58277918 TSecr=0 WS=128
 2384 110.992176408    127.0.0.1 → 127.0.0.1    TCP 74 5009 → 48526 [SYN, ACK] Seq=0 Ack=1 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=58277918 TSecr=58277918 WS=128
 2385 110.992289992    127.0.0.1 → 127.0.0.1    TCP 66 48526 → 5009 [ACK] Seq=1 Ack=1 Win=43776 Len=0 TSval=58277918 TSecr=58277918
 2386 110.992458295    127.0.0.1 → 127.0.0.1    TLSv1 278 Client Hello
...
 7880 337.608524835    127.0.0.1 → 127.0.0.1    TCP 66 48415 → 5009 [FIN, ACK] Seq=226 Ack=1 Win=43776 Len=0 TSval=58334572 TSecr=58259382
 7891 337.653927592    127.0.0.1 → 127.0.0.1    TCP 66 5009 → 48415 [ACK] Seq=1 Ack=227 Win=44800 Len=0 TSval=58334584 TSecr=58334572

While a regular Tor relay node would look like this:

  233 11.058804084    127.0.0.1 → 127.0.0.1    TCP 74 49525 → 5009 [SYN] Seq=0 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=58556397 TSecr=0 WS=128
  234 11.058812292    127.0.0.1 → 127.0.0.1    TCP 74 5009 → 49525 [SYN, ACK] Seq=0 Ack=1 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=58556397 TSecr=58556397 WS=128
  235 11.058819910    127.0.0.1 → 127.0.0.1    TCP 66 49525 → 5009 [ACK] Seq=1 Ack=1 Win=43776 Len=0 TSval=58556397 TSecr=58556397
  273 11.275158438    127.0.0.1 → 127.0.0.1    TLSv1 273 Client Hello
  274 11.275164941    127.0.0.1 → 127.0.0.1    TCP 66 5009 → 49525 [ACK] Seq=1 Ack=208 Win=44800 Len=0 TSval=58556451 TSecr=58556451
 1141 22.815326394    127.0.0.1 → 127.0.0.1    TLSv1.2 1067 Server Hello, Certificate, Server Key Exchange, Server Hello Done
 1142 22.815339025    127.0.0.1 → 127.0.0.1    TCP 66 49525 → 5009 [ACK] Seq=208 Ack=1002 Win=45696 Len=0 TSval=58559337 TSecr=58559337
 1143 22.857550431    127.0.0.1 → 127.0.0.1    TLSv1.2 192 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
 1144 22.857558494    127.0.0.1 → 127.0.0.1    TCP 66 5009 → 49525 [ACK] Seq=1002 Ack=334 Win=44800 Len=0 TSval=58559347 TSecr=58559347
 1209 23.740378627    127.0.0.1 → 127.0.0.1    TLSv1.2 117 Change Cipher Spec, Encrypted Handshake Message
 1210 23.740391704    127.0.0.1 → 127.0.0.1    TCP 66 49525 → 5009 [ACK] Seq=334 Ack=1053 Win=45696 Len=0 TSval=58559568 TSecr=58559568
 1211 23.740589442    127.0.0.1 → 127.0.0.1    TLSv1.2 106 Application Data

My guess is that, the client (e.g., of port 48415) was waiting for the relay node's ServerHello but didn't receive it for a while, and finally decided to close the connection (like a TLS timeout?). Was my analysis correct? Is there a way to ask the client to wait much longer before giving up? Can anyone who is familiar with Tor help me identify the part of the code that I need to change so that the network could work with my slow relay node?

Thanks a lot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.