Path attributes fall into four separate categories:1. Well-known mandatory. > BGP implementations MUST recognize all well-known attributes. Some of these attributes are mandatory and MUST be included in every UPDATE message that contains NLRI
2. Well-known discretionary. > Discretionary attributes MAY or MAY NOT be sent in a particular UPDATE message.
3. Optional transitive. > A BGP router not supporting this attribute can still receive routes with this attribute and advertise them to other peers.
4. Optional non-transitive. > If a BGP router does not support this attribute, it will not advertise routes with this attribute.
Best Path Selection Criteria:
Choose the path with the lowest preference value (routing protocol process preference).
Routes that are not eligible to be used for forwarding (for example, because they were rejected by routing policy or because a next hop is inaccessible) have a preference of –1 and are never chosen.
Prefer the path with higher local preference.
For non-BGP paths, choose the path with the lowest preference2 value.
If the accumulated interior gateway protocol (AIGP) attribute is enabled, add the IGP metric and prefer the path with the lower AIGP attribute.
Prefer the path with the shortest autonomous system (AS) path value (skipped if the as-path-ignore statement is configured).
as-path-ignore
A confederation segment (sequence or set) has a path length of 0. An AS set has a path length of 1.
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 (routes whose origin is unknown).
Prefer the path with the lowest multiple exit discriminator (MED) metric.
Depending on whether nondeterministic routing table path selection behavior is configured, there are two possible cases:
If nondeterministic routing table path selection behavior is not configured (that is, if the path-selection cisco-nondeterministic statement is not included in the BGP configuration), for paths with the same neighboring AS numbers at the front of the AS path, prefer the path with the lowest MED metric. To always compare MEDs whether or not the peer ASs of the compared routes are the same, include the path-selection always-compare-med statement.
path-selection cisco-nondeterministic
path-selection always-compare-med
If nondeterministic routing table path selection behavior is configured (that is, the path-selection cisco-nondeterministic statement is included in the BGP configuration), prefer the path with the lowest MED metric.
Confederations are not considered when determining neighboring ASs. A missing MED metric is treated as if a MED were present but zero.
8. Prefer strictly internal paths, which include IGP routes and locally generated routes (static, direct, local, and so forth).
9. Prefer strictly external BGP (EBGP) paths over external paths learned through internal BGP (IBGP) sessions.
10. Prefer the path whose next hop is resolved through the IGP route with the lowest metric. BGP routes that are resolved through IGP are preferred over unreachable or rejected routes.
11. If both paths are external, prefer the oldest path, in other words, the path that was learned first. This is done to minimize route-flapping. This rule is not used if any one of the following conditions is true:
path-selection external-router-id is configured.
Both peers have the same router ID.
Either peer is a confederation peer.
Neither path is the current active path.
12. Prefer a primary route over a secondary route. A primary route is one that belongs to the routing table. A secondary route is one that is added to the routing table through an export policy.
13. Prefer the path from the peer with the lowest router ID. For any path with an originator ID attribute, substitute the originator ID for the router ID during router ID comparison.
14. Prefer the path with the shortest cluster list length. The length is 0 for no list.
15. Prefer the path from the peer with the lowest peer IP address.
Please note that the Asterisk (*) in your "show route receive-protocol bgp " output specifically indicates the best path chosen by BGP for each individual destination prefix. It means it is preferred.
Please refer BGP Path Selection for more details.