Count the tunnels before you design
Topology is often chosen by habit: a full mesh because it gives the shortest paths, or hub-and-spoke because it is simple. A short calculation turns that into a decision. Every tunnel needs a BFD session to watch it, and every router has a limit on how many sessions it can hold, so the first design question is how many sessions each router will carry.
Count the sites, count the tunnels each pair of sites forms, multiply to get the sessions on each router, total for the fabric, then compare the busiest router with its limit.
- Siteshow many,and which kind
- Per pairtunnels fromallowed transports
- Per routersessions oneach router
- Fabrictotal tunnelsin the network
- Limitcompare thebusiest router
The arithmetic of a full mesh
Let N be the number of sites and K the number of tunnels that a pair of sites forms. With two transports that connect only to their own kind, K is 2. In a full mesh every site connects to the other N minus 1 sites, so each router holds (N minus 1) times K sessions and the fabric holds N times (N minus 1) times K divided by 2 tunnels.
| Sites | Sessions on each router | Tunnels in the fabric |
|---|---|---|
| 10 | 18 | 90 |
| 50 | 98 | 2,450 |
| 100 | 198 | 9,900 |
| 250 | 498 | 62,250 |
| 400 | 798 | 159,600 |
| 500 | 998 | 249,500 |
BFD sends hello packets on every session at a regular interval, commonly one second by default, so the sessions on a router also set how many hello packets it sends each second. A router with 998 sessions sends about 998 hellos every second in addition to user traffic, before counting the keys and the control traffic. The datasheet limit is the number to design against.
The same sites under different transport rules
Worked example (assumed limit, numbers computed by script). K is not fixed by the number of transports. It follows from which colors are allowed to connect. The example limit stays at 500 sessions.
| Transport rule | K | Sessions at 100 sites | Largest mesh at limit 500 |
|---|---|---|---|
| 2 transports, matching colors only | 2 | 198 | 251 sites |
| 3 transports, matching colors only | 3 | 297 | 167 sites |
| 2 transports, every color to every color | 4 | 396 | 126 sites |
| 3 transports, every color to every color | 9 | 891 | 56 sites |
The same 100 sites need 198 sessions on each router or 891, depending only on the color rules. When a design looks too big, check the color restrictions before blaming the topology.
Hub-and-spoke moves the load to the hubs
In hub-and-spoke a spoke connects only to the hubs. With two hubs and K equal to 2, a spoke holds 4 sessions however large the network grows. Each hub holds the sessions for every spoke, plus the sessions to the other hub, which comes to the same number as a router in a full mesh of that size.
In a full mesh every router carries the same large number of sessions. In hub-and-spoke the spokes carry only a few and the hubs carry the large number.
HUB-01#show sdwan bfd summary SESSIONS-TOTAL SESSIONS-UP SESSIONS-MAX SESSIONS-FLAP 198 198 198 0
Regions keep both numbers small
A regional design gives each region its own hubs. Spokes connect to the hubs of their region, and the regional hubs connect to each other across the network. With 20 regions of 20 sites, where each region has 2 hubs and 18 spokes, a spoke holds 4 sessions and a hub holds 36 for its spokes plus 78 for the other 39 hubs, which is 114 in total.
| Design | Spoke or branch | Hub | Tunnels in the fabric |
|---|---|---|---|
| Full mesh | 798 | Not applicable | 159,600 |
| Two central hubs | 4 | 798 | 1,594 |
| 20 regions, 2 hubs each | 4 | 114 | 3,000 |
How many regions?
Worked example (assumed values, numbers computed by script). Take 400 sites, K = 2, two hubs per region and the example limit of 500 sessions. A regional hub holds one set of sessions for its own spokes and one for every other hub in the network, so changing the number of regions moves load between the two.
| Regions | Sites each | Busiest hub | Headroom | Tunnels in the fabric |
|---|---|---|---|---|
| 1 (central hubs) | 400 | 798 | Over by 298 | 1,594 |
| 2 | 200 | 402 | 20% | 1,596 |
| 4 | 100 | 210 | 58% | 1,624 |
| 8 | 50 | 126 | 75% | 1,776 |
| 16 | 25 | 108 | 78% | 2,464 |
| 20 | 20 | 114 | 77% | 3,000 |
| 40 | 10 | 174 | 65% | 7,600 |
The busiest hub is lightest at about 16 regions. Fewer regions leave each hub carrying many spokes. More regions leave each hub carrying many other hubs, and the tunnels in the fabric keep growing. Four regions already leave more than half of the limit free. Going from 4 to 16 saves 102 sessions on the busiest hub but adds 840 tunnels to the fabric, so the lowest hub count is not the best design.
If a design needs more sessions than a platform can hold, reduce the sessions per router by adding regions, by sending branch traffic through hubs, by restricting which colors connect, or by using tunnels that are built only when needed.
- Regionshubs per regionlimit the mesh
- Hub pathsbranch trafficgoes via hubs
- Color rulesfewer tunnelsper site pair
- On demandtunnels builtwhen needed
A worked case: the mesh that does not fit
A retailer plans 400 stores with two transports each and wants a full mesh because every store talks to every other store for inventory transfers. The branch model it wants to buy has a datasheet limit that, for this lesson, is taken as 500 sessions. The figure is an example. In a real project it comes from the datasheet and release notes for the model and software release in use.
Four hundred sites with two transports need 798 sessions on each router in a full mesh. The example limit is 500, so the design does not fit. A regional design needs at most 114 on any router, which fits.
- Requirement400 sites, 2 transportsK = 2 tunnels per pair
- Full mesh(400 - 1) x 2 = 798 sessionsExample limit 500: does not fit
- RegionalSpoke 4, hub 114 at mostFits with room to grow
- DecisionRegional hubs with a core meshInventory traffic uses the hub path
The trade is path length. Store-to-store inventory traffic now crosses a regional hub instead of going directly, which adds a little latency that the transfers can tolerate. Where a few store pairs truly need a direct path, a small number of extra tunnels, or tunnels built only when traffic needs them, can be added without turning the whole design back into a full mesh.
Learn more: Hub-and-Spoke vs MeshTLOC ComponentsDual-Hub Data Center Design
Test yourself
A full mesh has 60 sites with two transports, and a pair of sites forms 2 tunnels. How many BFD sessions does each router hold?
A network has 10 sites in a full mesh and each pair forms 2 tunnels. How many tunnels are in the fabric?
A design uses two central hubs for 100 sites. Which statement is correct?
The count on a hub is lower than the formula says. What is the most useful reading?
Each site has 3 transports and every color may connect to every color. How many tunnels does one pair of sites form?
The example limit is 500 sessions and K is 3. What is the largest full mesh that fits?
For 400 sites, 16 regions give a busiest hub of 108 sessions and 4 regions give 210. Why not keep adding regions?