Cross-layer Design: a Survey and the Road Ahead