4

In a fully-switched network, switches use a spanning tree to forward frames as you know.

From a machine connected physically to any switch (say A), how could I know the frames traversing path from A to a machine connected to another switch (say B) if I have several possible paths between A and B?

As well, shall I know the root switch, or I should determine it?

P.S. I don't have access to switches.

  • As Ron said, without access to the switches, you cannot tell. There's no such thing as a "layer-2 traceroute". VLANs make things much more complicated as the port may be forwarding but the VLAN not. – Ricky Beam Apr 27 '15 at 20:52
  • thank you @RickyBeam. Would you please check my inquiry down Ron's answer. – Mohamad-Jaafar NEHME Apr 28 '15 at 7:31
5

If you can't access the switches there's not much you can do. Switches don't modify the Ethernet frames.

Even if you could query snmp mibs (to me, that's called having access), you would have to infer the topology. That isn't always accurate and you'd have to query every device you detect. All ports could be forwarding, but you wouldn't necessarily know which one your data was flowing out of without also querying the forwarding table.

  • Thank you. So, is it accurate to infer the next switch(es) of the spanning tree for instance using SNMP queries? – Mohamad-Jaafar NEHME Apr 28 '15 at 7:29
  • You wouldn't know that there was a switch or switches downstream. You could tell that traffic was being forwarded out port 2, for example, but not that there is another switch on port 2. If you already have a topology map, then you can infer that. – Ron Trunk Apr 28 '15 at 10:25
5

STP has a series of steps it uses to determine which paths are used and not used.

Your question has already been asked and answered here:

"Not sure how much you know about switching and spanning tree but basically when starting out all switches claim that they are the root. All switches send BPDUs (Bridge Protocol Data Unit) which contain a priority and the BID (Bridge ID).

The BID is 8 bytes long. 6 bytes is used for the MAC address of the bridge. 12 bits is used to indicate the VLAN, this is called extended system ID. 4 bits are used to set the priority. Lower priority means it is preferred compared to a higher. The priority is set in multiples of 4096.

If there is a tie in priority then the lowest MAC address will determine which bridge becomes the root.

To select the path to the root the cost to the root is calculated. As the BPDU travels from the root downstream the cost is increased INBOUND. 802.1D-1998 (legacy STP) had a cost of 19 for a FastEthernet interface. The newer standard 802.1D-2004 defines a cost of 200000 for FastEthernet.

If there is a tie in cost then choose the BPDU that came from the switch with lowest BID. If that is a tie as well (multiple links to same switch) port ID comes into play. The port ID is from the upstream switch as well and consists of a port priority and port ID which identifies the interface. The default port priority is 128.

There is a lot to spanning tree but these are the basic steps."

  • thanks @Barry, I don't want to determine the path nor to guess it. I want to get the next node from the switch. Something like snmp request. – Mohamad-Jaafar NEHME Apr 27 '15 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.