Performance analysis and optimization of infrastructure, aerial and multi-hop ad-hoc networks