Implementing wireless routing algorithms in NS2