Divide and conquer
Test the middle, and let the result tell you which half the fault is in. Each test halves the search, which suits long paths, tall stacks and long lists of changes.
Also known as: divide-and-conquer, in Cisco training material. In software it is also called bisection or a binary search for a fault.
How it works
- Write the path, the layers or the set of changes as an ordered list.
- Pick a point in the middle.
- Test there. Does the signal, request or behaviour arrive correctly?
- If it does, the fault is after that point. If it does not, it is before it. Discard the half that is cleared.
- Repeat with the remaining half until one component is left.
In Cisco training the starting point is a layer in the middle of the stack. A common example is to ping the destination: if the pings fail, check the lower layers, and if they succeed, check the upper layers. The same halving works on a path, and on a list of changes.
When to use it
- The path or stack has many parts and nothing points at any one of them.
- You can test at an arbitrary point, not only at the ends.
- You are looking for the change that broke something, among many changes.
When another approach is better
- You have a short list of suspects with a clear order of likelihood.Eliminationis simpler.
- The parts cannot be tested on their own. The halves will not mean anything.
Worked example
Illustrative example
A laptop reaches a database through a chain of eight components. Testing from the start could take up to eight tests. Halving takes three.
Chain: laptop, access point, switch, firewall,
router, load balancer, web server, database
Test at the firewall (4): works -> fault is in 5 to 8
Test at the load balancer (6): fails -> fault is in 5 or 6
Test at the router (5): works -> fault is at the load balancer (6)
The path was divided three times. The first test removed half the chain, the second removed half of what was left, and the third separated the last two candidates. Components 1 to 5 are cleared and 7 and 8 never needed testing.
The same idea finds a bad change. Version control tools can run the halving for you:
$ git bisect start $ git bisect bad HEAD $ git bisect good v2.3.0 # git checks out a commit halfway between; test it, then run # "git bisect good" or "git bisect bad" and repeat
Watch for
- An unreliable test. One wrong answer sends you into the wrong half and every later step is wasted.
- Intermittent faults. A pass may only mean the fault did not occur that time.
- Components that interact. A fault that needs two parts together will not sit in either half.
Related methodologies
-
Follow the path
: test every step in order.
-
Elimination
: test the most likely suspect first.
-
Spot the differences
: compare with how it was.
Sources
- Method name and the layered example:CCNP TSHOOT: Cisco Troubleshooting Techniques (Petri)andHow to Troubleshoot Networks (NetworkLessons).
- Extending the halving to paths and lists of changes, and the worked examples, are this site's own.
$ divide chain laptop -> database
- Component 1 Laptop ✓ Cleared
- Component 2 Access point ✓ Cleared
- Component 3 Switch ✓ Cleared
- Component 4 Firewall Test 1: works ✓ Cleared
- Component 5 Router Test 3: works ✓ Cleared
- Component 6 Load balancer Test 2: fails Test 2 failed here, and test 3 passed one step earlier. Start here. ✕ Fault found
- Component 7 Web server • Not checked
- Component 8 Database • Not checked
In practice
Examples and contributions
Entries appear here when a contributor tags them with this methodology.