Skip to content

ProfessionalLesson 8 of 14

Separate networks on one ​

A provider carries many customers over the same routers, and each customer picks its own private addresses. Sooner or later, two of them both use 10.1.1.0/24. A Virtual routing and forwarding: a separate routing table on one router. Each interface belongs to one VRF, and a packet arriving there is looked up only in that table. gives each customer a routing table of its own on the shared router. A packet is looked up only in the table of the port it arrived on, so the two 10.1.1.0/24 never meet.

Two customers, the same addresses ​

A provider router facing customers is a Provider edge: a router of the provider that customers connect to. It keeps each customer's routes in that customer's VRF., provider edge. The customer's own router on the other end of the link is the Customer edge: the customer's router on its side of the link to the provider., customer edge. With an IP VPN, the provider joins a customer's offices into one private network. Office 1 reaches office 2 through the provider, by the private addresses the customer chose.

Here one PE, pe-01, has two such customers: a bank and a school. Each has two offices, and both numbered them the same way, from the private ranges in NAT.

Try itKeep two customers apart
Routing tables on pe-01
pe-01one tableBank, office 110.1.1.0/24Bank, office 210.1.2.0/24School, office 110.1.1.0/24School, office 210.1.2.0/24

Send from each customer with one table. Then give each customer a VRF and send again.

Table main

PrefixViaPortWhose
10.1.1.0/24172.16.0.225g-1Bank, office 1
10.1.2.0/24172.16.0.625g-2Bank, office 2
10.1.1.0/24172.16.0.225g-3School, office 1
10.1.2.0/24172.16.0.625g-4School, office 2
pe-01.ts, part of it
interfaces: {
    ethernet: {
        "25g-1": { description: "Bank, office 1", addresses: ["172.16.0.1/30"] },
        "25g-2": { description: "Bank, office 2", addresses: ["172.16.0.5/30"] },
        "25g-3": { description: "School, office 1", addresses: ["172.16.0.1/30"] },
        "25g-4": { description: "School, office 2", addresses: ["172.16.0.5/30"] },
    },
},

routing: {
    static_routes: [
        { prefix: "10.1.1.0/24", next_hop: "172.16.0.2" },
        { prefix: "10.1.2.0/24", next_hop: "172.16.0.6" },
        { prefix: "10.1.1.0/24", next_hop: "172.16.0.2" },
        { prefix: "10.1.2.0/24", next_hop: "172.16.0.6" },
    ],
},
Terminal
$ circuit validate
  error  pe-01: 172.16.0.1 is on both interfaces.ethernet.25g-1 and interfaces.ethernet.25g-3
  error  pe-01: 172.16.0.5 is on both interfaces.ethernet.25g-2 and interfaces.ethernet.25g-4

2 error(s).

With one table, the two customers' routes to 10.1.2.0/24 have the same prefix and length, so the longest match can't choose between them. Depending on the router, it uses one of them, or shares traffic between both. Either way, some of one customer's traffic is delivered into the other customer's network.

Here circuit validate stops the file, but only because the two customers' links also share addresses. Two routes to one prefix alone are a normal thing to write, as a backup for each other, and Circuit can't know they belong to two customers.

With a VRF each, the router itself keeps the customers apart, not a filter someone could forget.

CheckThe bank and the school both use 10.20.0.0/16. On pe-01, each has its own VRF. The bank sends a packet to 10.20.5.5. Where can it go?

VRFs in Circuit ​

This is pe-01 from the widget, with a VRF for each customer. Both customers' links use the same addresses, just as their offices do. That is fine, because each 172.16.0.1 is in a different table.

ts
interfaces: {
    ethernet: {
        "25g-1": { description: "Bank, office 1", addresses: ["172.16.0.1/30"], vrf: "bank" },
        "25g-2": { description: "Bank, office 2", addresses: ["172.16.0.5/30"], vrf: "bank" },
        "25g-3": { description: "School, office 1", addresses: ["172.16.0.1/30"], vrf: "school" },
        "25g-4": { description: "School, office 2", addresses: ["172.16.0.5/30"], vrf: "school" },
    },
},

