L3 routing to the hypervisor with BGP

Vincent Bernat

On layer 2 net­works, high avail­abil­ity can be achieved by:

Layer 2 net­works need very lit­tle con­fig­u­ra­tion but come with a ma­jor draw­back in highly avail­able sce­nar­ios: an in­ci­dent is likely to bring the whole net­work down.2 There­fore, it is safer to limit the scope of a sin­gle layer 2 net­work by, for ex­am­ple, us­ing one dis­tinct net­work in each rack and con­nect­ing them with layer 3 rout­ing. In­ci­dents are un­likely to im­pact a whole IP network.

In the il­lus­tra­tion be­low, top of the rack switches pro­vide a de­fault gate­way for hosts. To pro­vide re­dun­dancy, they use an MC-LAG im­ple­men­ta­tion. Layer 2 fault do­mains are scoped to a rack. Each IP sub­net is bound to a spe­cific rack and rout­ing in­for­ma­tion is shared be­tween top of the rack switches and core routers us­ing a rout­ing pro­to­col like OSPF.

Legacy L2 design
Minimal layer 3 (routed) access design: each pair of top of the racks act as a gateway. Layer 2 fault domains are limited to a single rack. Hypervisors provide a bridge to virtual guests, extending the layer 2 domain. Each rack owns a set of subnets.

There are two main is­sues with this design:

  1. The L2 do­mains are still large. A rack could host sev­eral dozen hy­per­vi­sors and sev­eral thou­sand vir­tual guests. There­fore, a net­work in­ci­dent will have a large impact.

  2. IP sub­nets are pinned to each rack. A vir­tual guest can­not move to an­other rack and un­used IP ad­dresses in a rack can­not be used in an­other one.

To solve both these prob­lems, it is pos­si­ble to push L3 rout­ing fur­ther to the south, turn­ing each hy­per­vi­sor into an L3 router. How­ever, we need to en­sure cus­tomer vir­tual guests are blind to this change: they should keep get­ting their con­fig­u­ra­tion from DHCP (IP, sub­net, and gateway).

Hypervisor as a router#

In a nut­shell, for a guest with an IPv4 address:

  • the host­ing hy­per­vi­sor con­fig­ures a /32 route with the vir­tual in­ter­face as next-hop; and
  • this route is dis­trib­uted to other hy­per­vi­sors (and routers) using BGP.

Our de­sign also han­dles two rout­ing do­mains: a pub­lic one (host­ing vir­tual guests from mul­ti­ple ten­ants with di­rect In­ter­net ac­cess) and a pri­vate one (used by our own in­fra­struc­ture, hy­per­vi­sors in­cluded). Each hy­per­vi­sor uses two rout­ing ta­bles for this purpose.

The fol­low­ing il­lus­tra­tion shows the con­fig­u­ra­tion of a hy­per­vi­sor with 5 guests. No bridge is needed.

L3 routing inside a hypervisor
Layer 3 routing setup for a hypervisor. Each hypervisor is connected to a “public” network and a “private” one. Guests are attached to either of these networks. Each routing table contains connected routes for local guests, host routes for remote guests, and a default route for other destinations.

The com­plete con­fig­u­ra­tion de­scribed be­low is also avail­able on GitHub. In real life, a piece of soft­ware is needed to up­date the hy­per­vi­sor con­fig­u­ra­tion when an in­stance is added or re­moved. It would lis­ten to no­ti­fi­ca­tions from your cloud or­chestrator.

Cal­ico is a project ful­fill­ing the same ob­jec­tive (L3 rout­ing to the hy­per­vi­sor) with mostly the same ideas (ex­cept it heav­ily re­lies on Net­fil­ter to en­sure sep­a­ra­tion be­tween ad­min­is­tra­tive do­mains). It pro­vides an agent (Fe­lix) to serve as an in­ter­face with or­ches­tra­tors like OpenStack or Ku­ber­netes. Check it if you want a turnkey solution.

Routing setup#

Us­ing IP rules, each in­ter­face is “at­tached” to a rout­ing table:

$ ip rule show
0:  from all lookup local
20: from all iif lo lookup main
21: from all iif lo lookup local-out
30: from all iif eth0.private lookup private
30: from all iif eth1.private lookup private
30: from all iif vnet8 lookup private
30: from all iif vnet9 lookup private
40: from all lookup public

The most im­por­tant rules are the high­lighted ones (pri­or­ity 30 and 40): any traf­fic com­ing from a “pri­vate” in­ter­face uses the private ta­ble. Any re­main­ing traf­fic uses the public table.

