Medium Access Control, Packet Routing, and Internet Gateway Placement in Vehicular Ad Hoc Networks