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

TRACEROUTE (TCP) does not show middle hops as the TTL from the requests is changed to a fixed value #508

Open
gbappneta opened this issue Aug 12, 2020 · 0 comments

Comments

@gbappneta
Copy link

Expected behavior

A traceroute (TCP) command would show the middle hops
root@cmp-mac-gbarcotti:/# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 172.20.0.1 (172.20.0.1) 1.062 ms 0.982 ms 0.942 ms
2 hitronhub.home (192.168.0.1) 3.584 ms 4.599 ms 4.536 ms
3 * * *
4 rc1st-be164-1.vc.shawcable.net (64.59.148.125) 22.687 ms 21.090 ms 21.022 ms
5 rc2wt-be50-1.wa.shawcable.net (66.163.70.106) 35.724 ms 36.159 ms 36.317 ms
6 72.14.242.90 (72.14.242.90) 34.276 ms 40.536 ms 40.390 ms
7 * * *
8 dns.google (8.8.8.8) 27.897 ms 24.358 ms 28.457 ms

Actual behavior

A traceroute (TCP) command shows only 2 hops (the docker bridge and the target)

root@cmp-mac-gbarcotti:/# traceroute -T -p 443 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 172.20.0.1 (172.20.0.1) 0.114 ms 0.047 ms 0.118 ms
2 dns.google (8.8.8.8) 27.705 ms 29.068 ms 29.384 ms

Information

  • The issue is 100% reproducible
  • macOS Version: Catalina 10.15.5
  • Root cause of the issue:
    Looking at the packet capture obtained inside the container (tcpdump in the container) it is possible to see that the container traceroute application generates IPv4 TCP SYN requests with increasing TTL numbers (trace route typical approach), however, the corresponding packet capture from the host (MAC) shows that the TTL numbers for the TCP SYN messages get changed to a constant number (64) therefore the packets get a response directly from the target and not (ICMP TTL time exceeded from the middle hops). This completely breaks TCP traceroute.
    Notes:
    . ICMP and UDP traceroute works. in the ICMP and UDP cases, the TTL of the requests is only decremented by 1 (to account for the docker bridge hop) when they leave the host machine (MAC).
    . The same result is observed for docker bridged or host networking

Diagnostic logs

No Diagnostics logs

Docker for Mac: 
JLTM120:cmp-mac-gbarcotti gbarcotti$ docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:21:11 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Dockerfile

FROM debian:stable
RUN apt-get update && apt-get install traceroute

Steps to reproduce the behaviour (Just run the following commands on a MAC term/shell

mkdir scratch
cat >Dockerfile <<EOF
FROM debian:stable
RUN apt-get update && apt-get install traceroute
EOF
docker image build --tag tracerouterepro:latest .
docker run -ti tracerouterepro:latest /usr/bin/traceroute -T -p 443 8.8.8.8

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

No branches or pull requests

1 participant