State the function of routing of routing protocols?