Cross-layer optimized networking for next-generation 5G ad hoc networks