Routing protocols and architectural solutions for optimal wireless networks and security