Understanding 4 byte AS and JUNOS behavior with AS 23456
Summary:
The network is running into an exhaustion of 2 byte AS Number pool. It is been estimated that, at the end of 2010, all 2 byte AS will exhausted.
32bit AS expands the number space from 65536 to 4,294,967,296
BGP carries the Autonomous System number in the "My Autonomous System" field of the OPEN message, in the AS_PATH attribute of the UPDATE message, and in the AGGREGATOR attribute of the UPDATE message. BGP also carries the Autonomous System number in the BGP Communities attribute With 4byte AS; it is also carried by Capability field, in optional parameter.
Optional Parameter is used in BGP Open Messages to determine the capability of peer router (weather it supports 4byte AS or not). Optional parameter contains a Capability field to check, weather peer router supports 4byte AS.
Capability Optional Parameter
Capability Code:Capability Code is a one octet field that unambiguously identifies individual capabilities.
Capability Length:Capability Length is a one octet field that contains the length of the Capability Value field in octets. Length is set to 4.
Capability Value:Capability Value is a variable length field that is interpreted according to the value of the Capability Code field. It contains 4byte AS number.
A particular capability, as identified by its Capability Code, may occur more than once within the Optional Parameter.
AS23456(R1)---------AS10(R2)-----------AS23456(R3)
Default Junos Behavior for EBG is not to advertise routes, coming from one AS to another AS, if it lies in same autonomous system. To achieve this, you have to configure BGP with advertise peer-as. This Behavior is different for AS-23456, as this is reserved AS for inter AS operability. So any routes coming from AS-23456 will be advertised by default to the same AS (however peer AS will not accept that route unless you configure autonomous-system loop in the routing-option.
A router should no longer be explicitly configured with AS-23456 anymore, since it is now a reserved AS number. AS-23456 is the key to the method used by RFC 4893, to allow a mixture of routers that do and do not support 4-byte AS to interoperate.
AS-123456789(R1) -------------- AS-23456(R2)
JUNOS9.1 JUNOS8.5
Peering can not be done.
AS-12345678(R1) ------AS-10(R2) ------AS-23456(R3) ------AS-23456(R4)
JUNOS9.1 JUNOS9.1 JUNOS8.5 JUNOS8.5
Peering can be done between R1 and R2. Peering can not be done between R2 and R3. Peering can be done between R3 and R4.
interfaces {
ge-0/2/2 {
unit 0 {
family inet {
address 133.31.3.2/30;
}
}
}
ge-0/2/3 {
unit 0 {
family inet {
address 1.1.1.1/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.1.1/32;
}
}
}
}
routing-options {
static {
route 0.0.0.0/0 next-hop 133.31.3.1;
}
autonomous-system 30;
}
protocols {
bgp {
group ext {
type external;
neighbor 133.31.3.1 {
peer-as 20;
}
}
}
ospf {
area 0.0.0.0 {
interface ge-0/2/2.0;
interface lo0.0;
}
}
}
interfaces {
ge-5/0/0 {
unit 0 {
family inet {
address 2.2.2.2/30;
}
}
}
ge-6/1/1 {
unit 0 {
family inet {
address 133.31.3.1/30;
}
}
}
so-6/2/0 {
unit 0 {
family inet {
address 133.31.1.1/30;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 200.225.199.169/32;
}
}
}
}
routing-options {
autonomous-system 20;
}
protocols {
mpls {
interface all;
}
bgp {
group ext {
type external;
neighbor 133.31.1.2 {
peer-as 10;
}
neighbor 133.31.3.2 {
peer-as 30;
}
}
}
ospf {
area 0.0.0.0 {
interface so-6/2/0.0;
interface lo0.0;
interface ge-6/1/1.0;
}
}
ldp {
interface all;
}
}
interfaces {
ge-3/2/0 {
unit 0 {
family inet {
address 133.31.4.2/30;
}
}
}
}
protocols {
bgp {
group ext {
type external;
export static;
neighbor 133.31.4.1 {
peer-as 10;
}
}
}
ospf {
area 0.0.0.0 {
interface all;
}
}
}
policy-options {
policy-statement static {
from protocol static;
then accept;
}
}
routing-options {
static {
route 99.99.99.99/32 reject;
}
autonomous-system 11111111;
}
Peer: 133.31.1.1+64475 AS 20 Local: 133.31.1.2+179 AS 10
Type: External State: Established Flags: <ImportEval Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Options: <Preference PeerAS Refresh>
Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 200.225.199.169 Local ID: 200.225.199.170 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 1
BFD: disabled, down
Local Interface: so-0/2/0.0
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Peer does not support 4 byte AS extension
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 0
Suppressed due to damping: 0
Advertised prefixes: 1
Last traffic (seconds): Received 4 Sent 23 Checked 19
Input messages: Total 51 Updates 0 Refreshes 0 Octets 995
Output messages: Total 51 Updates 1 Refreshes 0 Octets 1045
Output Queue[0]: 0
Peer: 133.31.4.2+53289 AS 11111111 Local: 133.31.4.1+179 AS 10
Type: External State: Established Flags: <ImportEval Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Options: <Preference PeerAS Refresh>
Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 133.31.4.2 Local ID: 200.225.199.170 Active Holdtime: 90
Keepalive Interval: 30 Peer index: 0
BFD: disabled, down
Local Interface: ge-0/0/0.0
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Peer supports 4 byte AS extension (peer-as 11111111)
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes: 1
Received prefixes: 1
Suppressed due to damping: 0
Advertised prefixes: 0
Last traffic (seconds): Received 25 Sent 24 Checked 45
Input messages: Total 55 Updates 1 Refreshes 0 Octets 1114
Output messages: Total 54 Updates 0 Refreshes 0 Octets 1060
Output Queue[0]: 0
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
99.99.99.99/32 *[BGP/170] 00:14:42, localpref 100
AS path: 11111111 I
to 133.31.4.2 via ge-0/0/0.0
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
99.99.99.99/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 99.99.99.99/32 -> {133.31.4.2}
Page 0 idx 0 Type 1 val 8bd9d50
Nexthop: 133.31.4.2
AS path: [10] 11111111 I
Communities:
Advertise: 00000002
Path 99.99.99.99 from 133.31.4.2 Vector len 4. Val: 0
*BGP Preference: 170/-101
Next hop type: Router, Next hop index: 518
Next-hop reference count: 2
Source: 133.31.4.2
Next hop: 133.31.4.2 via ge-0/0/0.0, selected
State: <Active Ext>
Local AS: 10 Peer AS: 11111111
Age: 1:50
Task: BGP_11111111.133.31.4.2+63631
Announcement bits (2): 0-KRT 5-BGP RT Background
AS path: 11111111 I
Localpref: 100
Router ID: 133.31.4.2
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
99.99.99.99/32 *[BGP/170] 00:14:54, localpref 100
AS path: 10 23456 I
to 133.31.1.2 via so-6/2/0.0
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
99.99.99.99/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 99.99.99.99/32 -> {133.31.1.2}
Page 0 idx 0 Type 1 val 8979b28
Nexthop: 133.31.1.2
AS path: [20] 10 23456 I
Unrecognized Attributes: 13 bytes
Attr flags e0 code 11: 02 02 00 00 00 0a 00 a9 8a c7
Communities:
Advertise: 00000002
Path 99.99.99.99 from 133.31.1.2 Vector len 4. Val: 0
*BGP Preference: 170/-101
Next hop type: Router, Next hop index: 481
Next-hop reference count: 2
Source: 133.31.1.2
Next hop: 133.31.1.2 via so-6/2/0.0, selected
State: <Active Ext>
Local AS: 20 Peer AS: 10
Age: 1:59
Task: BGP_10.133.31.1.2+59938
Announcement bits (2): 0-KRT 5-BGP RT Background
AS path: 10 23456 I Unrecognized Attributes: 13 bytes
AS path: Attr flags e0 code 11: 02 02 00 00 00 0a 00 a9 8a c7
Localpref: 100
Router ID: 200.225.199.170
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
99.99.99.99/32 *[BGP/170] 00:17:56, localpref 100
AS path: 20 10 23456 I
to 133.31.3.1 via ge-0/2/2.0
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
99.99.99.99/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 99.99.99.99/32 -> {133.31.3.1}
*BGP Preference: 170/-101
Next hop type: Router, Next hop index: 463
Next-hop reference count: 13
Source: 133.31.3.1
Next hop: 133.31.3.1 via ge-0/2/2.0, selected
State: <Active Ext>
Local AS: 30 Peer AS: 20
Age: 18:02
Task: BGP_20.133.31.3.1+65431
Announcement bits (1): 0-KRT
AS path: 20 10 23456 I Unrecognized Attributes: 13 bytes
AS path: Attr flags e0 code 11: 02 02 00 00 00 0a 00 a9 8a c7
Localpref: 100
Router ID: 200.225.199.169