The two iif lo rules man­age rout­ing for pack­ets orig­i­nated from the hy­per­vi­sor it­self. The local-out ta­ble is a mix of the private and public ta­bles. The hy­per­vi­sor mostly needs the routes from the private ta­ble but also needs to con­tact lo­cal vir­tual guests (for ex­am­ple, to an­swer a ping re­quest) us­ing the public ta­ble. Both ta­bles con­tain a de­fault route (no chain­ing pos­si­ble), so we build a third ta­ble, local-out, by copy­ing all routes from the private ta­ble and di­rectly con­nected routes from the public table.

To avoid an ac­ci­den­tal leak of traf­fic, public, private, and local-out rout­ing ta­bles con­tain a de­fault last-re­sort route with a large met­ric.3 On nor­mal op­er­a­tions, these routes should be shad­owed by a reg­u­lar de­fault route:

ip route add blackhole default metric 4294967294 table public
ip route add blackhole default metric 4294967294 table private
ip route add blackhole default metric 4294967294 table local-out

IPv6 is far sim­pler as we have only one rout­ing do­main. While we keep a public ta­ble, there is no need for a local-out table:

$ ip -6 rule show
0:  from all lookup local
20: from all lookup main
40: from all lookup public

As the last step, for­ward­ing is en­abled and the max­i­mum size for IPv6 route cache is in­creased (de­fault is only 4096):4

sysctl -qw net.ipv4.conf.all.forwarding=1
sysctl -qw net.ipv6.conf.all.forwarding=1
sysctl -qw net.ipv6.route.max_size=524288

Up­date (2019-12)

Start­ing from Linux 4.2, en­tries for the route cache are only cre­ated when there is a PMTU ex­cep­tion. There­fore, it is best to keep the de­fault value and watch /proc/​net/​rt6_​stats: the next to last value is the cur­rent cache size in hexa­decimal.

Guest routes#

The sec­ond step is to con­fig­ure routes for each guest. For IPv6, we use the link-lo­cal ad­dress, de­rived from the re­mote MAC ad­dress, as next-hop:5

ip -6 route add 2001:db8:cb00:7100:5254:33ff:fe00:f/128 \
    via fe80::5254:33ff:fe00:f dev vnet6 \
    table public

As­sign­ing sev­eral IP ad­dresses (or sub­nets) to each guest can be done by adding more routes:

ip -6 route add 2001:db8:cb00:7107::/64 \
    via fe80::5254:33ff:fe00:f dev vnet6 \
    table public

For IPv4, the route uses the guest in­ter­face as a next-hop. Linux will is­sue an ARP re­quest be­fore be­ing able to for­ward the packet:6

ip route add 192.0.2.15/32 dev vnet6 \
  table public

Ad­di­tional IP ad­dresses and sub­nets can be con­fig­ured the same way but each IP ad­dress would have to an­swer to ARP re­quests. To avoid this, it is pos­si­ble to route ad­di­tional sub­nets through the first IP address:7

ip route add 203.0.113.128/28 \
  via 192.0.2.15 dev vnet6 onlink \
  table public

BGP setup#

The third step is to share routes be­tween hy­per­vi­sors, through BGP. This part is de­pen­dent on how hy­per­vi­sors are con­nected to each other.

Fabric design#

Sev­eral de­signs are pos­si­ble to con­nect hy­per­vi­sors. The most ob­vi­ous one is to use a full L3 leaf-spine fabric:

Full L3 fabric design
Full L3 leaf-spine fabric design. A BGP session is established over each link. Spine routers need to learn all routes.

Each hy­per­vi­sor es­tab­lishes an eBGP ses­sion with each of the leaf top-of-the-rack routers. These routers es­tab­lish an eBGP ses­sion with each spine router. This so­lu­tion can be ex­pen­sive be­cause the spine routers need to han­dle all routes. With the cur­rent gen­er­a­tion of switches/routers, this puts a limit around the max­i­mum num­ber of routes for the ex­pected den­sity.8 IP and BGP con­fig­u­ra­tion can also be te­dious un­less some un­com­mon au­to­con­fig­u­ra­tion mech­a­nisms are used. On the other hand, leaf routers (and hy­per­vi­sors) may op­tion­ally learn fewer routes as they can push non-lo­cal traf­fic north.

