Improving routing in long-distance wireless mesh networks via a distributed embedded router