A communication apparatus comprising: creation means for creating a network; search means for searching for another network after the network is created by said creation means; determination means for determining a role, for a communication parameter setting procedure, of another communication apparatus existing in the other network searched by said search means; join means for joining the other network, in which the other communication apparatus exists which has a role of a provider of communication parameters; and setting means for executing (S323-S325) the communication parameter setting procedure with the other communication apparatus in the other network joined by said join means; characterized by being configured such that the search for another network is performed by scanning for another communication apparatus having the role of a provider of communication parameters in the other network (S307, S308), wherein said scanning is performed by transmitting a search request to the other communication apparatus and, upon receiving a response to the search request from the other communication apparatus (S404, S405), determining directly from this response whether or not the other communication apparatus has the role of a provider of communication parameters, if the other communication apparatus having the role of a provider of communication parameters is found as a result of the search, the communication apparatus joins the other network by executing the communication parameter setting procedure with the other communication apparatus (S323-S325), and if no other communication apparatus having the role of a provider of communication parameters is found as a result of the search, communication in the network created by the creation means is continued, and, upon receiving a search request from another communication apparatus, a response indicating that the communication apparatus has the role of a provider of communication parameters, is transmitted to the other communication apparatus and communication parameters are provided to the other communication apparatus for the communication parameter setting procedure (S315, S316). creation means for creating a network; search means for searching for another network after the network is created by said creation means; determination means for determining a role, for a communication parameter setting procedure, of another communication apparatus existing in the other network searched by said search means; join means for joining the other network, in which the other communication apparatus exists which has a role of a provider of communication parameters; and setting means for executing (S323-S325) the communication parameter setting procedure with the other communication apparatus in the other network joined by said join means; characterized by being configured such that the search for another network is performed by scanning for another communication apparatus having the role of a provider of communication parameters in the other network (S307, S308), wherein said scanning is performed by transmitting a search request to the other communication apparatus and, upon receiving a response to the search request from the other communication apparatus (S404, S405), determining directly from this response whether or not the other communication apparatus has the role of a provider of communication parameters, if the other communication apparatus having the role of a provider of communication parameters is found as a result of the search, the communication apparatus joins the other network by executing the communication parameter setting procedure with the other communication apparatus (S323-S325), and if no other communication apparatus having the role of a provider of communication parameters is found as a result of the search, communication in the network created by the creation means is continued, and, upon receiving a search request from another communication apparatus, a response indicating that the communication apparatus has the role of a provider of communication parameters, is transmitted to the other communication apparatus and communication parameters are provided to the other communication apparatus for the communication parameter setting procedure (S315, S316).