Cross-Layer Design For Wireless Networks Using Antenna Arrays