SFP/Cable testing with VLANs
::: spoiler motivation I got some new sfp modules today, and i wanted to validate them... I was feeling lazy to drag two machines together to plug in the sfp modules for a point to point link (plus many machines don't even have sfp slots), I was feeling lazy to daisy chain two switches together to use the sfp modules.....
I do have iperf3 testing already setup on a stable host server pair in my network... so :::
Setup two vlans A, B. These vlans have no dhcp, no routes, nothing - Attach a interface to each vlan, assign as static ip address on the same subnet, run iperf3 in server mode. The test comes from how you bridge the vlans: A switch with vlan A on port A, and vlan B on port B, now if you plug in SFP.A and SFP.B and bridge with a cable... iperf3 can connect.
This extends your in place network path from interface A to interface B by forcing it to go over SW.PortA->SFP.A->Test Cable->SFP.B->->SW.PortB
Host interface A
│
│ VLAN A
▼
switch.portA ── Test SFP.A
│
│ test-cable
│
switch.portB ── Test SFP.B
▲
│ VLAN B
│
Host interface B
Run iperf3 in a loop, and now you can swap modules/cables and get the full benefit of a point to point cable test without having to move any machines around. This will even work with a single machine for testing, with a interface on A and B (different namespaces), you just have to double your iperf results mentally.
I realize this is fairly niche, and probably obvious to many people, but I just stumbled upon it today and thought it was pretty neat.
FWIW my SFP modules ran at 9.6gbps, so I'm happy with them!
3 replies
This feels illegal
The man is trying to get you not to use VLANs!
Can i interest you in a plastic baggie of dubiously sourced sfp modules?
Ah, the loopback network.
Edit: /j