---
title: 'Routing Policy'
visible: true
---

Details of the burble.dn42 routing policy.

===

## Routing Policy

With a global network and multiple peers, the burble.dn42 network typically has many alternative route paths for reaching a particular destination. The routing policy aims to keep route selection sane, and avoid sending traffic outside of a region where possible. 

### Policy Rules

1. Direct routes for prefixes belonging to a peer should be given the highest priority.  
  So that traffic to peer networks is routed over the burble.dn42 network directly to the peer and not via an external 3rd party
3. Routes to the anycast prefixes should be prioritised through stable, low latency peers.  
  To ensure stability within the network and provide good routes for well known destinations (e.g. DNS and the DN42 wiki)
5. Where prefixes are tagged with a DN42 region, they should be routed locally or within the burble.dn42 network.     
  To avoid sending traffic across regions when this could have been avoided.  
  The AS path length is also increased between regions to pursuade external routers to also prefer local hosts.
7. Prioritise by shortest path, then lowest latency

### Policy Implementation

#### bgp local_pref

The local_pref for routes is set on entry, and then propogated across the whole network (including across regions). This forces the network to prefer routes that, where possible, send traffic through the burble.dn42 network to a local peer, rather than sending cross regional traffic through external peers (aka [Cold Potato Routing](https://en.wikipedia.org/wiki/Hot-potato_and_cold-potato_routing)).

|Local Pref &nbsp; | Route Class |
|:---|:---|
| 1000 &nbsp; | Peer networks (AS path len = 1) |
| 900 &nbsp; | Prioritised routes for well known anycast prefixes |
| 500 &nbsp; | Route received in same DN42 region as it originated |
| 100 &nbsp; | Default |

#### bgp med

The med attribute is set _per host_ and not propogated through the network.  
The use of med is intended to pursuade the host to choose the lowest latency route to a prefix, in the case where the local_pref and AS path lengths are equal. Routes that originate in a different burble.dn42 region also get an additional med penalty.

```
med = 10 + 4 if cross region + DN42 maxmimum latency via 65411 community (1 to 9)
```
