weaveworks / scope

Monitoring, visualisation & management for Docker & Kubernetes
https://www.weave.works/oss/scope/
Apache License 2.0
5.87k stars 713 forks source link

Infer Weave Net underlay topology and visualise with mesh status #720

Open awh opened 8 years ago

awh commented 8 years ago

Whilst investigating weaveworks/weave#1744 I produced the following diagram img_20151202_124014 from the output of weave status peers (copied here in full in case the gist disappears):

➜  ~  weave status

       Version: 1.3.1

       Service: router
      Protocol: weave 1..2
          Name: 66:24:da:cd:5e:9e(ubuntu)
    Encryption: disabled
 PeerDiscovery: enabled
       Targets: 2
   Connections: 10 (9 established, 1 retrying)
         Peers: 11 (with 92 established, 5 pending connections)

       Service: ipam
     Consensus: achieved
         Range: 172.16.0.0-172.16.255.255
 DefaultSubnet: 172.16.0.0/16

       Service: dns
        Domain: weave.local.
           TTL: 1
       Entries: 22

       Service: proxy
       Address: unix:///var/run/weave/weave.sock

➜  ~  weave status peers
6a:df:8b:be:fc:8e(us4)
   <- 118.70.80.24:3137     1a:16:95:88:47:58(jake-pc)       established
   <- 117.6.161.201:36481   f6:26:fb:b3:70:01(hht3)          established
   <- 118.70.80.24:24993    66:24:da:cd:5e:9e(ubuntu)        established
   <- 142.0.199.28:33132    66:73:f8:3f:fc:6e(us2)           established
   <- 142.0.199.36:54202    aa:4c:64:2e:4a:bf(us3)           established
   <- 117.6.161.201:50337   3e:98:23:98:2c:38(hht2)          established
   <- 117.6.161.201:36417   86:2f:e8:fa:fe:5a(hht6)          established
   <- 117.6.161.201:50433   76:0e:93:15:47:9d(hht1)          established
   <- 80.8.104.154:39525    9e:b6:00:c6:7c:17(androgeek-SATELLITE-L50-C) pending
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
86:2f:e8:fa:fe:5a(hht6)
   -> 192.168.100.109:6783  76:0e:93:15:47:9d(hht1)          established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   -> 192.168.100.108:6783  f6:26:fb:b3:70:01(hht3)          established
   -> 192.168.100.112:6783  3e:98:23:98:2c:38(hht2)          established
   -> 142.0.199.28:6783     66:73:f8:3f:fc:6e(us2)           established
   <- 192.168.100.2:57724   1a:16:95:88:47:58(jake-pc)       established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   <- 192.168.100.132:55284 66:24:da:cd:5e:9e(ubuntu)        established
9e:b6:00:c6:7c:17(androgeek-SATELLITE-L50-C)
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
f6:26:fb:b3:70:01(hht3)
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   <- 192.168.100.2:44030   1a:16:95:88:47:58(jake-pc)       established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   <- 192.168.100.132:37682 66:24:da:cd:5e:9e(ubuntu)        established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   -> 192.168.100.109:6783  76:0e:93:15:47:9d(hht1)          established
   -> 142.0.199.28:6783     66:73:f8:3f:fc:6e(us2)           established
   <- 192.168.100.110:60426 86:2f:e8:fa:fe:5a(hht6)          established
   <- 192.168.100.112:51064 3e:98:23:98:2c:38(hht2)          established
aa:4c:64:2e:4a:bf(us3)
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   <- 80.8.104.154:43951    9e:b6:00:c6:7c:17(androgeek-SATELLITE-L50-C) pending
   <- 118.70.80.24:3041     1a:16:95:88:47:58(jake-pc)       established
   <- 117.6.161.201:60705   3e:98:23:98:2c:38(hht2)          established
   <- 183.91.4.73:47233     76:0e:93:15:47:9d(hht1)          established
   <- 183.91.4.73:47265     f6:26:fb:b3:70:01(hht3)          established
   <- 142.0.199.28:60504    66:73:f8:3f:fc:6e(us2)           established
   <- 117.6.161.201:50465   86:2f:e8:fa:fe:5a(hht6)          established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   <- 118.70.80.24:24961    66:24:da:cd:5e:9e(ubuntu)        established
76:0e:93:15:47:9d(hht1)
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   <- 192.168.100.132:41044 66:24:da:cd:5e:9e(ubuntu)        established
   <- 192.168.100.2:58114   1a:16:95:88:47:58(jake-pc)       established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   <- 192.168.100.110:35670 86:2f:e8:fa:fe:5a(hht6)          established
   -> 192.168.100.112:6783  3e:98:23:98:2c:38(hht2)          established
   <- 192.168.100.108:59930 f6:26:fb:b3:70:01(hht3)          established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   -> 142.0.199.28:6783     66:73:f8:3f:fc:6e(us2)           established
