skydive icon indicating copy to clipboard operation
skydive copied to clipboard

Can routers and switches be discovered in the network topology?

Open RunningXJ opened this issue 6 years ago • 29 comments

By the way, I run allinone mode on one physical machine, open a virtual machine on another machine, and also run allinone mode. Why in the virtual machine, open the browser and only display one machine, can't find another An agent

RunningXJ avatar Jun 14 '19 06:06 RunningXJ

All the agents need to have the list of the analyzer set in their configuration file:

https://github.com/skydive-project/skydive/blob/master/etc/skydive.yml.default#L175

A usual deployment is

  • one analyzer
  • multiple agents

The standalone mode is there mostly for testing purpose, for a single node

safchain avatar Jun 14 '19 07:06 safchain

thanks! Can routers and switches be discovered in the network topology?

RunningXJ avatar Jun 14 '19 10:06 RunningXJ

I started with a binary file, then do I need to write the configuration file myself? The contents of the configuration file must be all there, or just add the configuration you want to use. Can a file like this be used? Analyzers:    - 127.0.0.1:8082 Agent: 192.168.4.18:8081

RunningXJ avatar Jun 14 '19 10:06 RunningXJ

adding just what you need is enough. As an example, if you have 2 agents(host) and 1 analyzer

the configuration of the agents will be

analyzers:
  - <analyzer ip>:8082

so same config file for all the agents. Of course IP/Port of the analyzer have to be reachable by the agents.

For the router/switch discovery, I would say yes if they support LLDP. In that case the LLDP probe as to be enabled.

https://github.com/skydive-project/skydive/blob/master/etc/skydive.yml.default#L204

So need to add this in the agent config file

agent:
  topology:
    probes:
      - lldp

safchain avatar Jun 14 '19 10:06 safchain

thank for your time. i wrote like this:

analyzers: - 192.168.4.14:8082

agent: - 192.168.4.15:8081 auth: api: backend: noauth cluster: username: admin password: 123456

is something wrong? When I start it shows, ERROR agent/agent.go:45 glob..func1 xj-virtual-machine: Can't start Skydive agent: Authentication type unknown or backend not defined for:

RunningXJ avatar Jun 14 '19 10:06 RunningXJ

if i just need to write: analyzers:

  • 192.168.4.14:8082

agent:

  • 192.168.4.15:8081

RunningXJ avatar Jun 14 '19 10:06 RunningXJ

I executed the skydive analyzer with a host. Other agents (host) executed skydive agent -c skydive.yml The contents of the configuration file are as follows: Analyzers:    - 192.168.4.120:8082

But it prompts me: ERROR websocket/client.go:557 (*Client).Start.func1 controller: Unable to create a WebSocket connection ws://192.168.4.120:8082/ws/agent/topology : dial tcp 192.168.4.120:8082: connect: Connection refused

But I did not disable the 8082 port

RunningXJ avatar Jun 14 '19 11:06 RunningXJ

@RunningXJ I suggest you first try to peer your agent and your analyzer together, then later set up the authentication.

Regarding the Connection refused error, by default the analyzer listens only on 127.0.0.1:8082 So you need to set the following configuration for the analyzer :

analyzer:
    listen: 192.168.4.120:8082

lebauce avatar Jun 14 '19 12:06 lebauce

thanks!I will try it!

RunningXJ avatar Jun 14 '19 14:06 RunningXJ

thank you very much ! it works! BTW, when I want to discover routers and switches, I assume that I know that router switches support lldp, so what configuration do I need to do for routers and switches? Or it can be found automatically

RunningXJ avatar Jun 15 '19 02:06 RunningXJ

When I start the agent on two hosts, why are the two nodes not connected together in the network topology? They are on the same subnet, one is 192.168.4.14 and the other is 192.168.4.15

RunningXJ avatar Jun 15 '19 03:06 RunningXJ

Did you enable the lldp probe as suggested by @safchain ?

agent:
  topology:
    probes:
      - lldp