routing: {
    // One routing table for each customer.
    vrfs: {
        bank: {},
        school: {},
    },
    static_routes: [
        // The bank's offices, then the school's: the same prefixes, in different tables.
        { prefix: "10.1.1.0/24", next_hop: "172.16.0.2", vrf: "bank" },
        { prefix: "10.1.2.0/24", next_hop: "172.16.0.6", vrf: "bank" },
        { prefix: "10.1.1.0/24", next_hop: "172.16.0.2", vrf: "school" },
        { prefix: "10.1.2.0/24", next_hop: "172.16.0.6", vrf: "school" },
    ],
},
FieldWhat it does
vrfsThe device's VRFs, each under a name, with an optional description.
vrf on a port or interfaceThe table it routes in. Without vrf, it routes in the default table.
vrf on a routeThe table a static route is in. Without it, the route is in the default table.

A name that isn't in vrfs is an error before anything reaches the router:

text
pe-01: routing.static_routes[3].vrf: no VRF shop

The same idea keeps a network's own management apart. Give each edge router a VRF such as oob for its out-of-band port, with a default route of its own. Then the operators' way in never mixes with customer or internet traffic.

Most platforms run VRFs, but Raisecom ROS doesn't, and some platforms have limits. Platforms lists them. Circuit has no field for running BGP inside a VRF, or for passing routes from one VRF to another. So the routes in a VRF are static ones you write.

Carrying a customer across the core ​

One PE is the easy case. A provider has PEs in many places, with the core between them. The core is routers that join PEs to each other and face no customer, called Provider router: a core router of the provider, between the PE routers. It faces no customer, and has none of the customers' routes.. If every P router had every customer's VRF, the core would need thousands of tables. It would also have to change whenever a customer did.

So the PE wraps the customer's packet. The core reads only the wrapping, which says "from this PE to that PE." The network the core routes is called the The network that carries an overlay's wrapped packets: the provider's own links, routers, and addresses.. The customers' networks carried across it are the A network carried inside another network, such as customers' networks wrapped and sent across a provider's own network, the underlay.. Two ways of wrapping are in wide use:

  1. Multiprotocol Label Switching: routers forward each packet by a short label put in front of it, instead of by the packet's own address.. The PE puts short numbers, A short number put in front of a packet on an MPLS network. Each router forwards by the label, and swaps it for the label the next router expects., in front of the packet. A BGP/MPLS IP VPN, or L3VPN, is defined in RFC 4364. It uses two labels: an outer label that leads to the far PE, and an inner one that the far PE gave out for that customer's VRF. PEs tell each other the customers' routes over iBGP, as in BGP inside a network. A Eight bytes put in front of a customer's prefix inside BGP, so two customers' identical prefixes stay two different routes. keeps two customers' identical prefixes apart inside BGP. A A tag on a VPN route that says which VRFs on other PE routers take it in. says which VRFs take a route in.
  2. Virtual Extensible LAN: a frame carried inside a UDP packet between two routers or switches, with a number that says which network it belongs to., defined in RFC 7348. The PE puts the customer's Ethernet frame inside a UDP packet to port 4789, addressed to the far end. A VXLAN network identifier: the 24-bit number in a VXLAN header that says which customer or segment a frame belongs to. in the VXLAN header says which segment the frame is from. A VNI has 24 bits, for about 16 million segments, where a VLAN ID has 4094. Each tunnel end is a VXLAN tunnel endpoint: a router or switch that wraps frames in VXLAN and unwraps them..

Both still leave a question: how does a PE learn which customer addresses are behind which other PE? Plain VXLAN learns by flooding. It sends unknown traffic to every other VTEP, and remembers where the answers come from. With Ethernet VPN: routers announce in BGP which MAC and IP addresses are behind each of them, so nobody has to flood to find out., the PEs announce it in BGP instead. RFC 7432 defines EVPN for MPLS, and RFC 8365 for VXLAN. RFC 7348 made VXLAN for data centers, where it carries segments between the switches of a leaf-spine fabric.

Try itWrap a packet and send it across the core

Step through the bank's packet with VXLAN, then with MPLS labels. Then send the school's packet to the same address, and see what changes. Last, find the MTU the core links need for 1500-byte packets.

How the core carries the traffic
Whose packet
Office 1pe-01Corepe-02
  1. The bank's packet10.1.1.20 to 10.1.2.201500 bytesRead here

Step 1 of 4

The bank's office 1 sends a packet

