So how does BGP actually work? It follows a basic algorithm to formulate the best path. This algorithm includes factors called attributes.