Method and apparatus for device-to-device communication
Various embodiments of the present disclosure provide a method for direct device-to-device communication. The method which may be performed by a first device comprises generating an Internet protocol address of the first device. The Internet protocol address of the first device may be applicable for direct device-to-device communication between the first device and a second device via a third device. The method further comprises transmitting the Internet protocol address to the third device. According to various embodiments of the present disclosure, the relaying for direct device-to-device communication may be implemented efficiently and flexibly.
1 . A method performed by a third device, comprising:
receiving an Internet protocol address of a first device from the first device, wherein the Internet protocol address of the first device is a link-local Internet protocol version 6 (IPv6) address which is generated by the first device and applicable for direct device-to-device communication between the first device and a second device via the third device;
determining a first mapping between the Internet protocol address of the first device and an identifier of the first device; and
receiving a first message from the first device to request an Internet protocol address of the second device, wherein the first message includes an application layer identifier of the second device.
2 . The method according to claim 1 , wherein the identifier of the first device is an application layer identifier of the first device.
3 . The method according to claim 1 , wherein the generation of the Internet protocol address of the first device is triggered by:
setting up a connection between the first device and the third device; or
a first indicator transmitted from the third device to the first device to indicate an Internet protocol address conflict.
4 . The method according to claim 1 , further comprising:
receiving the Internet protocol address of the second device from the second device, wherein the Internet protocol address of the second device is generated by the second device and applicable for the direct device-to-device communication between the first device and the second device via the third device; and
determining a second mapping between the Internet protocol address of the second device and an identifier of the second device.
5 . The method according to claim 4 , wherein the identifier of the second device is an application layer identifier of the second device.
6 . The method according to claim 4 , wherein the generation of the Internet protocol address of the second device is triggered by:
setting up a connection between the second device and the third device; or
a second indicator transmitted from the third device to the second device to indicate an Internet protocol address conflict.
7 . The method according to claim 1 , further comprising:
providing the Internet protocol address of the second device to the first device, according to a second mapping between the Internet protocol address of the second device and an identifier of the second device.
8 . The method according to claim 1 , further comprising:
receiving a second message from the second device to request the Internet protocol address of the first device, wherein the second message includes an application layer identifier of the first device.
9 . The method according to claim 1 , further comprising:
providing the Internet protocol address of the first device to the second device, according to the first mapping between the Internet protocol address of the first device and the identifier of the first device.
10 . The method according to claim 1 , further comprising:
forwarding data between the first device and the second device, according to at least one of the Internet protocol address of the first device and the Internet protocol address of the second device.
11 . The method according to claim 1 , wherein the Internet protocol address of the second device is a link-local IPv6 address.
12 . A third device, comprising:
one or more processors; and
one or more memories comprising computer program codes,
the one or more memories and the computer program codes configured to, with the one or more processors, cause the third device at least to:
receive an Internet protocol address of a first device from the first device, wherein the Internet protocol address of the first device is a link-local Internet protocol version 6 (IPv6) address which is generated by the first device and applicable for direct device-to-device communication between the first device and a second device via the third device;
determine a first mapping between the Internet protocol address of the first device and an identifier of the first device; and
receive a first message from the first device to request an Internet protocol address of the second device, wherein the first message includes an application layer identifier of the second device.
13 . A method performed by a fourth device, comprising:
maintaining a first mapping between an Internet protocol address of a first device and an identifier of the first device, and a second mapping between an Internet protocol address of a second device and an identifier of the second device, wherein the Internet protocol address of the first device is generated by the first device, and the Internet protocol address of the second device is generated by the second device; and
forwarding data between the first device and the second device, according to at least one of the Internet protocol address of the first device and the Internet protocol address of the second device, after a path for direct device-to-device communication between the first device and the second device is changed from a first path via a third device to a second path via the fourth device.
14 . The method according to claim 13 , wherein the at least one of the Internet protocol address of the first device and the Internet protocol address of the second device is also used for communication between the first device and the second device over the first path.
15 . The method according to claim 13 , wherein the generation of the Internet protocol address of the first device is triggered by:
setting up a connection between the first device and the fourth device; or
a third indicator transmitted from the fourth device to the first device to indicate an Internet protocol address conflict.
16 . The method according to claim 13 , wherein the generation of the Internet protocol address of the second device is triggered by:
setting up a connection between the second device and the fourth device; or
a fourth indicator transmitted from the fourth device to the second device to indicate an Internet protocol address conflict.
17 . The method according to claim 13 , wherein the Internet protocol address of the first device is received by the fourth device from the first device, and the Internet protocol address of the second device is received by the fourth device from the second device.
18 . The method according to claim 13 , further comprising:
providing the Internet protocol address of the first device to the second device, according to the first mapping.
19 . The method according to claim 13 , further comprising:
providing the Internet protocol address of the second device to the first device, according to the second mapping.