Network Design and Architecture Questions
Designing networks at the topology level: data-center fabrics (spine-leaf/Clos, ECMP path selection, underlay and overlay, VXLAN, GENEVE and EVPN-VXLAN, multi-pod and multi-site, lossless RDMA and AI fabrics, low-latency designs), campus and branch design (hierarchical access/distribution/core, small-office design), and WAN and backbone architecture (MPLS label switching, segment routing with SR-MPLS and SRv6, RSVP-TE versus SR-TE, provider POPs and private L3 VPN service, SD-WAN and MPLS migration, multihoming, internet edge, transit and peering cost, backbone and interconnect). Covers redundancy and resilience at the link, device and site level, QoS design, bandwidth and capacity growth planning, segmentation and tenant isolation at design level, the management network, inline service placement, physical constraints such as cabling, optics and power, and equipment and vendor selection with justification. The architecture layer above configuration. Excludes protocol configuration mechanics and BGP or OSPF policy, VLAN and STP operation, cloud VPC and hybrid-cloud design, firewall and zero-trust security design, load balancing, fault diagnosis, telemetry collection, device automation or SDN controller operation, and application-level failover and disaster recovery testing, which are covered elsewhere.
Design the topology for a small campus with about 200 users and four shared services (directory, DNS, file and print). Which physical topology would you choose, and what would make you change it as the company grows?
Sample Answer
Direct answer
Use a dual-star: two core switches in the server room (the central switches everything else plugs into), with every wiring closet (a small room on each floor holding the switches that user ports cable to) connected to both cores. Do not use a bus (obsolete), a ring (extra hops and a protocol needed to break the loop) or a full mesh (links grow quadratically). Change it when a user subnet nears its address limit, closet uplinks run busy, a second building appears, or the core runs out of ports.
The design
Assumptions: 200 users in four wiring closets (56, 56, 56 and 32 users), 10 wireless access points, 8 printers, 30% spare ports. The four services are directory (Active Directory, the Windows identity service), DNS (the service that turns names into IP addresses), file and print.
+----------+ 2x10G +----------+
| core-a |===========| core-b |
+----------+ +----------+
/ | | \ / | | \
(each closet stack has one 10G cable to core-a and one to core-b)
closet-A closet-B closet-C closet-D
(2 sw) (2 sw) (2 sw) (1 sw)
Wiring: the two switches in a closet are joined by stacking cables, so they behave as one logical switch. Each closet has one 10G uplink cable to core-a and one to core-b. In the three two-switch closets (A, B and C) the two cables leave from different member switches, so losing one switch still leaves a path for the users on the other. Closet D has a single switch, so both of its uplinks leave from that one switch: that survives the loss of a core or a cable but not the loss of that switch, which would take its 32 users off the network until it is replaced. I accept that at this size, keep a cold spare switch, and would add a second switch to closet D as it grows. Stacking cables stay inside the closet and are not counted as uplinks. The 2x10G between the cores is counted as one core-to-core link (a bundle of two cables).
Links: 4 closets x 2 uplinks (one cable to each core) + 1 core-to-core bundle = 9 links. A full mesh of the same 6 devices needs 6 x 5 / 2 = 15.
Access switches (48 ports each): ports needed per closet are users + access points + printers, times 1.3 for spare, rounded up to whole switches.
| Closet | Ports used (users + access points + printers) | With 30% spare | Switches | Ports installed |
|---|---|---|---|---|
| A | 56 + 3 + 2 = 61 | 80 | 2 | 96 |
| B | 61 | 80 | 2 | 96 |
| C | 61 | 80 | 2 | 96 |
| D | 32 + 1 + 2 = 35 | 46 | 1 | 48 |
Worked step for closet A: 56 + 3 + 2 = 61 ports; 61 x 1.3 = 79.3, rounded up to 80; 80 / 48 = 1.67, so 2 switches, which is 96 ports. Closet D: 32 + 1 + 2 = 35; 35 x 1.3 = 45.5, rounded up to 46; 46 fits in 1 switch of 48. That is 7 access switches (2 + 2 + 2 + 1), 7 x 48 = 336 ports. The 10 access points split as 3, 3, 3 and 1 across the closets, and the 8 printers as 2 per closet.
Addressing and VLANs. A VLAN is a virtual LAN: one switch network split into separate broadcast domains, each given its own subnet. How to read a prefix like /25: an IPv4 address has 32 bits and /25 fixes the first 25 as the network part, leaving 32 - 25 = 7 bits for hosts. 2^7 = 128 addresses, minus 2 (the all-zeros network address and the all-ones broadcast address, which no host can use) = 126 usable hosts. In the same way /26 leaves 6 bits: 64 - 2 = 62, and /27 leaves 5 bits: 32 - 2 = 30. The whole block 10.20.0.0/22 leaves 10 bits, so it spans 1,024 addresses, 10.20.0.0 to 10.20.3.255; every subnet below sits inside it and none overlap (a /25 covers 128 addresses, so the next /25 starts 128 higher).
| VLAN | Purpose | Subnet | Usable hosts | Planned use |
|---|---|---|---|---|
| 10 | Users, closet A | 10.20.0.0/25 | 126 | 56 |
| 20 | Users, closet B | 10.20.0.128/25 | 126 | 56 |
| 30 | Users, closet C | 10.20.1.0/25 | 126 | 56 |
| 40 | Users, closet D | 10.20.1.128/26 | 62 | 32 |
| 50 | Servers | 10.20.2.0/27 | 30 | 3 servers plus gateways |
| 60 | Switch management | 10.20.2.32/27 | 30 | 9 switches (7 access + 2 core) |
| 70 | Printers and access points | 10.20.2.64/27 | 30 | 18 (10 access points + 8 printers) |
Services: two directory servers that also run DNS (one per core so either core can fail), and one file and print server. The file and print server is a single point of failure that I accept at this size, and I would say so plainly.
Spanning tree (STP, the protocol that blocks redundant links to prevent loops): switches elect one root bridge, the reference switch every other switch calculates its loop-free path toward. Run Rapid STP (the faster-converging version) with core-a as the root bridge and core-b as the secondary, set by a lower priority number on core-a. With only STP, each closet uplink to the non-root core sits blocked until the other fails. Better still, pair the cores with multi-chassis link aggregation (two core switches present themselves to a closet as one switch, so both uplinks forward at once and neither is blocked).
Is the uplink big enough
Oversubscription is the ratio of the bandwidth users could demand to the bandwidth of the uplink that carries it. Worst case is a 96-port closet: 96 x 1 Gbps = 96 Gbps of port capacity over 2 x 10 Gbps = 20 Gbps of uplink, so 96 / 20 = 4.8 to 1 on paper. In practice, if about 61 hosts are busy at an assumed 20 Mbps each, that is 61 x 20 = 1,220 Mbps = 1.22 Gbps, which is 1.22 / 20 = 6% of the 20 Gbps and 1.22 / 10 = 12% of one 10G uplink if the other fails. Nothing here runs at 100%. Replace the 20 Mbps with your own measured 95th-percentile figure after the first month (sort the month's 5-minute readings and take the value that 95% of them fall below, which ignores brief spikes but shows the sustained busy hours).
What would make me change it
The thresholds in this table are illustrative starting values, not standards. Set yours from your own baseline.
| Trigger | Threshold | Change |
|---|---|---|
| A user subnet fills | Above 75% of a /25, which is 94 hosts (0.75 x 126 = 94.5, rounded down) | Split the VLAN or move to a larger block |
| Uplink load | 95th percentile above 5 Gbps on one uplink | Add uplinks or move to 25G |
| Spare ports | A closet under 10% free | Add a switch before it hits zero |
| Second building or site | Any | Routed link with its own subnet, not a stretched VLAN |
| Services need different trust levels | e.g. a finance share | Put them behind a firewall in their own VLAN |
| Core ports exhausted | Under 4 free 10G ports per core | Add a distribution layer so closets stop landing on the cores |
Past a few hundred more users the usual move is a three-tier design (access switches, a distribution layer that aggregates closets and does the routing between VLANs, and a core on top), which keeps each failure domain small. A failure domain is the set of users or services that one fault can take down together.
Pitfalls
- VLAN 70 spans all closets. That is acceptable here, but each extra stretched VLAN widens the spanning-tree domain.
- Two cores only give redundancy if each closet really has a cable to each. Test by pulling one uplink per closet during the install.
- Put the servers on VLAN 50 behind the cores (cabled to the core switches themselves), not in a closet, so a closet failure does not take out directory and DNS together.
Where would you insert inline services such as a firewall, IDS and NAT in a data center, and how do physical, virtual and software-defined steering approaches differ in scaling, state handling and failure behavior?
Sample Answer
Direct answer
Put the stateful north-south services (firewall, NAT, inline intrusion prevention) in one dedicated tier on the border leaf pair (the leaves that connect the fabric to the outside world and also host the service appliances, so they act as the service leaves), sized as N+1 (N is the number of units that carry peak load while staying under a stated utilisation ceiling, plus one spare, so that after losing one unit N are still running). Hang the intrusion detection sensor off a passive copy of the traffic so that its failure can never interrupt production. Enforce east-west policy as close to the workload as possible instead of hairpinning it through the border. The three steering approaches differ mainly in where the session state lives: in a physical appliance (fixed capacity per box, state lost or synchronised when the box fails), in a virtual appliance (scales by adding instances, lower throughput per instance, state dies with the VM), or in a controller-programmed distributed layer (scales with the number of hosts, state sits beside the workload, no central choke point).
Terms used here: north-south traffic crosses the data center boundary (clients or the Internet to servers) and east-west traffic stays between servers inside it; the fabric is the leaf and spine network connecting the racks; a border leaf is the leaf that connects the fabric to the outside world and a service leaf is a leaf that connects service appliances; hairpinning means sending traffic out to a distant box and back along the same path; micro-segmentation means enforcing a separate policy around each workload; anti-affinity means placing two VMs on different hosts on purpose; IDS (intrusion detection system) raises alerts from a copy of traffic; IPS (intrusion prevention system) sits in the path and can drop packets; NAT (network address translation) rewrites addresses and keeps a translation table; a VRF (virtual routing and forwarding instance) is a separate routing table on the same switch; PBR (policy-based routing, a forwarding rule on something other than the destination) forwards on a rule such as source address or port instead of destination alone; ECMP (equal-cost multipath) spreads flows over several equal next hops by hashing; a TAP is a passive device that copies traffic from a link.
Where each service sits, and why traffic must pass it
internet routers -> border leaf [outside VRF] -> firewall tier (NAT + IPS) -> border leaf [inside VRF] -> tenant VRFs
|
TAP on inside link -> IDS sensors (passive)
- Firewall and IPS: between two VRFs on the border leaf pair. The outside VRF holds internet routes, the inside VRF holds data center routes, and there is deliberately no route leaking between them. The only path from one to the other is through the firewall interfaces, so traffic cannot bypass it. This is the "VRF sandwich": the firewall tier is the filling between an outside routing table and an inside routing table on the same switches.
- NAT: on the firewall tier, at the internet boundary. A NAT device must see both directions of a session. Give each firewall unit its own slice of the public pool (for example one /29 per unit, which is 8 addresses, so five units use 40 addresses) and advertise each slice only from the unit that owns it. Return traffic is then attracted to the unit that holds the translation, so no session table needs to be shared for correctness.
- IDS: passive, on the inside of the firewall. On the inside link the addresses are still the real internal ones (NAT has not been applied to outbound traffic yet), so alerts name the actual host. A sensor fed by a TAP or mirror port cannot block or delay traffic, so a sensor outage costs visibility, not availability. Monitor sensor health, because a silent IDS looks identical to a quiet network.
Physical, virtual and software-defined steering compared
| Approach | Scaling | State handling | Failure behavior |
|---|---|---|---|
| Physical appliances behind VRFs, PBR or ECMP | Add units; throughput per box is fixed, so sizing is by rated throughput with inspection and NAT switched on | Session table inside each box; active/standby or cluster pairs synchronise it, which costs bandwidth and CPU | Unit dies: sessions it held reset unless synced; the ECMP group shrinks and flows rehash. Detect fast with BFD (bidirectional forwarding detection) from the leaf |
| Virtual appliances (firewall VMs or containers) | Add instances per tenant or segment; per-instance throughput is lower and depends on host CPU and NIC | In the VM's memory; lost on restart unless an HA pair syncs | A host failure takes down every VM on it, so use anti-affinity between pair members; restart time sets the outage |
| Software-defined / distributed (controller programs the hypervisor switch or NIC; chaining of external appliances with a service header) | Enforcement capacity grows with each host added; no central choke point | State sits on the host that runs the workload, so it follows the workload only if the platform supports migration of state | A host failure affects only its own workloads; a controller outage normally freezes policy changes while existing rules keep enforcing (confirm this per platform) |
Chaining is needed only when traffic must visit several separate appliances in a fixed order and they do not enforce policy in the host; the VRF sandwich above does not use it. For that case the standard service header is the Network Service Header (RFC 8300): a 24-bit Service Path Identifier names the chain and an 8-bit Service Index counts position along it, decremented at each service function. An appliance that does not understand the header needs an SFC proxy (service function chaining proxy) that strips the header before the appliance and re-adds it, decrementing the index, afterwards.
One failure traced
Take the five-unit tier with fw-3 as the one that fails, carrying 20% of flows. Those flows' sessions are lost unless the units synchronise state, so those users see a reset and reconnect. The leaf detects fw-3 through BFD and removes it from the ECMP group; with resilient hashing the other 80% of flows keep their firewall and their state, and the 20% are spread over fw-1, fw-2, fw-4 and fw-5. With plain hash-mod-N, 80% of flows would instead land on a unit with no state for them and be dropped, a much larger outage than the one box that failed.
Worked example: sizing the physical tier
Assumptions: 120 Gbps peak north-south traffic, each firewall unit rated 40 Gbps with NAT and inspection enabled, and the rule that after one unit fails the remaining ones must run at or under 80 percent.
PEAK, UNIT, LIMIT_AFTER_FAIL = 120, 40, 0.80 # Gbps peak north-south, Gbps per firewall, ceiling
n = 2
while PEAK / ((n - 1) * UNIT) > LIMIT_AFTER_FAIL: n += 1
print(f"units needed: {n}; normal load {PEAK/(n*UNIT):.0%}; after one failure {PEAK/((n-1)*UNIT):.0%}")
# the unit that fails is the last one (index n-1); flows hash by h
keys = range(n * (n - 1) * 1000)
on_failed = sum(1 for h in keys if h % n == n - 1) / len(keys)
changed = sum(1 for h in keys if h % n != h % (n - 1)) / len(keys)
print(f"flows that were on the failed unit: {on_failed:.0%}")
print(f"flows whose firewall changes with plain hash-mod-N after the failure: {changed:.0%}")
print(f"flows whose firewall changes with resilient hashing: {on_failed:.0%} (only the failed unit's)")
Reading the script: the loop starts at 2 units and adds one until the load on the units left after one failure, 120 / ((n - 1) x 40), is at or below 0.80. For n = 2 that is 120/40 = 300%, n = 3 is 150%, n = 4 is 100%, n = 5 is 75%, so it stops at 5. Each integer h stands for the hash of one flow. h % n is the index of the firewall that flow uses while n units are up, and h % (n - 1) is its index after one unit is removed. The script counts the flows whose index changes. The key range is n x (n - 1) x 1000 = 20,000, which divides evenly by both 5 and 4, so the fractions are exact.
units needed: 5; normal load 60%; after one failure 75%
flows that were on the failed unit: 20%
flows whose firewall changes with plain hash-mod-N after the failure: 80%
flows whose firewall changes with resilient hashing: 20% (only the failed unit's)
Five units run at 60 percent normally and 75 percent after one failure. In N+1 terms the ceiling sets N: 120 / (0.8 x 40) = 3.75, so N = 4 units, plus one spare = 5. Without the 80 percent ceiling, N would be 3 (120 / 40) and a pure N+1 of 4 units would sit at 100 percent after a failure, which is why the ceiling adds a unit. Two units would be asked to carry 120 Gbps on 40 Gbps of surviving capacity (300 percent), which is why a "pair" is only enough when the pair is sized for the whole load each. The plain hash-mod-N result matters (hash-mod-N means picking the firewall as the flow's hash modulo the number of units): with a naive hash, removing one of five units changes the unit for 80 percent of flows, so ECMP with resilient (consistent) hashing, a scheme where flows keep their unit and only the failed unit's flows are reassigned, is a design requirement for the stateful tier. Headroom after a failure is (0.8 x 160) - 120 = 8 Gbps, about 7 percent growth. The growth path is a sixth unit, which lifts the capacity usable after a failure at the 80 percent ceiling from 0.8 x 160 = 128 Gbps to 0.8 x 200 = 160 Gbps, which is 25 percent more than today and lets peak traffic grow from 120 to 160 Gbps (33 percent).
Trade-offs and pitfalls
- Fail-closed versus fail-open for inline inspection. At the internet edge choose fail-closed for the IPS function and buy availability with the N+1 tier instead. Fail-open is acceptable only for an inline sensor that protects nothing on its own.
- Asymmetric routing breaks stateful devices. Every path rule (PBR, advertised NAT slices, ECMP hashing both directions) must send both directions of a flow to the same unit.
- East-west through the border is a hairpin. It doubles link use and floods the firewall with traffic that distributed enforcement handles at the host.
- NAT table exhaustion and MTU. Size the translation table for peak concurrent sessions, and check that any overlay used for steering leaves room in the MTU.
What would change the recommendation: a handful of tenants that each demand their own firewall policy and change windows favours virtual firewalls per tenant; mostly east-west traffic with strict micro-segmentation favours distributed enforcement as the primary control and shrinks the physical tier to the internet edge only.
You are designing a fabric for RDMA-based storage or AI training traffic that cannot tolerate loss. What does the network have to provide, and what failure modes does a lossless design introduce?
Sample Answer
Direct answer
RDMA (remote direct memory access: a NIC reads or writes a peer's memory without the CPU copying data) over Ethernet, called RoCEv2 (RDMA over Converged Ethernet version 2, carried in UDP destination port 4791), was designed for a lossless network: a dropped packet forces a slow retransmission that stalls training steps or storage I/O. The network must provide near-zero loss in a dedicated traffic class, early congestion signalling so senders slow down before buffers overflow, and enough buffer headroom for flow control to work. The price is new failure modes: pause storms, deadlocks and head-of-line blocking (a stalled packet at the front of a queue holding up everything behind it) that can spread a local problem fabric-wide.
What the network must provide
| Requirement | Mechanism | Detail |
|---|---|---|
| No loss in the RDMA class | PFC (priority flow control, IEEE 802.1Qbb): a receiver sends a pause for one of 8 priorities when its buffer fills, without pausing the others | Enable on only the RDMA priority (e.g. priority 3), not all 8 |
| Slow senders before PFC triggers | ECN (explicit congestion notification, RFC 3168: switches set the 2-bit ECN field in the IP header to 11, called the CE codepoint for congestion experienced) plus an end-to-end rate control such as DCQCN (receiver returns congestion notification packets, CNPs, and the sender cuts its rate) | Set ECN marking thresholds below the PFC threshold, so ECN is the normal control and PFC is the last resort |
| Buffer headroom | Reserved per-port, per-priority buffer for data still in flight when the pause is sent | See the calculation below |
| Traffic isolation | Separate queue and scheduler share (ETS, enhanced transmission selection: a configured slice of link bandwidth per traffic class) for RDMA, with CNPs in a strict-priority queue (one that is always served first) so notifications are never delayed behind the congestion they report | Keeps storage traffic from starving general data and vice versa |
| Consistent MTU | Same jumbo MTU (maximum frame size, here above the standard 1,500 bytes) on every NIC and every switch hop | A smaller MTU on one hop drops large packets |
| Multipathing | ECMP across equal-cost spine paths | Few, long-lived, high-bandwidth RDMA flows (elephant flows) hash unevenly, so check per-link load |
Headroom calculation (first-order estimate)
When a switch asks its neighbour to stop, data already on the wire and in the neighbour's pipeline keeps arriving. Headroom is roughly the rate x (round-trip cable delay + pause response time), plus two maximum-size frames. Assumptions: 100 Gbps, 5 ns per metre in fibre, 1 µs for the peer to react, MTU 4,200 bytes.
headroom=8100×109×(2×L×5ns+1μs)+2×4,200 B| Cable length | Headroom per port per lossless priority |
|---|---|
| 10 m | 22.15 KB |
| 100 m | 33.4 KB |
| 300 m | 58.4 KB |
A 64-port switch with 100 m cables needs 64 x 33.4 KB = 2.14 MB reserved for one lossless priority, which comes out of a shared buffer of only tens of MB on typical merchant silicon (off-the-shelf switch chips sold by chip vendors rather than designed in-house by the switch maker), so longer cables and more lossless priorities cost real buffer. If the fabric runs 9,000-byte jumbo frames instead, the two maximum-size frames become 18,000 B and the 100 m figure rises from 33.4 KB to 43.0 KB (25,000 + 18,000 B). Use the vendor's own headroom formula in production; this one shows which variables matter.
Which control acts when
Order of operation: ECN with DCQCN acts first, keeping queues short by slowing senders. PFC acts only if a queue still reaches its pause threshold. The PFC watchdog (a timer that notices a queue paused for abnormally long and temporarily drops or ignores its pauses) acts only when a pause has lasted too long, as the last line of defence.
Failure modes a lossless design introduces
- Pause storm / head-of-line victim flows: a stuck receiver (a failed NIC that never drains) keeps asserting PFC, the pause propagates upstream hop by hop, and innocent flows sharing the same priority stall. Walked through (illustrative names): the NIC on host-7 hangs. The buffer on leaf-1 for the port to host-7 fills, so leaf-1 pauses the RDMA priority toward spine-1. Spine-1's buffer toward leaf-1 fills with packets for host-7 and for other hosts behind leaf-1, so spine-1 pauses the other leaves that feed it. Flows between hosts that have nothing to do with host-7 now stall because they share that priority and that spine.
- PFC deadlock: pauses can form a cycle of buffer dependencies across switches, and traffic stops permanently. A Clos fabric (a leaf-spine design in which every leaf switch connects to every spine switch) normally has no such cycle, because packets only go up to a spine and then down. A link failure that re-routes traffic through an up-down-up path (up to a spine, down to a leaf, then up again to another spine, which a healthy fabric never does) can create one. Walked through with four switches whose lossless traffic flows around a ring: sw-1 sends to sw-2, sw-2 to sw-3, sw-3 to sw-4 and sw-4 back to sw-1. Each switch's buffer for the RDMA priority fills with packets that are all headed for the next switch. sw-2 is full, so it pauses sw-1; sw-3 pauses sw-2; sw-4 pauses sw-3; sw-1 pauses sw-4. Every switch is now waiting for the next one to drain, and none can drain until the next one does, so nothing moves and the stall is permanent until something drops packets. Mitigations: a PFC watchdog (the timer described above) that breaks the cycle, routing that avoids up-down-up paths, and fewer lossless priorities.
- Misconfiguration mismatch: PFC enabled on the switch but not the NIC, or different priority mapping at the two ends, gives silent loss or a fabric that is lossless only in some places.
- ECN thresholds wrong: marking too late lets PFC fire constantly; too early under-uses bandwidth.
- Unequal ECMP: a few elephant flows (huge, long-lived transfers) hash onto one uplink, creating congestion while other links idle.
Operating it
Before enabling the class, check the path MTU (the largest packet that crosses every hop without being split) end to end from a host. The headroom estimate above assumed 4,200-byte frames, so test that size: ping -M do -s 4172 <peer> sends a 4,200-byte packet (4,172 payload + 8 ICMP header + 20 IP header = 4,200) with the do-not-fragment rule on (-M do: set the DF flag, and the packet is rejected if it is too large for the path; Linux iputils syntax). If your fabric is set to 9,000-byte jumbo frames, use -s 8972 (8,972 + 28 = 9,000) instead. A reply means every hop accepts that size; an error such as 'message too long' means one hop has a smaller MTU. Then monitor per-queue PFC pause counters and watchdog drops, because rising pause counts are the early warning for a storm.
Recommendation
Treat PFC as a backstop and make ECN/DCQCN the main control; confine lossless behaviour to one priority, give storage and training their own isolated fabric or at least their own queue and scheduling weight, and test failures (pull links, reboot a spine, wedge a NIC) before production traffic arrives.
A trading client needs under 10 ms of latency between three data centers on different continents. How do you plan routes, colocation and peering to meet that target, what physical limits decide whether it is achievable, and what residency and audit constraints shape the design?
Sample Answer
Direct answer
As worded, the target cannot be met: light in glass fibre covers about 200 km per millisecond, so even a perfectly straight fibre between New York and London has a round-trip floor of 55 ms, many times the 10 ms target. The first step is to turn the number into a measurable requirement per pair of sites: what is being timed (round trip or one way, port to port or application to application) and between which pairs. A plausible design then pins each latency-critical component (the order gateway, the server that sends client orders to the exchange, and the matching or risk engine, the system that pairs buy and sell orders or checks them against limits) at the venue (the exchange or trading platform) in each region, colocated in the venue's data center and cross-connected to it (joined by a direct physical cable inside the building), and treats the cross-continent links as an asynchronous replication, risk and reporting path with a latency budget of its own. A 10 ms round trip is achievable only for sites within roughly 770 km of each other as the crow flies, and only with a short, direct fibre route.
Physical limits that decide feasibility
Planning figures (stated as assumptions): light travels at about 200 km per millisecond in fibre (the commonly quoted figure of about 200,000 km/s, from the glass refractive index near 1.45); the fibre route is about 1.3 times the great-circle distance (an assumed route factor, to be replaced by the carrier's stated route length); equipment adds 0.3 ms to a round trip (assumed).
from math import radians, sin, cos, asin, sqrt
KM_PER_MS = 200 # planning figure for light in glass (about 2/3 c)
ROUTE_FACTOR = 1.3 # assumed fibre path length / great-circle distance
SITES = {"new-york": (40.73, -74.17), "london": (51.51, -0.60), "tokyo": (35.68, 139.77),
"frankfurt": (50.11, 8.68)}
def gc(a, b):
la1, lo1, la2, lo2 = map(radians, (*SITES[a], *SITES[b]))
h = sin((la2-la1)/2)**2 + cos(la1)*cos(la2)*sin((lo2-lo1)/2)**2
return 2 * 6371 * asin(sqrt(h))
for a, b in [("london", "frankfurt"), ("new-york", "london"), ("new-york", "tokyo"), ("london", "tokyo")]:
d = gc(a, b)
print(f"{a}-{b}: great circle {d:,.0f} km | RTT floor straight glass {2*d/KM_PER_MS:.1f} ms | "
f"RTT at x{ROUTE_FACTOR} route {2*d*ROUTE_FACTOR/KM_PER_MS:.1f} ms")
print(f"10 ms RTT = {10/2*KM_PER_MS:.0f} km of fibre each way = {10/2*KM_PER_MS/ROUTE_FACTOR:.0f} km great circle")
print(f"10 ms one-way = {10*KM_PER_MS:.0f} km of fibre = {10*KM_PER_MS/ROUTE_FACTOR:.0f} km great circle")
EQUIP_MS = 0.3 # assumed total switching and serialisation delay on the path, round trip
d = gc("london", "frankfurt")
print(f"max route factor for a 10 ms RTT london-frankfurt with {EQUIP_MS} ms equipment: "
f"{(10 - EQUIP_MS) / (2 * d / KM_PER_MS):.2f}")
london-frankfurt: great circle 670 km | RTT floor straight glass 6.7 ms | RTT at x1.3 route 8.7 ms
new-york-london: great circle 5,549 km | RTT floor straight glass 55.5 ms | RTT at x1.3 route 72.1 ms
new-york-tokyo: great circle 10,839 km | RTT floor straight glass 108.4 ms | RTT at x1.3 route 140.9 ms
london-tokyo: great circle 9,579 km | RTT floor straight glass 95.8 ms | RTT at x1.3 route 124.5 ms
10 ms RTT = 1000 km of fibre each way = 769 km great circle
10 ms one-way = 2000 km of fibre = 1538 km great circle
max route factor for a 10 ms RTT london-frankfurt with 0.3 ms equipment: 1.45
Reading the output:
- One-way versus round trip changes the answer by a factor of two. A 10 ms round trip allows 1000 km of fibre each way (about 769 km great circle at a 1.3 route factor). A 10 ms one-way target allows 2000 km of fibre (about 1538 km great circle). Neither comes close to New York to London at 5,549 km.
- London to Frankfurt works only with a good route. The straight-glass floor is 6.7 ms and the 1.3 route factor gives 8.7 ms. After 0.3 ms of equipment delay the route factor may not exceed 1.45, so a carrier that detours through a third city fails the target. The 1.45 is the point where the budget runs out: the straight-glass round trip is 2 x 670 / 200 = 6.7 ms, the room left after equipment is 10 - 0.3 = 9.7 ms, and 9.7 / 6.7 = 1.45. A fibre route 1.45 times the map distance exactly uses the budget; anything longer misses 10 ms. Ask for the route length in km and a measured one-way delay, not only a round-trip figure.
- Intercontinental pairs land at tens to over a hundred milliseconds, never single digits. At a 1.3 route factor New York to London is about 72 ms round trip and New York to Tokyo about 141 ms.
How to plan routes, colocation and peering
- Routes. Choose carriers by route kilometres and by the measured delay of the specific path, not by bandwidth. For undersea segments, pick the cable with the shortest lit path between the landing cities, check that your backhaul from the landing station to the data center is not a detour, and buy a second route that is diverse in conduit and landing station for resilience, accepting that the diverse route is longer and will have its own (higher) latency to publish.
- Colocation. Place equipment in the same facility as the venue's matching engine and use a direct cross-connect (a physical cable inside the building). Every extra switch hop or building adds delay that cannot be bought back later.
- Peering. Use private direct peering to the venue and to counterparties over cross-connects, not a public internet exchange fabric or a transit provider. Use BGP preferences (local preference is a number that makes a router favour one exit, higher wins, so give the direct session the higher value; AS path is the list of networks a route crosses, shorter preferred) so traffic never hairpins through a third network, and verify with traceroute and one-way delay probes that the path matches the contract.
- Measurement. Measure one-way delay with GPS-disciplined clocks (clocks kept in step with GPS time and shared over the network with PTP, Precision Time Protocol). A round-trip figure hides asymmetric paths where the forward route is long and the return route short.
- Host tuning, briefly. Kernel bypass (the application reads the network card directly instead of going through the operating system's network stack) and NIC hardware timestamping (the network card stamps each packet's time itself) decide microseconds on the host. They cannot recover milliseconds that the fibre path has already spent.
Residency and audit constraints
- Residency. Order and client data subject to a jurisdiction's residency rules stays and is processed in that region; only what counsel confirms may leave is replicated across borders, and encrypted on the link. Encryption such as MACsec (encryption between two directly connected devices) or IPsec (encryption between two endpoints across a network) adds processing delay, so measure it against the budget instead of assuming it is free.
- Audit. Regulators expect accurate time. MiFID II (the EU markets-in-financial-instruments directive) has technical standards on clock synchronisation and timestamp accuracy; look up the exact tolerance that applies to your activity in the regulation rather than relying on a remembered figure. For example, an auditor might ask: which clock source feeds this server, show the logged offset from that source for a given day, and show that every order timestamp was taken from it. Keep immutable, time-stamped logs and packet captures at the cross-connects, with change control on every route and policy change.
Trade-offs and the client conversation
Shorter latency costs money (direct cross-connects, which are typically billed per cable per month so every extra venue adds a recurring charge, premium routes, duplicated equipment per region) and resilience (a shorter route has fewer diverse alternatives). Present the client with a table of what each pair can achieve with the route lengths computed above, and a clear statement that cross-continent state is eventually consistent (copies in different regions agree after a delay, not instantly) by physics, not by design choice. What would change the plan: a client who needs synchronous cross-continent state must accept a latency floor of tens to over a hundred milliseconds, or relocate the latency-critical function to one site.
Your SLA requires 99.99% availability. How do you choose among N+1, 2N, active-active and active-passive redundancy for power, spine switches and firewalls, and how do you reason about the availability you will actually achieve?
Sample Answer
Direct answer
99.99% availability allows 52.56 minutes of downtime per year, or 4.32 minutes in a 30-day month. I would pick the redundancy pattern per layer from how that layer fails: 2N for power, N+1 with equal-cost multipath (ECMP, the switches spread traffic across all spines that offer an equally short path) for the spine layer (the top tier of switches that connect all the leaf switches), and an active-passive pair for stateful firewalls unless throughput forces a cluster. Then I would check the design with an availability model whose biggest terms are usually not hardware failures: failures that hit both halves of a pair at once, and failover time. Finally I would measure the availability users actually get, because a model is only a design check.
The patterns, defined
- N+1: N units are needed to carry the load, plus one spare. Losing one unit is survivable, losing two is not.
- 2N: two complete, independent systems, each able to carry 100% of the load alone.
- Active-active: both units forward traffic all the time. Capacity is only redundant if each unit is sized to carry everything alone.
- Active-passive: one unit forwards, the standby takes over after a failure. Takeover time and state synchronisation become part of the outage.
Choice per layer
| Layer | Choice | Why | What bites |
|---|---|---|---|
| Power | 2N: two feeds (utility, UPS, power distribution unit) on separate paths, every device with two power supplies, one per feed | A single feed's maintenance or fault is invisible to devices | If total load is above what one feed can carry, it is 2N on paper only. Check that each feed alone covers 100% |
| Leaf switches | Dual-homed servers on an active-active pair (multi-chassis link aggregation, MLAG, one logical switch built from two chassis) | Either leaf can fail with no failover event | Both leaves run the same software, so one bug can take both |
| Spines | N+1 with ECMP: 4 spines, 3 needed for peak | No failover event, traffic just rehashes (the switches recompute which spine each flow uses) onto the remaining members | Capacity after a loss (see below) |
| Firewalls | Active-passive HA pair with state sync | Simple, predictable, one policy to audit | Failover takes seconds and sometimes fails; the standby is idle capacity |
Active-active firewalls double capacity but each must be sized for 100% of traffic alone. Two firewalls each running at 70% are N+0 after a failure (no spare left): the one left is asked for 70% + 70% = 140%, which is a brownout (the service is up but so overloaded that it drops traffic or crawls), and a brownout counts against the SLA (service-level agreement) just as an outage does.
Capacity after a failure is part of availability. With 4 spines, a peak of 75% means the three remaining spines run at 100% after one failure. That design is at its capacity limit the moment anything breaks, and it needs a growth path: add a fifth and sixth spine, or cap peak utilisation at 60% so the remaining members run at 80%.
Computing what you will actually achieve
Series components multiply: two 99.9% devices in series give 99.8% (0.999 x 0.999 = 0.998001), and four give 99.60%. Unavailability is the fraction of time something is down, so 99.9% availability is u = 0.001. A redundant pair with independent failures is down only when both are down, which has unavailability u squared, so two 99.9% devices give 0.001 x 0.001 = 0.000001, or 99.9999%. Real pairs do not fail independently, so I add a common-cause fraction beta: the share of failures that hit both members together (the same software bug, the same upgrade, the same room's cooling). With u the unavailability of one unit:
Upair=((1−β)u)2+βu
The first term is both members failing separately (the independent share of failures, squared); the second is the shared cause, which takes both down at once and is not squared. Worked trace for the leaf pair with u = 0.001 and beta = 0.02: the independent share is 0.98 x 0.001 = 0.00098, squared is 0.00000096; the shared share is 0.02 x 0.001 = 0.00002; the sum is 0.00002096. Over 525,600 minutes a year that is 0.00002096 x 525,600 = 11.02 minutes, the figure in the leaf-pair column below. Power at beta = 0.02 follows the same steps with u = 0.0001 and gives 1.06 minutes.
The firewall term adds failover blackout (the seconds of lost traffic while the standby takes over: failures per year x failover time) and failed failovers (failures x 5% x 30 minutes of manual recovery). All inputs below are planning assumptions, not measurements: u = 0.001 for a switch or firewall including software crashes, upgrades and human error, a power feed at 0.0001, repair time 8 hours (1.095 failures per unit per year), failover 30 seconds.
The spine layer needs 3 of 4 spines, so it is down when 2 or more spines are down at once. The code sums the chance of exactly 2, 3 or 4 independent spine failures (a binomial sum) and then adds the shared-cause term.
from math import comb
MIN_YEAR = 365 * 24 * 60 # 525,600 minutes
print(f"99.99% = {MIN_YEAR * 0.0001:.2f} min/yr, {30 * 24 * 60 * 0.0001:.2f} min per 30-day month")
u = 0.001 # assumed all-causes unavailability of one switch or firewall (99.9%)
u_feed = 0.0001 # assumed unavailability of one power feed (99.99%)
fails_per_year = 8760 * u / 8 # MTTR 8 h -> 1.095 failures per node-year
def pair(u, beta): # either member can carry the load; beta = share of failures hitting both
return ((1 - beta) * u) ** 2 + beta * u
def three_of_four(u, beta): # spine layer: needs 3 of 4 spines
p = (1 - beta) * u
both = sum(comb(4, k) * p**k * (1 - p)**(4 - k) for k in (2, 3, 4))
return both + beta * u
def firewall_pair(u, beta, failover_s=30, cover=0.95, manual_min=30):
both_down = pair(u, beta) * MIN_YEAR
failover = fails_per_year * failover_s / 60
failed_failover = fails_per_year * (1 - cover) * manual_min
return both_down + failover + failed_failover
print("beta power leaf-pair spines firewalls total(min/yr) availability within 52.56?")
for beta in (0.01, 0.02, 0.05):
parts = [pair(u_feed, beta) * MIN_YEAR, pair(u, beta) * MIN_YEAR,
three_of_four(u, beta) * MIN_YEAR, firewall_pair(u, beta)]
total = sum(parts)
print(f"{beta:.2f} " + " ".join(f"{p:8.2f}" for p in parts) +
f" {total:8.2f} {100 * (1 - total / MIN_YEAR):.4f}% {total <= MIN_YEAR * 0.0001}")
print("four single nodes in series at 99.9% each:", f"{0.999 ** 4:.4f}")
for peak in (0.60, 0.75):
print(f"4 spines at {peak:.0%} peak: after one fails the other three run at {peak * 4 / 3:.0%}")
Output:
99.99% = 52.56 min/yr, 4.32 min per 30-day month
beta power leaf-pair spines firewalls total(min/yr) availability within 52.56?
0.01 0.53 5.77 8.34 7.96 22.61 99.9957% True
0.02 1.06 11.02 13.54 13.21 38.82 99.9926% True
0.05 2.63 26.75 29.12 28.94 87.45 99.9834% False
four single nodes in series at 99.9% each: 0.9960
4 spines at 60% peak: after one fails the other three run at 80%
4 spines at 75% peak: after one fails the other three run at 100%
Reading the result
At beta = 2% the design uses 38.82 of 52.56 minutes, so it meets the target with 13.74 minutes of margin. At beta = 5% it misses (87.45 minutes). The conclusion is that the lever is not another redundant box but controlling common cause: stagger upgrades across the two members, avoid pushing one change to both at once, keep the pair on different software trains where the vendor allows it, and put the pair in separate fault domains (rooms, rows, feeds).
Two things the model leaves out, which a real commitment must price: upstream carriers and anything outside your control, and planned maintenance if the SLA does not exclude it.
The SLA window matters. The model's firewall term includes failed failovers of 30 minutes. One such event is inside the 52.56-minute annual budget but is 6.9 times the 4.32-minute monthly budget (30 / 4.32). If the SLA is measured monthly, one failed failover breaches it, so failover must be rehearsed and automated.
Verifying in production
Run synthetic probes from user locations to a service through the full path, record success per minute, and compare the measured downtime with the budget each month. Test each redundancy mechanism on purpose in a change window: pull a power feed, drain a spine, force a firewall failover, and confirm the failover time against the 30 seconds assumed above.
Pitfalls
- Counting "two of everything" without checking shared fate: both power supplies on one feed, both firewalls in one rack.
- Quoting a vendor's single-box availability for a pair.
- Treating 2N and N+1 as interchangeable: 2N doubles the plant, N+1 adds one unit, and they fail differently under a second fault.
Unlock Full Question Bank
Get access to all 33 Network Design and Architecture interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.