A method, comprising: receiving, at a first gateway, a data packet from a first host served by the first gateway destined to a second host served by a second gateway, the data packet having a header comprising a layer 3 destination address of the second host and a broadcast layer 2 destination address, searching, by the first gateway, a flow table which contains rules for data forwarding and is stored in the first gateway for a layer 2 identity of the second gateway associated with the layer 3 destination address of the second host, if the layer 2 identity of the second gateway is found in the flow table, replacing, by the first gateway, the broadcast layer 2 destination address with the layer 2 identity of the second gateway, and transmitting, by the first gateway, the data packet to the second gateway, if the layer 2 identity of the second gateway is not found in the flow table, searching, by the first gateway, an allocation table which stores the layer 3 addresses of hosts in association with the layer 2 identities of the gateways serving the respective hosts and is stored in the first gateway, for the layer 2 identity of the second gateway associated with the layer 3 destination address, and if the layer 2 identity of the second gateway associated with the layer 3 destination address is found in the allocation table, storing, in the flow table, the layer 2 identity of the second gateway in association with the layer 3 destination address, replacing the broadcast layer 2 destination address with the layer 2 identity of the second gateway, and transmitting, by the first gateway, the data packet to the second gateway. receiving, at a first gateway, a data packet from a first host served by the first gateway destined to a second host served by a second gateway, the data packet having a header comprising a layer 3 destination address of the second host and a broadcast layer 2 destination address, searching, by the first gateway, a flow table which contains rules for data forwarding and is stored in the first gateway for a layer 2 identity of the second gateway associated with the layer 3 destination address of the second host, if the layer 2 identity of the second gateway is found in the flow table, replacing, by the first gateway, the broadcast layer 2 destination address with the layer 2 identity of the second gateway, and transmitting, by the first gateway, the data packet to the second gateway, if the layer 2 identity of the second gateway is not found in the flow table, searching, by the first gateway, an allocation table which stores the layer 3 addresses of hosts in association with the layer 2 identities of the gateways serving the respective hosts and is stored in the first gateway, for the layer 2 identity of the second gateway associated with the layer 3 destination address, and if the layer 2 identity of the second gateway associated with the layer 3 destination address is found in the allocation table, storing, in the flow table, the layer 2 identity of the second gateway in association with the layer 3 destination address, replacing the broadcast layer 2 destination address with the layer 2 identity of the second gateway, and transmitting, by the first gateway, the data packet to the second gateway.