Wireless communication systems for prevention of replay attack

SA516371857B1Undetermined Publication Date: 2019-04-15QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
SA516371857
Authority / Receiving Office
SA · SA
Patent Type
Patents
Current Assignee / Owner
Filing Date
2016-09-18
Publication Date
2019-04-15
Estimated Expiration
2036-09-18
Patent Text Reader

Abstract

Methods, systems (300), and devices are described for device-to-device (D2D) wireless communication. A device may receive a timing variable (430) from a network (400) while the device is in a connected mode. The device may then use the timing variable for D2D discovery message authentication (810). The device may compare the timing variable with a local timing variable (825) to determine whether a difference between the two variables is within a maximum allowable offset (815). The device may announce the D2D discovery message to another device when the difference is within the maximum allowable offset. Fig. 3
Need to check novelty before this filing date? Find Prior Art

Description

<h2 style=";text-align:left;direction:ltr">Full description<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Background of the invention<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The current disclosure relates, for example, to wireless communication systems, and in particular to the long-range advanced device-to-device replay attack.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Wireless communication systems are widely used to provide multiple types of communication content such as voice, video, packet data, messages, broadcasting, and more. These systems may be multiple access systems that can support communication with multiple users by sharing available system resources (such as time, frequency, and power). Examples of these multiple access systems include code-division multiple access (CDMA), time-division multiple access (TDMA), frequency-division multiple access (FDMA), and orthogonal frequency-division multiple access (OFDMA). A multiple access communication system generally includes a number of base stations, all of which support communication with multiple user devices simultaneously. Base stations may communicate with devices on both uplinks and downlinks. Each base station has a coverage area, which can be referred to as the station's or cell's coverage area.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Nearby devices (user equipment) also communicate directly with each other through device-to-device (D2D) communication or proximity-based service (ProSe). However, this direct communication involves potential security vulnerabilities. In particular, devices participating in discovery-based D2D communication may be vulnerable to a replay attack, for example, by an unknown station. Therefore, the security of devices participating in discovery-based D2D communications can be improved.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> International application 2014037277 relates to a method for establishing a D2D communication session between mobile devices. The invention also relates to a mobile device for establishing a D2D communication session with an additional mobile device. The invention further relates to a control program comprising instructions for execution on the mobile device. The invention also relates to a mobile network.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">International application 2013010108 relates to the manufacture of electronic and / or mechanical structures, components, and devices, such as those used in the electronics industry. In particular, the present invention relates to the use of homogeneous or heterogeneous materials in the three-dimensional fabrication of electronic and / or mechanical structures, components, and devices. Furthermore, the present invention relates to selective metallization processes involving electroless and / or electrolytic metallization.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> International application 2004092436 relates to a process for manufacturing spraying, turning, drilling and casting tools.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> U.S. Patent 2012282417 relates to a simplified metallization method applying polymeric substrates.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> General description of the invention<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The features described generally relate to one or more improved methods, systems or devices for managing wireless communications.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Improved methods include receiving a time variable at the device when the device is in communication mode. This time variable can then be used during device-to-device discovery communications to verify the validity of device-to-device discovery messages.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> According to the first set of illustrative examples, the wireless communication method may include receiving a timing variable from the network at the device, where the timing variable is received when the device is in communication mode. The method may also include using the timing variable to validate device-to-device discovery messages. The timing variable may also be stored at the device for comparison with a local timing variable. In some examples, the timing variable is received from a proximity-based service (ProSe) functional property in the network.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The time variable may be received with the device-to-device discovery application token and may be in coordinated universal time (UTC). The allowed time start may also be received from the network-based proximity service functional feature. The method may include comparing the received time variable to the local time variable to determine whether the difference between the received time variable and the local time variable is less than the allowed time start. The local time variable may be received through a system information block (SIB). If the difference between the network-based time variable and the local time variable is within the allowed time start, the method may include advertising the device-to-device discovery application token. If the difference is greater than the allowed time start, the method may include informing the proximity-based service functional feature that there is an anomaly.<h2 style=";text-align:left;direction:ltr">In some embodiments, the method may include switching to the base station communication mode or sending a request to the base station for the time variable through radio resource control (RRC) messages.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The method may also include synchronizing the time variable received from the functional property of the proximity-based service with the local time variable when the difference is less than a permissible starting time. The functional property of the proximity-based service may be notified of an anomaly when the difference is greater than a permissible starting time.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The time variable received from the network may be used to generate a message integrity token to be included in the device-to-device discovery announcement. The message integrity token may be generated based on the device-to-device discovery application token, the key associated with the device-to-device discovery application token, and a local copy of the time variable when the device-to-device discovery announcement is sent. Alternatively, the method may include receiving the device-to-device discovery announcement, including the message integrity token, and transmitting the received message integrity token and the time variable to a proximity-based service functional property in the network.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some embodiments, the method may also include obtaining authorization to participate in device-to-device discovery when the device is online and exposing a system information block when the device is online. The time variable may be received through the system information block. The system information block may be assigned to the device-to-device discovery information. The method may also include discarding the time variable received in the system information block when the device detects more than one system information block containing timing information and obtaining the time variable outside the system information block. Furthermore, the method may include comparing the time variable received in the system information block with a local time variable. If the difference between the received time variable and the local time variable is greater than a predetermined threshold, the method may include obtaining the time variable from outside the system information block.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the method may include receiving a system information block to synchronize the time variable via a wireless source control message when the device is in the networking mode. The method may also include requesting device-to-device discovery resources via a wireless source control message when the device uses a network-controlled device-to-device discovery resource allocation scheme, wherein the time variable is received by responding to the wireless source control message. Alternatively, the method may include requesting device-to-device discovery resources via a source control message when the device uses a device-controlled device-to-device discovery resource allocation scheme and receiving a response to the wireless source control message comprising the time variable and an empty resource allocation element.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Other examples include routing a received time variable to another device. The time variable may be a coordinated time zone. Alternatively, the time variable may be a counter that increments the number of time intervals for exploration from device to device.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to the second set of illustrative examples, a wireless communication device may include a means for receiving a time variable from a network at a device, receiving the time variable when the device is in communication mode, and a means for using the time variable in a device-to-device discovery message validation process. The time variable may be received from a functional feature of the proximity-based service in the network. The time variable may also be received with the device-to-device discovery application code, which may be a coordinated universal time. The device may also include a means for receiving a permissible time start from the functional feature of the proximity-based service in the network, and a means for comparing the time variable received from the network to a local time variable to determine whether the difference between the received time variable and the local time variable is less than the permissible time start. The device may also include a means for announcing the device-to-device discovery application code if the difference between the time variable received from the network and the local time variable is within the permissible time start.<h2 style=";text-align:left;direction:ltr">A means may also be included for using the time variable to produce a message integrity code to be included in the device-to-device discovery announcement. Alternatively, the device may include a means for receiving the device-to-device discovery announcement, including a message integrity code, and a means for transmitting the received message integrity code and the time variable to a proximity-based service functional feature in the network. The device may also include a means for receiving authorization to participate in device-to-device discovery when the device is in communication mode. A means for receiving the local time variable may also be included through a system information block.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the device may include receiving a system information block to synchronize the time variable via a wireless source control message when the device is in network mode. The device may also include a means for requesting device-to-device discovery resources via a wireless source control message when the device uses a network-controlled device-to-device discovery resource allocation scheme, where the time variable is received by responding to the wireless source control message. The device may include a means for requesting device-to-device discovery resources via a wireless source control message when the device uses a device-to-device discovery resource allocation scheme controlled by the device.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to another set of illustrative examples, a device configured for wireless communication may include at least one processor and memory associated with the at least one processor. The at least one processor may be configured to receive a time variable from a networked device. The time variable is received when the device is in communication mode and is used in the process of verifying a device-to-device discovery message. The time variable may be received from a functional feature of the proximity-based service in the network. The time variable may also be received with device-to-device discovery application code and may be a coordinated universal time. The processor may also be configured to receive a permissible time start from the functional feature of the proximity-based service in the network and compare the time variable received from the network with a local time variable to determine whether the received time variable and the local time variable differ less than the permissible time start.<h2 style=";text-align:left;direction:ltr">Additionally, the processor can also be configured to advertise device-to-device discovery application code if the difference between the time variable received from the network and the local time variable is within the allowed start time.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to another set of illustrative examples, a computer software product may include at least one processor, a non-transitory computer-readable storage medium, and non-transitory program code recorded therein. The non-transitory program code may be configured to receive a time variable from a networked device, receiving the time variable when the device is online, and the program code may also be configured to use the time variable in the process of verifying a device-to-device discovery message. The time variable may be received from a functional feature of a proximity-based service in the network. The time variable may also be received with the device-to-device discovery application code and may be a coordinated universal time. The program code may include other program code to receive a permissible time start from the functional feature of the proximity-based service in the network and compare the time variable received from the network to a local time variable to determine whether the difference between the received time variable and the local time variable is less than the permissible time start.<h2 style=";text-align:left;direction:ltr">Additionally, the program code may include other program code to advertise the device-to-device discovery application code if the difference between the time variable received from the network and the local time variable is within the permitted start time.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to another set of illustrative examples, a method for wireless communication in a wireless network may include entering into communication mode with a device and sending the device a time variable while in communication mode for use in verifying a device-to-device discovery message. The time variable may be sent via a functional feature of the proximity-based service. The time variable may be sent with the device-to-device discovery application code, which may be a coordinated universal time. The method may include sending the device a start of the allowed time when the start of the allowed time is the maximum difference between the time variable and a local time variable at the device. The method may also, in some examples, include receiving the discovery request containing the proximity-based service application identifier and sending the device a discovery response containing the time variable, the device-to-device discovery application code, a key associated with the device-to-device discovery request code, and the start of the allowed time. Alternatively, the method may include sending a wireless source control message containing a system information block containing the time variable.<h2 style=";text-align:left;direction:ltr">The method in some other examples may include receiving a wireless source control request for the discovery sources, wherein the process of transmitting the time variable includes transmitting a response to the wireless source control request containing the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to another set of illustrative examples, a wireless communication device in a wireless network may include a means for entering into communication with a device and a means for transmitting a time variable to the device when in communication for use in verifying a device-to-device discovery message. The time variable may be transmitted through a functional feature of the proximity-based service. The time variable may be transmitted along with the device-to-device discovery application code, which may be a coordinated universal time. The device may also include a means for transmitting to the device the start of a permissible time when the start of the permissible time is the maximum difference between the time variable and the local time variable at the device. The device may also, in some examples, include a means for receiving a discovery request containing a proximity-based service application identifier and a means for transmitting to the device a discovery response comprising the time variable, the device-to-device discovery application code, the key associated with the device-to-device discovery request code, and the start of the permissible time.<h2 style=";text-align:left;direction:ltr">Alternatively, the apparatus may include a means for transmitting a wireless source control message containing a system information block that includes the time variable. In some other examples, the apparatus may include a means for receiving a wireless source control request for discovery sources, wherein transmitting the time variable includes transmitting a response to the wireless source control request containing the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to another set of illustrative examples, a device configured for wireless communication may include at least one processor and memory associated with the at least one processor. That is, the at least one processor may be configured to enter connected mode with the device and send a time variable for use in the device-to-device discovery message verification process when the device is in connected mode. The time variable may be sent via a proximity-based service function. The time variable may be sent with the device-to-device discovery application code, which may be a counter based on a coordinated universal time. The processor may also be configured to send the start of the allowed time to the device when the start of the allowed time is the maximum difference between the time variable and the local time variable at the device. The processor may also be configured to receive a discovery request containing a proximity-based service application identifier and send a discovery response to the device comprising the time variable, the device-to-device discovery application code, the key associated with the device-to-device discovery request code, and the start of the allowed time.<h2 style=";text-align:left;direction:ltr">Alternatively, the processor may be configured to send a WRC message containing a system information block that includes the time variable. The processor may also be configured in some other examples to receive a WRC request for discovery sources, where the process of sending the time variable includes sending a response to the WRC request containing the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">According to another set of illustrative examples, a computer software product may include a computer-readable non-transient storage medium and non-transient program code recorded therein. The non-transient storage medium may contain program code for entering online mode with the device and program code for transmitting a time variable for use in the discovery message verification process from device to device when the device is in online mode. The time variable may be transmitted via a proximity-based service functionality. The time variable may be transmitted with the discovery application code from device to device and may be a coordinated universal time. The program code may also include program code for transmitting the start of a permissible time to the device when the start of the permissible time is the maximum difference between the time variable and the local time variable at the device.<h2 style=";text-align:left;direction:ltr">The software code may also include code for receiving a discovery request containing a proximity-based service application identifier and sending a discovery response to the device comprising a time variable, the device-to-device discovery application code, a key associated with the device-to-device discovery request code, and the start of the permitted time. The software code may also include program code for sending a wireless source control message containing a system information block containing the time variable. The software code, in some other examples, includes program code for receiving a wireless source control request for discovery sources, wherein the process of sending the time variable includes sending a response to the wireless source control request containing the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The scope of applicability of the methods and devices described will be demonstrated by examining the following detailed description, protective elements, and drawings. The detailed description and specific examples are provided for illustrative purposes only, as it will be evident to a person skilled in the art that many changes and modifications can be made to them without departing from the spirit and scope of the description.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Brief explanation of the drawings<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The nature and advantages of the present invention will be further understood by reference to the following drawings. The accompanying drawings may contain similar components or features with the same reference number. Multiple components of the same type may also be distinguished by adding a dash to the reference number and a second reference number to distinguish between similar components. If the first reference number is used in the description, the description applies to all similar components bearing the same first reference number, regardless of the second reference number.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 1 illustrates an example wireless communications system in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 2 illustrates an example device-to-device discovery and wireless communications system in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 3 shows a message flowchart illustrating communications between user devices involved in device-to-device discovery and the functional property of a proximity-based service in a network in accordance with several aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 4 shows a schematic diagram of an example device used in wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 5 shows a message flowchart illustrating communications between a user device participating in a device-to-device discovery process and a base station in accordance with several aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 6 shows a message flowchart illustrating communications between a user device participating in a device-to-device discovery process and a base station in accordance with several aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 7 shows a message flowchart illustrating communications between a user device participating in a device-to-device discovery process and a base station in accordance with several aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 8 shows a message flowchart illustrating communications between a user device participating in a device-to-device discovery process and a proximity-based service functional feature and a base station in accordance with several aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 9 shows an illustrative diagram of a user device used in wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 10 shows a schematic diagram of an example device used in wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 11 shows an illustrative block diagram of a communications system configured for use in receiving and transmitting device-to-device discovery communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 12 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 13 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 14 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 15 shows a schematic diagram of an example method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 16 illustrates an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 17 shows a schematic diagram of an example method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 18 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 19 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 20 illustrates an example of a method for wireless communications in accordance with many aspects of the present disclosure;<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 21 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure; and<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 22 shows a schematic diagram of an example of a method for wireless communications in accordance with many aspects of the present disclosure.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Detailed description:<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Devices (user equipment) typically participate in wireless communication by communicating with the base station of a wireless communication system. However, these devices may participate in direct wireless device-to-device (D2D) communications or in proximity-based services. D2D allows user devices within range of each other to communicate directly with each other rather than through the base station. An example of a situation where D2D wireless communication is desirable is when a user device intends to communicate in a session with other user devices nearby or when it is visible to other user devices in the location. The user device may broadcast a D2D announcement, such as a direct peer discovery signal in a long-term evolution system, which is received by a nearby user device monitoring these discovery-based communications. The advertising user device may include a symbol, such as the D2D application symbol, in the discovery announcement message transmitted over the air.<h2 style=";text-align:left;direction:ltr">The device-to-device discovery application token may indicate the desired intent or functional characteristic of the advertising user's device. The monitoring user's device may receive the device-to-device discovery advertisement with the device-to-device discovery application token and may then determine the availability of the monitoring user's device to engage in device-to-device communications with the advertising user's device.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">However, without additional information or action, the monitoring user device may not be able to verify the authenticity of the M2M discovery announcement. To mitigate this potential security risk, the advertising user device may include a message integrity code in its M2M discovery announcement, which the monitoring user device can use in coordination with the M2M discovery module in the wireless network to determine the authenticity of system-to-system discovery communications. One element used to generate the M2M is a time variable. The process of generating the M2M by the advertising user device and parsing the M2M by the monitoring device requires that both devices have access to an accurate time variable, and there is a need to ensure that the user devices can securely obtain or determine the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The following description illustrates some examples that are not limited to the scope, applicability, or configuration described in the claims. Variations in the functional feature and arrangement of the items discussed may be made without departing from the spirit and scope of the disclosure. Multiple examples may omit, substitute, or add multiple procedures or components as appropriate. For example, the methods described may be implemented in a form other than the described form, and multiple steps may be added, omitted, or combined. Features described in connection with some examples may also be combined in other examples.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 1 shows an illustrative diagram of an example wireless communications system 100 according to various aspects of the present disclosure. The wireless communications system 100 includes base stations (or cells) 105, communication devices 115, and a core network 130. The base stations 105 may communicate with the communication devices 115 under the control of a base station controller (not shown), which may form part of the core network 130 or, in many examples, the base stations 105. The base stations 105 may transmit control information or user data to the core network 130 via transmission links, see 132. The base stations 105 in the examples may communicate, directly or indirectly, with each other via transmission links, see 134, which may be wired or wireless communication links. The wireless communications system 100 may support operation on multiple carriers (waveform signals at different frequencies). Multicarrier transmitters may transmit synchronously modulated signals on multiple carriers.<h2 style=";text-align:left;direction:ltr">For example, each communication link may have 125 multi-carrier modulated signals compatible with the various wireless technologies described above. Each modulated signal may be transmitted on a different carrier and may carry control information (such as reference signals, control channels, etc.), general information, data, etc.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Base stations 105 may communicate with user devices 115 wirelessly via one or more base station antennas. All base station locations may provide communications coverage for the relevant coverage area 110. In some examples, the base station 105 may be referred to as a base transceiver station, wireless base station, access point, wireless transceiver, basic service set, extended service set, NodeB, eNodeB (eNB), home NodeB, home eNodeB, or other appropriate terms. The coverage area 110 of the base station may be divided into sectors that constitute only a portion of the coverage area (not shown). The wireless communications system 100 may include base stations 105 of various types (macro, micro, or millionth base stations). Overlapping coverage areas may exist for different technologies.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The wireless communications system 100 is an example of an LTE / LTE-A network. In LTE / LTE-A networks, the terms eNB and user device may be used to describe the base stations 105 and user devices 115, respectively. The wireless communications system 100 may be a heterogeneous LTE / LTE-A network comprising different types of base stations to provide coverage for multiple geographic areas. For example, each base station may provide communications coverage for a macrocell, microcell, part-millionth cell, femtocell, or other cell type. Macrocell coverage generally covers a relatively large geographic area (several kilometers in radius) and may allow unrestricted access by a service provider's co-server user devices. A part-millionth cell may generally cover a relatively smaller geographic area and may allow unrestricted access by a service provider's co-server user devices.<h2 style=";text-align:left;direction:ltr">A femtocell may also cover a relatively small geographic area (a home) and may allow restricted access by user devices sharing the femtocell (user devices in a closed subscriber group, user devices in a home, or similar). A base station due to a macrocell may be referred to as a macro eNB, for example. A base station due to a part-millionth cell may be referred to as a part-millionth eNB, for example. A base station due to a femtocell may also be referred to as a femto eNB or a home eNB. A base station may support one or multiple cells (two, three, four, or similar).<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The core network 130 may communicate with the base stations 105 via backhaul links (e.g., S1 or otherwise). The base stations 105 may also communicate with each other directly or indirectly via backhaul links 134 (e.g., X2 or otherwise) or via backhaul links 132 (through the core network 130). The wireless communications system 100 may support synchronous or asynchronous operation. For synchronous operation, the base stations may have similar frame timing, and transmissions from different base stations may be aligned approximately in time. For asynchronous operation, the base stations may have different frame timing, and transmissions from different base stations may not be aligned in time. The methods provided in this disclosure may be used for synchronous or asynchronous operation.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Base stations 105 may also transmit information and commands to user devices 115. For example, when the user device 115 enters communication mode with the base station 105, the base station 105 and the user device 115 mutually verify each other. Once the verification process is complete, the base station 105 may securely transmit the information to the user device 115. The information transmitted by the base station 105 to the user device 115 may include information related to the current time or another time variable so that the user device 115 is fully synchronized with the base station 105 (and other devices in the wireless communications system 100). The user device 115 may use the current time or other time variable during the device-to-device discovery message verification process, as will be illustrated in the following examples.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">User devices 115 are dispersed on the wireless communications system 100 and may be stationary or mobile. User device 115 may also be referred to by a person skilled in the art as a mobile device, mobile station, subscriber station, mobile unit, subscriber unit, wireless unit, remote unit, radio device, wireless communications device, remote device, mobile subscriber station, subscriber terminal, mobile terminal, wireless terminal, remote terminal, handset, mobile client, client, relay device, or other appropriate terms. The user device may be a telephone, personal digital assistant, wireless modem, wireless communications device, handheld device, tablet computer, laptop computer, cordless phone, wireless local loop station, or the like. The user device may be capable of communicating with macro eNBs, part-million eNBs, femto eNBs, relay devices, and the like. User device 115-a may also communicate directly with another user device 115 through wireless device-to-device communications.<h2 style=";text-align:left;direction:ltr">In one illustrative example, the user device 115-A-1 within the coverage area of ​​the base station 105 may act as a relay device for the user device 115-A-2 located outside the coverage area of ​​the base station 105-A. The user device within the coverage area of ​​115-A-1 may relay (or retransmit) communications from the base station 105 to the user device located outside the coverage area of ​​115-A-2. Similarly, the user device within the coverage area of ​​115-A-1 may relay from the user device located outside the coverage area of ​​115-A-2. Wireless device-to-device communications may also occur between the user devices 115 within the coverage area for several reasons. Therefore, the user device within the coverage area of ​​115-A-1 may participate in wireless device-to-device communications with the user device located within the coverage area of ​​115-A-3. The user device located within the coverage area of ​​115-A-3 may also participate in a device-to-device wireless connection with the user device 115-A-2.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In order for the user device 115 to participate in the device-to-device wireless communication process, the user device 115 may first participate in device-to-device discovery. Device-to-device discovery allows the user devices 115 to discover other user devices that may participate in the device-to-device communication. The device-to-device discovery process involves the user device broadcasting the device-to-device discovery announcement and a monitoring user device monitoring the device-to-device discovery announcements. The monitoring user device may receive the device-to-device discovery announcement and then respond and participate in device-to-device wireless communication with the advertising user device. However, excluding the base station or other network unit from this device-to-device communication may expose the communication to security risks. Examples of these risks and how to mitigate them are provided below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The communication links shown in the wireless communication system 100 may include uplink transmissions from the user device 115 to the base station or downlink transmissions from the base station 105 to the user device 115. The downlink transmission may also be called a forward link transmission while the uplink transmission is called a backward link transmission. The communication links 125 may also include device-to-device messages (including device-to-device discovery messages) exchanged between user devices.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 2 shows a schematic diagram of an example of a device-to-device discovery and wireless communication system 200 in accordance with various aspects of the present disclosure. The system 200 shown in Figure 2 may be an example of the wireless communication system 100 shown in Figure 1. In one embodiment, the base station 105-A-1 may communicate with one or more devices within the coverage area 110-B-1 of the base station 105-A-1. A user device located within the coverage area 115-B-1 may transmit / receive communications to / from the base station 105-A-1. One or more user devices 115-B-2, 115-B-3, 115-B-4 may be located outside the coverage area 110-B-1 of the base station 105-A-1 and may participate in device-to-device communications. Other user devices 115-B-5 may be within the coverage area of ​​110-B-1 base station 105-A-1 but may also be participating in device-to-device communications. User devices 115-B-2 and 115-B-3 may also be within the coverage area of ​​110-B-2 a different base station 105-A-2 and may be communicating with the base station 105-A-2.<h2 style=";text-align:left;direction:ltr">Base stations 105-a and user devices may be examples of base stations 105 and user devices 115 shown by reference to Figure 1.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> In one embodiment, a user device located within the coverage area 115-b-1 may transmit a single or multiple device-to-device discovery signal through the communication link 125. The signal may be transmitted to one or more user devices within or outside the coverage area. The device-to-device discovery signal may be a device-to-device discovery announcement message. The device-to-device discovery message may, for example, indicate the identifier of the user device located within the coverage area 115-b-1. For example, the identifier may be the media access control address of the user device located within the coverage area 115-b-1. The device-to-device discovery signal may also include the device-to-device discovery application code of the user device 115-b-1.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In one embodiment, the out-of-range user device may transmit a device-to-device discovery signal to one or more user devices within the coverage area 115-b-1. The peer discovery signal may indicate that the user device is out of coverage or request relay services. The signal may include an identifier for the out-of-range user device. In one example, the user device may broadcast the device-to-device discovery signal when it senses that it is about to leave the coverage area 110-b-1 of the base station 105-a-1. In another embodiment, the user device may broadcast the signal after it has already left the coverage area 110-b-1.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">As a further example, two user devices within coverage areas 115-B-1 and 115-B-5 may communicate with each other via a direct device-to-device connection. In this example, user device 115-B-5 may send a message requesting a direct device-to-device connection to other nearby user devices. User device 115-B-1 may receive the request and initiate direct device-to-device connections with user device 115-B-5. In a further example, user devices 115-B-2 and 115-B-3 may communicate with user device 115-B-1 via direct device-to-device connections. For example, user device 115-B-1 may act as a relay device for user devices 115-B-2 and 115-B-3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Before the user device 115 can participate in a wireless device-to-device communication, the user device 115 must first be authorized. The internal network 130-A grants this authorization. The internal network 130-A may include a network device-to-device discovery module 210 to authorize the device-to-device communication. The proximity-based service functional characteristic is an example of a network device-to-device discovery module 210. The user device 115 may request authorization for the device-to-device communication by communicating with the network device-to-device discovery module 210 through a wireless communication interface 215 such as a PC3 communication interface. The network device-to-device discovery module 210 may respond by authorizing the requesting user device 115.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">During device-to-device communications authorization, the network device-to-device discovery module 210 generates a device-to-device discovery application code such as a proximity-based service application code. The device-to-device discovery application code corresponds to the device-to-device functional feature to be engaged by, for example, the advertising user device 115-b-1. Then, once authorization is achieved, the advertising user device 115-b-1 may broadcast the device-to-device discovery application code as part of the device-to-device discovery advertisement.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The network device-to-device discovery module 210 may also be used to generate security elements used by the user device 115 participating in device-to-device discovery to secure device-to-device discovery messages. Protection may be provided against rogue base stations such as the base station 105-A-3 in system 200. The base station 105-A-3 may be used to hijack device-to-device communications originating from the user device 115. Therefore, the security scheme may be used by the user devices 115 and the network device-to-device discovery module 210 to provide protection against the rogue base station 105-A-3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 3 shows a schematic diagram of message 300 to illustrate the security scheme employed by user devices 115-C-1, 115-C-2 participating in device-to-device discovery and the network device-to-device discovery module 210-A in accordance with various aspects of the present disclosure. The user devices and the network device-to-device discovery module may be examples of the user devices 115 shown in Figure 1 and / or 2 and the network device-to-device discovery module 210 shown in Figure 2.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The advertising user device 115-C-1 may send a request to the network device-to-device discovery module 210-A located in the network to be allowed to advertise the device-to-device discovery application code to other devices, such as the monitoring user device 115-C2. In response, the network device-to-device discovery module 210-A located in the network may return the device-to-device discovery application code to the advertising user device 115-C-1. In addition to producing the device-to-device discovery application code for the advertising user device 115-C1, the network device-to-device discovery module 210-A may also produce an associated key for the device-to-device discovery application code. The network device-to-device discovery module 210-A may send a discovery response message 310 containing the device-to-device discovery application code and associated key to the advertising user device 115-C-1.<h2 style=";text-align:left;direction:ltr">Additionally, the network device-to-device discovery module 210-A may provide the advertising user device 115-C-1 with a current time standard that includes information about the current time (e.g., the time variable) at the network device-to-device discovery module 210-A and the start of the permissible time. The network device-to-device discovery module 210-A may be the functional characteristic of a proximity-based service in the home public land mobile network (HPLMN) or visited public land mobile network (VPMLN) serving the user device. The start of the permissible time may be referred to in this disclosure as the maximum offset to indicate the maximum difference between the time variable and the local time variable at the user device. The advertising user device 115-C-1 may use the recipient device-to-device discovery application code, the associated key, and the time variable to produce a message integrity code (at step 315). A time variable may be information about a time element such as Coordinated Universal Time or the time of another system.<h2 style=";text-align:left;direction:ltr">Alternatively, the time variable may be a counter value that, for example, increments at each device-to-device exploration period and does not loop repeatedly. In either case, the time variable may be obtained from other sources. For example, the time variable may be obtained through network identification, time zone, network time protocol, Broadcast System Information Block 16, GPS, or otherwise. The advertising user device 115-C-1 may then compare the time variable received from the network device-to-device exploration module 210-A with the local time variable to determine that there is a difference between the received time variable and the local time variable within the allowed start time (maximum offset). If it is determined that there is a difference between the network-received time variable and the local time variable within the allowed start time, the advertising user device 115-C-1 may begin advertising the device-to-device exploration application token, such as the proximity-based service application token.<h2 style=";text-align:left;direction:ltr">If the difference is greater than the allowable start time, the advertising user device 115-C-1 may recognize an anomaly and attempt to find another method that may be pre-configured or configured by the proximity-based service functionality to receive an updated time variable. For example, the advertising user device 115-C-1 may inform the proximity-based service functionality of the anomaly. Alternatively, the advertising user device 115-C-1 may switch to communication mode and request the base station (e.g., eNB) to obtain the updated time variable through radio source control messages.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The advertising user device 115-C-1 may generate a message integrity code to be included in the device-to-device discovery application code using the associated time-varying discovery key (in step 315). The advertising user device 115-C-1 may include the message integrity code with the device-to-device discovery application code in the device-to-device discovery advertisement message 320. The monitoring user device 115-C-2 may be served by a different network than the network serving the advertising user device 115-C-1. Therefore, the network device-to-device discovery module of the monitoring user device 115-C-2 may differ from the network device-to-device discovery module 210-A of the advertising user device 115-C-1. In such cases, the device-to-device discovery module of the monitoring user device and the advertising user device may replace the monitoring request and response messages.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Prior to receiving the device-to-device discovery announcement message 320, the monitoring user device 115-C-2 may receive the discovery request 305-A and response messages 310-A ​​with the device-to-device discovery module 210-B in the same network. For example, the monitoring user device 115-C-2 may send a discovery request message containing the device-to-device application code to the device-to-device discovery module (functional feature of the proximity-based service) in the network to obtain discovery filters it wishes to listen to. The device-to-device discovery module in the network may send the discovery filter containing the device-to-device application code and the proximity-based service mask, or both, with parameters of the current time and maximum offset. The monitoring user device 115-C-2 then adjusts its proximity-based service clock to match the current time and stores the maximum offset to replace any previous values.<h2 style=";text-align:left;direction:ltr">Like the advertising user device 115-C-1, the monitoring user device 115-C-2 may receive a time variable from multiple sources available to the monitoring user device 115-C-2 (e.g., SIB16, NITZ, NTP, or GPS). The monitoring user device 115-C-2 may store the received time variable and increment it according to the timing information represented by the time variable. Upon receiving the discovery filter, the monitoring user device C-2 may listen for the discovery advertisement message corresponding to the discovery filter if the time variable is within a maximum offset with respect to the proximity-based service clock.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When the monitoring user device 115-C-2 receives the device-to-device discovery announcement message 320, the monitoring user device 115-C-2 transmits a message 325 containing the device-to-device application focus and the message integrity code to the network device-to-device discovery module 210-A for verification. The message 320 also includes a time variable known to the monitoring user device 115-C-2. In some examples, the message may be a conformance report 325 containing a UTC-based time variable with four least significant bits corresponding to the four least significant bits received with the discovery announcement message near the time variable of the user device associated with the discovery cavity upon hearing the discovery announcement.<h2 style=";text-align:left;direction:ltr">In cases where the network device-to-device discovery module for the monitoring user device 115-C-2 differs from the network device-to-device discovery module 210-A for the advertising user device 115-C-1, the network device-to-device discovery module 210-B serving the monitoring user device 115-C-2 passes the conformity report 325 to the network device-to-device discovery module 210-A serving the advertising user device 115-C-1.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The network device-to-device discovery unit 210-A verifies the message integrity code (at step 330) using the time variable received from the monitoring user device 115-C-2. For example, the message integrity code may be verified if the time variable received by the monitoring user device 115-C-2 is within the permitted start time. The message integrity code may be verified if the time variable received by the advertising user device 115-C1 to produce the message integrity code is the same as the time variable sent to the network device-to-device discovery unit 210-A through the monitoring user device 115-C-2. If the message integrity code is verified, the network device-to-device discovery unit 210-A notifies the monitoring user device 115-C-2 with message 335, which may contain additional information about the device-to-device communication.<h2 style=";text-align:left;direction:ltr">In cases where the network device-to-device discovery unit 210-B with respect to the monitoring user device 115-C-2 differs from the network device-to-device discovery unit 210-A with respect to the advertising user device 115-C-1, the network device-to-device discovery unit 210-A with respect to the advertising user device 115-C-1 may send an acknowledgment of successful message integrity code validation to the network device-to-device discovery unit 210-B with respect to the monitoring user device 115-C-2 in an ACK message 336. The network device-to-device discovery unit 210-B with respect to the monitoring user device 115-C-2 may then send a conformity response 337 to the monitoring user device 115-C-2. The monitoring user device 115-C-2 may then engage in device-to-device wireless communications 340 with the advertising user device 115-C-1.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In the above security scheme, both the advertising user device and the monitoring user device may use an unprotected time to obtain time variables associated with the exploration cavity. This means that an attacker, such as one of the strange base stations 105-A-3 (as shown in Figure 2), could successfully retransmit the advertisement message if the user device is tricked into using a time different from the current one.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">For example, the alien base station 105-A-3 may broadcast a different system time in the system information block that precedes the actual coordinated universal time. If the user device synchronizes with the broadcast time, the advertising user device will broadcast a message integrity code based on a time variable whose time value has not yet been verified. The alien base station 105-A-3 may receive the M2M discovery advertisement message from the advertising user device and store the M2M discovery application code and associated message integrity code. The attacker may then, at a later time corresponding to a false time broadcast by the alien base station 105-A-C, "retransmit" the stored M2M discovery application code and associated message integrity code, potentially tricking other monitored user devices into engaging in M2M communications with an illegitimate party.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In another example, an attacker might record the broadcast of a device-to-device discovery announcement from an advertising user device and record the device-to-device discovery application code, message integrity code, and system time when broadcasting the device-to-device discovery announcement. The attacker might later use the unauthorized base station 105-A-3 to broadcast a system information block that includes an incorrect time variable. Instead of including the correct time, the system information block includes the correct time that corresponds to when the advertising user device broadcasts the device-to-device discovery announcement. If the monitoring user device incorrectly synchronizes its time variable with the broadcast system information block, the attacker could retransmit the recorded device-to-device discovery message, tricking the monitoring user device into engaging in device-to-device communications with the attacker.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Therefore, the methods and systems disclosed in this document for mitigating replay attacks include this time variable. In the disclosed examples, the advertising and monitoring user devices may be able to securely obtain and synchronize with the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The maximum offset can be used to limit an attacker's ability to successfully retransmit messages or correctly obtain a validated discovery message for later use. For example, the maximum offset is used as the maximum difference between the UTC-based time associated with the discovery cavity and the local time variable stored in the monitoring device (the proximity-based service clock deposited by the monitoring device). In some examples, the user device may receive the time variable while the user device is online to securely obtain the time variable. For example, when the user device is online via wireless source control, the user device and the entity it is communicating with (e.g., a base station) are mutually validated. Therefore, the information exchanged between the communicating entities at that time may be secure. Therefore, the time variable obtained by the user device while online may be considered secure, or at least validated.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Because of the high cost of entering online mode in terms of battery life, range, and processing power on the user device, the time variable must sometimes be received when the user device is already online. In other words, the user device should avoid entering online mode just to obtain and synchronize the time variable. Instead, the user device may obtain the time variable when it enters online mode, for example, to synchronize device-to-device discovery. After allowing device-to-device discovery connections, the user device may also obtain the time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 4 shows an illustrative block diagram 400 of a device 405 used in wireless communications in accordance with various aspects of the present disclosure. In some examples, the device 405 may embody one or more of the user devices 115 illustrated by reference to Figure 1, 2, and / or 3 and may participate in a device-to-device wireless communication. The device 405 may also embody a processor. The device 405 may include a receiver module 410, a device-to-device detection module 415, and / or a transmitter module 420. All of these components may be interconnected.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The components of the device 405 may be implemented individually or collectively using one or more application-specific integrated circuits (ASICs) configured to implement some or all of the functional features of the device. Alternatively, the functional features may be implemented by one or more processing units (or cores) in one or more ICs. In other examples, other types of integrated circuits (such as structured / platformed ASICs, field-programmable gate arrays, or other semi-custom ICs) may be used that can be programmed by any of the methods known in the art. The functional features of each unit may also be implemented in whole or in part by instructions contained in memory configured for execution by one or more general-purpose or application-specific processors.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the receiver module 410 may include at least one radio frequency (RF) receiver such as at least one RF receiver operable to receive transmissions over the radio frequency band. In some examples, the radio frequency band may be used for LTE / LTE-A communications as shown by reference to, for example, Figure 1, 2, and / or 3. The receiver module 410 may be used to receive multiple types of data or control signals (transmissions) over one or more communication links of the wireless communications system such as one or more communication links 125 of the wireless communications system 100 shown by reference to Figure 1 and / or 2. Furthermore, the receiver module 410 may also be used to receive device-to-device communications over one or more communication links of the wireless communications system such as one or more communication links 125 of the wireless communications system 100.<h2 style=";text-align:left;direction:ltr">Specific examples of some types of communications received by the receiver unit 410, including messages 305, 315, 330, and device-to-device wireless communications 335, are shown by reference to Figure 3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> In some examples, the transmitter module 420 may include at least one radio frequency transmitter that can be operated to transmit device-to-device messages. The transmitter module 420 may be used to transmit multiple types of data and control messages (transmissions) over one or more communications links of a wireless communications system, such as one or more communications links 125 of the wireless communications system 100 shown by reference to Figure 1 and / or 2. In addition, the transmitter module 420 may also be used to transmit device-to-device communications over one or more communications links 125. Examples of types of data and control signals transmitted by the transmitter module 420, including messages 315 and 320 and wireless device-to-device communications 335, are shown by reference to Figure 3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the device-to-device discovery module 415 may be used to manage the reception and transmission of device-to-device discovery messages and device-to-device communication via the receiver module 410 and / or the transmitter module 420. The process of managing the transmission and reception of device-to-receiver discovery messages may include transmitting device-to-device discovery application codes and keys from the device-to-device discovery module to the network, transmitting device-to-device discovery application codes, message integrity codes, and local time variables, and receiving message integrity code verification as shown in messages 305, 310, 315, 320, 325, 335, and step 310 of Figure 3. The message integrity code module 425 of the device-to-device discovery module 415 at the advertising user device may be used to generate the message integrity code, device-to-device discovery application codes, keys, and time variables received from the network. The message integrity code module 425 may also be used to assist in verifying the message integrity code at the monitoring user device.<h2 style=";text-align:left;direction:ltr">Additionally, to enhance the security of the message integrity code, the device-to-device discovery module 415 may include a time variable module 430 that may be used to receive and store the time variable used in generating and / or verifying the message integrity code. The time variable module 430 may do this using several different alternative methods.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 5 shows a message flowchart 500 illustrating communications between a user device 115-d participating in device-to-device discovery and a base station 105-b in accordance with various aspects of the present disclosure. The user device and base station may be examples of the user devices 115 shown in Figures 1, 2, 3, and / or 4 and the base stations 105 shown in Figures 1 and / or 2.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When the user device 115-D is in communication mode 505 with the base station 105-B, the user device 115-D and the base station 105-B mutually verify that communications between the two entities in communication mode 505 are secure. The base station 105-B is able to determine (at block 510) whether the user device 115-D has been authorized to participate in device-to-device discovery communications (e.g., by receiving credentials from a network device-to-device discovery module). The user device 115-D may send a discovery request message 510 to the base station 105-B to be authorized to advertise the device-to-device discovery request code. In response, the base station 105-B may return the device-to-device discovery request code and the associated discovery key for the user device 115-D to advertise. Once the base station 105-D recognizes that the user device 115-D is a device-to-device user device, the base station 105-B may send a discovery response 515 to the user device 115-D that includes the application code and the associated discovery code.<h2 style=";text-align:left;direction:ltr">The exploration response may also include a current time standard including a time based on the coordinated universal time at the device-to-device exploration unit 210-A and a maximum offset and / or validity timer as shown in Figure 3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When the user device 115-D receives the discovery response 515, the user device 115-D may adjust the clock it uses for verification (the proximity-based service clock) to match the current time value and store the maximum offset to replace previous values. In some examples, the user device 115-D may receive the UTC-based counter value associated with the discovery cavity. The counter may be set to the UTC value in several seconds. In some cases, the user device 115-D attempts to detect and obtain the time variable through, for example, a System Information Block Broadcast (SIB) message. The user device 115-D may, for example, obtain the SIB broadcast schedule through a Type 1 SIB that the user device typically obtains when in communication mode. SIBs are generally transmitted in the DL_SCH downlink channel.<h2 style=";text-align:left;direction:ltr">When the user device 115-d receives the system information block and the timing variable included in the system information block, the user device 115-d may check for extraneous movements (step 525) and then store the received timing variable for comparison with the ownlocal timing variable (step 530).<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">It may be necessary to verify the absence of strange behavior in some situations when an alien base station is active. For example, the alien base station may also receive system information block scheduling information from the real base station 105-B and then attempt to eject a time-related system information block in the same broadcast slot planned by the real base station 105-B. Thus, in the same situation, the user device 115-D may observe the broadcast of multiple system information blocks of the same type at the same time. Many user devices cannot handle receiving two system information blocks of the same type in the same broadcast slot and may not be able to read a single one of the received system information blocks. Other types of user devices can receive multiple system information blocks and can then compare the time variables (time based on UTC) contained in the received system information blocks to determine whether a conflict exists.<h2 style=";text-align:left;direction:ltr">When the user device 115-D receives multiple system information blocks of the same type or determines that there is a discrepancy between the time variants of the received system information blocks, the user device 115-D may determine not to store and synchronize the received time variant while continuing to use its local copy. In addition, the user device 115-D may determine to use a different method (as described below) to obtain an updated time variant.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When a foreign base station broadcasts a system information block at the same time that a real base station broadcasts the same type of system information block, several strange movements may occur at the user device 115-D. As shown above, the user device 115-D may receive both of the transmitted system information blocks. Alternatively, the transmitted system information blocks may collide with each other, in which case the user device 115-D is unable to receive either of them. In another case, a fake system information block may be transmitted with sufficient power, and the user device 115-D recognizes only the fake system information block. Therefore, it is useful for the user device 115-D to compare the received time variable with its local copy and determine whether there is a significant discrepancy. If there is a significant discrepancy (exceeding a predetermined threshold), the user device 115-D may recognize a strange movement, and the user device 115-D must then try another method to receive the updated time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 6 illustrates a method for obtaining the time variable. Figure 6 illustrates a message flowchart 600 illustrating communications between the user device 115-e participating in device-to-device discovery and the base station 105-c in accordance with various aspects of the present disclosure. The user device and the base station may be examples of the user devices 115 shown in Figures 1, 2, 3, and / or 4 and the base stations 105 shown in Figures 1 and / or 2.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When the user device 115-E is in connected mode 605 with the base station 105-C, the user device 115-E and the base station 105-C are mutually verified so that communications between the two entities in connected mode 605 are secure. The base station 105-C is able to determine (at block 610) whether the user device 115-E has been authorized to participate in device-to-device discovery communications (e.g., by receiving credentials from a network device-to-device discovery module). Once the base station 105-C identifies the user device 115-E as a device-to-device user device, the base station 105-C may transmit a wireless source control message 615 to the user device 115-E without waiting for a request from the user device 115-E. The wireless source control message 615 may include a system information block containing the requested time variable.<h2 style=";text-align:left;direction:ltr">For example, the wireless source control message 615 may be a wireless source control connection initialization message and may include a system information block 16 or another system information block intended for device-to-device communications that includes the time variable. When the user device 115-e receives the time variable via the wireless source control message 615, the user device 115-e may compare its local time variable with the received time variable (step 620). The base station may only transmit an additional time variable in the signals provided to the user device being verified in connection with the device-to-device communication in a manner that maintains the previous support without affecting other user devices not participating in the device-to-device communication.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 7 illustrates another method for obtaining the time variable. Figure 7 illustrates a message flowchart 700 illustrating communications between a user device 115 participating in a device-to-device discovery process and a base station 105 in accordance with various aspects of the present disclosure. The user device and base station may be examples of the user devices 115 shown in Figures 1, 2, 3, and / or 4 and the base stations 105 shown in Figures 1 and / or 2.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When the user device 115-F is in communication mode 705 with the base station 105-D, the user device 115-F and the base station 105-D are mutually authenticated so that communications between the two entities in communication mode 705 are secure. In this manner, the user device 115-F uses additional messages that are actually required to participate in device-to-device communications. For example, the user device 115-F may send a dedicated wireless source control message 710 to the base station 150-D to request device-to-device communication resources. Base stations may allocate device-to-device communication resources in accordance with Type 1 (shared or device-controlled resource allocation) or Type 2 (ad hoc or network-controlled resource allocation). Device-controlled or Type 1 discovery sources are not assigned to a specific user device but represent a pool of sources from which multiple user devices may autonomously select the source used for device-to-device discovery.<h2 style=";text-align:left;direction:ltr">Type 2 or network-controlled resources are allocated to individual user devices in a distinct manner.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Therefore, when the user device 115-F uses a Type II assignment, the user device 115-F may send an RF control request 710 to the base station 105-D to receive the specified resource assignment. In response to the RF control request 710, the base station 105-D may return an RF control response 715 to the user device 115-F. The RF control response 715 in the case of a Type II assignment may include the allocation of resources to the device-to-device communication. In addition, the RF control response 715 may also include the necessary time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">When the user device 115-F uses the first type of device-to-device resource allocation, the user device 115-F may not be required to obtain the specified resource allocation from the base station 105-D. In this manner, the user device 115-F continues to transmit the radio frequency control request 710 to the base station 105-D, and the radio frequency control response 715 may not include the resource allocation but only the required time variable.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Therefore, regardless of whether the user device 115-F uses Type 1 or Type 2 device-to-device resource allocation, the user device 115-F may transmit the RF control request 710 to the base station 105-D. In either case, the base station 105-D will transmit the RF control response 715 to the user device 115-F, which includes the necessary time variable. An example of the RF control request 710 transmitted to the user device 115-F is a request to allocate proximity-based service resources for wireless source control. An example of the RF control response 715 received is an allocation of proximity-based service resources for wireless source control. When the user device 115-E receives the time variable via the RF control response 715, the user device 115-F may synchronize its local time variable with the received time variable (step 720).<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 8 illustrates another method for obtaining the time variable in a secure manner, wherein a message 800 diagram illustrates communications between the user device 115-g participating in device-to-device discovery, the network device-to-device discovery module 210-b, and the base station 105-e, consistent with various aspects of the present disclosure. The user device may be one of the examples of the user devices 115 shown in Figures 1, 2, 3, and / or 4. The base station may be one of the examples of the base stations 105 shown in Figures 1 and / or 2. The network device-to-device discovery module 210-b may be one of the examples of the network device-to-device discovery module 210 and / or 210-a shown by reference to Figures 2 and / or 3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In this scenario, the time variable information is initially obtained not from the base station 105-E but from the network device-to-device discovery module 210-C. This occurs when the user device 115-G attempts to obtain authorization from the network device-to-device discovery module 210-C to participate in the device-to-device communications. To do so, the user device 115-G enters communication mode 805 with the network device-to-device discovery module 210-C. The user device 115-G then sends a request 810 to the network device-to-device discovery module 210-C for authorization to conduct the device-to-device discovery. The network device-to-device discovery module 201-B sends a response 815 that may include the necessary authorization and time variable. The user device 115-G may then synchronize the time variable (step 820).<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The response may also include the start of the permissible timing. Because communications between the user device 115-G and the device-to-device detection module of the network 210-C may be subject to multiple network delays, the start of the permissible timing is included to indicate the maximum timing offset to prevent the retransmission attack condition described above. The start of the permissible timing enables the user device 115-G to evaluate the accuracy of the time variable received later, as explained below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">After storing and synchronizing the time variable received from the network device-to-device discovery module 210-B via message 815 (step 820), the user device 115-G may identify local time variables in system information blocks. For example, the user device 105-E may broadcast a system information block broadcast message 825 containing the time variable. The user device 115-G may then compare the time variable (previously synchronized with the time variable provided by the network device-to-device discovery module 210-B) with the local time variable contained in the broadcast system information block and thereby identify any anomalies (template 830). If two time variables are within the permitted start time, the user device 115-G may assume the validity of the broadcast system information template and store the local time variable contained in the broadcast system information block (template 835).<h2 style=";text-align:left;direction:ltr">If the difference between two time variables is greater than the allowable start time, the user device 115-G may identify this condition as an anomaly and may continue to use the stored time variable and notify the network device-to-device detection module 210-B and / or attempt to obtain an updated time variable using one of the various methods described above.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The network device-to-device detection module 210 may also use the permissible timing start while verifying the message integrity code (as shown by reference to Figure 3). Thus, when the network device-to-device detection module 210 verifies the message integrity code, it may use the permissible timing start to determine the permissible difference between the time variable used to produce the message integrity code and the time variable sent by the monitoring user device.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Although the time variable module 430 may perform the functional tasks related to the time variable using any of the methods shown above in reference to Figure 5, 6, 7, and / or 8, the message integrity code module 425 (shown in Figure 4) uses the time variable in producing and / or verifying the message verification code.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Referring back to Figure 4, the message integrity code module 425 generates the message integrity code based on the time variable when the user device 115 is ready to broadcast the message integrity code (e.g., through message 320 shown in Figure 3). For example, the message integrity code module 425 may obtain the estimated time to transmit the message from, say, the transmitter module 420. The transmission time estimate may be based on the device-to-device discovery slot, available device-to-device discovery resources allocated by the network, and the user device's time variable. The network may set the discovery slot every ten seconds, for example, and may transmit the device-to-device discovery message within some wireless frames with some wireless resources. Therefore, the transmitter module 420 may consider these factors in addition to its current state (e.g., the number of device-to-device discovery messages in its queue, transmission opportunities based on control algorithms, any estimated delay in preparing the message for transmission, etc.) when determining the estimated transmission time.<h2 style=";text-align:left;direction:ltr">The transmitting unit 420 may then provide the estimated time when capable of transmitting the message verification code message wirelessly and provide the estimated time to the message integrity code unit 425. The message integrity code unit 425 may then use the estimated time in its production of the message integrity code.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> If device 405 is a monitoring user device, the message integrity code module 425 may receive the message integrity code and timestamp the received message using the user device's time variable. Device 405 then passes the received message integrity code and device-to-device discovery application code and timestamps based on the network device-to-device discovery module 210.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Alternatively, the user device may include a time delta representing the time elapsed when the monitoring user device receives the message integrity code and when the monitoring user device sends the message integrity code to the network device-to-device discovery module 210 in its message to the network device-to-device discovery module 210.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Accordingly, the device-to-device discovery module 415 may be used in the advertising user device and the monitoring user device to receive time variables and / or transmit the message integrity code. In addition, the device 405 may use the device-to-device discovery module 415 to transmit time variables to other user devices, such as user devices located outside the coverage area (e.g., the user device 115-B-4 shown in Figure 2).<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 9 shows an illustrative block 900 of a device 115-i used in wireless communications in accordance with various aspects of the present disclosure. The user device 115-i may have many configurations and may be embedded in a personal computer (laptop computer, netbook computer, tablet computer, etc.), cellular telephone, smart phone, personal digital assistant, digital video recorder, internet appliance, gaming console, e-reader, etc. In some examples, the user device 115-i may have an internal power supply (not shown), such as a small battery, to facilitate mobile operation. In some examples, the user device 115-i may be an example of one or more aspects of one of the user devices 115 or the device 405 illustrated by reference to Figures 1, 2, 3, 4, 5, 6, 7, and / or 8.<h2 style=";text-align:left;direction:ltr">The user device 115-i may be configured to perform at least some of the functional features and tasks shown by reference to Figure 1, 2, 3, 4, 5, 6, 7 and / or 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The user device 115-i may include a user device processor module 905, a user device memory module 910, at least one transceiver module (represented by the user device transceiver module 930), at least one user device antenna (represented by the user device antenna 935), or a device-to-device detection module 415-a. All of these components may be connected directly or indirectly via one or more user device buses 925. The user device 115-i may also include a base station communications module 925 to perform tasks related to communications with one or more base stations.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The user device memory module 910 may include random access memory (RAM) or read-only memory (ROM). The user device memory module 910 may implement computer-readable and executable user device software code 920 that includes instructions configured to cause the user device processor module 905 to perform the various functional tasks described in this disclosure, for example, by sending discovery-related messages from device to device. Alternatively, the user device software code 920 may not be directly executable by the user device processor module 905 and may be configured to cause the user device 115-i (when compiled and executed) to perform the various functional tasks described in this disclosure.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The user device processor module 905 may include an intelligent device such as a central processing unit (CPU), such as those manufactured by Intel® or AMD®, a microcontroller, or an application-specific integrated circuit (ASIC). The user device processor module 905 may process data received by the transceiver module 930 or information sent to the user device transceiver module 930 for transmission through the antenna devices of the user device 935. The user device processor module 905 may, alone or in combination with the device-to-device discovery module 415-A, perform various aspects of transmitting, receiving, and managing device-to-device discovery communications.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The user device transceiver module 630 may include a modem configured to modulate packets and deliver modulated data packets to the user device antenna 935 for transmission and demodulate data packets received from the antenna 935. The transceiver module 930 may, in some examples, be implemented as one or more separate transmitters or one or more separate receivers. The user device transceiver module 930 may support device-to-device discovery communications. The user device transceiver module 930 may be configured to communicate bidirectionally via the user device antenna 935 and the communication link 125 with the base station 105, for example, which may be one or more base stations as shown in FIGS 1, 2, 3, 4, 5, 6, 7, and / or 8.<h2 style=";text-align:left;direction:ltr">The user device 930 transceiver module may also be configured to communicate bidirectionally, via the user device 935 antennas and communication link 125, with the user device 115-H, for example, which may be one or more of the user devices 115 shown by reference to Figure 1, 2, 3, 4, 5, 6, 7, and / or 8, or the device 405 shown by reference to Figure 4. Although the user device 115-H may include a single antenna, there are some examples where the user device 115-H includes multiple antenna devices 935.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The device-to-device discovery module 415-A may be configured to implement or control the functional features and tasks indicated by reference to Figures 1, 2, 3, 4, 5, 6, 7, and / or 8 with respect to device-to-device discovery. For example, the device-to-device discovery module 415-A may be configured to support the transmission and reception of device-to-device discovery messages and to manage device-to-device discovery conducted through the relevant messages. In some examples, for example, the device-to-device discovery module 415-A may represent one example of one or more aspects of the device-to-device discovery module 415 shown by reference to Figure 1, 2, 3, 4, 5, 6, 7, and / or 8. The device-to-device discovery module 415-A may include a message integrity code module 425-A (which may be an example of the message integrity code module 425 shown in Figure 4) and a timing variable module 430-A (which may be an example of the timing variable module 430 shown in Figure 4).<h2 style=";text-align:left;direction:ltr">The device-to-device discovery module 415-A, or a portion thereof, may include a processor or some or all of the functional tasks of the device-to-device discovery module 415-A may be performed by the user device processor module 905 or in combination with the user device processor module 905. Furthermore, the device-to-device discovery module 415-A, or a portion thereof, may include memory or some or all of the functional tasks of the device-to-device discovery module 415-A may be performed by the user device memory module 905 or in combination with the user device memory module.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 10 shows an illustrative block diagram 1000 of a device 1005 used in wireless communications in accordance with various aspects of the present disclosure. In some examples, the device 1005 may embody one or more of the aspects of the base stations 105 illustrated by reference to Figures 1, 2, 5, 6, 7, and / or 8. The device 1005 may also embody a processor. The device 1005 may include a base station receiver module 1010, a base station device-to-device detection module 1015, and / or a base station transmitter module 1020. All of these components may be interconnected.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The components of the device 1005 may be implemented individually or collectively using one or more application-specific integrated circuits (ASICs) configured to implement some or all of the functional properties of the device. Alternatively, the functional properties may be implemented by one or more processing units (or cores) in one or more ICs. In other examples, other types of ICs (structured / platformed ASICs, field-programmable gate arrays, or other semi-custom ICs) may be used that can be programmed by any of the methods known in the art. The functional properties of each unit may also be implemented in whole or in part by instructions contained in memory configured for execution by one or more general-purpose or application-specific processors.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the base station receiving unit 1010 may include at least one radio frequency receiver, such as at least one radio frequency receiver operable to receive transmissions over the radio frequency band. In some examples, the radio frequency band may be used for LTE / LTE-A communications, as shown, for example, by reference to Figure 1, 2, or 7. The base station receiving unit 1010 may be used to receive multiple types of data and control signals (transmissions) over one or more communications links of a wireless communications system, such as one of the communications links 125, 134, or more of a wireless communications system 100 shown by reference to Figure 1 or 2. Examples of the types of data and control signals received by the base station receiving unit 1010 include device-to-device discovery communications shown by reference to Figure 5, 6, 7, or 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the base station transmitter 1020 may include at least one radio frequency transmitter that can be operated to transmit device-to-device discovery communications. The base station transmitter 1020 may be used to transmit multiple types of data or control signals (transmissions) over one or more communications links of a wireless communications system, such as one or more communications links 125, 134 of the wireless communications system 100 shown by reference to Figure 1 or 2. Examples of the types of data and control signals transmitted by the base station transmitter 1020 include the device-to-device discovery communications shown by reference to Figure 5, 6, 7, and / or 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In some examples, the base station device-to-device discovery module 1015 may be used to manage the reception of device-to-device discovery requests 710 and the transmission of device-to-device discovery messages 515, 520, 516, 715, or 825 (see Figure 5, 6, 7, or 8) via the base station receiver module 1010 and / or the base station transmitter module 1020. The process of managing the reception and transmission of device-to-device discovery communications may include transmitting the time variable of the user device when the user device is in communication mode with the device 1005. For example, and referring to Figure 5, the base station device-to-device discovery module 1015 may manage the transmission of the system information block in message 520. In a further example, referring to Figure 6, the base station device-to-device discovery module 1015 may manage the transmission of the wireless source control message 615 to the connected user device 115-e, wherein the wireless source control message includes the system information block And the time variable.<h2 style=";text-align:left;direction:ltr">Referring to Figure 7, the device-to-device discovery module at the base station 1015 may manage the reception of the wireless source control request 710 for resources and, in response to the request 710, transmit the wireless source control response 715 comprising the time variable. Referring to Figure 8, the device 1005 may broadcast a system information block comprising the time variable in a system information block message 825.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 11 shows an illustrative block diagram of a communications system 100 configured for use in receiving and transmitting device-to-device discovery communications in accordance with various aspects of the present disclosure. System 100 may represent one example of aspects of the wireless communications device 100 and / or 200 shown in Figure 1 and / or 2. System 100 may include a base station 105-g. Base station 1005-a may include an antenna at base station 1145, a transceiver unit at base station 1150, a memory at base station 1180, and a processor unit at base station 1170, all of which may be connected to each other directly or indirectly (via one or more buses). The base station transceiver module 1150 may be configured to communicate bidirectionally via the base station antenna 1145 with the user device 115-e, which may be an example of the user device 115 shown in Figure 1, 2, 3, 5, 6, 7, and / or 8 and / or the device 405 shown in Figure 4. The base station transceiver module 1150 (and / or other components of the base station 105-g) may be configured for bidirectional communication with one or more networks.<h2 style=";text-align:left;direction:ltr">In some cases, the base station 105-g may connect to the main network 130-b and / or the controller 1120 through the network communication module 1175. The base station 105-g may be an example of the base stations 105 shown in Figure 1, 2, 5, 6, 7 and / or 8 and / or the device 1005 shown in Figure 10 and may be an eNodeB, a Home eNodeB, a Base Station NodeB, or a Home NodeB. The controller 1120 may be integrated into the base station 1005-a in some cases, such as integration into the eNodeB.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The base station 105-G may also communicate with other base stations 105, such as the base station 1005-M and the base station 1005-N. All base stations 105 may communicate with the user device 115-E using different wireless communication technologies, such as different wireless access technologies. In some cases, the base station 105-G may communicate with other base stations, such as the 1005-M and / or the 1005-N, using the base station communications module 1165. In some examples, the base station communications module 1165 may provide an X2 communication interface in LTE wireless technology to provide communication between some of the base stations 105. In some examples, the base station 105-G may communicate with other base stations through the controller 1120 and / or the backbone network 130-B.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The base station memory 1180 may include RAM and ROM. The base station memory 1180 may also store computer-readable and executable program code 1185 containing instructions configured to, when executed, cause the base station processor unit 1170 to perform various functional tasks described in this disclosure (sending and receiving device-to-device discovery communications). Alternatively, the program code 1185 may not be directly executable by the user device processor unit 1170 and is configured to, when compiled and executed, cause the computer to perform various functional tasks described in this disclosure.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The base station processor unit 1170 may include an intelligent device (a central processing unit, microcontroller, application-specific integrated circuit, or other). The base station processor unit 1170 may include a speech encoder (not shown) configured to receive voice via a microphone, convert it into data packets (e.g., 30 milliseconds in length), represent the received sounds, transmit the voice data packets to the base station transceiver unit 1150, and provide indications of whether the user is speaking. Alternatively, the encoder may only transmit the data packets to the base station transceiver unit 1150, while allowing or preventing the same data packet from providing indications of whether the user is speaking.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The base station transceiver module 1150 may include a modem configured to modulate data packets and deliver the modulated data packets to the base station antenna 1145 for transmission, and the data packets received by the base station antenna 1145 are demodulated. Although some examples of the base station 105-g may include a single base station antenna 1145, preferably the base station 105-g may include multiple base station antennas 1145 to establish multiple communication links that may support carrier aggregation. For example, one or more communication links may be used to support aggregate communications with the user device 115-j.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">In accordance with the structure shown in Figure 11, the base station 105-G may also include a communications management module 1160. The communications management module 1160 may manage communications with other base stations. For example, the communications management module 1160 may be a component of the base station 105-G connected to some or all of the other components of the base station 105-G via a bus. Alternatively, the functional tasks of the communications management module 1160 may be implemented as a component of the base station transceiver module 1150 as a computer program product and / or as a control element of the base station processor module 1170.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The components of the base station 105-Z may be configured to implement aspects previously discussed with respect to the device 1005 shown in Figure 10 and are not repeated here for brevity. For example, the base station 105-Z may include a device-to-device discovery module 1015-A. The device-to-device discovery module of the base station 1015-A may be an example of the device-to-device discovery module of the base station 1015 shown in Figure 10. The device-to-device discovery module of the base station 1015-A may be configured to implement or control some or all of the functional features and tasks set forth by reference to Figures 1, 2, 5, 6, 7, 8, and / or 10 with respect to device-to-device discovery. For example, the device-to-device discovery module of the base station 1015-A may be configured to support the transmission and reception of device-to-device discovery communications. The device-to-device detection module of the base station 1015-A may be specifically configured to support transmission of the time variable to the user device (user device 115-Y for example) when the user device is in communication mode with the base station 105-G.<h2 style=";text-align:left;direction:ltr">The base station device-to-device discovery unit 1015-A, or a portion thereof, may include a processor or some or all of the functional tasks of the base station device-to-device discovery unit 1015-A may be performed by the base station processor unit 1170 or in combination with the base station processor unit 1170. In addition, the base station device-to-device discovery unit 1015-A, or a portion thereof, may include memory or some or all of the functional tasks of the base station device-to-device discovery unit 1015-A may use the base station memory 1180 or be used in combination with the base station memory 1180.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 12 shows a schematic diagram of one example of a method 1200 for wireless communications in accordance with various aspects of the present disclosure. Method 1200 is described for clarity by reference to one or some aspects of the user devices 115 shown by reference to Figure 1, 2, 3, 5, 6, 7, 8, and / or 9 or one or some aspects of the devices 405 shown by reference to Figure 4. In some examples, a user device such as the user device 115 or a device such as the device 405 may implement one or more sets of codes to control functional elements of the user device or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1205, method 1200 may include receiving the time variable from the network at a device where the time variable is received when the device is in the communication mode. The time variable may be received in the form of messages 520, 615, 715, 810, and / or 825 as indicated above by reference to Figures 5, 6, 7, and / or 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At template 1210, method 1200 may include using the time variable in validating device-to-device discovery messages. For example, the received time variable may be used in generating a message integrity code or in verifying the message integrity code as shown above by reference to Figure 3.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> In some examples, the operations described at blocks 1205 or 1210 may be performed using the device-to-device exploration module 415 by reference to Figure 4 and / or 9. Although it should be noted that method 1200 is performed in a single execution pattern, the operations included in method 1200 may be rearranged or otherwise modified such that other execution patterns may be followed.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 13 shows a schematic diagram of one example of a method 1300 for wireless communications in accordance with various aspects of the present disclosure. Method 1300 is described for clarity by reference to one or some aspects of the user devices 115 shown by reference to Figures 1, 2, 3, 5, 6, and / or 9, respectively, or one or some aspects of the devices 405 shown by reference to Figure 4. In some examples, a user device such as the user device 115 or a device such as the device 405 may implement one or more sets of codes to control functional elements of the user device or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Method 1300 illustrates two alternative flow paths represented by paths 1335 and 1340. At block 1305, method 1300 may include entering a communication mode. As previously described, the user device may benefit from receiving the time variable while in a communication mode, such as a wireless source control communication mode where the user device and the entity being communicated are mutually verified. Then, at block 1305, the user device enters a communication mode as indicated by communication modes 505 and / or 605 shown in, for example, FIGS 5 and / or 6. The user device may then obtain the necessary time variable using one of flow paths 1335 and 1340. Additional alternative flow paths are identified, shown in FIGS 14, as will be explained below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Following flow path 1335 and at block 1310, method 1300 may include disclosing a system information block containing the required time variable. The system information block disclosure is in response to receiving a command to do so. The system information block is disclosed while the user device is still online. Figure 5 shows an example of the system information block disclosure in message 520.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1315, method 1300 may include the step of checking for anomalies with respect to the received time variable. Figure 5 shows an example of such a step at step 525. Anomaly checking may be necessary in some situations where a foreign base station is active. For example, the foreign base station may attempt to insert a timing-related system information block into the same slot as the actual base station's planned broadcast. The user equipment may then observe multiple system information blocks of the same type being broadcast at the same time. Alternatively, the multiple system information blocks may collide and the user equipment may not be able to receive any of them. Furthermore, the user equipment may only receive the system information block broadcast by the foreign base station where the user equipment determines that there is not a significant difference between the received time variable (from the non-genuine system information block) and the time variable stored locally by the user equipment. In any of these cases, the user equipment may determine that anomalies exist and the time variable must be obtained by another method.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">If no extraneous movement is considered, the received time variable is stored at the user device (at block 1320). A similar step is described in Figure 5 at step 530.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> If an alternative path is used to obtain the time variable, such as path 1340, the method includes block 1330. The method 1300 includes, at block 1330, receiving a WSC message containing a system information block containing the required time variable. An example of a received WSC message may include message 615, as shown in Figure 6. The WSC message may be received without the user device specifically requesting the message, and the transmitting base station may also independently specify that the user device participate in device-to-device discovery communications. Once the user device receives the WSC message containing the time variable, the user device is able to store the time variable at block 1320.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">It should be noted that Method 1300 is a single execution pattern, and the operations of Method 1300 may be rearranged or otherwise modified to enable other execution patterns. As an example, in particular, not all of the operations described in Method 1300 are required to be performed, and many of the operations may be performed in a different order than the order shown in Figure 13.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 14 shows a schematic diagram of one example of a method 1400 for wireless communications in accordance with various aspects of the present disclosure. Method 1400 is described for clarity by reference to one or some aspects of the user devices 115 shown by reference to Figures 1, 2, 3, 7, 8, and / or 9, respectively, or one or some aspects of the devices 405 shown by reference to Figure 4. In some examples, a user device such as the user device 115 or a device such as the device 405 may implement one or more sets of codes to control functional elements of the user device or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Method 1400 illustrates two alternative flow paths represented by flow paths 1450 and 1455. At block 1405, method 1400 may include entering a communication mode. As previously explained, the user device may benefit from receiving the time variable while in a communication mode, such as a wireless source control communication mode where the user device and the entity being communicated are mutually verified. Then, at block 1405, the user device enters a communication mode as indicated by communication modes 705 and / or 805 shown in FIGS. 7 and / or 8, for example. The user device may then obtain the necessary time variable using one of the flow paths 1450 and 1455. Additional alternative flow paths are identified in FIGS. 13, as previously explained.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Following flow path 1450 and at block 1410, method 1400 may include sending a wireless source control request to obtain discovery sources. The wireless source control request may be sent from a user device to the base station. The wireless source control request may be sent regardless of whether the user device uses Type 1 source allocation (device control) or Type 2 source allocation (network control). Device-controlled or Type 1 discovery sources are not assigned to a specific user device but represent a pool of sources from which multiple user devices may select the source used for device-to-device discovery in a self-selected manner. Type 2 or network-controlled sources are allocated to individual user devices in a distinct manner. Thus, when the user device uses Type 2 allocation, the user device may be required to send an RF control request to the base station to receive the selected source allocation.<h2 style=";text-align:left;direction:ltr">When the user device uses the first type of device-to-device resource allocation, the user device does not need to obtain a specific resource allocation from the base station. However, in method 1400, the user device still sends a WRC request regardless of whether the user device uses type 1 or type 1 resource allocation. An example of a WRC request sent is the WRC request 710 shown in Figure 7.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1415, the user device receives a WSC response containing the time variable. If the user device uses Type 2 resource allocation, the WSC response may contain both the resource allocation and the time variable. If the user device uses Type 1 resource allocation, the WSC response may not contain the actual resource allocation but only the time variable. An example of a received WSC response is the WSC response 715 shown in Figure 7.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Once received, the time variable is stored on the user's device (at block 1430). A similar step is described in Figure 7 at block 720.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> When using an alternative path to obtain the time variable, such as path 1455, the method may include templates 1420, 1425, 1435, 1440, and 1445. At template 1420, the method includes sending a request to verify device-to-device discovery. The request is sent from the user device to the device-to-device discovery module, as a functional property of a proximity-based service. An example of such a request is request 810 shown in Figure 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1425, the user device receives an authorization message from the device-to-device discovery module. The received authorization message may also contain the time variable. The received authorization message may additionally contain the allowable timing start, such as the maximum offset. An example of a received authorization message containing the time variable and the allowable timing start is message 815 in Figure 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The user device may use the time variable received from the device-to-device detection module to compare it with a locally stored time variable. Therefore, at block 1430, the user device may store the received time variable. An example of this step is shown in block 820 of Figure 8. In addition, upon receiving the start of the allowed time, the start of the allowed time may also be stored. The user device may use the received start of the allowed time to determine that there is a difference between the received time variable and the local time variable within the start of the allowed time, as shown below. With respect to Figure 8, at block 1435, the user device may receive a system information block broadcast from the base station. The received system information block may contain the local time variable. An example of a system information block broadcast message received by the user device may include message 825 shown in Figure 8.<h2 style=";text-align:left;direction:ltr">At block 1440, the user device checks for any extraneous movements between the received time variable (received from the network's device-to-device detection module) and the local time variable received as part of the system information block issued by the base station. When comparing the two variables, the user device uses the previously received tolerable start time. If the difference between the two time variables is greater than the received tolerable start time, extraneous movements may exist, and the user device may need to obtain an updated time variable using a different method. However, if the difference between the two time variables is less than the received tolerable start time, the user device may conclude that there are no extraneous movements. An example of the verification step is shown at block 830 of Figure 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> In the absence of any unusual movements, the user device at block 1445 may begin broadcasting an exploration announcement message such as the proximity-based service application code shown by reference to Figure 3. An example of the announcement step at block 835 is shown in Figure 8.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">It should be noted that Method 1400 is a single execution pattern, and the operations of Method 1400 may be rearranged or otherwise modified to enable other execution patterns. As an example, in particular, not all of the operations described in Method 1400 are required to be performed, and many of the operations may be performed in a different order than the order shown in Figure 14.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 15 shows a schematic diagram of one example of a method 1500 for wireless communications in accordance with various aspects of the present disclosure. Method 1500 is described for clarity by reference to one or some aspects of the base stations 105 shown by reference to Figures 1, 2, 5, 6, 7, 8, and / or 11 or one or some devices 1005 shown by reference to Figure 10. In some examples, one or more base stations, such as the base station 105, or one or more devices, such as the device 1005, may implement one or more sets of codes to control functional elements of the base station or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At template 1505, method 1500 may include entering a communication mode with the device. The communication mode, such as communication modes 505, 605, and / or 705 of Figure 5, 6, and / or 7, may ensure that the base station and the communicating user device mutually verify the authenticity of the device.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1510, method 1500 may include sending the time variable to the device when the device is in communication mode. The time variable may be sent in the form of message 520, 615, or 715 as indicated above by reference to Figures 5 and / or 7.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> In some examples, the operations described at blocks 1205 or 1210 may be implemented using the device-to-device discovery module of the base station 1015 by reference to Figure 10 and / or 11. Although it should be noted that method 1500 is performed in one implementation pattern, the operations included in method 1500 may be rearranged or otherwise modified such that other implementation patterns may be followed.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 16 shows an illustrative diagram of one example of a method 1600 for wireless communications in accordance with various aspects of the present disclosure. Method 1600 is described for clarity by reference to one or some aspects of the base stations 105 shown by reference to Figures 1, 2, 5, 6, 7, and / or 11 or one or some aspects of the devices 1005 shown by reference to Figure 10. In some examples, one or more base stations, such as the base station 105, or one or more devices, such as the device 1005, may implement one or more sets of codes to control functional elements of the base station or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Method 1600 illustrates three alternative flow paths represented by paths 1654, 1650, and 155. At block 1605, method 1600 may include communicating with the user device in the communication mode. As previously described, the user device may benefit from receiving the time variable while in the communication mode, such as in a wireless source control communication mode where the user device and the base station are mutually verified. Then, at block 1605, the base station communicates with the device in the communication mode, as indicated by communication modes 505, 605, and / or 705 shown in Figures 5, 6, and / or 7, for example. The base station may then transmit the necessary time variable using one of the flow paths 1645, 1650, or 1655.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Following flow path 1645 and at block 1610, method 1600 may include determining the authentication of the connected user device to perform device-to-device discovery. For example, the base station may determine the authentication of the connected user device to participate in device-to-device discovery communications by receiving authorization from a network device-to-device discovery module. An example of this step is shown in block 510 of Figure 5.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1615, method 1600 may include broadcasting a system information block containing the time variable. The system information block for broadcasting may be such as the system information block message 520 shown in Figure 5, system information block 16, or a device-to-device discovery system information block. In this way, the user device is enabled to receive the time variable when in communication mode with the base station.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Alternatively, flow paths 1650 may be followed. Following flow path 1650 and at block 1625, the method 1600 may include determining the authentication of the connected user device to perform device-to-device discovery. For example, the base station may determine the authentication of the connected user device to participate in device-to-device discovery communications by receiving authorization from a network device-to-device discovery module. An example of this step is shown in block 610 of Figure 6.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1630, the method 1600 may include transmitting a wireless source control message containing a system information block that includes the time variable. Since the base station has already determined that the connected user device is authorized to perform device-to-device discovery, the base station may transmit the wireless source control message without waiting for a request from the connected user device. An example of the transmitted message may include the wireless source control message 615 shown in Figure 6.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Alternatively, flow path 1655 may be followed. In flow path 1655 and at block 1635, method 1600 may include receiving a wireless source control request for discovery resources such as the wireless source control request 710 shown in Figure 7. The wireless source control request may be obtained from a user device that uses a type 1 (device control) or type 2 (network control) device-to-device discovery resource allocation.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1640, method 1600 may include sending a WSC response in response to a WSC request. If the user device uses Type 2 (network-controlled) resource allocation, the WSC response may include the allocated resources and a time variable. If the user device uses Type 1 (device-controlled) resource allocation, the WSC response may not contain the resource allocation but only the time variable. In either case, the time variable is part of the WSC response. An example of a WSC response is the WSC response 715 shown in Figure 7.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">It should be noted that Method 1600 is a single execution pattern, and the operations of Method 1600 may be rearranged or otherwise modified to enable other execution patterns. As an example, in particular, not all of the operations shown in Method 1600 need to be performed, and many of the operations may be performed in a different order than the order shown in Figure 16.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 17 shows a schematic diagram of one example of a method 1700 for wireless communications in accordance with various aspects of the present disclosure. Method 1700 is described below with reference to one or some aspects of the user devices 115 shown by reference to Figure 1, 2, 3, 5, 6, and / or 9, respectively, or one or some aspects of the devices 405 shown by reference to Figure 4. In some examples, a user device such as the user device 115 or a device such as the device 405 may implement one or more sets of codes to control functional elements of the user device or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1705, the method includes sending a discovery request to a proximity-based service functional feature in the network to be allowed to advertise the device-to-device discovery application code as shown above by reference to Figure 3. The discovery request may contain the proximity-based service application identifier. The discovery request may be sent to a device-to-device discovery module such as a proximity-based service functional feature in an HPLMN or VPMLN that provides the service to the user device. The device-to-device discovery module 415 may perform the operations of block 1705 in conjunction with the transmission module 420 shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1710, method 1700 includes receiving a discovery response from the network as shown above with reference to Figure 3. The discovery response may include a time variable and a permissible start time. Device-to-device discovery module 415 may perform the operations of block 1710 in conjunction with the receiver module 410 shown above with reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 18 shows a schematic diagram of an example of a method 1800 for wireless communications in accordance with various aspects of the present disclosure. The method 1800 is illustrated below by reference to one or more user device aspects 115 shown by reference to Figure 1, 2, 3, 5, 6, and / or 9, respectively, or to device aspects 405 shown by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1805, method 1800 includes sending the discovery request to the network to allow it to advertise the device-to-device discovery application code as shown above by reference to Figure 3. The discovery request may contain the proximity-based service application identifier. The discovery request may be sent to a device-to-device discovery module such as a proximity-based service functional feature of a Home Public Land Mobile Network (HPLMN) or Visited Public Land Mobile Network (VPMLN) that provides the service to the user device. The device-to-device discovery module 415 may perform the operations of block 1805 in conjunction with the transmission module 420 shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1810, method 1800 includes receiving a discovery response from the network as shown above with reference to Figure 3. The discovery response may include a time variable and a permissible start time. Device-to-device discovery module 415 may perform the operations of block 1810 in conjunction with the receiver module 410 shown above with reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1815, the method 1800 includes comparing the time variable received from the network with the local time variable at the device to determine that there is a difference between the time variable received from the network and the local time variable within the time offset received from the network as shown above by reference to Figure 3. The time variable module 430 may perform the operations of block 1815 as shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1820, method 1800 includes broadcasting the discovery announcement from device to device if the difference between the time variable received from the network and the local time variable is within the allowable time offset as shown above by reference to Figure 3. The time variable module 430 may perform the operations of block 1820 as shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 19 shows a schematic diagram of an example of a method 1900 for wireless communications in accordance with various aspects of the present disclosure. Method 1900 is illustrated below by reference to one or more user device aspects 115 shown by reference to Figure 1, 2, 3, 5, 6, and / or 9, respectively, or device aspects 405 shown by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At template 1905, method 1800 includes sending a discovery request to the network to allow it to advertise the device-to-device discovery application code as shown above with reference to Figure 3. The discovery request may contain the application identifier of the proximity-based service. The discovery request may be sent to a device-to-device discovery module such as a proximity-based service functional feature of an HPLMN or VPMLN that provides the service to the user device. The device-to-device discovery module 415 may perform the operations of template 1905 in conjunction with the transmission module 420 shown above with reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At template 1910, method 1900 includes receiving a discovery response from the network as shown above with reference to Figure 3. The discovery response may include a time variable and a permissible start time. Device-to-device discovery module 415 may perform the operations of template 1910 in conjunction with the receiver module 410 shown above with reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1915, the method 1900 includes comparing the time variable received from the network with the local time variable at the device to determine that there is a difference between the time variable received from the network and the local time variable within the time offset received from the network as shown above by reference to Figure 3. The time variable module 430 may perform the operations of block 1915 as shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At block 1920, method 1900 includes producing a message integrity code included in the device-to-device discovery announcement as shown above by reference to Figure 3. The message integrity code module 425 may perform the operations of block 1920 as shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 1925, method 1900 includes broadcasting a device-to-device discovery announcement if the difference between the network-received time variable and the local time variable is within the allowable time offset as shown above with reference to Figure 3. The device-to-device discovery code includes a message integrity code and a device-to-device discovery application code. The time variable module 430 may perform the operations of block 1925 in conjunction with the transmission module 420 shown above with reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 20 shows a schematic diagram of an example of method 2000 for wireless communications in accordance with various aspects of the present disclosure. Method 2000 is illustrated below by reference to one or more user device aspects 115 illustrated by reference to Figure 1, 2, 3, 5, 6, and / or 9, respectively, or device aspects 405 illustrated by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At template 2005, method 2000 includes receiving the device-to-device discovery announcement through the monitoring user device 115-C-2 as shown above by reference to Figure 3. The device-to-device discovery announcement may include the device-to-device discovery application code and the message integrity code produced at the advertising user device 115-C1 shown in Figure 3. The receiving unit 410 may perform the operations of template 2005 as shown above by reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At template 2010, method 2000 includes sending a conformance report to the network for verification as shown above with reference to Figure 3. The conformance report may contain device-to-device discovery application code, message integrity code, and a time variable. The transmission module 420 may perform the operations of template 2010 as shown above with reference to Figure 4.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Figure 21 shows a schematic diagram of one example of a method 2100 for wireless communications in accordance with various aspects of the present disclosure. Method 2100 is described for clarity by reference to one or some aspects of the base station 105 and the backbone network 130 shown by reference to Figure 1, 2, 5, 6, 7, 8, and / or 11, or one or some aspects of the device 1005 shown by reference to Figure 10. In some examples, one or more base stations, such as the base station 105, or one or more devices, such as the device 1005, may implement one or more sets of codes to control functional elements of the base station or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At template 2105, method 2100 includes receiving the discovery request from the device as shown above with reference to Figure 3. The receiving unit 1010 may perform the operations of template 2105 as shown above with reference to Figure 10.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At block 2110, method 2100 includes sending a probe response to the device as shown above with reference to Figure 3. The probe response may include a time variable and a permissible timing offset. The transmitter 1020 may perform the operations of block 2110 as shown above with reference to Figure 10.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> Figure 22 illustrates an example of a method 2200 for wireless communications in accordance with various aspects of the present disclosure. For illustration, method 2200 is illustrated below with reference to aspects of the network device-to-device detection module 210 and / or 1015 as illustrated by reference to Figures 2, 3, 8, and / or 10. In some examples, the device 1005 may implement one or more sets of codes to control functional elements of the base station or device to perform the functional tasks described below.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">At template 2205, method 2200 may include receiving a conformance report from the device as shown by reference to Figure 3. The conformance report may be received from the monitoring user device and may contain a message integrity code, a time variable, and device-to-device discovery application code. The receiving module 1010 may perform the operations of template 2205 as shown above by reference to Figure 10.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At template 2210, method 2200 may include verifying the validity of the message integrity code included in the conformance report as shown by reference to Figure 3. Device-to-device discovery module 210 and / or 1015 may perform template 2210 operations as shown above by reference to Figure 2, 3, 8, and / or 10.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> At template 2215, the method may include sending a match response to the device shown by reference to Figure 3. The match response may include a time variable indicating the current network time and the application ID of the proximity-based service. The device-to-device discovery module 210 and / or 1015 may perform the operations of template 2215 in conjunction with the transmission module 1020 as shown above by reference to Figure 10.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">It should be noted that the methods shown in Figures 1700, 1800, 1900, 2000, 2100, and 2200 are implementation models provided as examples and the processes shown in the method and steps may be rearranged or otherwise modified so that other implementation models may be followed.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The detailed description above, in conjunction with the accompanying drawings, provides examples and is not limited to the examples provided that can be implemented or examples that do not fall outside the scope of the claims. The words "example" and "for example" used in this description are intended to be "given as an example or illustration" and are not intended to be "preferred" or "distinctive over other examples." The detailed description includes specific details provided for the purpose of understanding the methods described. However, these methods can be practiced without the need for such specific details. Common installations and apparatus are, in some cases, illustrated in schematic form with templates to avoid confusion about the concepts of the examples shown.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">The methods described in this disclosure may be used in many wireless communications systems such as CDMA, TDMA, FDMA, OFDMA, SC-FDMA, and others. The term "system" is often used interchangeably with the term "network." A CDMA system may implement wireless technology such as CDMA2000, Universal Terrestrial Radio Access (UTRA), and others. CDMA2000 includes the IS-2000, IS-95, and IS-856 standards. Versions 0 and 1 of IS-2000 are often referred to as CDMA2000 1X, 1X, and others. IS-856 (TIA-856) is often referred to as CDMA2000 1xEV-DO, High Rate Packet Data (HRPD), and others. UTRA includes Wideband CDMA (WCDMA) and other CDMA variants. A TDMA system may implement a wireless technology such as the Global System for Mobile Communications (GSM). An OFDMA system may implement a wireless technology such as Ultra Mobile Broadband (UMB), Evolved UTRA (E-UTRA), IEEE 802.11 (Wi-Fi), IEEE 802.16 (WiMAX), IEEE 802.20, Flash-OFDM, and others.<h2 style=";text-align:left;direction:ltr">UTRA and E-UTRA are part of the Universal Mobile Telecommunication System (UMTS). 3GPP Long Term Evolution (LTE) and LTE Advanced (LTE-A) are newer versions of UMTS that use E-UTRA. UTRA, E-UTRA, UMTS LTE, LTE-A, and GSM are described in documents issued by an organization called the Third Generation Partnership Project (3GPP). CDMA2000 and UMB are described in documents issued by an organization called the Third Generation Partnership Project 2 (3GPP2). The methods described in this disclosure may be used in the above-described and other wireless systems and technologies. While the above description describes LTE by way of example, LTE terminology is used throughout most of the foregoing description, the methods may be applied to applications other than LTE.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Communications networks that accommodate some of the examples shown may be packet-based networks that operate along a layered protocol path. For example, communications at the carrier layer or the Packet Data Convergence Protocol (PDCP) layer may be IP-based. The Radio Link Control (RLC) layer may fragment and reassemble packets for communication across logical channels. The Medium Access Control (MAC) layer may handle priority and multiplex logical channels into transport channels. The MAC layer may use Hybrid Automatic Repeat Request (HARQ) to retransmit MAC to improve link efficiency. At the physical layer, transport channels may be mapped to physical channels.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">Information and signals can be represented using any of a variety of different techniques and methods. For example, the data, instructions, commands, information, signals, bits, symbols, and chips referred to in the previous description can be represented in the form of electrical voltages, electrical currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or a combination of the above.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">SEQ Paragraph \# "