An­other po­ten­tial de­sign is to use an L2 fab­ric. This may sound sur­pris­ing af­ter bad-mouthing L2 net­works for their un­re­li­a­bil­ity but we don’t need them to be highly avail­able. They can pro­vide a very scal­able and cost-ef­fi­cient design:9

L2 fabric design
L2 fabric leaf-spine fabric design with 4 distinct L2 networks. Each hypervisor establishes a BGP session to at least one route reflector for each L2 network.

Each hy­per­vi­sor is con­nected to 4 dis­tinct L2 net­works, lim­it­ing the scope of a sin­gle fail­ure to a quar­ter of the avail­able band­width. In this de­sign, only iBGP is used. To avoid a full-mesh topol­ogy be­tween all hy­per­vi­sors, route re­flec­tors are used. Each hy­per­vi­sor has an iBGP ses­sion with one or sev­eral route re­flec­tors from each of the L2 net­works. Route re­flec­tors on the same L2 net­work share their routes us­ing iBGP. Cal­ico doc­u­ments this de­sign in more detail.

This is the so­lu­tion de­scribed be­low. Pub­lic and pri­vate do­mains share the same in­fra­struc­ture but use dis­tinct VLANs.

Up­date (2022-07)

While such a de­sign made sense a few years back, re­cent hard­ware can scale bet­ter and I rec­om­mend you opt for a full L3 de­sign. In this case, you do not need the route re­flec­tors. If you swap BIRD with FRR, you can even use a sin­gle IPv6 eBGP ses­sion with VPNv4 (pub­lic and pri­vate), VPNv6 (pub­lic), and EVPN (for VXLAN, not de­scribed here). De­pend­ing on the de­vices in­volved, you can con­fig­ure un­num­bered BGP peers. This does not re­quire any IP ad­dress­ing plan and the con­fig­u­ra­tion is there­fore minimized.

Route reflectors#

Route re­flec­tors are BGP-speak­ing boxes act­ing as a hub for all routes on a given L2 net­work but not rout­ing any traf­fic. We need at least one of them on each L2 net­work. We can use more for re­dundancy.

Here is an ex­am­ple of con­fig­u­ra­tion for Junos:10

protocols {
    bgp {
        group public-v4 {
            family inet {
                unicast {
                    no-install; # ❶
                }
            }
            type internal;
            cluster 198.51.100.126; # ❷
            allow 198.51.100.0/25; # ❸
            neighbor 198.51.100.127;
        }
        group public-v6 {
            family inet6 {
                unicast {
                    no-install;
                }
            }
            type internal;
            cluster 198.51.100.126;
            allow 2001:db8:c633:6401::/64;
            neighbor 2001:db8:c633:6401::198.51.100.127;
        }
        ttl 255;
        bfd-liveness-detection { # ❹
            minimum-interval 100;
            multiplier 5;
        }
    }
}
routing-options {
    router-id 198.51.100.126;
    autonomous-system 65000;
}

This route re­flec­tor ac­cepts and re­dis­tributes IPv4 and IPv6 routes. In ❶, we en­sure re­ceived routes are not in­stalled in FIB: route re­flec­tors are not routers.

Each route re­flec­tor needs to be as­signed a clus­ter iden­ti­fier, which is used in loop de­tec­tion. In our case, we use the IPv4 ad­dress for this pur­pose (in ❷). Hav­ing a dif­fer­ent clus­ter iden­ti­fier for each route re­flec­tor on the same net­work en­sures they share the routes they re­ceive—in­creas­ing re­siliency.

In­stead of ex­plic­itly declar­ing all hy­per­vi­sors al­lowed to con­nect to this route re­flec­tor, a whole sub­net is au­tho­rized in ❸.11 We also de­clare the sec­ond route re­flec­tor for the same net­work as a neigh­bor to en­sure they con­nect to each other.

An­other im­por­tant point of this setup is how to quickly re­act to un­avail­able paths. With di­rectly con­nected BGP ses­sions, a faulty link may be de­tected im­me­di­ately and the as­so­ci­ated BGP ses­sions will be brought down. This may not al­ways be re­li­able. More­over, in our case, BGP ses­sions are es­tab­lished over sev­eral switches: a link down on a path may be left un­de­tected un­til the hold timer ex­pires. There­fore, in ❹, we en­able BFD, a pro­to­col to quickly12 de­tect faults in the path be­tween two BGP peers (RFC 5880).

