A method of transceiving a synchronization signal by a first user equipment supporting a device-to-device communication between user equipments (110-150; 210-270; 310-380; 410-450), the method comprising: receiving, by the first user equipment, synchronization signals transmitted from different synchronization sources, respectively; prioritizing the different synchronization sources based on categories of the different synchronization sources, the categories, according to a prioritized order, comprising a) an evolved NodeB , b) a user equipment synchronized with, and located in a coverage of, an evolved NodeB, c) a user equipment synchronized with, but located out of a coverage of, an evolved NodeB, and d) a user equipment having a synchronization timing reference independent from an evolved NodeB; determining, based on the prioritizing, a reference synchronization source for the first user equipment among the different synchronization sources; synchronizing with the reference synchronization source based on a synchronization timing reference associated with the reference synchronization source; generating a synchronization signal for the device-to-device communication, comprising a root index, based on the synchronization timing reference, wherein the root index corresponds to a first value different from 25, 29, and 34 if the determined reference synchronization source corresponds to a user equipment synchronized with, but located out of a coverage of, an evolved NodeB, or the root index corresponds to a second value different from 25, 29, and 34 and different from the first value if the determined reference synchronization source corresponds to a user equipment having a synchronization timing reference independent from an evolved NodeB; and transmitting, from the first user equipment to a target user equipment, the generated synchronization signal for the device-to-device communication. receiving, by the first user equipment, synchronization signals transmitted from different synchronization sources, respectively; prioritizing the different synchronization sources based on categories of the different synchronization sources, the categories, according to a prioritized order, comprising a) an evolved NodeB , b) a user equipment synchronized with, and located in a coverage of, an evolved NodeB, c) a user equipment synchronized with, but located out of a coverage of, an evolved NodeB, and d) a user equipment having a synchronization timing reference independent from an evolved NodeB; a) an evolved NodeB , b) a user equipment synchronized with, and located in a coverage of, an evolved NodeB, c) a user equipment synchronized with, but located out of a coverage of, an evolved NodeB, and d) a user equipment having a synchronization timing reference independent from an evolved NodeB; determining, based on the prioritizing, a reference synchronization source for the first user equipment among the different synchronization sources; synchronizing with the reference synchronization source based on a synchronization timing reference associated with the reference synchronization source; generating a synchronization signal for the device-to-device communication, comprising a root index, based on the synchronization timing reference, wherein the root index corresponds to a first value different from 25, 29, and 34 if the determined reference synchronization source corresponds to a user equipment synchronized with, but located out of a coverage of, an evolved NodeB, or the root index corresponds to a second value different from 25, 29, and 34 and different from the first value if the determined reference synchronization source corresponds to a user equipment having a synchronization timing reference independent from an evolved NodeB; and transmitting, from the first user equipment to a target user equipment, the generated synchronization signal for the device-to-device communication. <EOS>