[0000] " \* MERGEFORMAT \* MERGEFORMAT \* MERGEFORMAT The various illustrative templates and modules related to this disclosure may be implemented or implemented using a general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an FPGA, or other programmable logic device, discrete gate component, logic transistor, discrete hardware component, or a combination of the foregoing devices intended to perform the tasks described in this disclosure. The general purpose processor may be a microprocessor, but alternatively, a conventional processor, a control unit, a microcontroller, or a state machine may be implemented. The processor may be implemented in the form of embedded computers, i.e., a combination of a digital signal processor, a microprocessor, multiple microprocessors, one or more microprocessors with a digital signal processor core, or other configurations. In some cases, the processor may be electronically connected to memory, where the memory stores instructions executable by the processor.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr"> The functionalities described in this disclosure may be implemented in the form of hardware or software executable by a processor, firmware, or a combination of the foregoing. In the case of a processor-executable program, the functionalities may be stored or transmitted via one or more instructions or codes on a computer-readable medium. Other examples and embodiments of implementation fall within the scope and spirit of the disclosure and the accompanying claims. For example, because of the nature of the programs, the functionalities described above may be implemented using software executable by a processor, hardware, firmware, wiring, or a combination of the foregoing. Functionalities implementing the attributes may also be located in multiple locations, including distributed locations where portions of the functionalities are implemented in different physical locations. The character "or" used in this disclosure and the accompanying claims to indicate a list of items, such as a list of "one or more of A, B, or C," means A, B, C, AB, ACC, or ABC (A, B, and C).<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">A computer program product or computer-readable medium includes a computer-readable storage medium or communications medium, including any media that facilitates the transfer of a computer program from one location to another. The storage medium may be any media accessible by a general-purpose or special-purpose computer.<h2 style=";text-align:left;direction:ltr">By way of example, computer-readable medium may include Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc read-only-memory CD-ROMs, other optical disk storage, magnetic disk storage, other magnetic storage devices, or other media that can be used to transmit or store desired computer-readable program code in the form of instructions or data and that can be accessed by a general-purpose or special-purpose computer or by a general-purpose or special-purpose processor. This also applies to any connection that is called computer-readable medium.<h2 style=";text-align:left;direction:ltr">For example, if a program is transmitted from a website, server, or other remote light source using coaxial cable, fiber optic cable, twisted pair cable, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair cable, digital subscriber line, or wireless technologies such as infrared, radio, and microwaves are included in the definition of medium. The term "disc" as used in this disclosure includes compact disc, laser disc, optical disc, digital multidisc, floppy disk, and blu-ray disc, where discs are used to reproduce data magnetically and optically using a laser. The scope of "computer-readable media" includes a combination of any of the above.<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">SEQ Paragraph \# "