The last point to con­sider is whether you want to al­low any­cast on your net­work: if an IP is ad­ver­tised from more than one hy­per­vi­sor, you may want to:

  • send all flows to only one hy­per­visor; or
  • load-bal­ance flows be­tween hy­pervisors.

The sec­ond choice pro­vides a scal­able L3 load-bal­ancer. With the above con­fig­u­ra­tion, for each pre­fix, route re­flec­tors choose one path and dis­trib­ute it. There­fore, only one hy­per­vi­sor will re­ceive pack­ets. To get load-bal­anc­ing, you need to en­able ad­ver­tise­ment of mul­ti­ple paths in BGP (RFC 7911):13

set protocols bgp group public-v4 family inet  unicast add-path send path-count 4
set protocols bgp group public-v6 family inet6 unicast add-path send path-count 4

Here is an ex­cerpt of show route ex­hibit­ing “sim­ple” routes as well as an any­cast route:

> show route protocol bgp
inet.0: 6 destinations, 7 routes (7 active, 1 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0        *[BGP/170] 00:09:01, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.1 via em1.90
192.0.2.15/32    *[BGP/170] 00:09:00, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.101 via em1.90
203.0.113.1/32   *[BGP/170] 00:09:00, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.101 via em1.90
203.0.113.6/32   *[BGP/170] 00:09:00, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.102 via em1.90
203.0.113.18/32  *[BGP/170] 00:09:00, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.103 via em1.90
203.0.113.10/32  *[BGP/170] 00:09:00, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.101 via em1.90
                  [BGP/170] 00:09:00, localpref 100
                    AS path: I, validation-state: unverified
                  > to 198.51.100.102 via em1.90

Com­plete con­fig­u­ra­tion is avail­able on GitHub. Con­fig­u­ra­tions for GoBGP, BIRD or FRR (run­ning on Cu­mu­lus Linux) are also avail­able.14 The con­fig­u­ra­tion for the pri­vate rout­ing do­main is sim­i­lar. To avoid ded­i­cated boxes, a so­lu­tion is to run the route re­flec­tors on some of the top of the rack switches.

Hypervisor configuration#

Let’s tackle the last step: the hy­per­vi­sor con­fig­u­ra­tion. We use BIRD (1.6.x) as a BGP dae­mon. It main­tains three in­ter­nal rout­ing ta­bles (public, private, and local-out). We use a tem­plate with the com­mon prop­er­ties to con­nect to a route re­flector:

template bgp rr_client {
  local as 65000;   # Local ASN matches route reflector ASN
  import all;       # Accept all received routes
  export all;       # Send all routes to remote peer
  next hop self;    # Modify next-hop with the IP used for this BGP session
  bfd yes;          # Enable BFD
  direct;           # Not a multi-hop BGP session
  ttl security yes; # GTSM is enabled
  add paths rx;     # Enable ADD-PATH reception (for anycast)

  # Low timers to establish sessions faster
  connect delay time 1;
  connect retry time 5;
  error wait time 1,5;
  error forget time 10;
}

table public;
protocol bgp RR1_public from rr_client {
  neighbor 198.51.100.126 as 65000;
  table public;
}
# […]

With the above con­fig­u­ra­tion, all routes in BIRD’s public ta­ble are sent to the route re­flec­tor 198.51.100.126. Any route from the route re­flec­tor is ac­cepted. We also need to con­nect BIRD’s public ta­ble to the ker­nel’s one:15

protocol kernel kernel_public {
  persist;
  scan time 10;
  import filter {
    # Take any route from kernel,
    # except our last-resort default route
    if krt_metric < 4294967294 then accept;
    reject;
  };
  export all;      # Put all routes into kernel
  learn;           # Learn routes not added by BIRD
  merge paths yes; # Build ECMP routes if possible
  table public;    # BIRD's table name
  kernel table 90; # Kernel table number
}

We also need to en­able BFD on all in­terfaces:

protocol bfd {
  interface "*" {
    interval 100ms;
    multiplier 5;
  };
}

To avoid los­ing BFD pack­ets when the con­ntrack ta­ble is full, it is safer to dis­able con­nec­tion track­ing for these datagrams:

ip46tables -t raw -A PREROUTING -p udp --dport 3784 \
  -m addrtype --dst-type LOCAL -j CT --notrack
ip46tables -t raw -A OUTPUT -p udp --dport 3784 \
  -m addrtype --src-type LOCAL -j CT --notrack

Some miss­ing bits are:

Once the BGP ses­sions have been es­tab­lished, we can query the ker­nel for the in­stalled routes:

$ ip route show table public proto bird
default
        nexthop via 198.51.100.1 dev eth0.public weight 1
        nexthop via 198.51.100.254 dev eth1.public weight 1
203.0.113.6
        nexthop via 198.51.100.102 dev eth0.public weight 1
        nexthop via 198.51.100.202 dev eth1.public weight 1
203.0.113.18
        nexthop via 198.51.100.103 dev eth0.public weight 1
        nexthop via 198.51.100.203 dev eth1.public weight 1

Performance#

You may be wor­ried about how much mem­ory Linux may use when han­dling many routes. Well, don’t:

  • 128 MiB can fit 1 mil­lion IPv4 routes; and
  • 512 MiB can fit 1 mil­lion IPv6 routes.

BIRD uses about the same amount of mem­ory for its own us­age. As for lookup times, per­for­mance is also ex­cel­lent with IPv4 and still quite good with IPv6:

  • 30 ns per lookup with 1 mil­lion IPv4 routes; and
  • 1.25 µs per lookup with 1 mil­lion IPv6 routes.

There­fore, the im­pact of let­ting Linux han­dle many routes is very low. For more de­tails, see “IPv4 route lookup on Linux” and “IPv6 route lookup on Linux.”

Reverse path filtering#

To avoid spoof­ing, re­verse path fil­ter­ing is en­abled on vir­tual guest in­ter­faces: Linux will ver­ify the source ad­dress is le­git by check­ing the an­swer would use the in­com­ing in­ter­face as an out­go­ing in­ter­face. This ef­fec­tively pre­vents any pos­si­ble spoof­ing from guests.

For IPv4, re­verse path fil­ter­ing can be en­abled ei­ther through a per-in­ter­face sysctl17 or through the rpfilter match of Net­fil­ter. For IPv6, only the sec­ond method is available.

# For IPv6, use NetFilter
ip6tables -t raw -N RPFILTER
ip6tables -t raw -A RPFILTER -m rpfilter -j RETURN
ip6tables -t raw -A RPFILTER -m rpfilter --accept-local \
  -m addrtype --dst-type MULTICAST -j DROP
ip6tables -t raw -A RPFILTER -m limit --limit 5/s --limit-burst 5 \
  -j LOG --log-prefix "NF: rpfilter: " --log-level warning
ip6tables -t raw -A RPFILTER -j DROP
ip6tables -t raw -A PREROUTING -i vnet+ -j RPFILTER

# For IPv4, use sysctls
sysctl -qw net.ipv4.conf.all.rp_filter=0
for iface in /sys/class/net/vnet*; do
    sysctl -qw net.ipv4.conf.${iface##*/}.rp_filter=1
done

There is no need to pre­vent L2 spoof­ing as there is no gain for the attacker.

Keeping guests in the dark#

An im­por­tant as­pect of the so­lu­tion is to en­sure guests be­lieve they are at­tached to a clas­sic L2 net­work (with an IP in a subnet).

The first step is to pro­vide them with a work­ing de­fault gate­way. On the hy­per­vi­sor, this can be done by as­sign­ing the de­fault gate­way IP di­rectly to the guest in­terface:

ip addr add 203.0.113.254/32 dev vnet5 scope link

Our main goal is to en­sure Linux will an­swer ARP re­quests for the gate­way IP. Con­fig­ur­ing a /32 is enough for this and we do not want to con­fig­ure a larger sub­net as, by de­fault, Linux would in­stall a route for the sub­net to this in­ter­face, which would be in­correct.18

For IPv6, this is not needed as we rely on link-lo­cal ad­dresses instead.

A guest may also try to speak with other guests on the same sub­net. The hy­per­vi­sor will an­swer ARP re­quests on their be­half. Once it starts re­ceiv­ing IP traf­fic, it will route it to the ap­pro­pri­ate in­ter­face. This can be done by en­abling ARP prox­y­ing on the guest in­terface:

sysctl -qw net.ipv4.conf.vnet5.proxy_arp=1
sysctl -qw net.ipv4.neigh.vnet5.proxy_delay=0

For IPv6, Linux NDP prox­y­ing is far less con­ve­nient. In­stead, ndppd can han­dle this task. For each in­ter­face, we use the fol­low­ing con­fig­u­ra­tion snippet:

proxy vnet5 {
  rule 2001:db8:cb00:7100::/64 {
    static
  }
}

ndppd does not spoof the source ad­dress and some sys­tems are pick­ier about it. There­fore, an ap­pro­pri­ate ad­dress needs to be con­fig­ured on each in­terface:

ip addr add 2001:db8:cb00:7100::1/64 dev vnet5 noprefixroute nodad

For DHCP, some dae­mons may have dif­fi­cul­ties to han­dle this odd con­fig­u­ra­tion (with the /32 IP ad­dress on the in­ter­face), but dns­masq ac­cepts such an odd­ity. For IPv6, as­sum­ing the as­signed IP ad­dress is a EUI-64 one, radvd works with the fol­low­ing con­fig­u­ra­tion on each in­terface:

interface vnet5 {
  AdvSendAdvert on;
  prefix 2001:db8:cb00:7100::/64 {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
  };
};

Conclusion and future work#

This setup should work with BIRD 1.6.3 and a Linux 3.15+ ker­nel. Com­pared to legacy L2 net­works, it brings flex­i­bil­ity and re­siliency while keep­ing guests un­aware of the change. By hand­ing over rout­ing to Linux, this de­sign is also cheap as ex­ist­ing equip­ment can be reused. Still, op­er­a­tion of such a so­lu­tion is sim­ple enough once the ba­sic con­cepts are un­der­stood—IP rules, rout­ing ta­bles, and BGP sessions.

There are sev­eral po­ten­tial im­provements:

Us­ing VRF
Start­ing from Linux 4.3, L3 VRF do­mains en­able bind­ing in­ter­faces to rout­ing ta­bles. We could have three VRFs: public, private, and local-out. This would im­prove per­for­mance by re­mov­ing most IP rules (but un­til Linux 4.8, per­for­mance is crip­pled due to of­fload­ing fea­tures not en­abled, see com­mit 7889681f4a6c). For more in­for­ma­tion, have a look at the ker­nel doc­u­mentation.
Full L3 rout­ing
The BGP setup can be en­hanced and sim­pli­fied by us­ing an L3 fab­ric and us­ing some au­to­con­fig­u­ra­tion fea­tures. Cu­mu­lus pub­lished a nice book, “BGP in the dat­a­cen­ter,” on this topic. How­ever, this re­quires all BGP speak­ers to sup­port these fea­tures. On the hy­per­vi­sors, this would mean us­ing FRR while the var­i­ous net­work equip­ment would need to run Cu­mu­lus Linux.
BGP re­siliency with BGP LLGR
Us­ing short BFD timers make our net­work re­act fast to any dis­rup­tion by quickly in­val­i­dat­ing faulty paths with­out re­ly­ing on link sta­tus. How­ever, un­der load or con­ges­tion, BFD pack­ets may be lost, mak­ing the whole hy­per­vi­sor un­reach­able un­til BGP ses­sions can be brought up again. Some BGP im­ple­men­ta­tions sup­port Long-Lived BGP Grace­ful Restart, an ex­ten­sion al­low­ing stale routes to be re­tained with a lower pri­or­ity (see draft-ut­taro-idr-bgp-per­sis­tence-03). This is an ideal so­lu­tion to our prob­lem: these stale routes are used only as last re­sort, af­ter all links have failed. Cur­rently, no open-source im­ple­men­ta­tion sup­ports this draft. See “BGP LLGR: ro­bust and re­ac­tive BGP ses­sions” for more details.

Up­date (2019-08)

For bet­ter se­cu­rity, it is pos­si­ble to re­use fea­tures around the RPKI to val­i­date an­nounce­ments from each hy­per­vi­sor. See “Se­cur­ing BGP on the host with ori­gin val­i­dation.”

Up­date (2021-05)

Face­book pub­lished “Run­ning BGP in Data Cen­ters at Scale.” This pa­per con­tains some in­sights on how Face­book man­ages BGP in its dat­a­cen­ters. This is an or­thog­o­nal is­sue to ex­tend­ing BGP to the server but it is an in­ter­est­ing read, no­tably the use of poli­cies to help op­er­ability.

Up­date (2021-10)

We have pub­lished the con­fig­u­ra­tion used at Blade in our San Fran­cisco and Seoul data cen­ters that are us­ing BGP-to-the-hosts with an L3 fab­ric. This in­cludes the con­fig­u­ra­tion for Ju­niper top-of-the-rack switches and Cu­mu­lus top-of-the-rack switches. These fea­ture a DHCP server for pro­vi­sion­ing. The BGP con­fig­u­ra­tion on the servers is done via an API served by nginx.