- #networking
- #service-mesh
- #security
North-South, East-West: How Traffic Really Moves Through Your System
Why most traffic never leaves the data centre, how load balancers, API gateways, sidecars and service meshes handle each direction, and why zero trust between services became the norm. With case files from Lyft, Netflix, Google, Target and Razorpay.
Akshit Bansal20 min readPart 3
follow the packetson this page
In one minute
- North-south traffic crosses your edge: users and partners talking to your servers. East-west traffic stays inside: your services calling each other.
- Microservices, containers and big fan-out requests made east-west the bulk of data-centre traffic. Networks and security both had to change shape.
- The front door gets a load balancer and an API gateway. The corridors get a service mesh: a sidecar proxy next to every service, plus a control plane that configures them all.
- Zero trust between services: every call proves who it comes from and is checked against rules, so one stolen login can't walk to the payments database. The price is extra latency, memory and moving parts.
Words you need
Data centre
A building (or a cloud region) full of servers that run your system.
Like an office building full of desks
Service
One program that does one job, such as orders or payments, and talks to other services over the network. Splitting an app into many of them is called microservices.
Like one shop in a shopping mall
North-south traffic
Traffic that crosses your system's edge: between the outside world (users, partner APIs, payment networks) and your servers.
Like shoppers walking in and out of the mall's main doors
East-west traffic
Traffic that stays inside: your servers and services calling each other.
Like shops passing stock to each other along the back corridors
Edge (perimeter)
The boundary between your system and the internet. Everything outside it is a stranger.
Like the outer wall and front door of the building
IP address and port
An IP address says which machine; a port number says which program on it.
Like a street address and a flat number
DNS
The system that turns a name like api.example.com into an IP address.
Like a phone book
CDN
Content delivery network: servers spread around the world that answer from a nearby cache and soak up attacks before they reach you.
Like local kiosks that stock the best-selling items
Load balancer
Spreads incoming requests across several copies of a service, so no single server is overwhelmed.
Like a host seating diners across all the tables
Layer 4 / Layer 7
A Layer 4 load balancer only sees addresses and ports. A Layer 7 one understands HTTP, so it can route by URL or header.
Like a courier who reads only the address vs one who reads the letter
API gateway
A smarter front door. It checks who you are (authentication), limits how often you can call (rate limits) and sends each request to the right internal service.
Like a reception desk that checks your ID and sends you to the right floor
Proxy
A program in the middle of a call. It receives the call, does some work on it, and forwards it.
Like an assistant who places your phone calls for you
Sidecar
A small proxy that runs right next to one service and handles all of that service's network traffic.
Like a sidecar bolted to a motorbike
Service mesh
A sidecar next to every service, plus a central brain that configures all of them.
Like staff at every shop's back door, all managed by the mall office
Control plane / data plane
The data plane is the sidecars carrying the real calls. The control plane is the central brain that gives every sidecar its rules, policies and certificates.
Like the trains vs the signal box
Certificate
A signed digital ID card a program shows to prove who it is.
Like a staff ID badge
TLS and mTLS
TLS encrypts a connection, and the server shows a certificate (that's the S in HTTPS). Mutual TLS (mTLS): both sides show one.
Like only the shop showing its licence vs both of you showing ID
Timeout and retry
A timeout gives up on a call that takes too long. A retry tries a failed call again.
Like hanging up after ten rings, then calling back
Firewall and VPN
A firewall lets only allowed traffic through. A VPN is an encrypted tunnel into a private network.
Like a gate guard, and a private tunnel to the building
Perimeter security
A strong wall at the edge and full trust for anything inside it. Also called castle-and-moat.
Like a castle: big walls, no locks on the inside doors
Zero trust
Never trust a request because of where it comes from. Check who is asking on every request, inside or out.
Like a badge reader on every door, not just the front one
Moving sideways
An attacker spreading from their first foothold to other machines inside. Security people call it lateral movement.
Like a thief in the corridor trying every office door
Switch
A network box that connects machines with cables and passes traffic between them.
Like a road junction
VM and container
Ways to run many small, walled-off workloads on one physical machine, and move them around.
Like flats in one building, with tenants moving in and out
A locked front door and open offices
Picture an office building with great front-door security: a guard, a badge reader, a visitor log. Past the lobby, every office door is unlocked, and nobody asks who you are as you walk from floor to floor.
- In late 2013 this happened to the US retailer Target (case file #4). Attackers logged in with credentials stolen from a refrigeration and HVAC contractor.
- That first foothold was nowhere near the payment systems. They moved sideways through the internal network to the checkout terminals in Target's stores.
- Data from about 40 million credit and debit cards was stolen.
North-south vs east-west
Engineers draw the internet at the top of the page and the servers below it. That gives the two directions their names.
- North-south crosses the wall. A phone asks your app for a feed (southbound); the answer goes back out (northbound).
- East-west runs sideways, inside. Web asks Orders for a user's orders; Orders asks Payments for a payment status; Payments reads the payments database.
North: the internet
- Phones
- Browsers
- Partner APIs
- Payment networks
Inside your data centre
east-west
One click: 2 links cross the edge, 7 links stay inside.
| North-south | East-west | |
|---|---|---|
| Where it goes | Across your edge, in and out | Between services, inside |
| Who sends it | Strangers on the public internet: users, partners, attackers | Your own services (or whoever has taken one over) |
| How much | One request in, one answer out | That one request fans out into many internal calls |
| Old assumption | Untrusted: check everything | Trusted, because it's inside |
| Main tools | DNS, CDN, load balancer, API gateway | Libraries in each service, sidecars, a service mesh |
Why east-west traffic exploded
In the early web, most apps had three layers: a web server, an application server and a database. This is a three-tier architecture. A request came in, went down the layers and the answer went back out: mostly north-south. Then three things changed.
Fan-out
Big internet companies split work across many machines. One search or feed request might fan out to hundreds of servers, each holding a slice of the data, and their answers get combined.
VMs, then containers
Many small workloads packed onto shared hardware, moving around all the time. More things on the network, talking to each other.
Microservices
Apps split into dozens or hundreds of small services that call each other over the network. One click can trigger a whole chain of internal calls.
The network changed shape
- The classic data-centre network was a tree. Servers plugged into access switches, which fed aggregation switches, which fed one big core switch at the top, connected to the outside world. Great for traffic going up and out.
- For east-west traffic it's a detour: two servers in different branches talk all the way up through the core and back down, and every such call shares that one core.
- So data centres moved to leaf-spine: every leaf switch (servers plug into these) connects to every spine switch. Any two servers on different leaves are the same short distance apart, over many equal paths.
Three-tier tree
built for north-south
6 hopsvia the one core switch
Leaf-spine
built for east-west
4 hops2 equal paths
A → H: 6 hops in the tree (via the one core switch), 4 hops in leaf-spine, and the load can split over both spines.
From castle-and-moat to zero trust
Security had to change too.
| Perimeter (castle-and-moat) | Zero trust | |
|---|---|---|
| The idea | Strong wall at the edge; anything inside is friendly | Assume someone is already inside; trust nothing by location |
| What gets checked | Whether you're on the internal network | Who you are, and (for people) what device you're on |
| Where checks happen | At the edge: firewalls, VPNs | On every request, inside and out |
| After one breach | The attacker can move sideways freely | The attacker only reaches what that identity is allowed |
- Google was hit by a sophisticated attack in 2009, Operation Aurora. It then started BeyondCorp, described publicly in 2014: access depends on who the user is and what device they're on, not on being on the office network.
- That idea, now called zero trust, spread to service-to-service traffic too. Google's own services authenticate each other by identity (case file #3).
Quick check: A user's phone loads their feed. To build it, the feed service asks the profile service and the ads service for data, then replies. Which hops are east-west?
North-south: the front door
A request from a user's phone passes through a few layers before it reaches your code:
- 01
DNS
api.example.com → an address
- 02
CDN / edge
may answer from cache, absorbs attacks
- 03
Load balancer
picks a healthy server
- 04
API gateway
auth, rate limits, routing
- 05
Your service
finally, your code
| Load balancer | Layer 4 | Layer 7 |
|---|---|---|
| Sees | Addresses and ports | The HTTP request: URL, headers |
| Can route by | Where the packet is going | What the request asks for, e.g. /payments vs /search |
East-west: the corridors
East-west traffic is internal, so teams used to assume it was safe. But there's a lot of it, and every call can fail. Every service that calls another needs answers to the same five questions:
Discovery
Where are the healthy copies of the payments service right now?
Load balancing
Which copy should I call?
Resilience
What timeout? How many retries? (The blast radius post shows why this matters.)
Security
Is this really the payments service? Is the orders service allowed to call it?
Observability
How long did the call take, and where in the chain did it fail?
The first answers lived inside each service, as libraries. Then the network work moved out into a proxy.
| Library in every service | Sidecar proxy | |
|---|---|---|
| Where it runs | Inside your code, as an import | A separate program next to your code |
| Other languages | Rebuild and maintain it in each one (Go, Python, Java, Node...) | Works the same for any language |
| Shipping a fix | Every team must upgrade; one that forgets is the weak link | Update the proxy, not every service |
| Extra hop | None | Every call passes through two proxies |
| Example | Netflix's Java libraries for discovery, load balancing and resilience | Lyft's Envoy (case file #1) |
The sidecar: take the network out of the app
- The service makes a plain, simple call to
localhost. - Its sidecar handles discovery, load balancing, retries, timeouts, encryption and metrics, then forwards the call to the other service's sidecar, which hands it to the destination.
- Lyft built a proxy called Envoy for exactly this and open-sourced it in 2016 (case file #1). It became the building block of most service meshes.
- In 2017, Google, IBM and Lyft announced Istio, a control plane for Envoy proxies: it tells every sidecar the routing rules, security policies and certificates to use.
Control planethe central brain
Pod: Orders
Ordersyour code
Sidecarproxy
- rules
- certificate
Pod: Payments
Sidecarproxy
- policy
- certificate
Paymentsyour code
Step 1/6: The control plane hands every sidecar its routing rules, security policies and certificates.
Zero trust between services
With a sidecar on every service, every east-west call can be encrypted and authenticated with mTLS.
- In normal HTTPS, only the server proves who it is.
- In mTLS, both sides show a certificate. The payments service knows the caller really is the orders service, and the other way round.
- On top of that identity, you write rules:
# Only the payments service may talk to the payments database.apiVersion: security.istio.io/v1kind: AuthorizationPolicymetadata: name: payments-db-accessspec: selector: matchLabels: { app: payments-db } rules: - from: - source: { principals: ["cluster.local/ns/prod/sa/payments"] }Things to try:
- Switch between North-south and East-west. Count the lines: 2 against 7.
- Turn on Intruder inside Recs with the mesh off. Nothing inside checks who's calling.
- Now turn on Service mesh. Every call gets a padlock, and the intruder is denied at the database.
Quick check: With the policy above in place, an attacker takes over the Recs service and calls the payments database. What stops them?
Other ways to manage east-west traffic
| Approach | How it works | Where it breaks |
|---|---|---|
| Perimeter only | Firewalls and VPNs at the edge; the inside is trusted. Simple, cheap, and how most companies ran for decades. | The first time the wall is breached. With vendors, laptops, CI systems and cloud consoles, it gets breached eventually. Target's attackers came in through a contractor's account. |
| Library in every service | Discovery, retries, timeouts and security in a shared library every service imports. No extra process, no extra hop. | Across languages and teams: every language needs its own version, and every team must ship every fix. |
| Central internal gateway | Service-to-service calls go through one gateway, which enforces the rules. | It's a bottleneck and a single point of failure. Every call takes an extra trip; if that box has a bad day, everything does. |
| Segments by IP address | Firewall rules and separate network segments (VLANs, cloud security groups) let only some address ranges reach others. | Containers: addresses change every restart or move, so 'which IP may talk to which IP' is impossible to keep right. |
| Sidecar-less mesh | The proxy moves out of each service into a shared per-machine component, or into the operating system's core using a technology called eBPF. | Newer. Istio's ambient mode, announced in 2022, works like this; it reached general availability in 2024. |
Identity-based rules ("the payments service can talk to the payments database") don't care where things run. That's why the mesh usually wins inside, and why a gateway still wins at the edge, where traffic genuinely crosses a boundary.
Central internal gateway
Service mesh
What a mesh costs
Latency
Each call passes through two extra proxies, adding a little delay.
CPU and memory
Each sidecar uses CPU and memory. Across thousands of services, that adds up.
Complexity
A mesh is a complex system to run. If the control plane misbehaves, it can affect everything.
Those costs are exactly why sidecar-less designs appeared: one shared proxy per machine instead of one per service.
Sidecar per service
Sidecar-less (shared per machine)
Services, no sidecars
Quick check: You run six services, all written in Go, owned by one team. Requests come from a mobile app. What's the sensible starting point?
In the wild: case files
Lyft
Startup turned big tech · 2015–2017
the network, out of the app
- The problem
- As Lyft moved from a monolith to a service-oriented architecture, networking and observability became the hard part. Services were written in different languages, and debugging failures across many hops, with inconsistent retries, timeouts and metrics, was painful.
- The fix
- Lyft built Envoy, a high-performance C++ proxy designed to run next to every service on every host. It handles load balancing, circuit breaking, retries and rich statistics in one place, for any language. Lyft announced it as open source in 2016, describing it as a proxy and 'communication bus' for large service-oriented architectures.
- The lesson
- Envoy joined the Cloud Native Computing Foundation in 2017 and became the data plane underneath many service meshes, including Istio. Moving networking out of the application made consistent behaviour possible across a polyglot fleet.
Netflix
Big tech · 2013–2023
front door first, then the corridors
- The problem
- Netflix needed a single front door for traffic from every Netflix device worldwide: routing, authentication, resilience and insight into every request. Inside, its services used Java libraries (Eureka for discovery, Ribbon for load balancing) for east-west calls.
- The fix
- Netflix built Zuul as its edge gateway, then rebuilt it as Zuul 2 on an asynchronous, non-blocking framework (Netty) and open-sourced it in 2018. Netflix said its Cloud Gateway team ran more than 80 clusters of Zuul 2, handling over a million requests per second. For east-west traffic, it later moved to an Envoy-based service mesh and in 2023 described an 'on-demand cluster discovery' feature, built with the Envoy community, that removed most per-service mesh configuration.
- The lesson
- North-south and east-west need different tools. A strong gateway at the edge and a mesh inside solve different problems, and you can adopt them at different times.
Big tech · 2009–2017
the network is not a badge
- The problem
- After the 2009 Operation Aurora attacks, Google concluded that a privileged internal network was dangerous: once the perimeter is breached, an attacker has relatively easy access to everything inside.
- The fix
- BeyondCorp, described in a 2014 USENIX ;login: article, moved Google's corporate apps off the privileged network: access depends only on device and user credentials, regardless of network location. For service-to-service traffic, Google's 2017 whitepaper describes ALTS, which mutually authenticates production services by identity rather than by host, and protects RPCs by default.
- The lesson
- Zero trust applies in both directions: people reaching services, and services reaching each other. Identity replaces location as the thing you check.
Target
Big tech (retail) · November–December 2013
locked front door, open corridors
- The problem
- Attackers entered Target's network using credentials stolen from Fazio Mechanical Services, a refrigeration and HVAC contractor. From that foothold, far from any payment system, they moved through the internal network to the point-of-sale terminals in Target's stores.
- The fix
- Malware on those terminals captured data from about 40 million credit and debit card accounts between late November and mid-December 2013. A US Senate committee review criticised Target for giving network access to a vendor that didn't follow broadly accepted security practices.
- The lesson
- East-west movement is how small breaches become huge ones. Segmenting internal networks and authenticating internal access limits what a stolen login can reach.
Razorpay
Indian fintech · 2020s
a gateway that helps you migrate
- The problem
- Razorpay's API traffic used to pass through its monolith, which acted as a proxy for newer services. That extra hop added significant latency to busy APIs such as order creation, and as one of India's large payment platforms it also needed protection from DDoS and abusive traffic at the edge.
- The fix
- Razorpay built Edge, its own API gateway. Because not all of its roughly 400 APIs were ready to bypass the monolith, Edge supported selective traffic diversion, moving APIs one at a time, starting with order creation. Its PlatformCon 2023 talk describes Edge as the gateway for scalability, availability and protection against DDoS and abusive traffic.
- The lesson
- A gateway isn't only a security guard. It's also a migration tool: the front door can quietly redirect traffic to new services one route at a time.
Learn next and sources
- Next on this blog: blast radius (why timeouts and retries on east-west calls matter) and rate limiting (one of the gateway's front-door jobs).
- Next ideas: how a mesh issues and rotates the certificates behind mTLS; writing authorization policies by service identity; sidecar-less meshes and eBPF.
- MPR News, "Report: Target hackers breached account security via Penn. heating contractor" (opens in a new tab), 2014, and Dark Reading (opens in a new tab), 2014.
- Senate hearing coverage (opens in a new tab), GovInfoSecurity, 2014.
- Cisco, "Global Cloud Index projects cloud traffic to represent 95 percent of total data center traffic by 2021" (opens in a new tab), 2018, and eWeek coverage (opens in a new tab).
- Rory Ward and Betsy Beyer, "BeyondCorp: A New Approach to Enterprise Security" (opens in a new tab), ;login: 39(6), 2014.
- Google Security Blog, "Securing communications between Google services with ALTS" (opens in a new tab), 2017.
- Matt Klein, "Announcing Envoy: C++ L7 proxy and communication bus" (opens in a new tab), Lyft Engineering, 2016, and CNCF hosts Envoy (opens in a new tab), 2017.
- Istio, "Happy 7th Birthday, Istio!" (opens in a new tab), 2024, and "Istio's ambient mode reaches General Availability" (opens in a new tab), 2024.
- InfoQ, "Netflix's Zuul 2: asynchronous, non-blocking" (opens in a new tab), 2016, and Packt: Netflix open sources Zuul 2 (opens in a new tab), 2018.
- InfoQ, "Netflix builds a zero-configuration service mesh" (opens in a new tab), 2023.
- Razorpay Engineering, "Razorpay's Authentication Revamp: Turbocharging Performance" (opens in a new tab), and PlatformCon 2023, "Edge at Razorpay" (opens in a new tab).