A Layered Approach to Modelling and Design of Cross-Layer Protocols in Ad-Hoc Wireless Networks