1a:16:95:88:47:58(jake-pc)
   -> 192.168.100.109:6783  76:0e:93:15:47:9d(hht1)          established
   -> 142.0.199.28:6783     66:73:f8:3f:fc:6e(us2)           established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   -> 192.168.100.110:6783  86:2f:e8:fa:fe:5a(hht6)          established
   -> 192.168.100.112:6783  3e:98:23:98:2c:38(hht2)          established
   <- 192.168.100.132:41134 66:24:da:cd:5e:9e(ubuntu)        established
   -> 192.168.100.108:6783  f6:26:fb:b3:70:01(hht3)          established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
66:24:da:cd:5e:9e(ubuntu)
   -> 192.168.100.108:6783  f6:26:fb:b3:70:01(hht3)          established
   -> 142.0.199.28:6783     66:73:f8:3f:fc:6e(us2)           established
   -> 192.168.100.2:6783    1a:16:95:88:47:58(jake-pc)       established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   -> 192.168.100.110:6783  86:2f:e8:fa:fe:5a(hht6)          established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   -> 192.168.100.112:6783  3e:98:23:98:2c:38(hht2)          established
   -> 192.168.100.109:6783  76:0e:93:15:47:9d(hht1)          established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
02:ec:03:f7:ae:45(us1)
   <- 118.70.80.24:2977     1a:16:95:88:47:58(jake-pc)       established
   <- 117.6.161.201:60129   86:2f:e8:fa:fe:5a(hht6)          established
   <- 117.6.161.201:60673   f6:26:fb:b3:70:01(hht3)          established
   <- 142.0.199.36:48909    aa:4c:64:2e:4a:bf(us3)           established
   <- 142.0.199.44:54829    6a:df:8b:be:fc:8e(us4)           established
   <- 80.8.104.154:58214    9e:b6:00:c6:7c:17(androgeek-SATELLITE-L50-C) pending
   <- 117.6.161.201:50401   3e:98:23:98:2c:38(hht2)          established
   <- 117.6.161.201:50561   76:0e:93:15:47:9d(hht1)          established
   <- 142.0.199.28:58428    66:73:f8:3f:fc:6e(us2)           established
   <- 118.70.80.24:24865    66:24:da:cd:5e:9e(ubuntu)        established
3e:98:23:98:2c:38(hht2)
   -> 142.0.199.28:6783     66:73:f8:3f:fc:6e(us2)           established
   <- 192.168.100.2:46372   1a:16:95:88:47:58(jake-pc)       established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   <- 192.168.100.110:42026 86:2f:e8:fa:fe:5a(hht6)          established
   <- 192.168.100.132:34324 66:24:da:cd:5e:9e(ubuntu)        established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   -> 192.168.100.108:6783  f6:26:fb:b3:70:01(hht3)          established
   <- 192.168.100.109:60928 76:0e:93:15:47:9d(hht1)          established
66:73:f8:3f:fc:6e(us2)
   <- 183.91.4.73:47201     f6:26:fb:b3:70:01(hht3)          established
   <- 118.70.80.24:3105     1a:16:95:88:47:58(jake-pc)       established
   <- 118.70.80.24:24929    66:24:da:cd:5e:9e(ubuntu)        established
   -> 142.0.199.20:6783     02:ec:03:f7:ae:45(us1)           established
   -> 142.0.199.36:6783     aa:4c:64:2e:4a:bf(us3)           established
   <- 80.8.104.154:40413    9e:b6:00:c6:7c:17(androgeek-SATELLITE-L50-C) pending
   <- 117.6.161.201:50497   86:2f:e8:fa:fe:5a(hht6)          established
   <- 117.6.161.201:50529   3e:98:23:98:2c:38(hht2)          established
   -> 142.0.199.44:6783     6a:df:8b:be:fc:8e(us4)           established
   <- 183.91.4.73:47169     76:0e:93:15:47:9d(hht1)          established

It would be supremely helpful if Scope could produce such a diagram automatically, even more so if it were annotated to show the 'health' of the connections (e.g. established, pending) in some way.

faddat commented 8 years ago

+100 regarding the datagram generation. Further, how were you able to divine the Nat'd-ness of connections? The long UDP port #'s?

To answer your questions well, I'll recreate the scenario tomorrow.

2opremio commented 7 years ago

Fixed by https://github.com/weaveworks/scope/pull/1182 and https://github.com/weaveworks/scope/pull/1973

rade commented 7 years ago

This issue is still relevant. Specifically, scope does not yet "Infer the Weave Net underlay topology" as per the diagram in the first comment.