[0000] " \* MERGEFORMAT \* MERGEFORMAT \* MERGEFORMAT The foregoing description of the disclosure is provided to enable a person skilled in the art to apply or use it. It is already apparent to a person skilled in the art that many modifications will be made to this disclosure and that the general principles set forth in this disclosure can be applied to other examples without departing from the scope of the disclosure. The word "example" in this disclosure refers to the presentation by way of example and does not imply a preference for the examples referred to. Accordingly, the disclosure is not limited to the embodiments and designs shown in this document but conforms to the broader scope in accordance with the new principles and features set forth.

Claims

Protection elements<h1 style=";text-align:left;direction:ltr"> 1- A method for connecting wirelessly to a wireless network that includes:<h1 style=";text-align:left;direction:ltr"> Receiving a timing variable and a time offset allowed from a network at the device, the timing variable being received when the device is in online mode; and <h1 style=";text-align:left;direction:ltr"> Using the time variable and the allowed time offset in device-to-device discovery message verification by comparing the received time variable with the local timing variable to determine a time difference between the received time variable and the local time variable within the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 2- A method according to claim 1, further comprising:<h1 style=";text-align:left;direction:ltr"> Storing the received timing variable at the device to compare it with the local timing variable.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 3- A method according to claim 1, wherein the timing variable is received from the functional task of the proximity-based service (ProSe) in the network.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> ​4- A method according to claim 1, wherein the timing variable is received with the device-to-device (D2D) discovery application code.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 5- A method according to claim 3, further comprising:<h1 style=";text-align:left;direction:ltr"> Receive the allowed time offset from the functional task of the proximity-based service in the network. <h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 6- A method according to claim 5, further comprising:<h1 style=";text-align:left;direction:ltr"> Declare device-to-device discovery application token if the difference between the timing variable received from the network and the local timing variable is within the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 7- A method according to claim 5, further comprising:<h1 style=";text-align:left;direction:ltr"> Notify the proximity-based service job task of an unusual movement when the difference is greater than the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 8- A method according to protection element 5, wherein the timing variable received from the network is coordinated universal time (UTC).​ 9 - A method according to protection element 5, further comprising: Receiving a local timing variable via a system information block (SIB). 10 - A method according to protection element 1, further comprising: Sending a discovery request containing an application identification (ID) of a proximity based service (ProSe) service list to the network. 11 - A method according to protection element 10, further comprising: Receiving a discovery response from the network, where the response contains a timing variable and an allowed time offset. 12 - A method according to protection element 1, further comprising: Using the timing variable received from the network to generate a message security code to be included in the device - to - device (D2D) discovery advertisement. 13- A method according to claim 12, wherein the message integrity code is produced based on the device-to-device (D2D) discovery application token, the key associated with the device-to-device (D2D) discovery application token, and the timing variable when the device-to-device (D2D) discovery announcement is sent.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 14- A method according to claim 1, further comprising:<h1 style=";text-align:left;direction:ltr"> Receive a device-to-device discovery announcement containing a message integrity code (MIC); and <h1 style=";text-align:left;direction:ltr"> Send the received message integrity code and timing variable to the proximity-based service (ProSe) functional task in the network.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 15- A method according to claim 9, further comprising:<h1 style=";text-align:left;direction:ltr"> Ignore the local timing variable received in a system information block (SIB) if the device detects more than one SIB containing timing information; and <h1 style=";text-align:left;direction:ltr"> ​Get the local timing variable outside the system information block.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 16- A method according to claim 9, further comprising:<h1 style=";text-align:left;direction:ltr"> Compare the timing variable received in the system information block with the local timing variable; and <h1 style=";text-align:left;direction:ltr"> Get the timing variable outside the system information block if the difference between the received timing variable and the local timing variable is greater than the predefined value.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 17- A method according to claim 1, further comprising:<h1 style=";text-align:left;direction:ltr"> Device-to-device discovery resource request through a radio resource control (RRC) message when the device uses a device-to-device (D2D) discovery resource allocation scheme through network control;<h1 style=";text-align:left;direction:ltr"> Where the timing variable is received by responding to a radio resource control (RRC) message.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> ​18- A method according to claim 1, further comprising:<h1 style=";text-align:left;direction:ltr"> Receive a radio resource control (RRC) message containing a timing variable and an empty resource allocation element.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 19- A method according to claim 5, further comprising:<h1 style=";text-align:left;direction:ltr"> Synchronize the timing variable received from the proximity-based service (ProSe) job task with the local timing variable when the difference is less than the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 20- A device prepared for wireless communication consisting of:<h1 style=";text-align:left;direction:ltr"> At least one processor; and<h1 style=";text-align:left;direction:ltr"> Memory associated with at least one processor, wherein at least one processor is configured to: <h1 style=";text-align:left;direction:ltr"> Receiving a timing variable and a time offset allowed from a network at the device, the timing variable being received when the device is in online mode; and <h1 style=";text-align:left;direction:ltr"> ​Use the time variable and the allowed time offset in device-to-device discovery message verification by comparing the received time variable with the local timing variable to determine a time difference between the received time variable and the local time variable within the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 21- A device according to claim 20, wherein the timing variable is received from the proximity-based service (ProSe) functional task in the network.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 22- A device according to claim 21, wherein at least one processor is also configured to:<h1 style=";text-align:left;direction:ltr"> Receive the allowed time offset from the proximity-based service (ProSe) functional task in the network.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 23- A device according to claim 22, wherein at least one processor is also configured to:<h1 style=";text-align:left;direction:ltr"> ​Declare device-to-device discovery application token if the difference between the timing variable received from the network and the local timing variable is within the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 24- Ways to connect wirelessly to a wireless network include:<h1 style=";text-align:left;direction:ltr"> Enter the connection mode with the device; and <h1 style=";text-align:left;direction:ltr"> Send the timing variable and the allowed time offset to the device for use in verifying the device-to-device (D2D) discovery message when in communication mode, where the timing variable is used in comparison with the local timing variable to determine if there is a difference between the timing variable and the local timing variable within the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 25- A method according to claim 24, wherein the timing variable is transmitted from the functional task of the proximity-based service (ProSe).<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> ​26- A method according to claim 24, further comprising:<h1 style=";text-align:left;direction:ltr"> Send the timing variable with the discovery application code from device-to-device (D2D). <h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 27- A method according to claim 24, wherein the permissible time offset is the maximum difference between the timing variable and the local timing variable at the device. <h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 28- A method according to claim 24, further comprising:<h1 style=";text-align:left;direction:ltr"> Receive an exploration request containing the proximity-based service (ProSe) application ID from the device; and send an exploration response to the device, where the response contains the timing variable and the allowed time offset.<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 29- A method according to claim 24, further comprising:<h1 style=";text-align:left;direction:ltr"> Receive wireless source control request for exploration sources,<h1 style=";text-align:left;direction:ltr"> Where sending a timing variable involves sending a response to a radio source control request containing the timing variable.​<h1 style=";text-align:left;direction:ltr"> <h1 style=";text-align:left;direction:ltr"> 30- A device prepared for wireless communication consisting of:<h1 style=";text-align:left;direction:ltr"> At least one processor; and<h1 style=";text-align:left;direction:ltr"> Memory associated with at least one processor, wherein at least one processor is configured to: <h1 style=";text-align:left;direction:ltr"> Enter communication mode with the device; send the timing variable and the allowed time offset to the device for use in verifying the device-to-device discovery message when in communication mode, where the timing variable is used in comparison with the local timing variable to determine if there is a difference between the timing variable and the local timing variable within the allowed time offset.