Skip to content

ProfessionalLesson 12 of 14

Running it day to day ​

Running a network day to day is three jobs: changing it without breaking it, fixing it fast when it breaks anyway, and knowing what you have.

With Circuit, a change is a change to a file. So it goes through the same steps as a change to software: a branch, a plan anyone can read, and a second person who reviews it. Git records who did what, and why.

A change, from request to device ​

Every change follows the same steps, whatever its size:

  1. A request that someone can point to later, saying who asked, for what, and by when. Usually it is a A numbered record of a request or a problem, where everyone involved writes what they did, so the history stays in one place..
  2. A branch in git, so nothing reaches main, or a device, before review.
  3. The change to the files, and circuit validate.
  4. The plan, circuit diff <device>, against what the device runs now.
  5. A pull request with the request linked and the plan pasted in.
  6. Review by someone else.
  7. A window, a time agreed in advance with whoever the change can affect.
  8. Apply, circuit apply <device>. Read the plan, then say yes.
  9. Check that it works.
Try itWalk one change through

Netflix, a tenant of the colocation example, asks for a port for a third server.

Ticket
From:     Netflix
Asks for: a port for a third server, server 3, rack A1
Needs:    the same two networks as servers 1 and 2
By:       Thursday

Step 1 of 9

The request

A request someone can point to later.

The diff in the pull request was read from the device days before the window, and apply reads it again. If the plan from apply is longer, the device changed since, most likely by hand. Answer no, and find out why, because apply would remove whatever someone added by hand.

Merge and then apply, or apply and then merge. Do both in the same window.

Reviewing a change ​

A reviewer isn't there to check the spelling of a VLAN name. circuit validate does that, and Continuous integration: a service that runs checks, such as circuit validate, on every pull request. It shows whether they passed. can run it on every pull request. A reviewer reads the plan and asks what a computer can't:

  • Does validate pass? If not, there is nothing to review yet.
  • Does the plan do only what the request asks? Look hardest at the lines that start with -, because something that exists now is going away.
  • Who notices, and when? That decides the window, and who must be told.
  • How is it undone? Usually by reverting the commit and applying again. If the answer is harder than that, the change needs a plan of its own.
Try itReview three pull requests

Pull request 1: Give Netflix a port for server 3

The request: Netflix asked for a third server port, with the same networks as servers 1 and 2.

tenants/netflix.ts
ethernet: {
    "40g-1": { trunk_vlans: ["netflix-internet"] },
    "10g-1": { description: "netflix server 1", trunk_vlans: ["netflix-internet", "netflix-private"] },
    "10g-2": { description: "netflix server 2", trunk_vlans: ["netflix-internet", "netflix-private"] },
    "10g-3": { description: "netflix server 3", trunk_vlans: ["netflix-internet", "netflix-private"] },
},
CI: validate
$ circuit validate
✔ 2 device(s), no errors.
The plan the author pasted
$ circuit diff tor-01
tor-01: 7 command(s) in 1 step(s)
  interface 10GE1/0/3
    - shutdown
    + description netflix server 3
    + port link-type trunk
    + undo port trunk allow-pass vlan 1
    + port trunk allow-pass vlan 1001 2001
Ask what a reviewer asks

Read the request, the file, and the plan, ask your questions, then decide.

Not every mistake has a check written for it. When none does, the plan shows the mistake on its - lines. A valid file isn't always the change you meant, and that is what review is for.

Studio's Compare shows the change as a network. It shows each device's config then and now, the lines of the graph that are added or gone, and what validate finds now that it didn't before. Compare the pull request's branch with main before you approve it.

CheckCI passed and the plan for tor-01 shows an interface losing two VLANs that belong to a tenant who did not ask for anything. What do you do?

The window and the way back ​

A change that can affect customers goes out in a A time agreed in advance, usually at night or early morning when traffic is low, when planned work may interrupt service., announced to whoever can notice. How far in advance is a matter of contract: one exchange, for example, announces its windows at least seven days ahead. An emergency, such as a fix for an outage in progress, skips the wait, but is still written down and announced as one.

In the window, apply one device at a time, starting where a mistake hurts least, and check each before the next. Circuit tests the plan first where the platform allows it, and makes sure it doesn't lock you out. Make a change says how, platform by platform.

That protects your access, not your customers. For anything else, the way back is to revert the commit and apply again.

CheckIn the window, circuit apply tor-01 shows a plan of 40 lines. The plan in the pull request had 7. What do you do?

When it breaks ​

Something breaks anyway: a fiber is cut, a device fails, or a change does something nobody expected. Large networks keep a Network operations center: the people, often working in shifts, who watch the network and answer when it breaks., a team that watches the network around the clock. Smaller ones have an engineer Being the person who must answer alerts and calls outside working hours. People take turns by the week or by the shift.. Either way, an outage goes better with rules agreed before it starts. The Google book on running large systems gives these:

  1. Declare an incident early. It is one if a second team must help, if customers can see it, or if an hour of focused work hasn't solved it. Closing a small one quickly costs little.
  2. One person runs it, the incident commander, who decides and hands out the work. The people fixing it are the only ones changing anything.
  3. One person talks to everyone else, customers included, with regular updates.
  4. Keep a live document of what is known, what was tried, and who is doing what, with the most important part at the top.
  5. Afterwards, write a postmortem without blame: the impact, what was done, the causes, and what stops it happening again.

If a change went out just before the trouble began, undo it first, and ask why afterwards. So keep every change small, written down, and easy to revert.

On October 4, 2021, during routine maintenance, a command meant to assess the capacity of Facebook's backbone disconnected every link of it. A tool that audits such commands should have stopped it, but had a bug. Facebook's DNS servers stop announcing their routes when they can't reach the data centers. So they withdrew them, and nobody outside could find any of the company's services.

The A separate path to manage devices, such as a separate network or a console line. It keeps working when the main network does not. network was down too, so engineers had to travel to the data centers. They brought services back in stages, because switching everything on at once could have overloaded power and systems. That outage needed every safeguard in this lesson: a check before the change, a way in that doesn't depend on the network, and a careful way back.

Keeping the plant written down ​

A provider keeps three records besides the configs:

  • Data center infrastructure management: the record of racks, what is mounted where, power feeds, and every cable from one port to another. holds the racks, what is mounted in which unit, the power feeds, and every cable from end to end.
  • IP address management: the record of which prefixes and addresses are used where, and which are free. holds every prefix and address, who has it, and what is free.
  • Capacity says how full each port, link, and device is, from the monitoring in Watching the network, so an upgrade is ordered before a link fills.

Circuit already has part of this. The files know every device, port, cable (link), VLAN, and address. Studio and circuit addresses list every address in use, and what is free.

What Circuit doesn't know is the physical plant: racks, power, serial numbers, and which building a device is in. Many networks keep that in NetBox, which combines IPAM and DCIM. circuit sync netbox keeps NetBox in sync with your config, one way. Circuit writes, and NetBox shows. Each device's site and role place it there. See NetBox.

Further reading ​

Discussion

Stuck, or found a mistake? Ask here. You sign in with GitHub.

Released under the Business Source License 1.1.