# Minimal tests for six ethernet lines

I have been wiring my house with ethernet cables, and was testing the connections with a simple ethernet tester: you plug two cable ends into the tester, and it tells you if the cable ends are connected to each other and the 8 wires are in the correct order.

Let's say you have unlimited patch cables which are known good, and you want to verify that all wiring has been done as intended. You also want to do it without walking between buildings any more than is necessary.

The wiring is between two buildings, A and B, and there are 6 lines to test, 6 ports in one building, and 6 ports in the other: A(1-6) and B(1-6). All lines are wired from one building to the other: line 1 connects port A1 to port B1, line 2 connects A2 to B2, and so on.

For example, you could patch A1 and A2 together and go to building B to test that B1-B2 are connected as expected. However, this is not enough to prove that lines 1 and 2 are wired correctly, because if the connections cross, (B1-A2-patch-A1-B2) you'd get a false positive.

What's the minimal number of trips between buildings you have to do to make sure that all the wiring works, and every line is connected as expected?

• Can you patch 3 wires together? Or only 2? – Dr Xorile Dec 6 '18 at 17:39
• @DrXorile a patch cable has two ends, each end can connect to a port, or to the tester. – Bass Dec 6 '18 at 20:36
• Sorry someone has edited out the fact we are not just testing if wires are connected to each other, but if in fact, the 4 pairs inside an ethernet cable are in the correct order. To also confirm we know that A1 is cabled to B1 etc. @Bass what was the reason for removing that detail? – Simon Bennett Dec 6 '18 at 21:27
• Sorry, I thought it was inconsequential, but seems like I have misunderstood the question. Please re-edit the puzzle as you see fit, I was only trying to make things easier to read, since most of the folks here aren't net techs, and don't know how the wiring is supposed to be connected. – Bass Dec 7 '18 at 0:20
• Possible duplicate of Labeling wires in a *damaged* bundle – boboquack Aug 26 '19 at 4:08

Suppose you have the wires in a are 1-6. We'll call the wiring at b 1',2',...,6'. Then there are $$6!=720$$ possibilities on the other side for how the wires come out.

I believe it can be done in two trips:
1. You first connect 2 pairs at location a (1-2, 3-4) and walk across to b. This reduces it to 16 possibilities. You will know what the three pairs are, but will not know which pair is which (apart from whether it's connected or not) or which order. (1,2)(3,4)(5,6); (3,4)(1,2)(5,6). Because you don't know which wire is which, each of these pairs can be either way around, so it's 8 possibilities per group or 16 possibilities.
2. Next, you connect e.g. 2'-3' and 4'-5' at b and go back to test them at a. This reduces it to 1 possibility. E.g. suppose you discover that 1 and 6 are not connected while 2-3 and 4-5 are connected. Then you know that b is 1,2,3,4,5,6. Or if 4 and 6 are not connected while 1-3 and 2-5 are connected, then you know that b is 4,3,1,2,5,6. Etc.

I suspect this is optimal.

• I don't think this detects whether the line from A6 to B6 is faulty or not? – Bass Dec 6 '18 at 20:34
• Yeah, I misunderstood the question – Dr Xorile Dec 6 '18 at 21:48

It requires ...

1 trip only

... to find out that (1) either all are good or all are opposite or that (2) some are wired wrongly

How to find this ?

In room A, connect A1 to A2, A3 to A4 & A5 to A6.
Now go to room B and check by all combinations of Pairs, say B1 to B{2,3,4,5,6} which forms chains of 4 end Points.
If less than 3 Pairs show good, then some are bad. We figured that in one trip.
No more than 3 Pairs can show good. If exactly 3 Pairs show good, then connect one end Point of a Pair to one end Point of another Pair, and connect one end Point of the last Pair to either of the remaining end Points, which gives a chain of all 12 end Points.
If this chain shows good, then either all are good or all are opposite. We have figured that in one trip.

• The cables are all known to be good. It's the order which is the issue. – Dr Xorile Dec 6 '18 at 18:08
• @DrXorile , If the order is the issue and all are opposite, then how can we ever find out ? – Prem Dec 6 '18 at 18:24
• @DrXorile , In the last line, OP says "What the minimal number of trips you would have to do to test all lines are good?" , which I assume, means to find if all lines are good, which implies that it is not known if all lines are good. – Prem Dec 6 '18 at 18:28
• Ahh. I guess I misunderstood the question then. – Dr Xorile Dec 6 '18 at 19:14
• @DrXorile , no Problem, but I would not be surprised if the question wording got changed and this valid answer becomes invalid – Prem Dec 6 '18 at 19:39