netdiag

netdiag

Find the cause of a network problem at any layer, and get the next step.

The demos run the diagnosis model of netdiag in your browser. They send no packets: you give the observations, a simulated network gives them, or a report of a real check gives them.

1. Name the cause from the observations

Pick a value for each thing that you observed. diagnose gives the probability of each cause of the catalog, and explain tells why.

The most probable causes

Select a cause to see why it has its probability.

    Why

    2. Find a hidden fault, one probe at a time

    A simulated network has one fault. Each probe draws its facts from the likelihoods of that fault. rankProbes puts first the probe with the largest expected information gain.

    The probes, from the largest gain

      The most probable causes

        The probes so far

          3. Score the catalog in a simulated lab

          The lab makes each fault many times, and the probes observe it. scoreLab gives the recall of each fault with its Wilson interval. labGate holds the lower end of each interval with a bar.

          The lab draws each observation from the likelihoods of the catalog. Thus a recall here tests the model on its own assumptions, not on real networks. The real bars come from the kernel lab, with faults on real networks.

          The probes of each run

            No reader of netdiag gives the link state or the Wi-Fi signal yet, so no probe of the demo observes them. Compare the rows of interface.down and wifi.weak.

            4. Read a check report

            The command netdiag check <target> --json writes a report. Pick a report of the loopback lab or of the kernel lab, or open your own report. The page reads your file in your browser and sends it nowhere.

            Paste a report

            Where the fault is

            Each box is a part of the network, from your computer to the service. Its shade is the probability of a fault in it.

              Where the loss starts

              Each row is a hop of the path that mtr traced, from your computer to the destination. Red rows are the part where the loss can start.

              The observations of each layer

                The most probable causes

                  The next step

                  The probes in time

                  5. Where each fault class is tested

                  Each fault class must have a test on each layer of the lab, from code on a false clock (E0) to real hardware (E6). A cell is one class on one layer. The work ends only at zero gaps, and a gate in CI stops a rise of the count of gaps.

                  The layers of the lab

                    The layers and their limits come from the table of the plan S7. A cell is impossible only when its class needs a thing that the layer cannot prove. The command pnpm --filter @netdiag/lab roadmap writes the data of this demo.

                    Install

                    pnpm add @mark1russell7/netdiag
                    import { STANDARD_CATALOG, diagnose } from "@mark1russell7/netdiag/diagnosis";
                    
                    const result = diagnose(STANDARD_CATALOG, [
                      { feature: "icmp.reply", value: "none", primary: true },
                      { feature: "tcp.connect", value: "connected", primary: true },
                    ]);
                    // result.causes[0].id is "filter.icmp": a filter blocks ICMP, and the host is up.

                    Releases shows each version, and Status shows the open work.