1.When a routing protocol has more than one path to a destination, it will use metrics to present a route to the router.
2.When a router is presented with multiple routes to a destination, it will use AD to decide which one to use and will install that route in the routing table.
3.Finally when a routers needs to route a packet, it will look at the routing table and use the route longest match prefix (subnet mask). For example, two routes are present in the routing table – 10.1.1.0/24 and 10.1.1.0/28, and a packet destined to 10.1.1.1 is received, the router will select the 10.1.1.0/28 route since it is route with the longest match prefix.