A method performed by a first device for device to device, D2D, communication with a second device, comprising: discovering a second device supportive of the D2D communication; receiving an ANQP message which includes service information from the discovered second device; determining whether a mirroring service is supported based on the received ANQP message of the second device; if the second device doesn't support the mirroring service, performing a group owner negotiation step in accordance with a general Wi-Fi Direct connectivity according to which the group owner is determined by comparing preset group owner intent values being transmitted as random values; if the second device supports the mirroring service as a result of the determining step, performing the following steps: determining either the first device or the second device as a group owner based on the service information of the second device and service information of the first device; receiving a group owner intent value of the second device from the second device; if the second device is determined as a group owner, comparing the group owner intent value of the first device and the group owner intent value of the second device to each other; if the group owner intent value of the second device is smaller than the group owner intent value of the first device as a result of the comparison, setting the group owner intent value of the first device smaller than the group owner intent value of the second device; and if the second device is determined as a client, comparing the group owner intent value of the first device and the group owner intent value of the second device to each other; if the group owner intent value of the first device is smaller than the group owner intent value of the second device as a result of the comparison, setting the group owner intent value of the first device to greater than the group owner intent value of the second device; transmitting the set group owner intent value of the first device to the second device. discovering a second device supportive of the D2D communication; receiving an ANQP message which includes service information from the discovered second device; determining whether a mirroring service is supported based on the received ANQP message of the second device; if the second device doesn't support the mirroring service, performing a group owner negotiation step in accordance with a general Wi-Fi Direct connectivity according to which the group owner is determined by comparing preset group owner intent values being transmitted as random values; determining either the first device or the second device as a group owner based on the service information of the second device and service information of the first device; receiving a group owner intent value of the second device from the second device; if the second device is determined as a group owner, comparing the group owner intent value of the first device and the group owner intent value of the second device to each other; if the group owner intent value of the second device is smaller than the group owner intent value of the first device as a result of the comparison, setting the group owner intent value of the first device smaller than the group owner intent value of the second device; and if the second device is determined as a client, comparing the group owner intent value of the first device and the group owner intent value of the second device to each other; if the group owner intent value of the first device is smaller than the group owner intent value of the second device as a result of the comparison, setting the group owner intent value of the first device to greater than the group owner intent value of the second device; transmitting the set group owner intent value of the first device to the second device.