Given a switch S1, I’d like to guess the target port of a switch S2 to which it is wired.
I can get their updated Mac Address Table (some say Address Forwarding Table) and that’s all. I can’t enable any CDP, LLDP or any other such protocol.
So with the MAT/AFT, I know that to reach a given set of mac address, I have to go through port P1 of switch S1. If S2 also holds all these mac addresses in its MAT/AFT, I can guess that they’re most probably wired together.
I tried finding if any port of S2 holds a bunch of MACs that can be found on S1, but with this I sometime got several candidate ports… or even none (which seems a little stupid to me). For the moment I do not analyse VLANs separately.
I wonder if anyone knows any good algorithm to infer the target port of S2?