1. Field of the Invention
The present invention relates to communication apparatuses that perform communication by sharing encryption keys.
2. Description of the Related Art
In a wireless LAN compliant with the IEEE 802.11 series of standards, an ad hoc mode is defined which allows communication apparatuses to directly communicate with one another without the use of an access point. Communication apparatuses communicating in the ad hoc mode can communicate with one another by automatically setting mutually different IP addresses using Auto IP. In Auto IP, IP addresses are specifically set as follows. First, a first communication apparatus sets a certain IP address and inquires whether or not there is another communication apparatus having that same IP address set therefor, using an ARP request. When it is detected that there is another communication apparatus having that same address set therefor, the first communication apparatus sets another IP address and inquires again whether or not there is another communication apparatus having that same IP address set therefor, using an ARP request. The above-described processing is repeated until an IP address is found for which there is no other communication apparatus having that same IP address set therefor. Thereby, communication apparatuses can set IP addresses which are different from one another. Here, IP stands for Internet Protocol and ARP stands for Address Resolution Protocol.
Further, in a wireless LAN, Wi-Fi Protected Access (WPA) is defined to increase network security. Communication apparatuses which join a WPA compliant network perform communication using encryption (hereinafter called encrypted communication).
However, there is no definition regarding a timing at which a terminal newly joining a WPA compliant network is to start encrypted communication, in the IEEE specifications (IEEE Computer Society, “IEEE Standard for Information technology—Telecommunication and information exchange between systems—Local and metropolitan area networks—Specific requirements, Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications”, IEEE Std 802.11-2007, Revision of IEEE Std 802.11-1999). Hence, there may be a case in which a communication apparatus starts encrypted communication in order to use Auto IP before an encryption key is shared with other communication apparatuses already belonging to an ad hoc network. In such a case, duplicate-IP-address detection processing using Auto IP cannot be performed correctly. In other words, when a communication apparatus transmits an ARP request using encryption, other communication apparatuses which do not share the encryption key cannot decrypt this ARP request, and hence cannot make an appropriate response. As a result, there may be a case in which the same IP address is set for a plurality of communication apparatuses, thereby prohibiting normal communication.