In BGP, a router receives prefix announcements via eBGP. If you are multi-homed or peer, you will receive announcements for one and the same prefix from multiple sources. Out of these multiple announcements, a router has to select one announcement as best. This best prefix announcement will then be used for routing and also propagated further (for simplicity we will not look at BGP multipath where more than one announcement is selected).
The decision which prefix announcement is best has to meet the following criteria:
- Only one single path for each prefix is needed (and wanted)
- The decision has to be based on attributes of the BGP announcement
- The decision has to be be deterministic (with the same parameters, the decision is always the same)