BGP ORIGIN Attribute: Lab Tests and Who Rewrites It
At 00:27 UTC tonight the RouteViews collector in Oregon held fifteen paths to 105.32.0.0/12. Eight of them had the same AS_PATH length, seven hops, and six of those eight ended in Origin incomplete. The router threw those six away and picked a path through Lumen (AS3356) that ended in Origin IGP. Every copy that came straight from Cogent said INCOMPLETE; the copies that crossed Lumen or Vocus said IGP. One byte, changed by a network in the middle of the path, decided the route. The BGP ORIGIN attribute is that byte. It records how the route first entered BGP: IGP, EGP or INCOMPLETE, the i, e and ? at the end of every show ip bgp line. This is part 6 of our 26-part BGP Deep Dive and the first of the one-attribute-per-article parts. It covers the definition and the bytes, the history from EGP to RFC 4271, how each vendor sets the value, where ORIGIN sits in best-path selection, a GoBGP lab in which ORIGIN wins, loses and gets rewritten, broken ORIGIN values, and fresh RIPE RIS and RouteViews data on who rewrites it today.
- What it is: ORIGIN is type code 1, a well-known mandatory attribute with one value byte: 0 IGP, 1 EGP, 2 INCOMPLETE. The originating speaker sets it, and RFC 4271 says nobody else SHOULD change it.[1]
- How it is set: on Cisco IOS, IOS XR and FRR a
networkstatement givesiandredistributegives?. Junos exports with IGP by default. EGP means the historic protocol of RFC 904, not eBGP.[9][11][13][6] - Best path: lowest ORIGIN wins at tie-break step (b) of RFC 4271, after AS_PATH length and before MED. RFC 1771 (1995) did not list it at all.[1][2][8]
- Lab: in GoBGP 4.11 ORIGIN beat the router ID and MED, lost to a shorter AS_PATH, and an import policy that rewrote
?toimoved the best path and was passed on to the next AS.[20] - Broken ORIGIN: value 3, length 2 or no ORIGIN at all: treat-as-withdraw under RFC 7606, and the session stayed up in our lab.[7][20]
- Real Internet: in RIPE RIS rrc14 at 00:00 UTC today, the NTT (AS2914) peer sent 1,074,172 IPv4 routes and not one was INCOMPLETE; Sparkle's peer showed 8.93%. A RIPE 91 study named six tier-1 networks that rewrite ORIGIN to IGP, and Cloudflare's 2026 experiment found the same count.[21][15][16]
What the BGP ORIGIN attribute is
RFC 4271 defines ORIGIN in two sentences. Section 4.3 gives the type code and the values: ORIGIN is type code 1, "a well-known mandatory attribute that defines the origin of the path information", and its one data octet can be 0 (IGP: the NLRI "is interior to the originating AS"), 1 (EGP: the NLRI was "learned via the EGP protocol [RFC904]") or 2 (INCOMPLETE: the NLRI was "learned by some other means").[1] Section 5.1.1 gives the rule of use: the attribute "is generated by the speaker that originates the associated routing information. Its value SHOULD NOT be changed by any other speaker."[1]
Three consequences follow from "well-known mandatory":
- Every BGP implementation must recognise ORIGIN. There is no such thing as an unknown ORIGIN.
- Every UPDATE that announces prefixes must carry it. An UPDATE that only withdraws routes carries no path attributes at all.
- It is transitive by definition: well-known attributes always have the Transitive bit set, so ORIGIN travels with the route through every AS, to the far end of the Internet.
Do not confuse ORIGIN with the origin AS. The origin AS is the last AS number in the AS_PATH, the network that announced the prefix, and it is what RPKI route origin validation checks. ORIGIN is a different thing: one byte describing how that network put the route into BGP. The Cloudflare study mentioned below makes the same warning in its first paragraph.[15]
ORIGIN on the wire: four bytes
ORIGIN is the smallest path attribute you will meet. The flags byte is 0x40 (Optional = 0, Transitive = 1, Partial = 0, Extended Length = 0), the type code is 0x01, the length is 0x01 and the value is one byte.[1] RFC 4271 also recommends sending attributes in ascending type-code order, so in most captures ORIGIN is the first attribute after the "Total Path Attribute Length" field. That makes it easy to find by eye: look for 40 01 01.
Here are three real UPDATEs that our GoBGP router r1 sent to a raw Python BGP speaker, O, as the best path to 203.0.113.0/24 changed during the lab described below. The 16-byte marker is cut off; everything else is as received.[20]
t=1.025 s 0033 02 0000 0018 40 01 01 02 40 02 0a 02 02 0000fde9 0000fdea 40 03 04 7f00023d 18 cb0071
t=2.546 s 0033 02 0000 0018 40 01 01 01 40 02 0a 02 02 0000fde9 0000fdeb 40 03 04 7f00023d 18 cb0071
t=4.072 s 0033 02 0000 0018 40 01 01 00 40 02 0a 02 02 0000fde9 0000fdea 40 03 04 7f00023d 18 cb0071
The three messages are identical except for two places: the ORIGIN value byte (02, then 01, then 00) and the neighbour AS in the AS_PATH (0xfdea = 65002, 0xfdeb = 65003). Each time r1 chose a better path, it sent a new UPDATE for the same prefix that implicitly replaced the previous one; no withdrawal was needed in between. The ORIGIN byte r1 sent was exactly the one it had received from the winning neighbour. r1 prepended its own AS 65001 (0xfde9) and set itself as the NEXT_HOP (127.0.2.61), but it did not touch ORIGIN. That is the RFC behaviour, and it is the default on every implementation we know of.
From EGP to BGP-4: why the values are IGP, EGP and INCOMPLETE
The three values only make sense with the history in mind. Before BGP, autonomous systems exchanged reachability with the Exterior Gateway Protocol, specified in RFC 827 (1982) and formally in RFC 904 (1984).[6] BGP was built "on experience gained with EGP", and its first version, RFC 1105 (June 1989), had no ORIGIN attribute. Instead, each AS in the path came with a one-byte "Direction" field whose values included 4 EGP_LINK ("EGP derived information") and 5 INCOMPLETE ("incomplete information"). An EGP-learned route was passed over BGP with EGP_LINK and the AS number of the EGP peer. Any other exterior route could be passed "by setting AS Number field to zero and Direction field to INCOMPLETE".[3]
BGP-2, RFC 1163 (June 1990), replaced the Direction field with path attributes. ORIGIN became type 1, well-known mandatory, with the three values that are still in use: 0 IGP, 1 EGP, 2 INCOMPLETE. The same RFC defined error subcode 6, "Invalid ORIGIN Attribute".[4] So ORIGIN existed to tell a BGP speaker in 1990 whether a route had been learned inside an AS, had come through the old EGP core, or had arrived from somewhere it could not vouch for.
BGP-4 in 1995 kept ORIGIN mandatory, and the companion document RFC 1772 described the migration: "The information received by EGP2 can be injected into BGP-4 with the ORIGIN path attribute set to 1." In its list of things a route-selection policy might consider, RFC 1772 also wrote: "A path learned entirely from BGP ... is generally better than one for which part of the path was learned via EGP or some other means."[5] But RFC 1771, the BGP-4 specification itself, did not use ORIGIN when it broke ties. Its section 9.2.1.1 lists three rules: lowest MULTI_EXIT_DISC if the local system is configured to use it, lowest cost to the NEXT_HOP, and lowest BGP Identifier.[2]
The step that every engineer now learns, "prefer the lowest ORIGIN", entered the standard in RFC 4271 in 2006. Its tie-break procedure starts with (a) the fewest AS numbers in the AS_PATH and (b) "Remove from consideration all routes that are not tied for having the lowest Origin number in their Origin attribute."[1] Appendix A lists the change only as "Clarification of the tie-breaking procedures". The 2025 Internet-Draft that proposes scrubbing ORIGIN puts it plainly: in RFC 1771 the attribute was "not being formally specified to be used for best route selection", and the RFC 4271 version "was most probably simply copied from the existing stuff out there", that is, from implementations that already did it.[17]
How each value gets set on real routers
In practice nobody runs EGP, so the values now record which configuration command put the route into BGP:
- IGP (
i): on Cisco IOS the origin is IGP "when you issue the bgp network command".[9] The same holds for FRR: inbgpd/bgp_route.cthe function behindnetwork,bgp_static_update(), builds the route withBGP_ORIGIN_IGP.[13] - INCOMPLETE (
?): Cisco: "INCOMPLETE usually occurs when you redistribute routes from other routing protocols into BGP". Their example shows a static route redistributed into BGP and seen by the neighbour as100 ?.[9] FRR'sbgp_redistribute_add()usesBGP_ORIGIN_INCOMPLETE.[13] Nokia SR OS: when a router "originates a BGP route for an IP prefix by exporting a non-BGP route from the routing table, it sets the value of the ORIGIN attribute to Incomplete".[12] - Junos is different: it has no
networkstatement; routes are put into BGP by an export policy, and by default they get ORIGIN IGP, static and aggregate routes included. Juniper's own docs only describe the values, so this comes from operators: a Juniper community thread (2009) and a 2026 JNCIP-ENT lab write-up that shows a direct route exported asIand notes that "IOS redistribute does the opposite".[11] - EGP (
e): nothing sets it by default any more. It appears only when a policy sets it, for example Cisco'sset origin egp <AS>or Junosthen origin egp.[9][10] As we will see, it still shows up thousands of times in today's Internet table.
Aggregation has its own rule in RFC 4271 section 9.2.2.2: if at least one aggregated route is INCOMPLETE, the aggregate is INCOMPLETE; otherwise if at least one is EGP, the aggregate is EGP; in all other cases it is IGP.[1] FRR lets you override this with aggregate-address A.B.C.D/M origin <egp|igp|incomplete>.[13]
Our GoBGP lab added one more data point. GoBGP's CLI gobgp global rib add takes an optional origin { igp | egp | incomplete }. When we left it out, router r2 originated 100.64.0.0/24 as INCOMPLETE:[20]
$ gobgp global rib -a ipv4 add 100.64.0.0/24 # r2, no origin keyword
$ gobgp global rib -a ipv4 100.64.0.0/24
Network Next Hop AS_PATH Age Attrs
*> 100.64.0.0/24 0.0.0.0 00:00:02 [{Origin: ?}]
The practical lesson is the opening paragraph of Simon Painter's November 2026 write-up: on most platforms one engineer typed network and another typed redistribute static, and "nothing about the route's quality changes between those two".[18] Yet the second route loses to the first at step (b) of best-path selection.
Where ORIGIN sits in BGP best-path selection
Every major implementation compares ORIGIN in the same place: after LOCAL_PREF and AS_PATH length, before MED.
- RFC 4271: in Phase 2, (a) the shortest AS_PATH ("an AS_SET counts as 1"), then (b) the lowest ORIGIN, then (c) MED between routes from the same neighbouring AS, (d) eBGP over iBGP, (e) the lowest IGP cost to the NEXT_HOP, (f) the lowest BGP Identifier, (g) the lowest peer address.[1]
- Cisco IOS / IOS XE: step 5 of document 13753, after weight, LOCAL_PREF, locally originated (with an AIGP note) and shortest AS_PATH: "Prefer the path with the lowest origin type. Note: IGP is lower than Exterior Gateway Protocol (EGP), and EGP is lower than INCOMPLETE", then MED.[8]
- Junos: step 6 of the active-route algorithm: "Prefer the route with the lower origin code. Routes learned from an IGP have a lower origin code than those learned from an exterior gateway protocol (EGP), and both have lower origin codes than incomplete routes."[10]
- FRR: "Origin check: Prefer the lowest origin type route. That is, prefer IGP origin routes to EGP, to Incomplete routes", directly after the AS path length check.[13]
"It is just a late tie-breaker" is half true. ORIGIN matters only when LOCAL_PREF and AS_PATH length are equal. But in practice they often are: if you buy transit from two providers at the same LOCAL_PREF, both are frequently the same number of AS hops from a destination. Every such pair reaches the ORIGIN step before MED, before eBGP-over-iBGP and before your IGP costs. That is exactly why rewriting ORIGIN pays off, as the measurements later in this article show.[18]
Two vendor details are worth knowing. Cisco's set origin command takes egp together with an AS number (set origin egp 65010); the doc describes the keyword as "Local Exterior Gateway Protocol (EGP) system".[9] Juniper's BGP overview page describes value 1 as "The router originally learned the route through an EGP (most likely BGP)".[10] That parenthesis is misleading. In RFC 4271, EGP means the protocol of RFC 904, not eBGP, and a route learned from an eBGP neighbour keeps the ORIGIN its originator set.[1]
Lab: ORIGIN deciding, and not deciding, the best path
We built the test on CLAUDE_BOSS with four real GoBGP 4.11 daemons on loopback addresses (no root, no virtual machines). r1 (AS 65001, 127.0.2.61) is the router under test. Three eBGP neighbours feed it: r2 (AS 65002, router ID 10.0.0.62, the highest), r3 (AS 65003, router ID 10.0.0.3) and r4 (AS 65002, router ID 10.0.0.2, the lowest). r1 has external-compare-router-id = true, so when everything else ties it picks the lowest router ID, as RFC 4271 step (f) says. Two raw Python BGP speakers complete the setup: O (AS 65005) only listens and records every byte r1 sends, and X (AS 65006) sends broken UPDATEs. Each neighbour originates routes with gobgp global rib add ... origin <value>. All output below is GoBGP 4.11 lab output, captured at 01:22-01:24 CET.[20]
Test 1: three ORIGIN values for one prefix
r4 announced 203.0.113.0/24 as INCOMPLETE first, then r3 as EGP, then r2 as IGP. All three AS_PATHs have length 1 and there is no MED. r2 has the newest route and the highest router ID, so it would lose every later tie-break. It won anyway:
$ gobgp global rib -a ipv4 203.0.113.0/24 # r1
Network Next Hop AS_PATH Age Attrs
*> 203.0.113.0/24 127.0.2.62 65002 00:00:02 [{Origin: i}]
* 203.0.113.0/24 127.0.2.63 65003 00:00:03 [{Origin: e}]
* 203.0.113.0/24 127.0.2.64 65002 00:00:05 [{Origin: ?}]
Then r2 withdrew. Now r3 (EGP) faced r4 (INCOMPLETE), and r4 has the lower router ID. EGP beats INCOMPLETE, so r3 won. This is the full order 0 < 1 < 2 in one prefix:
Network Next Hop AS_PATH Age Attrs
*> 203.0.113.0/24 127.0.2.63 65003 00:00:16 [{Origin: e}]
* 203.0.113.0/24 127.0.2.64 65002 00:00:18 [{Origin: ?}]
As a control, r3 then re-announced the prefix as IGP, and r3 stayed best over r4's INCOMPLETE path:
Network Next Hop AS_PATH Age Attrs
*> 203.0.113.0/24 127.0.2.63 65003 00:00:02 [{Origin: i}]
* 203.0.113.0/24 127.0.2.64 65002 00:00:22 [{Origin: ?}]
Test 2: AS_PATH length comes first
For 198.51.100.0/24, r2 sent INCOMPLETE with AS_PATH 65002 and r3 sent IGP with AS_PATH 65003 65003. The shorter path won although its ORIGIN was worse. ORIGIN is never compared unless the AS_PATH lengths are equal:
Network Next Hop AS_PATH Age Attrs
*> 198.51.100.0/24 127.0.2.62 65002 00:00:02 [{Origin: ?}]
* 198.51.100.0/24 127.0.2.63 65003 65003 00:00:02 [{Origin: i}]
Test 3: ORIGIN is compared before MED
For 192.0.2.0/24 both neighbours are in AS 65002, so their MEDs are comparable. r4 sent INCOMPLETE with MED 0, r2 sent IGP with MED 500. A lower MED is better, yet r2 won, because ORIGIN is checked first:
Network Next Hop AS_PATH Age Attrs
*> 192.0.2.0/24 127.0.2.62 65002 00:00:02 [{Origin: i} {Med: 500}]
* 192.0.2.0/24 127.0.2.64 65002 00:00:03 [{Origin: ?} {Med: 0}]
When r2 re-sent the route as INCOMPLETE with the same MED 500, ORIGIN tied and MED decided for r4:
Network Next Hop AS_PATH Age Attrs
*> 192.0.2.0/24 127.0.2.64 65002 00:00:06 [{Origin: ?} {Med: 0}]
* 192.0.2.0/24 127.0.2.62 65002 00:00:02 [{Origin: ?} {Med: 500}]
Test 4: rewriting ORIGIN with an import policy
Now we did what many networks do. We restarted r1 with an import policy that sets ORIGIN to IGP on everything from r4. In GoBGP this is a bgp-actions statement (the real configuration we ran):
[[defined-sets.neighbor-sets]]
neighbor-set-name = "r4"
neighbor-info-list = ["127.0.2.64"]
[[policy-definitions]]
name = "origin-from-r4"
[[policy-definitions.statements]]
name = "set-igp"
[policy-definitions.statements.conditions.match-neighbor-set]
neighbor-set = "r4"
[policy-definitions.statements.actions]
route-disposition = "accept-route"
[policy-definitions.statements.actions.bgp-actions]
set-route-origin = "igp"
[global.apply-policy.config]
import-policy-list = ["origin-from-r4"]
default-import-policy = "accept-route"
The same three routes arrived. r4's Adj-RIB-In still shows what r4 sent, ?. After the policy, r1's table shows i. Now r2 and r4 tie on ORIGIN, MED (none) and eBGP, and r4 wins on the lowest router ID:
$ gobgp neighbor 127.0.2.64 adj-in -a ipv4 # r1, before policy
ID Network Next Hop AS_PATH Age Attrs
0 203.0.113.0/24 127.0.2.64 65002 00:00:05 [{Origin: ?}]
$ gobgp global rib -a ipv4 203.0.113.0/24 # r1, after policy
Network Next Hop AS_PATH Age Attrs
*> 203.0.113.0/24 127.0.2.64 65002 00:00:05 [{Origin: i}]
* 203.0.113.0/24 127.0.2.62 65002 00:00:02 [{Origin: i}]
* 203.0.113.0/24 127.0.2.63 65003 00:00:03 [{Origin: e}]
$ gobgp neighbor 127.0.2.65 adj-out -a ipv4 # what r1 sends to O (AS 65005)
ID Network Next Hop AS_PATH AttrsFiltered
1 203.0.113.0/24 127.0.2.61 65001 65002 [{Origin: i}]not filtered
The last output is the important one. The rewritten value did not stay inside r1: O received 40 01 01 00 (IGP) for a route whose originator had said INCOMPLETE. Every AS behind O now sees a route that looks as if it had been put into BGP with a network statement. That is how one network's import policy changes path selection several AS hops away.
Broken ORIGIN: RFC 4271 vs RFC 7606
RFC 4271 treated a bad ORIGIN as fatal for the session: "If the ORIGIN attribute has an undefined value, then the Error Subcode MUST be set to Invalid Origin Attribute", followed by a NOTIFICATION and a session reset.[1] RFC 7606 (2015) changed that. ORIGIN "is considered malformed if its length is not 1 or if it has an undefined value", and such an UPDATE "SHALL be handled using the approach of 'treat-as-withdraw'". A missing well-known mandatory attribute is also handled as treat-as-withdraw.[7]
We sent five UPDATEs from the raw peer X to r1, 2.5 seconds apart, on one TCP session, and then a sixth that reused a prefix that was already valid:
01:22:48.016 the received Update message was treated as withdraw: invalid origin attribute. value : 3
01:22:50.566 the received Update message was treated as withdraw: Origin attribute length is incorrect
01:22:53.119 the received Update message was treated as withdraw: well-known mandatory attributes are not present. type : 1
01:22:58.217 the received Update message was treated as withdraw: invalid origin attribute. value : 3
Three details matter in practice:
- The session counter
Discardedrose only for the length error (0 to 1). The undefined value and the missing ORIGIN were treat-as-withdraw without touching it. Do not use that counter alone to look for bad UPDATEs; read the log. - Valid EGP passed through without comment, and r1 listed it as
[{Origin: e}]. - Treat-as-withdraw is not "ignore". 198.18.0.0/24 had been accepted with a valid ORIGIN. When X sent the same prefix again with ORIGIN 3, r1 removed the old route as well. Only the EGP route was left in the Adj-RIB-In:
$ gobgp neighbor 127.0.2.66 adj-in -a ipv4 # before the last test
ID Network Next Hop AS_PATH Age Attrs
0 198.18.0.0/24 127.0.2.66 65006 00:00:13 [{Origin: ?}]
0 198.18.4.0/24 127.0.2.66 65006 00:00:03 [{Origin: e}]
$ gobgp neighbor 127.0.2.66 adj-in -a ipv4 # after ORIGIN 3 for 198.18.0.0/24
ID Network Next Hop AS_PATH Age Attrs
0 198.18.4.0/24 127.0.2.66 65006 00:00:05 [{Origin: e}]
Real Internet data: i, e and ? today
How common is each value, and does the RFC rule "SHOULD NOT be changed" hold? We downloaded tonight's RIPE RIS routing-table dump from collector rrc14 in Palo Alto (bview.20261130.0000.gz, 00:00 UTC, 20 peers) and parsed it with our own MRT TABLE_DUMP_V2 parser.[21] It holds 1,107,958 IPv4 and 258,330 IPv6 prefixes and 5,587,145 IPv4 RIB entries (one entry per prefix per peer):
| RIS rrc14, 30 Nov 2026 00:00 UTC | IGP (i) | EGP (e) | INCOMPLETE (?) |
|---|---|---|---|
| IPv4 entries (5,587,145) | 5,330,248 (95.40%) | 3,602 (0.06%) | 253,295 (4.53%) |
| IPv6 entries (1,396,903) | 1,321,529 (94.60%) | 133 (0.01%) | 75,241 (5.39%) |
| IPv4 prefixes with different ORIGIN values depending on the peer | 144,105 of 1,107,958 (13.01%) | ||
If ORIGIN were never changed, every peer would report the same value for a given prefix. For 13% of IPv4 prefixes they do not. The per-peer view shows why:
The NTT (AS2914) session sent 1,074,172 IPv4 routes, and every one of them was IGP. The Sparkle (AS6762) session sent 1,074,235, and 8.93% of them were INCOMPLETE. Both are full Internet tables of nearly the same size. We also checked by transit AS: for every AS that appears in the middle of a path, we counted the ORIGIN values of the paths that crossed it. For AS2914, AS1299, AS3356, AS3491 and AS9002 the count of INCOMPLETE and EGP was zero, across 1.58 million, 775,000, 480,000, 381,000 and 140,000 paths respectively. Paths through AS6939 showed 74 INCOMPLETE in 1.1 million. Paths through AS174, AS6762, AS6453 and AS3257 carried 7.95-13.64% INCOMPLETE. One prefix shows the effect clearly. 105.32.0.0/12 arrives at rrc14 as INCOMPLETE from three peers whose paths run through Cogent (AS174). The NTT peer sends 2914 174 8452 ... as IGP, and so does ISC, whose path is 1280 2914 174 .... Since Cogent passed INCOMPLETE to the others, the change most likely happened at AS2914.[21]
This matches two independent studies. James Bensley of Inter.link (AS5405) compared full tables with public looking glasses for RIPE 91 and found 6 of 16 tier-1 networks rewriting ORIGIN to IGP: AS1299, AS2914, AS3356, AS3491, AS6453 and AS6939. AS174, AS701, AS3257, AS3320, AS5511, AS6461, AS6762, AS6830, AS7018 and AS12956 did not.[16] Cloudflare published a cleaner experiment on 24 July 2026. They announced test prefixes with each ORIGIN value from all their locations and watched RIPE RIS, RouteViews and their own BMP feeds. About 70% of the unique IPv4 AS_PATHs (67% for IPv6) showed ORIGIN reset to IGP somewhere along the way, and 26% of the top-50 ASes by AS Rank rewrote it. A few ASes rewrote the other way, to EGP or INCOMPLETE, to make peer and provider routes less preferred than customer routes.[15] One difference from Bensley's list: in our snapshot the paths through AS6453 still carried 18,185 INCOMPLETE and 502 EGP entries. So at least on the sessions that feed rrc14, Tata passed ORIGIN through. Cloudflare also found one tier-1 that rewrites only routes learned from peers, so behaviour can differ per session.[15]
The same thing shows up on a single router you can query yourself. On route-views.routeviews.org at 00:27 UTC:[22]
route-views>show ip bgp 105.32.0.0/12 (excerpt, 4 of 15 paths)
Paths: (15 available, best #8, table default)
3303 174 8452 24863 37069 37069 37069, (aggregated by 24863 172.16.21.180)
Origin incomplete, localpref 100, valid, external
4826 174 8452 24863 37069 37069 37069, (aggregated by 24863 172.16.21.180)
Origin IGP, localpref 100, valid, external
2497 174 8452 24863 37069 37069 37069, (aggregated by 24863 172.16.21.180)
Origin incomplete, localpref 100, valid, external
3356 174 8452 24863 37069 37069 37069, (aggregated by 24863 172.16.21.180)
Origin IGP, metric 0, localpref 100, valid, external, best
EGP is not dead either. rrc14 had 3,602 IPv4 entries with ORIGIN EGP, from 343 different origin ASes, and 686 prefixes where EGP was the most common value among peers. The biggest single source was AS396982 (Google Cloud Platform) with 350 prefixes.[21][23] On RouteViews, 1.179.112.0/20 (origin AS396982, path ... 15169 396982) shows Origin EGP on 8 of 15 paths, for example via AT&T (AS7018), Swisscom (AS3303) and IIJ (AS2497), and Origin IGP on the 7 paths that cross AS3356, AS6939, AS4826, AS1136 or AS57866. Ten paths have length 3; the ORIGIN step removed the six EGP copies and an IGP copy via Lumen won.[22] Our data cannot tell why the routes arrive at the collectors as EGP, whether AS396982 or AS15169 sets it, so we only report what is visible. Bensley counted 293 ASes originating 2,064 EGP prefixes in September 2025, which "seem to be legacy customer config".[16]
Reading and changing ORIGIN on real routers
To read it, look at the end of the AS path in the table view (65002 i, 65002 ?) or at the Origin field in the detailed view: show ip bgp <prefix> on IOS/IOS XE, show bgp <prefix> on IOS XR, show route <prefix> detail on Junos (the AS path ends in I, E or ?), and show bgp ipv4 unicast <prefix> on FRR. To compare two upstreams quickly, count the codes per session: if one full feed shows several percent ? and the other none, the second one, or a network behind it, rewrites ORIGIN.[18]
To change it, every platform has a policy action. These are configuration examples written from the vendor documentation, not output from a device:[9][10][13][19]
! Cisco IOS / IOS XE: give a redistributed static route ORIGIN IGP
ip prefix-list LOOPBACKS seq 5 permit 192.0.2.0/24
route-map STATIC-TO-BGP permit 10
match ip address prefix-list LOOPBACKS
set origin igp
router bgp 65001
address-family ipv4
redistribute static route-map STATIC-TO-BGP
! Cisco IOS XR: only locally originated routes (AS_PATH empty before prepend)
as-path-set LOCAL-ORIGIN
ios-regex '^$'
end-set
route-policy EBGP-OUT
if as-path in LOCAL-ORIGIN then
set origin igp
endif
pass
end-policy
# Junos: match and set
set policy-options policy-statement EXPORT-STATIC term 1 from protocol static
set policy-options policy-statement EXPORT-STATIC term 1 then origin igp
set policy-options policy-statement EXPORT-STATIC term 1 then accept
! FRR
route-map STATIC-TO-BGP permit 10
set origin igp
router bgp 65001
address-family ipv4 unicast
redistribute static route-map STATIC-TO-BGP
Cisco's command reference adds two details. The default origin "is based on the path information of the route in the main IP routing table", and you need a match clause in the route-map entry, "even if it points to a 'permit everything' list", to set the origin.[9] The IOS XR example follows the kazulog.info lab. That lab also shows why matching ^$ works there: the local AS is prepended after the outbound policy runs, so a locally originated route has an empty AS_PATH when the policy sees it.[19]
Should you rewrite ORIGIN? Both sides
There is a real argument here, and it is not settled.
Against rewriting. RFC 4271 says the value "SHOULD NOT be changed by any other speaker".[1] Cloudflare calls rewriting to IGP a way "to siphon traffic and generate revenue" and describes the situation as "a revenue-driven arms race". Their measurements show rewriters winning paths they would otherwise lose: in the IPv4 test, 12 extra AS paths (+18%) that would otherwise have gone through networks that preserve ORIGIN; in IPv6, 33 extra paths (+40%).[15] A network that follows the RFC loses equal-length ties to one that does not. If you rewrite on import, the new value also leaves your AS, as our Test 4 showed, so you are deciding for your customers and their customers too.
For normalising. The values no longer mean anything about route quality, only which command an operator typed.[18] One tier-1 quoted at RIPE 91 argued that RFC 2119's SHOULD NOT "allows for exceptions when operationally justified" and that normalising to IGP "helps maintain route stability and predictability".[16] Inter.link (AS5405) had left ORIGIN alone. After customers kept asking why their traffic preferred the other upstream, they announced at RIPE 91 that they will rewrite to IGP on all eBGP advertisements, with an opt-out on request.[16] On the operator side, Painter's advice is that if you take two full feeds and one of them rewrites, normalising ORIGIN on import from all transits and peers makes the decision fall through to MED and IGP cost, "where it belongs".[18]
The standards track. draft-marenamat-idr-scrub-bgp-origin-00 (Maria Matějka, CZ.NIC, November 2025) proposed making that the rule: accept a missing or malformed ORIGIN and set it to 0, deprecate EGP and INCOMPLETE, and in effect turn the ORIGIN step into a no-op. It expired on 7 May 2026 without being adopted. Cloudflare called for it, or a new approach, to be revived.[17][15]
Our view, for what it is worth: do not use ORIGIN as your traffic-engineering tool. LOCAL_PREF, AS_PATH prepending, MED and provider communities were designed for that, and later parts of this series cover each of them. But know where ORIGIN sits in the decision, check whether your upstreams rewrite it, and decide deliberately whether to normalise it, rather than letting a flag set by someone else's redistribute steer your traffic.
Common mistakes and troubleshooting
| Mistake | What really happens | Do this instead |
|---|---|---|
Reading e as "learned via eBGP" | e is EGP, the RFC 904 protocol; eBGP routes keep the originator's value[1][9] | Read external/internal in the detailed view to see how the route was learned |
| Redistributing statics into BGP and wondering why another site's copy wins | Redistributed routes are INCOMPLETE on IOS/XR/FRR and lose to network routes of equal length[9][13] | Use network statements or set origin igp on the redistribution route-map, consistently at all sites |
| Expecting MED to decide between two equal-length paths | ORIGIN is compared before MED; our Test 3 picked MED 500 over MED 0[20] | Check ORIGIN on both paths first |
| Mixed Cisco and Juniper edge originating the same prefix | Junos exports as IGP by default, IOS redistribute as INCOMPLETE: the Junos copy wins remote ties[11] | Set ORIGIN explicitly in both policies |
| Assuming the ORIGIN you see is what the originator sent | Several large transits rewrite it; 13% of IPv4 prefixes at rrc14 had different values per peer[15][16][21] | Compare a direct session or several collectors before drawing conclusions |
| Using ORIGIN as an inbound TE knob | Upstreams that rewrite to IGP cancel it; it acts only at equal LOCAL_PREF and AS_PATH length[15] | Use prepending, MED or provider communities |
| Hunting a missing prefix only in the session counters | A malformed ORIGIN is treat-as-withdraw; GoBGP did not even raise Discarded for value 3[20] | Grep the BGP log for "treat-as-withdraw" or "malformed" |
For a quick check of a public prefix, our free BGP Route Lookup tool shows the origin AS and AS paths seen by RIPE RIS. Note that it shows the origin AS, not the ORIGIN attribute. For the ORIGIN value itself, use a looking glass such as RouteViews.
FAQ
What does the BGP ORIGIN attribute mean?
ORIGIN (type code 1) records how a route was first put into BGP by the router that originated it: 0 IGP (the prefix is interior to the originating AS, typically a network statement), 1 EGP (learned from the historic Exterior Gateway Protocol of RFC 904) or 2 INCOMPLETE (learned by some other means, typically redistribution). It says nothing about the quality of the path.
What do i, e and ? mean in show ip bgp?
They are the ORIGIN codes printed at the end of the AS path: i = IGP, e = EGP, ? = INCOMPLETE. The e does not mean eBGP. A route learned over eBGP keeps whatever ORIGIN its originator set, unless someone on the way rewrites it.
Which ORIGIN value is preferred in BGP best-path selection?
The lowest value: IGP (0) before EGP (1) before INCOMPLETE (2). RFC 4271 applies it as tie-break step (b), right after the shortest AS_PATH and before MED. Cisco lists it as step 5, after weight, LOCAL_PREF, locally originated paths and AS_PATH length; Junos (step 6, after AIGP) and FRR use the same position relative to AS_PATH and MED.
Is the ORIGIN attribute transitive?
Yes. ORIGIN is well-known mandatory, so every BGP speaker must recognise it and pass it on, and it must be present in every UPDATE that announces prefixes. RFC 4271 says its value SHOULD NOT be changed by any speaker other than the originator.
Why does my redistributed route show ORIGIN incomplete?
On Cisco IOS, IOS XE, IOS XR and FRR, redistribute sets ORIGIN INCOMPLETE and the network statement sets IGP. Junos sets IGP by default for routes exported into BGP by policy, and Nokia SR OS sets Incomplete when it exports a non-BGP route. You can override the value with set origin in a route-map or route-policy, or with then origin in Junos.
Do ISPs really rewrite the ORIGIN attribute?
Yes. A RIPE 91 study found 6 of 16 tier-1 networks rewriting ORIGIN to IGP, and Cloudflare measured in July 2026 that about 70% of the IPv4 AS paths in its experiment had ORIGIN reset to IGP somewhere. In our RIPE RIS snapshot of 30 November 2026, not one of 1,074,172 IPv4 routes from the AS2914 peer carried INCOMPLETE, while other peers showed 5.5-8.9%.
What happens if a BGP UPDATE has a malformed ORIGIN?
RFC 4271 required a NOTIFICATION (subcode 6 Invalid ORIGIN Attribute) and a session reset. RFC 7606 replaced that with treat-as-withdraw: the prefixes in that UPDATE are removed, the session stays up. GoBGP 4.11 did exactly that in our lab for an undefined value, a wrong length and a missing ORIGIN.
Our earlier posts cover ORIGIN in short form: How the BGP ORIGIN Attribute Affects Best-Path Selection (2026) and BGP Attribute - ORIGIN (2011). Redistribution itself is covered in BGP redistribution rules and Route Redistribution Risks Between OSPF, EIGRP and BGP. Next in the series is AS_PATH, the attribute that is compared just before ORIGIN.
Series hub: BGP in 26 Parts: From EGP to EVPN
Previous: The Four Categories of BGP Path Attributes
Next: How BGP Encodes AS_PATH: AS_SET and AS4_PATH (coming soon)
References (all read on 30 November 2026)
[1] Y. Rekhter, T. Li, S. Hares (eds.), RFC 4271: A Border Gateway Protocol 4 (BGP-4), January 2006: s.4.3 a) ORIGIN, s.5.1.1, s.6.3, s.9.1.2.2 (tie-breaking), s.9.2.2.2 (aggregation), Appendix A.
[2] Y. Rekhter, T. Li, RFC 1771: A Border Gateway Protocol 4 (BGP-4), March 1995: s.9.2.1.1 Breaking Ties.
[3] K. Lougheed, Y. Rekhter, RFC 1105: A Border Gateway Protocol (BGP), June 1989: UPDATE Direction field.
[4] K. Lougheed, Y. Rekhter, RFC 1163: A Border Gateway Protocol (BGP), June 1990: ORIGIN path attribute, error subcode 6.
[5] Y. Rekhter, P. Gross, RFC 1772: Application of the Border Gateway Protocol in the Internet, March 1995: path origin as a policy criterion, EGP2 to BGP-4 migration.
[6] E. Rosen, RFC 827: Exterior Gateway Protocol (EGP), October 1982; D. Mills, RFC 904: Exterior Gateway Protocol formal specification, April 1984.
[7] E. Chen, J. Scudder, P. Mohapatra, K. Patel, RFC 7606: Revised Error Handling for BGP UPDATE Messages, August 2015: s.3, s.7.1.
[8] Cisco, Select BGP Best-path Algorithm, document 13753, updated 28 April 2026.
[9] Cisco, BGP Case Studies (document 26634, "Origin Attribute"); Cisco IOS IP Routing: BGP Command Reference, set origin (BGP).
[10] Juniper Networks, BGP Overview (origin values, path selection) and Actions in Routing Policy Terms (then origin).
[11] HPE/Juniper community thread Query on BGP attribute origin (2009-2012); A. B. Coşkun, JNCIP-ENT: BGP Path Attributes and Path Selection, 27 July 2026. Operator sources for the Junos default.
[12] Nokia, 7750 SR Unicast Routing Protocols Guide, Release 24.10.R1, s.5.5.1 Origin.
[13] FRRouting, BGP documentation (Route Selection, aggregate-address origin) and Route Maps (set origin); source bgpd/bgp_route.c (bgp_static_update, bgp_redistribute_add), master branch.
[14] BIRD Internet Routing Daemon, BIRD 2 User's Guide, BGP: bgp_origin.
[15] Cloudflare, BGP ORIGIN attribute manipulation and its impact on the Internet, 24 July 2026.
[16] J. Bensley (Inter.link), BGP Origin Type, RIPE 91 (slides).
[17] M. Matějka, draft-marenamat-idr-scrub-bgp-origin-00: Scrubbing BGP ORIGIN Attribute, 3 November 2025 (expired 7 May 2026).
[18] S. Painter, The BGP ORIGIN arms race nobody told you about, 23 November 2026.
[19] kazulog.info, BGP ORIGIN Attribute (Cisco IOS XR lab with configs and show output).
[20] Network freak lab: GoBGP 4.11.0 routers r1-r4 (127.0.2.61-64) and raw Python BGP speakers O and X (127.0.2.65-66), 30 November 2026, 01:22-01:24 CET. Configs, logs and bytes kept with the article sources.
[21] RIPE NCC, RIS raw data, rrc14: bview.20261130.0000.gz (30 November 2026 00:00 UTC), parsed with our own MRT TABLE_DUMP_V2 parser.
[22] University of Oregon RouteViews, route-views.routeviews.org (telnet, user rviews): show ip bgp for 223.5.5.0/24, 105.32.0.0/12 and 1.179.112.0/20, 30 November 2026, 00:27 UTC.
[23] RIPEstat as-overview for AS396982, AS37069, AS45102, AS19151, AS199524, AS4826, queried 30 November 2026.
Figures 1-9: Network freak, drawn from the sources above, our lab, RIPE RIS and RouteViews.
Try it: BGP Route Lookup: origin AS, AS paths and RPKI check - free, runs in your browser.
Related reading
- How the BGP ORIGIN Attribute Affects Best-Path Selection
- BGP Attribute - ORIGIN (2011)
- BGP LOCAL_PREF: Outbound Traffic Control, Policy and Troubleshooting
- BGP MED: Inbound Traffic Influence, Limits and Troubleshooting
- How to Control Inbound BGP Traffic: AS_PATH Prepending, MED and Provider Communities
- BGP redistribution rules
Comments
Post a Comment