Quantum State Transfer and Entanglement Distribution among Distant Nodes in a Quantum Network