5. Path Attributes
This section discusses the path attributes of the UPDATE message.
Path attributes fall into four separate categories:
- Well-known mandatory.
- Well-known discretionary.
- Optional transitive.
- Optional non-transitive.
Well-known attributes must be recognized by all BGP implementations. Some of these attributes are mandatory and must be included in every UPDATE message. Others are discretionary and may or may not be sent in a particular UPDATE message. Which well-known attributes are mandatory or discretionary is noted in the table below.
All well-known attributes must be passed along (after proper updating, if necessary) to other BGP peers.
In addition to well-known attributes, each path may contain one or more optional attributes. It is not required or expected that all BGP implementations support all optional attributes. The handling of an unrecognized optional attribute is determined by the setting of the Transitive bit in the attribute flags octet. Paths with unrecognized transitive optional attributes should be accepted. If a path with unrecognized transitive optional attribute is accepted and passed along to other BGP peers, then the unrecognized transitive optional attribute of that path must be passed along with the path to other BGP peers with the Partial bit in the Attribute Flags octet set to 1. If a path with recognized transitive optional attribute is accepted and passed along to other BGP peers and the Partial bit in the Attribute Flags octet is set to 1 by some previous AS, it is not set back to 0 by the current AS. Unrecognized non-transitive optional attributes must be quietly ignored and not passed along to other BGP peers.
New transitive optional attributes may be attached to the path by the originator or by any other AS in the path. If they are not attached by the originator, the Partial bit in the Attribute Flags octet is set to 1. The rules for attaching new non-transitive optional attributes will depend on the nature of the specific attribute. The documentation of each new non-transitive optional attribute will be expected to include such rules. (The description of the INTER-AS METRIC attribute gives an example.) All optional attributes (both transitive and non-transitive) may be updated (if appropriate) by ASs in the path.
The sender of an UPDATE message should order path attributes within the UPDATE message in ascending order of attribute type. The receiver of an UPDATE message must be prepared to handle path attributes within the UPDATE message that are out of order.
The same attribute cannot appear more than once within the Path Attributes field of a particular UPDATE message.
Following table specifies attribute type code, attribute length, and attribute category for path attributes defined in this document:
Attribute Name Type Code Length Attribute category
ORIGIN 1 1 well-known, mandatory
AS_PATH 2 variable well-known, mandatory
NEXT_HOP 3 4 well-known, mandatory
UNREACHABLE 4 0 well-known, discretionary
INTER-AS METRIC 5 2 optional, non-transitive
ORIGIN:
The ORIGIN path attribute defines the origin of the path information. The data octet can assume the following values:
Value Meaning
0 IGP - network(s) are interior to the originating AS
1 EGP - network(s) learned via EGP
2 INCOMPLETE - network(s) learned by some other means
AS_PATH:
The AS_PATH attribute enumerates the ASs that must be traversed to reach the networks listed in the UPDATE message. Since an AS identifier is 2 octets, the length of an AS_PATH attribute is twice the number of ASs in the path. Rules for constructing an AS_PATH attribute are discussed in Section 9.
If a previously advertised route has become unreachable, then the AS_PATH path attribute of the unreachable route may be truncated when passed in the UPDATE message. Truncation is achieved by constructing the AS_PATH path attribute that consists of only the autonomous system of the sender of the UPDATE message. To make the truncated AS_PATH semantically correct, the sender also sends the ORIGIN path attribute with the value INCOMPLETE. Note that truncation may be done only over external BGP links.
NEXT_HOP:
The NEXT_HOP path attribute defines the IP address of the border router that should be used as the next hop to the networks listed in the UPDATE message. If this border router belongs to the same AS as the BGP peer that advertises it, it is called an internal border router. If this border router belongs to a different AS than the one that the BGP peer that advertises it, it is called an external border router. A BGP speaker can advertise any internal border router as the next hop provided that the interface associated with the IP address of this border router (as specified in the NEXT_HOP path attribute) shares a common subnet with both the local and remote BGP speakers. A BGP speaker can advertise any external border router as the next hop, provided that the IP address of this border router was learned from one of the BGP speaker's peers, and the interface associated with the IP address of this border router (as specified in the NEXT_HOP path attribute) shares a common subnet with the local and remote BGP speakers. A BGP speaker needs to be able to support disabling advertisement of external border routers.
The NEXT_HOP path attribute has meaning only on external BGP links. However, presence of the NEXT_HOP path attribute in the UPDATE message received via an internal BGP link does not constitute an error.
UNREACHABLE:
The UNREACHABLE attribute is used to notify a BGP peer that some of the previously advertised routes have become unreachable.
INTER-AS METRIC:
The INTER-AS METRIC attribute may be used on external (inter-AS) links to discriminate between multiple exit or entry points to the same neighboring AS. The value of the INTER-AS METRIC attribute is a 2-octet unsigned number which is called a metric. All other factors being equal, the exit or entry point with lower metric should be preferred. If received over external links, the INTER-AS METRIC attribute may be propagated over internal links to other BGP speaker within the same AS. The INTER-AS METRIC attribute is never propagated to other BGP speakers in neighboring AS's.
If a previously advertised route has become unreachable, then the INTER-AS METRIC path attribute may be omitted from the UPDATE message.