A method for device-to-device communication between a first and a second user equipments, UEs, comprising: receiving, by a first user plane gateway, a second session context record for the second UE from a control plane gateway, wherein the session context record for the second UE on the first user plane gateway comprises an Internet Protocol, IP, address of the second UE and an identifier of a second user plane gateway serving the second UE; receiving, by the first user plane gateway, a first session context record for the first UE from the control plane gateway; receiving, by the first user plane gateway, a first data packet to be sent to the second UE from the first UE, wherein the first data packet comprises first data and the IP address of the second UE; obtaining, by the first user plane gateway from the second session context record, the identifier of the second user plane gateway based on the IP address of the second UE; sending, by the first user plane gateway, via a first tunnel, the first data packet to the second user plane gateway according to the identifier of the second user plane gateway; when the second UE has switched to a third user plane gateway, the method further comprises: receiving, by the first user plane gateway, an updated session context record for the second UE from the control plane gateway to update the context record for the second UE, wherein the updated context record includes the IP address of the second UE and an identifier of the third user plane gateway; receiving, by the first user plane gateway, a second data packet to be sent to the second UE from the first UE, wherein the second data packet comprises second data and the IP address of the second UE; obtaining, by the first user plane gateway from the updated session context record, the identifier of the third user plane gateway based on the IP address of the second UE and sending, by the first user plane gateway, via a second tunnel, the second data packet to the third user plane gateway according to the identifier of the third user plane gateway included in the updated context record. receiving, by a first user plane gateway, a second session context record for the second UE from a control plane gateway, wherein the session context record for the second UE on the first user plane gateway comprises an Internet Protocol, IP, address of the second UE and an identifier of a second user plane gateway serving the second UE; receiving, by the first user plane gateway, a first session context record for the first UE from the control plane gateway; receiving, by the first user plane gateway, a first data packet to be sent to the second UE from the first UE, wherein the first data packet comprises first data and the IP address of the second UE; obtaining, by the first user plane gateway from the second session context record, the identifier of the second user plane gateway based on the IP address of the second UE; sending, by the first user plane gateway, via a first tunnel, the first data packet to the second user plane gateway according to the identifier of the second user plane gateway; when the second UE has switched to a third user plane gateway, the method further comprises: receiving, by the first user plane gateway, an updated session context record for the second UE from the control plane gateway to update the context record for the second UE, wherein the updated context record includes the IP address of the second UE and an identifier of the third user plane gateway; receiving, by the first user plane gateway, a second data packet to be sent to the second UE from the first UE, wherein the second data packet comprises second data and the IP address of the second UE; obtaining, by the first user plane gateway from the updated session context record, the identifier of the third user plane gateway based on the IP address of the second UE and sending, by the first user plane gateway, via a second tunnel, the second data packet to the third user plane gateway according to the identifier of the third user plane gateway included in the updated context record. receiving, by the first user plane gateway, an updated session context record for the second UE from the control plane gateway to update the context record for the second UE, wherein the updated context record includes the IP address of the second UE and an identifier of the third user plane gateway; receiving, by the first user plane gateway, a second data packet to be sent to the second UE from the first UE, wherein the second data packet comprises second data and the IP address of the second UE; obtaining, by the first user plane gateway from the updated session context record, the identifier of the third user plane gateway based on the IP address of the second UE and sending, by the first user plane gateway, via a second tunnel, the second data packet to the third user plane gateway according to the identifier of the third user plane gateway included in the updated context record.