FreeTransit Learning Centre
How RPKI authorises route origins, what ROA maxLength allows and how networks validate the routes they receive.
RPKI, ROAs and route origin validation
With the Resource Public Key Infrastructure (RPKI), the holder of an IP prefix publishes a signed statement saying which ASN may originate it. That statement is a Route Origin Authorisation, or ROA.
Origin validation catches routes announced from the wrong ASN, by accident or on purpose. It says nothing about the rest of the AS path, and you still need normal import and export filters.
Two sides of RPKI
As a resource holder: publish ROAs
For each prefix you announce, publish a ROA with:
- the ASN allowed to originate it
- the prefix
- a
maxLengththat allows only the prefix lengths you actually announce
As a network operator: validate what you receive
A validator (relying-party software) downloads and checks the RPKI data. Your routers get the result over the RPKI-to-Router (RTR) protocol and mark every BGP route with one of three states:
- Valid: a ROA covers the prefix and allows this origin ASN and prefix length.
- Invalid: a ROA covers the prefix, but the origin ASN or the prefix length doesn't match.
- Not Found: no ROA covers the prefix.
Most networks reject Invalid routes once they have watched the results for a while. Not Found is not Invalid and is normally accepted.
FreeTransit rejects RPKI-invalid routes on every session, including the ones you send us. A wrong ROA for your own prefix means we drop it. Routes we pass on to you carry a large community with their RPKI state (see the features page).
Understand maxLength
maxLength lets you announce more-specifics. Leave it equal to the prefix length unless you really announce them.
Examples:
2001:db8:1000::/48, origin AS64512,maxLength48: allows only that /48.2001:db8:2000::/44, origin AS64512,maxLength48: allows the /44 and every more-specific from /45 to /48.- If you announce only the /44,
maxLength48 grants more than you need. Anyone who can forge your origin can then announce a valid /48 out of your space. - If you do announce some /48s, the ROA has to allow them, or you publish separate ROAs for exactly those /48s.
Use the tightest ROAs that fit your real routing plan. Don't pick /24 for IPv4 or /48 for IPv6 out of habit.
Official resources
- RIPE NCC RPKI overview
- Using the RIPE NCC hosted Certificate Authority
- RIPE NCC routing learning path
- RIPE NCC BGP Security course
- RIPE NCC BGP webinar recordings, including Introduction to RPKI and Deploying RPKI
- APNIC Academy: MANRS course
- MANRS
Open-source RPKI software
Routinator
Routinator is an open-source validator from NLnet Labs. It checks RPKI data and serves the result to your routers. See the manual page and the interactive mode, which is handy for checking a single prefix.
Krill
Krill is an open-source RPKI Certificate Authority and publication server. Most applicants are better off with their RIR's hosted CA; Krill is useful for learning delegated RPKI.
Rolling out validation
- List every prefix and origin ASN you operate.
- Compare what you intend to announce with what is visible in BGP today.
- Create narrow ROAs that match the plan.
- Check the published result with a tool you don't control, such as RIPEstat.
- Watch for Invalid announcements before you change any router policy.
- Run at least two independent validators in production.
- Connect routers to them following your vendor's guidance on failures and caching.
- Watch validation states without rejecting anything.
- Fix legitimate routes that show up as Invalid.
- Turn on rejection of Invalid routes as a planned change.
- Monitor validator freshness, RTR sessions and the number of rejected routes.
- Revisit your ROAs whenever prefixes, origins or traffic-engineering announcements change.
Monitoring
- RIPEstat shows routing and RPKI data for an ASN or prefix.
- BGPlay replays routing changes over time.
- RIPE RIS Live streams BGP messages in real time.
- BGPalerter alerts on lost visibility, unexpected origins and RPKI problems.
- NLNOG Looking Glass shows your routes from many outside networks.
Talks
- RPKI (DENOG10, 2018), an eight-minute introduction.
- Securing your Router with RPKI (GPN19, 2019), deployment at a small network with free software.
- BGP Routing Security: Hijacks vs RPKI (RIPE NCC at NetUK)
The older talks show older software. Take commands from the current RIPE NCC and NLnet Labs documentation.