Roles in a network
A network bigger than one room is laid out in layers, and every device in it has one role: edge, core, aggregation, or access.
Why lay a network out by role
A network that grew one device at a time, each plugged in where there was a free port, works until something breaks. Then nobody can say which way traffic goes, which devices a failure takes down, or what a new device should look like.
Roles fix that, because each layer has one job:
- Devices of one role look alike. Every rack switch has the same uplinks, VLANs, and logins. In Circuit they share one part, and differ only in their ports.
- Each layer grows on its own. A new rack gets a new access switch and two cables up. Nothing changes in the layers over it, except two ports.
- A failure stays inside its layer. With devices in pairs at every layer over the racks, one can fail without cutting anything off.
- Traffic takes known paths. It goes up from the access layer, across the middle, and back down, or out through the edge.
The roles, from the outside in
| Role | Also called | What it does | What plugs into it |
|---|---|---|---|
| Edge | Border | Joins your network to others, and runs the BGP sessions and policies | Transit providers, exchanges, links to your other sites |
| Core | Backbone | Carries traffic between the parts of the network as fast as it can | The edge over it, and aggregation or access under it |
| Aggregation | Distribution | Gathers many access switches, and often routes between their VLANs | The core over it, and access switches under it |
| Access | Top of rack, in a data center | Where hosts plug in | Servers, desks, access points |
The The router where your network meets other networks: transit providers, exchanges, and peers. Also called a border router. faces outward, and every lesson of Intermediate was about it.
Core means two things, and a provider meets both. Inside one site, it is the middle switch, or pair of switches, that the rest of the site hangs from. Across a whole provider network, it is the backbone. This is the routers and long links that join the provider's Point of presence: a place, usually a rack or a room in a data center, where a network has equipment and others connect to it. to each other, with no customer plugged into them. The standard for provider VPNs calls those P routers. It calls the routers that customers plug into PE routers, for provider edge.
The aggregation layer exists because a core switch has only so many ports. When a site has dozens of access switches, they join aggregation switches first, and only those join the core. A small site has nothing to aggregate, so one pair of switches does both jobs. That is called a A design in which the core and the aggregation layer are the same switches, because the site is too small to need both..
Access is the bottom layer, where hosts plug in. In a data center the access switch sits at the top of each rack, so it is called a A switch at the top of a rack of servers. Every server in the rack is cabled to it, and it has a few uplinks to the next layer. ToR for short., or ToR.
These are the ten devices of a small provider with two sites.
Read what is plugged into each device below, then give it a role.
Device 1 Site A, rack 4: customers' servers, and one cable up to each of the two switches in the middle of the site.
Device 2 Site A, rack 1: Hurricane Electric for transit, DE-CIX Frankfurt, a cable to its twin, and a trunk down to one of the switches in the middle of the site.
Device 3 Site B: a trunk up to the edge router, the office's printer and phones, customers' servers, and one rack switch under it.
Device 4 Site A, rack 2: a bundle up to the second edge router, its twin beside it, and a cable down to every rack switch at the site.
Device 5 Site B, rack 2: customers' servers and six office desks, with one cable up.
Device 6 Site B, rack 1: Arelion for transit, the leased line to site A, and a trunk down to the switch under it.
Device 7 Site A, rack 3: customers' servers, and one cable up to each of the two switches in the middle of the site.
Device 8 Site A, rack 1: a trunk up to the first edge router, its twin beside it, the site's own servers, and a cable down to every rack switch.
Device 9 Site A, rack 2: Cogent for transit, DE-CIX Frankfurt, the leased line to site B, and a bundle down to the second switch in the middle of the site.
Device 10 Site A, rack 5: customers' servers on 25G ports, and two cables bundled up to each switch in the middle of the site.
The roles came from what was plugged in, not from the device's model or size. The two edge routers at site A are the same model as the one at site B, and so are several of the switches.
The middle switches of both sites take two answers. Site A has a pair in the middle, and every rack switch hangs from both. They sit in the OSPF backbone area with the edge routers, so this network calls them core-a1 and core-a2. Site B has one switch that gathers an office and one rack, in an OSPF area of its own, so this network calls it agg-b1. Both are collapsed cores.
Names that say the role and the place
A device's name shows up everywhere. You see it in the prompt when you log in, in every log line it sends, and in the graphs of your monitoring. The devices around it see it too, because Link Layer Discovery Protocol: each device tells the device at the other end of each cable its own name and the port the cable is on. tells each neighbor the device's name. A name that says the role and the place answers the first question of every incident, "where is this?", before anyone opens a drawing.
The network in the widget uses one rule for all ten devices: role, a hyphen, the site's letter, and a number.
| Part | In tor-a3 | Says |
|---|---|---|
| Role | tor | A top-of-rack switch |
| Site | a | At site A |
| Number | 3 | The third device of that role there |
A few rules keep a naming scheme working for years:
- Use only lowercase letters, digits, and hyphens. A hostname may use only these characters. Names compare without regard to case, so lowercase avoids two spellings of one name.
- Name the role and the place, nothing that changes. A device's model, its owner, or the customer it serves change over its life, but its role and site rarely do. A name written into fifty files and every log shouldn't need to change when a customer leaves.
- Number within the role and the site. The pair is
edge-a1andedge-a2, so the twin of a device is easy to guess, and a third one isedge-a3. - Keep it short. You type it in commands and read it in narrow columns.
- Write the rule down once, so the next person names the next device the same way.
Inside a data center: leaf and spine
The layers so far form a tree. Each access switch has uplinks to its aggregation pair, and each aggregation pair to the core. A tree has two weaknesses in a large data center:
- Traffic between two racks under different aggregation switches has to climb to the core and back down.
- To add racks, the switches near the top need more ports, until bigger switches must replace them.
Large data centers use a A network of switches in two layers. Every switch in the lower layer, a leaf, has a link to every switch in the upper layer, a spine. Also called a Clos network. The switches of a data center or an exchange, and the links between them, built to work as one network. instead. The leaves are the top-of-rack switches, and every leaf has one link to every spine. No leaf is joined to another leaf, and no spine to another spine.
Send a flow from rack 1 to rack 3, then send another. Then fail a spine.
| Cables between leaves and spines | 2 x 4 = 8 |
| Ports each spine needs for leaves | 4, one per leaf |
| Uplinks each leaf needs | 2, one per spine |
| Equal paths between two racks | 2 |
| Capacity left between racks | 100% |
What you saw follows from the cabling:
- Every pair of racks is three switches apart: leaf, spine, leaf. No path is longer than another.
- There are as many equal paths between two racks as there are spines. Each leaf shares The packets of one conversation, such as one download: the same source and destination addresses, ports, and protocol. over all of them with Equal-cost multipath: when several paths cost the same, the router shares traffic across all of them.. A router picks the path for a packet from the fields that tell its flow apart, such as its addresses. So the packets of one flow keep to one spine and arrive in order, while different flows spread out.
- A failed spine takes away a share of the capacity, not the connection. The leaves stop using it, and nothing else has to change.
- The fabric grows sideways. A new rack is one more leaf, and one cable to each spine. Each spine needs one port per leaf, so the ports on a spine set how many racks the fabric can hold. More capacity between racks means one more spine.
The provider in the widget isn't a data center, so its sites are trees, the right shape at that size. A leaf-spine fabric starts to pay off when there are more racks than a core pair has ports for. It also pays off when most traffic goes from rack to rack, rather than out to the internet.
Roles in a Circuit project
A device's role is free text, such as Top-of-rack switch. Circuit only passes it to NetBox, as the device's role there. The role shows in the device's name, in where its file lives, and in what it shares with devices like it. A larger network keeps each site's devices in a folder of their own:
circuit.ts the AS, address space, sites, and checks
sites/site-a/site.ts what the site's devices share: VLANs, addresses
sites/site-a/edge-a1.ts edge-a2.ts
sites/site-a/core-a1.ts core-a2.ts
sites/site-a/tor-a1.ts tor-a2.ts tor-a3.ts
sites/site-b/edge-b1.ts agg-b1.ts tor-b1.tsEach device file gives the device its name. Every cable uses that name to say which device is at its far end:
// sites/site-a/tor-a1.ts
import { as64500 } from "../../circuit";
export default as64500.device({
name: "tor-a1",
site: "site-a",
role: "Top-of-rack switch",
platform: "vrp",
model: "CE6855-48S6Q-HI",
connection: { host: "10.0.99.6", user: "operator" },
system: {
users: { operator: { role: "admin", password: secret("TOR_A1_PASSWORD") } },
},
// ...
interfaces: {
ethernet: {
"40g-1": { description: "core-a1 40GE1/0/2", trunk_vlans: ["mgmt"], link: { device: "core-a1", port: "40g-2" } },
"40g-2": { description: "core-a2 40GE1/0/2", trunk_vlans: ["mgmt"], link: { device: "core-a2", port: "40g-2" } },
},
},
switching: {
vlans: { mgmt: { id: 99, description: "Management" } },
},
});circuit validate checks that each link points to a device in the network, and that the far end links back. It also checks that both ends carry the same VLANs. Studio draws its cables from these links. What every switch shares, such as its logins, can be written once as a part that each switch takes with include.
Further reading
- RFC 7938, on BGP in large data centers: tree designs compared with leaf-spine designs, ECMP across the spines, and what a failed spine does.
- The hierarchical network model, on Wikipedia: the core, distribution, and access layers.
- RFC 4364, section 1.2, where P, PE, and CE routers are defined.
- RFC 952 and RFC 1123, section 2.1: which characters a hostname may use.
- Link Layer Discovery Protocol, on Wikipedia: what a device tells its neighbors, its system name included.
- RFC 2992, on choosing the path by hashing the fields of a flow.