Dynamic routing policies in communication networks: the finite buffer case