A plain packet to 10.1.2.20 arrives at pe-01 on the port for the bank's office 1. That port is in VRF bank.

VXLAN adds 50 bytes, so the core must carry 1550 bytes where the customer sent 1500. The core links take only 1500. RFC 7348 says a tunnel end must not split a VXLAN packet, so it is dropped: raise the core MTU, or lower the tunnel's own.

Only the VNI, or the inner label, told the two packets apart, and only pe-02 read it. So the core stays the same size however many customers there are, and only the PEs have VRFs.

The wrapping costs bytes. VXLAN adds 50, and each MPLS label adds 4. So for a customer sending full 1,500-byte packets, the core links need an Maximum transmission unit: the largest single piece of data a link carries, in bytes. On ordinary Ethernet it is 1,500 bytes. of at least 1,550 bytes for VXLAN. RFC 7348 says a tunnel end must not split a VXLAN packet into pieces.

So raise the MTU of the core links well over 1,500, to a A frame that carries more than the usual 1,500 bytes, often about 9,000. Networks use jumbo frames on links between their own devices, such as inside a data center. size. The core link in the next section does this with mtu: 9000. Where a tunnel crosses the internet, whose links you don't control, lower the tunnel's own MTU instead.

CheckA P router in the middle of an MPLS core forwards a packet of the bank from pe-01 to pe-02. What does it need to know?
CheckYour core links carry 1500-byte packets. A customer sends 1500-byte packets over VXLAN between two PEs. What happens?

Overlays in Circuit ​

Circuit writes a VXLAN tunnel under interfaces.vxlan. Each tunnel has its two ends, local_address and remote_address, its vni, and its UDP port, which is 4789 when you leave it out. Like any interface, it can have addresses and be in a VRF. Each customer gets a tunnel of its own from pe-01 to pe-02, between the same two loopbacks, told apart by its VNI:

ts
interfaces: {
    ethernet: {
        "100g-1": { description: "pe-02 qsfp28-1-1", mtu: 9000, addresses: ["10.255.0.0/31"], link: { device: "pe-02", port: "100g-1" } },
    },
    loopback: {
        loopback: { addresses: ["192.0.2.1/32"] },
    },
    vxlan: {
        "vxlan-bank": {
            description: "Bank, to pe-02",
            vni: 10001,
            local_address: "192.0.2.1",
            remote_address: "192.0.2.2",
            vrf: "bank",
            addresses: ["172.16.9.0/31"],
        },
        "vxlan-school": {
            description: "School, to pe-02",
            vni: 10002,
            local_address: "192.0.2.1",
            remote_address: "192.0.2.2",
            vrf: "school",
            addresses: ["172.16.9.0/31"],
        },
    },
},

routing: {
    vrfs: { bank: {}, school: {} },
    static_routes: [
        { prefix: "192.0.2.2/32", next_hop: "10.255.0.1", description: "pe-02's loopback" },
        { prefix: "10.1.2.0/24", next_hop: "172.16.9.1", vrf: "bank", description: "Bank, office 2, at pe-02" },
        { prefix: "10.1.2.0/24", next_hop: "172.16.9.1", vrf: "school", description: "School, office 2, at pe-02" },
    ],
},

pe-02 has the same two tunnels the other way round. When both routers are in your network, circuit validate checks that each tunnel has one back at the far end. The ends must be swapped, and the VNI and port must match.

Circuit doesn't do the rest of this lesson:

  • No MPLS. It has no labels, no L3VPN, and no route distinguishers or route targets.
  • No EVPN. Each VXLAN tunnel is point to point, with its far end written by hand, and the routes through it are static.
  • No BGP inside a VRF.

Tunnels and static routes written in files suit a few sites. A provider with hundreds of customers needs PEs that announce routes to each other with MPLS or EVPN, which Circuit doesn't write.

Further reading ​

  • RFC 4364, BGP/MPLS IP virtual private networks: VRFs, the PE, CE, and P routers, route distinguishers, and route targets.
  • RFC 3032, MPLS label stack encoding: a label is 4 bytes.
  • RFC 7348, VXLAN: the 24-bit VNI, UDP port 4789, and why a VTEP must not fragment.
  • RFC 7432, on EVPN over MPLS.
  • RFC 8365, on EVPN for VXLAN.

Discussion

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

Released under the Business Source License 1.1.