If so - and if the agents are on the same switch of course -, agents should be linked though a switch (displayed in orange in the Web UI, as in https://user-images.githubusercontent.com/4539421/46472598-04ae5080-c7de-11e8-8824-9158f8633a26.png)

lebauce avatar Jun 17 '19 13:06 lebauce

Skydive does not link agents if they are on the same L3 network. You need to use LLDP or use the fabric probe :

analyzer:
  topology:
    fabric:
    - TOR1[Name=tor1] -> TOR1_PORT1[Name=port1, MTU=1500]
    - TOR1_PORT1 -> *[Type=host, Name=agent1]/eth1
    - TOR1[Name=tor1] -> TOR1_PORT2[Name=port2, MTU=1500]
    - TOR1_PORT2 -> *[Type=host, Name=agent2]/eth1

You need to replace agent1 and agent2 with the respective hostnames of your agents, and eth1 with the name of the network interface connected to the switch

lebauce avatar Jun 17 '19 13:06 lebauce

If I enable the lldp probe, then do I only need to do the following configuration on the node where the agent is runing: for example: Analyzers:    - 192.168.4.120:8082 Agent:    Topology:      Probes:       - lldp

RunningXJ avatar Jun 18 '19 02:06 RunningXJ

BTW,if I enable the lldp probe,can I also discover the router in the topology? Because lldp is a link layer protocol, it is found that most of them can configure lldp for the switch, but rarely see to configure the router.

RunningXJ avatar Jun 18 '19 03:06 RunningXJ

As stated by @lebauce routers(L3) won't be reported you need to provide the topology using the configuration : https://github.com/skydive-project/skydive/blob/master/etc/skydive.yml.default#L84

another solution is to use Ansible : http://skydive.network/blog/ansible-library.html

or the Node/Edge API : http://skydive.network/blog/topology-rules.html

safchain avatar Jun 19 '19 07:06 safchain

For example, the switch needs to support lldp before it can be probed. What protocol does the router need to support?

RunningXJ avatar Jun 20 '19 02:06 RunningXJ

I have one machine for 192.168.4.14, another machine for 192.168.4.15, switch for Cisco, SG92-24. This switch has LLDP enabled. My agent configuration is as follows: Analyzers:    - 192.168.4.120:8082 Agent:    Topology:      Probes:        - lldp
The analyzers are configured as follows: Analyzer:           Listen: 192.168.4.120:8082 Agent:    Topology:       Probes:        - lldp

Why is there no switch in my network topology diagram?

RunningXJ avatar Jun 21 '19 08:06 RunningXJ

Without the logs, it's a bit difficult. Can you set the logging level to debug with:

logging:
  level: DEBUG

and paste the logs in the issue ? Thanks

lebauce avatar Jun 21 '19 09:06 lebauce

The following is the analysis node:

The following is the agent node:

RunningXJ avatar Jun 22 '19 02:06 RunningXJ

@RunningXJ The logs are incomplete. Screenshots are not the best way to send logs. Could you put the complete logs as text ? Thanks

lebauce avatar Jun 24 '19 07:06 lebauce

The last question has been resolved. I don't know much about this fabric network architecture, but according to online information, this TOR, or the concept of the switch? I mean whether it supports the discovery of routers for Layer 3 networks? Thanks

RunningXJ avatar Jun 25 '19 08:06 RunningXJ

The last question has been resolved.

So the LLDP probe is now working ? So you should now have a node for the Cisco switch with 2 ports attached to this switch. Then each Skydive agent should be linked to one of these ports. Right ?

I mean whether it supports the discovery of routers for Layer 3 networks?

Skydive does not support any L3 discovery. Only L2 discovery through the LLDP probe. If you have 2 agents that are not connected to the same L2 network, you can use the fabric probe as stated in my previous comment (https://github.com/skydive-project/skydive/issues/1867#issuecomment-502681521). This is simply a static configuration that describes manually the link between the nodes. The sample configuration I posted :

  • created a switch named TOR1 connected to a TOR1_PORT1
  • this TOR1_PORT1 is linked to the Skydive agent called agent1
  • same this with port TOR1_PORT2 connected to TOR1 and to the Skydive agent named agent2.

Of course, if the LLDP probe worked properly, this fabric configuration should not be necessary.

Hope this helps

lebauce avatar Jun 25 '19 09:06 lebauce

yes,it works! The two nodes I mentioned earlier can already be connected together as follows: The discovery of the L3-network will not be added in the future. In addition, I am currently trying to find an open source or free tool to discover the physical network environment and form a visual network topology. Do you have any suggestions?

RunningXJ avatar Jun 25 '19 09:06 RunningXJ

There is a chance that L3 discovery will be added in the future (we already discussed about it but I can't tell you when it will be done).

lebauce avatar Jun 25 '19 09:06 lebauce

Hahaha, I will continue to pay attention, can you give me some suggestions for finding tools? Thank you

RunningXJ avatar Jun 25 '19 10:06 RunningXJ

My question is similar to yours. There are two hosts and one switch. The host numbers are set to 192.168.1.100 and 192.168.1.50 respectively. I am not sure whether my switch has activated the LLDP probe, so I manually grab the port information in the form of fiber configuration. Why are there no two host nodes and one switch in my topology diagram.@lebauce @RunningXJ

15367060916 avatar Apr 08 '21 04:04 15367060916

This is my configuration file: analyzer: listen:192.168.1.15:8082 fabric: - TOR1[Name=tor1] -> TOR1_PORT1[Name=port1, MTU=1500] - TOR1_PORT1 -> *[Type=host, Name=agent1]/enp5s0 - TOR1[Name=tor1] -> TOR1_PORT2[Name=port2, MTU=1500] - TOR1_PORT2 -> *[Type=host, Name=agent2]/eno1

analyzers:

  • 192.168.1.15:8082

agent1:

  • 192.168.1.100:8081 agent2:
  • 192.168.1.50:8081

15367060916 avatar Apr 08 '21 04:04 15367060916

BTW,I would like to ask whether the same configuration is required on each host, that is, each host needs to be configured with the same analyzer address and two host agents. My current topology map is only my own host node, and I can't see another host, including the switch. @safchain

All the agents need to have the list of the analyzer set in their configuration file:

https://github.com/skydive-project/skydive/blob/master/etc/skydive.yml.default#L175

A usual deployment is

  • one analyzer
  • multiple agents

The standalone mode is there mostly for testing purpose, for a single node

15367060916 avatar Apr 08 '21 04:04 15367060916