1. A system comprising: a plurality of host machines for hosting a plurality of virtual machines, each host machine comprising: a managed physical switching element (MPSE) comprising a plurality of ports for performing link layer forwarding of packets to and from a set of virtual machines running on the host machine, each port associated with a unique media access control (MAC) address; and a managed routing element (MPRE) for receiving a data packet from a port of the MPSE and performing network layer routing in order to forward the received data packet from a first virtual machine of a first network segment to a second virtual machine of a second network segment; and a physical network for interconnecting the plurality of host machines.