-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Use socket connections for TCP
tracing
#134
Labels
Milestone
Comments
fujiapple852
added a commit
that referenced
this issue
May 9, 2022
fujiapple852
added a commit
that referenced
this issue
May 11, 2022
fujiapple852
added a commit
that referenced
this issue
May 11, 2022
fujiapple852
added a commit
that referenced
this issue
May 13, 2022
fujiapple852
changed the title
Use
Use socket connections for May 13, 2022
connect
for TCP
tracingTCP
tracing
fujiapple852
added a commit
that referenced
this issue
May 13, 2022
fujiapple852
added a commit
that referenced
this issue
May 13, 2022
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current approach
The current approach for
tcp
probing is to construct aTcpPacket
and thensend_to
it over channel constructed with:Which is effectively:
Problem
With this setup, response packets (
syn
/rst
) are never delivered to the socket as, presumably, we have never calledbind
orconnect
. We're essentially sending atcp
packet. as a datagram.Whilst this works to a point (we can receive the
icmp
TimeExceeded
responses to get the bulk of the trace), we don't receivesyn
/rst
/ack
and so we don't ever get the response from the target.Solution
The solution is to create a normal (not raw socket) TCP connection to the target.
The tool
mtr
takes a similar approach, seeconstruct_ip4_packet()
andopen_stream_socket()
inconstruct_unix.c
where it goes through a normalsocket
->bind
->connect
setup.See also
receive_replies_from_probe_socket()
inprobe_unix.c
for where the the per-probe TCP socket is checked usingselect
and a successful connection orECONNREFUSED
is used to indicate that the target has responded.The text was updated successfully, but these errors were encountered: