Understanding 4 Byte AS

Summary:

Understanding 4 byte AS and JUNOS behavior with AS 23456
 
Problem or Goal:
  • What is the Consumption Ratio of 2 Byte (16 Bit) AS?
  • What messages carry AS Number?
  • What is the Benefit of AS 23456? -------RFC4893
  • What is BGP Capability Advertisement in 4byte AS? ----RFC2845
  • How Capability is negotiated between 4byte and 2byte AS?
  • How AS number is carried with the route in between Old_BGP and New_BGP peers?
  • JUNOS behavior with AS 23456?
Solution:
Benefit of 4 Byte AS:
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.

What is the Consumption Ratio of 2 Byte (16 Bit) AS:
  • Total Public/Private AS:                                            65,536 (0 to 65535)
  • IANA Reserved AS:                                                    0, 65,535, and 23456
  • Total Public AS Left:                                                  1 - 64,511
  • Total Private AS:                                                         64,512 - 65,534
  • Total Public AS consumed:                                     55,000 Approx.
  • Total Public AS Left:                                                  9,509
  • Average consumption rate                                      1200 AS/year
4Byte/32 Bit AS Number Range
32bit AS expands the number space from 65536 to 4,294,967,296

What messages carry AS Number?
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.

Benefit of AS 23456? -------RFC4893
  • If a neighbor is Old-BGP, it either responds that it does not support 4-byte ASN capability or does not respond to the Capability advertisement at all.
  • In this case, the New_BGP neighbor can still bring up a session with the Old-BGP neighbor, however it will not advertise its 4-byte ASN, instead, New_BGP uses a reserved 2-byte ASN, 23456, called AS_TRANS.
  • This AS number is added to the My Autonomous System field of the Open message, which is also known as AS_TRANS. Since AS_TRANS is reserved, no Old_BGP speaker can use it as its own ASN; only New_BGP speakers can use it.


What is BGP Capability Advertisement in 4byte AS? ----RFC2845

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.

How Capability is negotiated between 4byte and 2byte AS?

  • When a BGP speaker that supports capabilities advertisement, sends an OPEN message to its BGP peer, the message may include an Optional parameter with Capabilities field. This optional parameter lists the capabilities supported by the speaker.
  • A BGP speaker determine the capabilities supported by its peer by examining the list of capabilities present in the Capability field of  optional Parameter, carried by the OPEN message, that the speaker receives from the peer.
  • A BGP speaker that supports a particular capability may use this capability with its peer after the speaker determines (as described above) that the peer supports this capability.
  • A BGP speaker determines that its peer doesn't support capabilities advertisement, if in response to an OPEN message that carries the Capabilities Optional Parameter, the speaker receives a NOTIFICATION message with the Error Subcode set to Unsupported Optional Parameter. 
  • In this case the speaker should attempt to re-establish a BGP connection with the peer without sending to the peer the Capabilities Optional Parameter.


How AS number is carried with the route in between Old_BGP and New_BGP peers?

  • 4byte AS is carried in Capability field of Optional Parameter in Open message, where as 2byte AS is carried in My_as field in Open message.
  • There are two path messages used when carrying 4byte AS from New_BGP to Old_BGP.
AS_PATH
AS4_PATH
  • When advertising routes to a New_BGP neighbor, AS_PATH attribute is simply modified to carry 4-byte ASNs.
  • When advertising routes to an Old-BGP neighbor, the AS_PATH must be kept in its legacy format, as a list of 2-byte ASNs; Old_BGP neighbor would not otherwise know how to interpret the list.
  • Rather than adding its own 4-byte ASN to the AS_PATH, the New_BGP speaker adds the AS_TRANS (again, AS23456) to the AS_PATH as a placeholder for its own and any other 4-byte ASNs appearing on the path.
  • The router also adds a new attribute, AS4_PATH, to the route. This attribute carries the list of real ASNs, both 4-byte and 2-byte(if in the Path). Unlike AS_PATH, which is a mandatory attribute for all routes, AS4_PATH is optional transitive: “Optional” meaning it is only used when needed (and in fact a New_BGP speaker will not use this attribute if the AS_PATH is all 2-byte ASNs), and “transitive” meaning any BGP speaker passes the attribute along to other neighbors even if it doesn’t understand the attribute. Thus, the real autonomous system path can be passed transparently through one or more Old_BGP speakers.
  • When an Old_BGP speaker advertises a route with both AS_PATH and AS4_PATH attributes to a New_BGP speaker on the other side, New_BGP speaker uses both attributes to reconstruct the following two paths advertised by Old_BGP neighbor:
AS4_PATH: To find 4-byte ASNs on the path.
AS_PATH: To find any 2-byte ASNs Old_BGP speakers will have added since the path last passed through a New_BGP speaker.


Cautions:
  • Do not use AS 23456 as your router AS. This is reserved AS for inter AS operability.
  • If AS 23456 is used as an AS of you router, it will not work with 4byte AS and the BGP state will never come up.

JUNOS Behavior with AS 23456:
  • 4byte AS is support in JUNOS 9.1 and above releases.
  • AS 23456 is not configurable in JUNOS 9.1 and above.

Possible tested Scenarios:


1. For JUNOS 9.0 and below releases only : ( Not implicable for JUNOS 9.1 and above releases)

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.


2. If one router is using JUNOS 9.1 with 4byte AS configured and second router is using below JUNOS 9.1 release with AS 23456.
AS-123456789(R1) -------------- AS-23456(R2)
JUNOS9.1                                         JUNOS8.5
  • Peering can not be done.


3. Other tests with Old and New BGP.
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.


 

4 Byte AS Sample Configurations:


R1(AS:30)---------R2(AS:20)--------R3(AS:10)-------R4(AS:11111111)
JUNOS8.5           JUNOS8.5           JUNOS9.1           JUNOS9.1


R1:
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;
}
}
}
R2:


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;
}
}
R3:


interfaces {
ge-0/0/0 {
unit 0 {
family inet {
address 133.31.4.1/30;
}
}
}
so-0/2/0 {
unit 0 {
family inet {
address 133.31.1.2/30;
}
family mpls;
}
}
fxp0 {
unit 0 {
family inet {
address 20.1.1.1/24;
}
}
}
lo0 {
unit 0 {
family inet {
address 200.225.199.170/32;
}
}
}
}
routing-options {
autonomous-system 10;
}
protocols {
mpls {
interface ge-1/0/0.0;
interface lo0.0;
interface all;
}
bgp {
group ext {
type external;
neighbor 133.31.4.2 {
peer-as 11111111;
}
neighbor 133.31.1.1 {
peer-as 20;
}
}
}
ospf {
area 0.0.0.0 {
interface lo0.0;
interface so-0/2/0.0;
interface ge-0/0/0.0;
}
}
ldp {
interface all;
}
}

R4:

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;
}

R3:

lab@OXYGEN# run show bgp neighbor

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


lab@OXYGEN# run show route protocol bgp
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
lab@OXYGEN# run show route 99.99.99.99 extensive
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
R2:


lab@ATT-M320# run show route protocol bgp
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

 
lab@ATT-M320# run show route 99.99.99.99 extensive
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


R1:

lab@DYP# run show route 99.99.99.99
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


lab@DYP# run show route 99.99.99.99 extensive
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

你可能感兴趣的:(职场,AS,休闲)