Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP/DRAFT: Introducing tracers and adding trace hooks/callbacks for events #266

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

amircybersec
Copy link
Contributor

@amircybersec amircybersec commented Aug 23, 2024

This PR aims to introduces:

  1. a systematic event-driven approach to collect connection traces that capture events such as establishment of TCP connection, successful read, write, DNS resolution, TLS handshake, etc.
  2. New connectivity tests:
    2.1 do53-tcp
    2.2 do53-udp
    2.3 dot (dns over tls)
    2.4 doh (dns over https)
    2.5 http, https
    2.6 http3/quic

TODO:

  • Make a design decision on what must go into the trace package
  • Finalized the ClientTrace retrievers and listeners. Shall we define a set of specialized one (DNSClientTrace, TLSClientTrace, etc) which is more consistent with httptrace approach, or one generic one?
    -Put these event into a span/trace format suggested and discussed below:
    https://opentelemetry.io/docs/concepts/signals/traces/

Here's is an example of trace information getting printed out in stdio:

➜  test-connectivity git:(amir-dsn-trace) ✗ go run . -v  -transport="tls:|socks5://user:[email protected]:443" -test-type dot -resolver 1.1.1.1 -report-success-rate 1.0 -domain example.com -resolver-name one.one.one.one
DNS start: {pod3.letsgetconnectedquick.com}
DNS done: {[{45.76.69.216 } {70.34.210.176 }] <nil> false}
Connect start: tcp 45.76.69.216:443
Connect done: tcp 45.76.69.216:443 <nil>
TLS handshake started
SNI: pod3.letsgetconnectedquick.com
TLS version: 772
ALPN: 
TLS handshake took 0.041285625 seconds.
Connected to socks5 proxy at address 45.76.69.216:443
TLS handshake started
SNI: one.one.one.one
TLS version: 772
ALPN: 
TLS handshake took 0.019287583 seconds.
[DEBUG] 2024/08/22 18:43:50.254607 main.go:244: Test Type: dot Resolver Address: 1.1.1.1:853 domain: example.com result: <nil>
{"resolver":"1.1.1.1:853","proto":"tcp","transport":"tls:|socks5://[email protected]:443","time":"2024-08-23T01:43:50Z","duration_ms":186,"error":null}

@amircybersec amircybersec changed the title WIP/DRAFT: Introducing Trace package and adding trace hooks/callbacks for events WIP/DRAFT: Introducing tracers and adding trace hooks/callbacks for events Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant