JP2008140209A - Communication device with switchable server function, and switching method therefor and system - Google Patents

Communication device with switchable server function, and switching method therefor and system Download PDF

Info

Publication number
JP2008140209A
JP2008140209A JP2006326598A JP2006326598A JP2008140209A JP 2008140209 A JP2008140209 A JP 2008140209A JP 2006326598 A JP2006326598 A JP 2006326598A JP 2006326598 A JP2006326598 A JP 2006326598A JP 2008140209 A JP2008140209 A JP 2008140209A
Authority
JP
Japan
Prior art keywords
server function
communication device
router
server
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006326598A
Other languages
Japanese (ja)
Inventor
Ikue Nakano
育恵 中野
Takeshi Kokado
健 古門
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2006326598A priority Critical patent/JP2008140209A/en
Publication of JP2008140209A publication Critical patent/JP2008140209A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide service without depending on a network configuration, in a local network divided into one or more subnetworks by one or more routers. <P>SOLUTION: This communication device having a function (a server function) of providing the service to another communication device inside the local network has: a server function finding means finding the other communication device having the server function in the local network; a server function validity decision means deciding the communication device whose server function is enabled; and a server function switching means switching validation of the server function. When finding the other communication device having the server function, the communication device whose server function is enabled is switched when receiving a server function switching instruction from the communication device or when it is decided that the server function switching is necessary by the server function validity decision means. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、通信装置の交代方法に関し、より特定的には、ローカルネットワークにおいて、ネットワークに接続された通信装置間の通信に関し、特に宅内ネットワークが1台以上のルータで構成されるネットワークにおいて、ネットワーク構成の変化によりサービスを提供する通信装置を他の通信装置へ交代する方法に関するものである。   The present invention relates to a method for switching communication devices, and more particularly, to communication between communication devices connected to a network in a local network, and particularly in a network in which a home network is composed of one or more routers. The present invention relates to a method for switching a communication device that provides a service to another communication device due to a change in configuration.

近年、情報化社会の急速な進展とともに宅内におけるネットワーク化が普及しつつある。   In recent years, networking in the home has become widespread with the rapid development of the information society.

また、宅内のネットワークに接続される通信装置や通信機器(以降、併せて「通信機器」とよぶ)は、それらの通信機器が互いに連携して動作、つまり、通信機器間で通信し合いながら動作することで通信機器が提供するサービスの利便性を高めることが期待されている。しかし、宅内ネットワークの構成によってはサービスを受給できない(通信機器間の通信ができない)場合がある。   In addition, communication devices and communication devices (hereinafter collectively referred to as “communication devices”) connected to the home network operate in cooperation with each other, that is, communicate with each other. By doing so, it is expected to improve the convenience of the service provided by the communication device. However, depending on the configuration of the home network, the service may not be received (communication between communication devices may not be possible).

例えば、ハブの代わりにルータを接続したり、無線アクセスポイントの代わりに無線ルータを接続したりした場合、宅内ネットワークは複数のルータで構成されることになる。   For example, when a router is connected instead of a hub, or when a wireless router is connected instead of a wireless access point, the home network is composed of a plurality of routers.

ここで、家庭用ルータ(家庭用無線ルータ含む)にはNATまたはNAPT機能が搭載されている。図1はモデム内蔵ルータ3aの配下に無線ルータ3bを、さらにその配下に無線ルータ3cを接続し、宅内で複数のルータが直列に接続されたネットワーク構成の場合を示している。通信機器5bからサーバ機能付き通信機器4bに対しては、ルータ3bにとって同一ネットワーク内であるので通信可能である。また、通信機器5bから通信機器5aに対して開始する通信は、ルータ3bにとって、LAN側からWAN側への通信になるため、自動的にルータ3bにアドレス変換(NAPT)設定が行われ通信を行うことは可能である。しかし、通信機器5aからサーバ機能付き通信機器4bに対して開始する通信は、ルータ3bにとって、WAN側からLAN側への通信になるため、NAPT機能やファイアウォール機能が動作し通信することができない。この場合、LAN側からWAN側の通信機器へは通信が可能であるため、サーバ機能付き通信機器4bにサーバ機能付き通信機器4bから通信機器5aへ通信を開始する機能を持たせることで通信は可能である。ルータ3c配下の通信機器についても同様である。しかし、図2のようにルータ3aの配下にルータ3dが接続され、宅内で3台のルータがトライアングル状に接続されたネットワーク構成の場合は、前述の方法をもってしてもルータ3d配下の通信機器5dとルータ3b配下のサーバ機能付き通信機器4bが通信をすることは不可能である。この場合、サーバ機能付き通信機器4bではなくサーバ機能付き通信機器4aがサービスを供給していれば、全ての通信機器にとってLAN側からWAN側の通信となりサーバ機能付き通信機器と通信することが可能である。   Here, the home router (including the home wireless router) is equipped with a NAT or NAPT function. FIG. 1 shows a network configuration in which a wireless router 3b is connected under the modem built-in router 3a and a wireless router 3c is connected under the router 3a, and a plurality of routers are connected in series at home. Communication from the communication device 5b to the communication device 4b with a server function is possible because the router 3b is in the same network. Further, since the communication started from the communication device 5b to the communication device 5a is communication from the LAN side to the WAN side for the router 3b, address conversion (NAPT) is automatically set in the router 3b and communication is performed. It is possible to do. However, since the communication started from the communication device 5a to the communication device 4b with the server function is communication from the WAN side to the LAN side for the router 3b, the NAPT function and the firewall function operate and cannot communicate. In this case, since communication is possible from the LAN side to the communication device on the WAN side, the communication can be performed by providing the communication device with server function 4b with a function for starting communication from the communication device with server function 4b to the communication device 5a. Is possible. The same applies to the communication devices under the router 3c. However, in the case of a network configuration in which the router 3d is connected under the router 3a as shown in FIG. 2 and the three routers are connected in a triangle shape in the home, the communication equipment under the router 3d even if the above method is used. It is impossible for 5d and the communication device 4b with a server function under the router 3b to communicate. In this case, if the communication device 4a with the server function is supplying the service instead of the communication device 4b with the server function, the communication is performed from the LAN side to the WAN side for all the communication devices and can communicate with the communication device with the server function. It is.

このようにネットワーク構成によってサービスの受給ができなくなることを回避するために、ネットワーク構成が変化した際にサービスを供給する通信機器をより最適な通信機器に交代させることが必要である。   In order to avoid such a situation that the service cannot be received due to the network configuration, it is necessary to replace the communication device that supplies the service with a more optimal communication device when the network configuration changes.

従来の通信機器の交代の方法としては、ネットワーク内の各子機のバッテリ残量や各端末の位置関係を調査し、ネットワークの維持に適した端末(通信可能な子機の多い子機)を新たな親機とするものがあった(例えば、特許文献1参照)。図42は、前記特許文献1に記載された従来の通信端末交代方法のシーケンスを示すものである。   As a conventional method of replacing communication devices, check the remaining battery capacity of each slave unit in the network and the positional relationship of each terminal, and select a terminal suitable for network maintenance (slave unit with many slave units that can communicate). There was a new parent device (for example, see Patent Document 1). FIG. 42 shows a sequence of the conventional communication terminal changing method described in Patent Document 1.

図42において、親機である端末1は自身のバッテリ残量を測定し(ステップS100)、残量が規定値より少なければ親機の切り替えを決定し(ステップS101)、端末2、端末3にそれぞれのバッテリ残量の情報を要求する(ステップS102)。端末2、端末3はそれぞれ自身のバッテリ残量を測定して(ステップS103)親機である端末1に通知し(ステップS104)、端末1は、各端末から受信したそれぞれのバッテリ残量を比較して親機を交代する端末を決定していた(ステップS105)。
特開2003−273883号公報(第12頁、図3)
In FIG. 42, the terminal 1 which is the master unit measures its own battery remaining amount (step S100), and if the remaining amount is less than the specified value, it decides to switch the master unit (step S101). Information on the remaining amount of each battery is requested (step S102). Each of the terminal 2 and the terminal 3 measures its own battery remaining amount (step S103) and notifies the terminal 1 which is the parent device (step S104), and the terminal 1 compares the respective remaining battery amounts received from the respective terminals. Thus, the terminal for changing the parent device has been determined (step S105).
Japanese Patent Laying-Open No. 2003-273388 (page 12, FIG. 3)

しかしながら、前記従来の構成では同一ネットワークに接続する複数台の通信機器の中から1台を選択してサーバ機能を交代することは可能であるが、そもそも接続できないネットワーク構成が存在するという概念がないため、課題となる複数のルータで構成される宅内ネットワークに適用ができない。   However, in the conventional configuration, it is possible to select one of a plurality of communication devices connected to the same network and change the server function, but there is no concept that there is a network configuration that cannot be connected in the first place. Therefore, it cannot be applied to a home network composed of a plurality of routers as a problem.

つまり、複数のルータで構成される宅内ネットワークにおいて接続性を考慮すると上述の理由により、上位サブネットワークの通信機器にサーバ機能を交代することが望まれるが、従来の構成は同一のネットワーク上においてのみしか接続性を考慮できていないため、上位サブネットワークの通信機器にサーバ機能を交代させることができない。このことにより、上位サブネットワークの通信機器が下位サブネットワークのサーバ機能をもつ通信機器からサービスを受給できないという問題が発生する。   In other words, considering the connectivity in a home network composed of a plurality of routers, for the reasons described above, it is desirable to switch the server function to the communication device of the upper subnetwork. However, the conventional configuration is only on the same network. However, since the connectivity can only be taken into consideration, the server function cannot be changed to the communication device of the upper subnetwork. This causes a problem that the communication device of the upper subnetwork cannot receive service from the communication device having the server function of the lower subnetwork.

本発明は、前記従来の課題を解決するもので、ネットワーク構成が変化した際にサービスを供給する通信機器をより最適な通信機器に交代させる方法を提供することを目的とする。   An object of the present invention is to solve the above-described conventional problems, and to provide a method for replacing a communication device that supplies a service with a more optimal communication device when a network configuration changes.

前記従来の課題を解決するために、本発明の請求項1にかかるサーバ機能を有する通信装置は、外部ネットワークに接続するローカルネットワークにおいて、前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、ローカルネットワークは1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、ローカルネットワークのいずれかのルータに接続され、ローカルネットワーク内の他の通信装置にサービスを提供する機能(サーバ機能)を有する通信装置であって、ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を発見するサーバ機能発見手段と、少なくとも、サーバ機能発見手段の結果を用いてサーバ機能を有効にするべき通信装置を判断するサーバ機能適正判断手段と、サーバ機能適正判断手段の結果、または、他の通信装置からのサーバ機能切り替えメッセージの受信により、サーバ機能の有効及び無効を切り替えるサーバ機能切り替え手段と、を備える。   In order to solve the conventional problem, a communication device having a server function according to claim 1 of the present invention is provided in a local network connected to an external network, between the communication device in the local network and the external network. There is one or more routers, the local network is divided into one or more different sub-networks by one or more routers, connected to any router of the local network, and other communication devices in the local network A communication function having a function (server function) for providing a service to a server, a server function discovery means for discovering another communication apparatus having a server function existing in the local network, and at least a result of the server function discovery means A server that uses the server function to determine which communication device should be enabled Comprising a capacity proper determination means, the result of the server functions properly determining means, or by receiving the server function switching message from another communication apparatus, and a server function switching means for switching the valid and invalid server functions, the.

本構成によって、ネットワーク上にサーバ機能を有する通信装置が複数台存在する場合に、サービスを供給する通信装置をより最適な通信装置に交代させることが可能となる。   With this configuration, when there are a plurality of communication devices having a server function on the network, it is possible to replace the communication device that supplies the service with a more optimal communication device.

本発明の請求項2にかかる通信装置は、請求項1に記載のサーバ機能を有する通信装置であって、サーバ機能発見手段は、ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を探索するサーバ機能探索手段と、サーバ機能を有する他の通信装置からサーバ機能探索用パケットを受信し、サーバ機能探索用パケットに対して応答パケットを送信する探索応答手段を備え、サーバ機能探索手段が、ローカルネットワーク内に存在するサーバ機能を有する他の通信装置宛にサーバ機能探索用パケットを送信し、サーバ機能を有する他の通信装置からの応答パケットを受信する、または、探索応答手段が、サーバ機能を有する他の通信装置からサーバ機能探索用パケットを受信することでサーバ機能を有する通信装置を発見する。   According to a second aspect of the present invention, there is provided a communication apparatus having the server function according to the first aspect, wherein the server function discovery means searches for another communication apparatus having a server function existing in the local network. Server function search means for receiving the server function search packet from another communication device having a server function, and transmitting a response packet to the server function search packet, the server function search means, A server function search packet is transmitted to another communication apparatus having a server function existing in the local network, and a response packet is received from another communication apparatus having the server function, or the search response means has a server function The communication device having the server function is found by receiving the server function search packet from the other communication device having.

本構成によって、ネットワーク上にサーバ機能を有する装置が複数台存在するかどうかを検出することが可能となる。   With this configuration, it is possible to detect whether there are a plurality of apparatuses having a server function on the network.

本発明の請求項3にかかる通信装置は、請求項2に記載のサーバ機能を有する通信装置であって、サーバ機能を有する通信装置が接続されたルータから外部ネットワークとの間に位置するルータの内1つ以上のルータのLAN側アドレス情報又は、LAN側アドレス情報とWAN側アドレス情報を取得して、取得したアドレス情報を用いて、取得したアドレス情報が属する第1のネットワークに接続される通信装置が取ることが可能なアドレスの範囲を推測して記憶する上位サブネットワーク存在判断手段をさらに備え、サーバ機能探索手段は、上位サブネットワーク存在判断手段が記憶した1つ以上の前記第1のネットワークのアドレス範囲の情報を用いて、サーバ機能を有する通信装置が取りうるアドレスを得て、該アドレス宛にサーバ機能探索用パケットを送信する。   A communication device according to claim 3 of the present invention is a communication device having a server function according to claim 2, wherein a router located between the router to which the communication device having the server function is connected and an external network is connected. The LAN side address information of one or more routers or the LAN side address information and the WAN side address information is acquired, and the acquired address information is used to connect to the first network to which the acquired address information belongs. The apparatus further comprises upper subnetwork existence determination means for estimating and storing a range of addresses that can be taken by the apparatus, and the server function search means is one or more of the first networks stored by the upper subnetwork existence determination means By using the address range information, an address that can be taken by the communication device having the server function is obtained, and the server is addressed to the address. To send an ability to search for a packet.

本構成によって、自身が接続されたルータまたは、自身が接続されたルータと外部ネットワークとの間に存在する他のルータ(上位ルータ)に属するネットワークに存在するサーバ機能を有する通信装置および、自身が接続されたルータ配下に存在するサーバ機能を有する通信装置を発見することが可能となる。   With this configuration, a communication device having a server function that exists in a network to which the router to which the router is connected or another router (upper router) that exists between the router to which the router is connected and an external network, It becomes possible to find a communication device having a server function that exists under the connected router.

本発明の請求項4にかかる通信装置は、請求項2に記載のサーバ機能を有する通信装置であって、探索応答手段は、サーバ機能を有する他の通信装置からサーバ機能探索用パケットを受信し、サーバ機能適正判断手段が、自身はサーバ機能を有効にするべき通信装置であると判断している場合に、サーバ機能探索用パケットの応答パケットを送信する。   A communication device according to claim 4 of the present invention is the communication device having the server function according to claim 2, wherein the search response means receives a server function search packet from another communication device having the server function. When the server function appropriateness determining means determines that it is a communication device that should enable the server function, it transmits a response packet of the server function search packet.

本構成によって、サーバ機能を有する通信装置が多数存在した場合の探索応答によるトラフィック負荷を下げることが可能である。   With this configuration, it is possible to reduce the traffic load due to a search response when there are a large number of communication devices having a server function.

本発明の請求項5にかかる通信装置は、請求項1に記載のサーバ機能を有する通信装置であって、サーバ機能適正判断手段は、サーバ機能適正判断手段は、サーバ機能発見手段が、サーバ機能を有する通信装置が接続されたルータまたは、サーバ機能を有する通信装置が接続されたルータと外部ネットワークとの間に存在する他のルータ(上位ルータ)に属するネットワークにおいて、サーバ機能を有する他の通信装置を発見しなかった場合に、自身はサーバ機能を有効にするべき通信装置であると判断し、サーバ機能を有する他の通信装置を発見した場合に、自身はサーバ機能を無効にするべき通信装置である、と判断する。   According to a fifth aspect of the present invention, there is provided a communication apparatus having the server function according to the first aspect, wherein the server function appropriateness determining means is a server function appropriateness determining means, and the server function finding means is a server function. Other communication having a server function in a router to which a communication device having a network or a router to which a communication device having a server function is connected and another router (upper router) existing between an external network If a device is not found, it is determined that it is a communication device for which the server function is to be enabled, and if another communication device having the server function is found, it is a communication for which the server function is to be disabled. Judged to be a device.

本構成によって、常にサーバ機能を有する通信装置の中で最上位に位置する装置のサーバ機能を有効化できるため、サーバ機能を有する装置と他の通信装置との接続性を向上させることができる。また、自身が属するネットワークと同位ネットワークにサーバ機能を有効化しているサーバ機能を有する通信装置が存在している場合は交代しないことにより、サービスの提供を中断することなく維持することが可能である。   With this configuration, the server function of the device positioned at the highest level among the communication devices having the server function can be validated at all times, so that the connectivity between the device having the server function and other communication devices can be improved. In addition, if there is a communication device having a server function that enables the server function in the network to which it belongs and the peer network, it is possible to maintain the service provision without interruption by not replacing it. .

本発明の請求項6にかかる通信装置は、請求項1に記載のサーバ機能を有する通信装置であって、サーバ機能切り替え手段は、自身のサーバ機能を有効化から無効化に切り替える場合、自身がサービスを提供している通信装置に、サーバ機能を交代する他の通信装置の情報を送信する。   A communication device according to a sixth aspect of the present invention is the communication device having the server function according to the first aspect, wherein the server function switching means is configured such that when the server function is switched from being enabled to being disabled, Information of another communication device whose server function is changed is transmitted to the communication device providing the service.

本構成によって、サービスを提供されている各通信機器は新しくサーバ機能を有効化する通信装置に対して該装置をネットワーク上で検索することなく瞬時にセッションを接続しなおすことができ、サーバ機能を有効化する通信装置を交代することによるサービスの受給中断の可能性を低くすることが可能となる。   With this configuration, each communication device provided with a service can reconnect the session instantaneously without searching for the device on the network to the communication device that newly activates the server function. It is possible to reduce the possibility of interruption of service reception by changing the communication device to be activated.

本発明の請求項7にかかる通信装置は、請求項1に記載のサーバ機能を有する通信装置であって、サーバ機能切り替え手段は、自身のサーバ機能を無効化する場合、サーバ機能を交代する他の通信装置に自身がサービスを提供している通信装置の情報を送信する。   A communication device according to a seventh aspect of the present invention is the communication device having the server function according to the first aspect, wherein the server function switching means replaces the server function when invalidating its own server function. The information of the communication device that is providing the service is transmitted to the other communication device.

本構成によって、サービスを提供していた通信装置がサーバ機能が交代したことを検知できずサービスが受給不能となっている場合に、交代したサーバ機能を有効にした通信装置からサービスを提供していた通信装置に対してサービス提供を試みることが可能となる。   With this configuration, if the communication device that provided the service cannot detect that the server function has changed and the service cannot be received, the service is provided from the communication device that has enabled the replaced server function. It is possible to try to provide services to the communication apparatus.

本発明の請求項8にかかる通信装置は、請求項1に記載のサーバ機能を有する通信装置であって、サーバ機能切り替え手段は、前記サーバ機能適正判断手段が自身はサーバ機能を有効にするべき通信装置であると判断した場合に、サーバ機能発見手段が発見したサーバ機能を有する他の通信装置に、サーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し、自身のサーバ機能が有効化されていなければ自身のサーバ機能を有効化し、サーバ機能適正判断手段が自身はサーバ機能を無効にするべき通信装置であると判断した場合に、自身のサーバ機能が有効化されていれば、サーバ機能発見手段が発見したサーバ機能を有する他の通信装置に、サーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し、自身のサーバ機能を無効化する。   A communication apparatus according to an eighth aspect of the present invention is the communication apparatus having the server function according to the first aspect, wherein the server function switching means should enable the server function by itself. When it is determined that the server is a communication device, a server function switching message for instructing the server function to be invalidated is transmitted to another communication device having the server function discovered by the server function discovery means, and the server function is activated. If the server function is not enabled, the server function is enabled. If the server function appropriateness determining means determines that the server function is a communication device that should disable the server function, the server function is enabled. A server function switching message instructing the activation of the server function is transmitted to another communication device having the server function discovered by the function discovery means, and its own server To disable the function.

本構成によって、自身でサーバ機能の有効及び無効を切り替えるだけでなく、他のサーバ機能付き通信装置にサーバ機能の有効及び無効の切り替えを指示することが可能となる。   With this configuration, it is possible not only to switch the validity / invalidity of the server function by itself, but also to instruct other communication apparatuses with a server function to switch the validity / invalidity of the server function.

本発明の請求項9にかかる通信装置は、請求項1に記載のサーバ機能を有する通信装置であって、サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する下位サブネットワーク存在判断手段をさらに備え、下位サブネットワーク存在判断手段は、他の通信装置から受信するネットワーク構成変更通知メッセージを用いるか、または、ローカルネットワーク内の他の通信装置から受信するパケットに含まれる情報を用いて、サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断し、サーバ機能適正判断手段は、下位サブネットワーク存在判断手段の結果によりサーバ機能を有効にする通信装置を判断する。   A communication device according to claim 9 of the present invention is the communication device having the server function according to claim 1, wherein a plurality of different routers are connected in parallel below the router to which the communication device having the server function belongs. Lower subnetwork presence determination means for determining whether or not the lower subnetwork presence determination means uses a network configuration change notification message received from another communication device or from another communication device in the local network. The information contained in the received packet is used to determine that a plurality of different routers are connected in parallel below the router to which the communication device having the server function belongs. The communication device that validates the server function is determined based on the result of the determination means.

本構成によって、通信不可能な状態が発生した場合にのみサーバ機能を有効にした通信装置を交代させて通信不可な状態を回避させることができ、サービスを提供されている各通信装置がサーバ機能を有効化している通信装置とのセッションを張りなおす回数を削減でき、また、サーバ機能を有効にした通信装置をできるだけ変更させたくない場合などにも対応可能である。   With this configuration, it is possible to avoid the communication disabled state by replacing the communication device with the server function enabled only when the communication disabled state occurs, and each communication device provided with the service functions as a server function. It is possible to reduce the number of times of re-establishing a session with a communication apparatus that has enabled the server, and it is also possible to cope with a case where it is not desired to change the communication apparatus in which the server function is enabled as much as possible.

本発明の請求項10にかかる通信装置は、請求項9に記載のサーバ機能を有する通信装置であって、ローカルネットワーク内の他の通信装置から受信するパケットには、ローカルネットワーク内の他の通信装置が接続されたルータを識別可能な情報が含まれ、下位サブネットワーク存在判断手段は、少なくともローカルネットワーク内の他の通信装置から受信するパケットに含まれるルータを識別可能な情報を比較することで、サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する。   A communication device according to a tenth aspect of the present invention is the communication device having the server function according to the ninth aspect, wherein a packet received from another communication device in the local network includes other communication in the local network. Information that can identify the router to which the device is connected is included, and the sub-network existence determination means compares at least information that can identify the router included in a packet received from another communication device in the local network. Then, it is determined that a plurality of different routers are connected in parallel below the router to which the communication device having the server function belongs.

本構成によって、サーバ機能を有する通信装置自身で、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを判断できる。   With this configuration, the communication device itself having the server function can determine that a plurality of different routers are connected in parallel below the router to which the communication device belongs.

本発明の請求項11にかかる通信装置は、請求項10に記載のサーバ機能を有する通信装置であって、下位サブネットワーク存在判断手段は、サーバ機能を有する通信装置が接続されたルータの識別情報と異なるルータの識別情報を含むパケットを複数受信し、かつ、受信した前記異なるルータの識別情報を含むパケットのIPヘッダに含まれる送信元アドレスが同一でない場合、サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する。   A communication apparatus according to an eleventh aspect of the present invention is the communication apparatus having the server function according to the tenth aspect, wherein the lower-layer sub-network existence determining means is identification information of a router to which the communication apparatus having the server function is connected. The router to which the communication device having the server function belongs is received when a plurality of packets including identification information of different routers are received and the source address included in the IP header of the received packet including identification information of the different routers is not the same Is determined that a plurality of different routers are connected in parallel.

本構成によって、サーバ機能を有する通信装置自身で、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを確実に判断できる。   With this configuration, the communication device itself having the server function can reliably determine that a plurality of different routers are connected in parallel below the router to which the communication device belongs.

本発明の請求項12にかかる通信装置は、請求項9に記載のサーバ機能を有する通信装置であって、サーバ機能適正判断手段は、サーバ機能発見手段が、外部ネットワークに接続するローカルネットワークにおいて、サーバ機能を有する他の通信装置を発見しなかった場合に、自身はサーバ機能を有効にするべき通信装置であると判断し、サーバ機能を有する他の通信装置を発見した場合に、自身はサーバ機能を無効にするべき通信装置である、と判断する。   A communication apparatus according to a twelfth aspect of the present invention is a communication apparatus having the server function according to the ninth aspect, wherein the server function appropriateness determining means is configured so that the server function finding means is in a local network connected to an external network. If no other communication device having the server function is found, the device determines that it is a communication device to enable the server function, and if it finds another communication device having the server function, It is determined that the communication device is to disable the function.

本構成によって、各通信装置がサービスを受給可能なネットワーク構成である限りはサーバ機能を有効化する通信装置を変更させないことが可能である。   With this configuration, as long as each communication device has a network configuration that can receive a service, it is possible not to change the communication device that validates the server function.

本発明の請求項13にかかる通信装置は、請求項9に記載のサーバ機能を有する通信装置であって、サーバ機能適正判断手段は、サーバ機能発見手段が、サーバ機能を有する通信装置が属するルータの下位に、サーバ機能を有効化したサーバ機能を有する他の通信装置を発見しており、かつ、下位サブネットワーク存在判断手段が、サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていると判断した場合に、サーバ機能を有効化する通信装置を変更すべきと判断する。   According to a thirteenth aspect of the present invention, there is provided a communication apparatus having the server function according to the ninth aspect, wherein the server function appropriateness determining means is a router to which the server function finding means belongs and the communication apparatus having the server function belongs. The lower sub-network existence determination means has found a plurality of different routers below the router to which the communication device having the server function belongs. Are determined to be connected in parallel, it is determined that the communication device that activates the server function should be changed.

本構成によって、各通信装置がサービスを受給不可能なネットワーク構成に変更された場合にのみ、各通信装置がサービスを受給可能なサーバ機能を有する通信装置にサーバ機能を交代させることが可能である。   With this configuration, only when each communication device is changed to a network configuration that cannot receive a service, it is possible to change the server function to a communication device having a server function that allows each communication device to receive a service. .

本発明の請求項14にかかる通信装置は、外部ネットワークに接続するローカルネットワークにおいて、前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、ローカルネットワークのいずれかのルータに接続され、記ローカルネットワーク内のサーバ機能を有する通信装置および、他の通信装置とメッセージ通信を行う通信装置であって、サーバ機能を有する通信装置が接続されたルータと外部ネットワークとの間に位置するルータの内1つ以上のルータについて、LAN側ネットワークに接続される通信装置に設定することが可能なアドレスの範囲に関する情報を得て、記憶する上位サブネットワーク存在判断手段と、通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する下位サブネットワーク存在判断手段を備え、ローカルネットワーク内の他の通信装置から受信するパケットには、前記ローカルネットワーク内の他の通信装置が接続されたルータを識別可能な情報が含まれ、下位サブネットワーク存在判断手段は、少なくとも前記ローカルネットワーク内の他の通信装置から受信するパケットに含まれる前記ルータを識別可能な情報を比較することで、通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する。   In a communication device according to a fourteenth aspect of the present invention, in a local network connected to an external network, one or more routers exist between the communication device in the local network and the external network. It is divided into one or more different sub-networks by one or more routers, is connected to any router in the local network, and has a server function in the local network and performs message communication with other communication devices. One or more of the routers located between the router to which the communication device having the server function is connected and the external network are set as communication devices connected to the LAN side network. Obtain and store information about the range of possible addresses Subnetwork presence determination means and lower subnetwork presence determination means for determining that a plurality of different routers are connected in parallel below the router to which the communication device belongs are received from other communication devices in the local network The packet includes information capable of identifying a router to which another communication device in the local network is connected, and the lower subnetwork existence determination means includes at least a packet received from another communication device in the local network. By comparing information that can identify the routers included, it is determined that a plurality of different routers are connected in parallel below the router to which the communication device belongs.

本構成によって、サーバ機能をもたない通信装置が自身が属するルータの下位に複数の異なるルータが並列に接続されていることを判断可能となる。   With this configuration, it is possible to determine that a plurality of different routers are connected in parallel below the router to which the communication device having no server function belongs.

本発明の請求項15にかかる通信装置は、請求項14に記載の通信装置であって、下位サブネットワーク存在判断手段は、サーバ機能を有する通信装置が接続されたルータの識別情報と異なるルータの識別情報を含むパケットを複数受信し、かつ、受信した前記異なるルータの識別情報を含むパケットのIPヘッダに含まれる送信元アドレスが同一でない場合、通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する。   A communication device according to claim 15 of the present invention is the communication device according to claim 14, wherein the lower subnetwork existence determination means is a router different from the identification information of the router to which the communication device having a server function is connected. When a plurality of packets including identification information are received and the source address included in the IP header of the received packet including the identification information of the different router is not the same, a plurality of different routers are located below the router to which the communication device belongs. Determine that they are connected in parallel.

本構成によって、サーバ機能をもたない通信装置自身で、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを判断できる。   With this configuration, it is possible for a communication device itself having no server function to determine that a plurality of different routers are connected in parallel below the router to which the communication device belongs.

本発明の請求項16にかかる通信装置は、請求項14に記載の通信装置であって、下位サブネットワーク存在判断手段は、通信装置が属するルータの下位に複数の異なるルータが並列に接続されていると判断した場合に、上位サブネットワーク存在判断手段が記憶した1つ以上の前記第1のネットワークのアドレス範囲の情報を用いて、通信装置が接続されたルータまたは、前記通信装置が接続されたルータと外部ネットワークとの間に存在する他のルータ(上位ルータ)に属するネットワークに対し、ネットワーク構成変更通知メッセージを送信する。   The communication device according to claim 16 of the present invention is the communication device according to claim 14, wherein the lower subnetwork existence determination means includes a plurality of different routers connected in parallel below the router to which the communication device belongs. When it is determined that there is a router connected to the communication device or the communication device is connected using information on one or more address ranges of the first network stored by the upper subnetwork presence determination means A network configuration change notification message is transmitted to a network belonging to another router (upper router) existing between the router and the external network.

本構成によって、上位サブネットワークに存在する他の通信装置に対し、該ネットワークより下位のネットワークにおいて複数の異なるルータが並列に接続されていることを通知することが可能となる。   With this configuration, it is possible to notify other communication apparatuses existing in the upper subnetwork that a plurality of different routers are connected in parallel in a network lower than the network.

本発明の請求項17にかかるサーバ機能交代方法は、外部ネットワークに接続するローカルネットワークにおいて、前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、ローカルネットワークのいずれかのルータに接続され、ローカルネットワーク内の他の通信装置にサービスを提供する機能(サーバ機能)を有する通信装置の交代方法であって、ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を発見するステップと、サーバ機能を有効にするべき通信装置を判断するステップと、サーバ機能の有効及び無効を切り替えるステップと、を備える。   In the server function switching method according to claim 17 of the present invention, in a local network connected to an external network, one or more routers exist between the communication device in the local network and the external network. A function (server function) that is divided into one or more different sub-networks by the one or more routers, is connected to any router of the local network, and provides services to other communication devices in the local network A method of replacing a communication device having a step of discovering another communication device having a server function existing in a local network, a step of determining a communication device in which the server function is to be enabled, And a step of switching invalidity.

本構成によって、ネットワーク上にサーバ機能を有する通信装置が複数台存在する場合に、サービスを供給する通信装置をより最適な通信装置に交代させることが可能となる。   With this configuration, when there are a plurality of communication devices having a server function on the network, it is possible to replace the communication device that supplies the service with a more optimal communication device.

本発明の請求項18にかかる通信システムは、外部ネットワークに接続するローカルネットワークにおいて、前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、ローカルネットワークのいずれかのルータに接続され、ローカルネットワーク内の他の通信装置にサービスを提供する機能(サーバ機能)を有する通信装置と、ローカルネットワークのいずれかのルータに接続され、前記ローカルネットワーク内のサーバ機能を有する通信装置および、他の通信装置とメッセージ通信を行う通信装置とを備え、サーバ機能を有する通信装置は、ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を発見するサーバ発見部と、サーバ機能を有効にする通信装置を判断するサーバ適正判断部と、サーバ機能の有効及び無効を切り替えるサーバ機能切り替え部と含む。   In the communication system according to claim 18 of the present invention, in a local network connected to an external network, one or more routers exist between the communication device in the local network and the external network, and the local network is the 1 Communication divided into one or more different sub-networks by one or more routers, connected to any router in the local network, and having a function (server function) for providing services to other communication devices in the local network A communication device connected to one of the routers of the local network and having a server function in the local network, and a communication device that performs message communication with another communication device, the communication device having a server function, Server machine in the local network To discover other communication devices having comprising a server discovery unit, a server proper determination unit that determines a communication device to enable a server function, a server function switching unit for switching the valid and invalid server functions.

本構成によって、ネットワーク上にサーバ機能を有する通信装置が複数台存在する場合に、サービスを供給する通信装置をより最適な通信装置に交代させることが可能となる。   With this configuration, when there are a plurality of communication devices having a server function on the network, it is possible to replace the communication device that supplies the service with a more optimal communication device.

本発明の通信機器によれば、ネットワーク構成が変化した際にサービスを供給する通信機器をより最適な通信機器に交代させることで、ネットワーク構成に依存せず機器同士の接続性を向上させることができる。   According to the communication device of the present invention, it is possible to improve connectivity between devices without depending on the network configuration by replacing the communication device that supplies the service when the network configuration changes with a more optimal communication device. it can.

以下本発明の実施の形態について、図面を参照しながら説明する。   Embodiments of the present invention will be described below with reference to the drawings.

(実施の形態1)
[サーバ交代方法の適用環境]
図1は、本発明の実施の形態1における宅内ネットワークの一構成例である。
(Embodiment 1)
[Applicable environment for server replacement method]
FIG. 1 is a configuration example of a home network according to Embodiment 1 of the present invention.

宅内ネットワーク2は、3台のルータ3a〜3cが接続され構成されており、ルータ3aがインターネット1に接続している最上位ルータになっている。各ルータには、サーバ機能を有したサーバ機能付き通信機器4a〜4cとサーバ機能を持たない通信機器5a〜5cが接続されている。この宅内ネットワーク2の構成は有線でも無線でもよい。各通信機器4a〜4c、5a〜5cは、ネットワークを通じて通信することが可能である。また、サーバ機能付き通信機器はユーザや他の通信機器に自身が持つサービスを提供する機能を備えている。サーバ機能付き通信機器の一例としては、他の通信機器からの要求によりコンテンツ一覧の情報を応答送信したり、他の通信機器から要求されたコンテンツの内容を送信したりするネットワーク対応のAVのレコーダや、通信機器からの要求や応答を別の通信機器へ中継する中継装置などが考えられる。なお、ここで述べたAVレコーダや中継装置は、通信機器の一例でありこれに限定するものではない。また、3台のルータで構成された宅内ネットワークの構成は一例であり、3台より少ないルータで構成されたネットワーク又は3台以上のルータで構成されたネットワークでも同様に適用可能である。   The home network 2 is configured by connecting three routers 3 a to 3 c, and the router 3 a is the highest router connected to the Internet 1. Each router is connected to communication devices 4a to 4c with server function having a server function and communication devices 5a to 5c not having a server function. The configuration of the home network 2 may be wired or wireless. Each of the communication devices 4a to 4c and 5a to 5c can communicate through a network. Further, the communication device with a server function has a function of providing a service possessed by itself to a user or another communication device. As an example of a communication device with a server function, a network-compatible AV recorder that transmits content list information in response to a request from another communication device, or transmits the content of a content requested from another communication device. Also, a relay device that relays a request or response from a communication device to another communication device can be considered. Note that the AV recorder and the relay device described here are examples of communication devices and are not limited thereto. The configuration of a home network composed of three routers is an example, and the present invention can be similarly applied to a network composed of fewer than three routers or a network composed of three or more routers.

ここで、本実施の形態ではサーバ機能付き通信機器4a〜4cが持つサーバ機能は、他の通信機器と間に通信路を確保して、メッセージの中継を行うことで異なるルータ配下に接続する通信機器間のメッセージ通信を可能とする中継機能として説明する。よって本実施の形態においては、サーバ機能を有効にしているサーバ機能付き通信機器と一度メッセージの送受信を行った後は、通信機器とサーバ機能付き通信機器とは通信路を保持し、通信機器はサーバ機能付き通信機器を介して、他の通信機器とルータを越えた通信を行うことが可能となる。   Here, in the present embodiment, the server functions of the server-equipped communication devices 4a to 4c are communication that establishes a communication path with other communication devices and relays messages to connect to different routers. A relay function that enables message communication between devices will be described. Therefore, in this embodiment, after a message is once transmitted / received to / from a communication device with a server function in which the server function is enabled, the communication device and the communication device with a server function maintain a communication path. It is possible to communicate with other communication devices beyond the router via the communication device with a server function.

図3は、本発明の実施の形態1における通信機器の基本的なハード構成の一例を示している。通信機器は、メインCPUとROM、RAM、ユーザI/OとネットワークI/Fで構成される。メインCPUは、他の通信機器とデータの送受信を行うための通信サービスと、通信機器がユーザや他の通信機器にその通信機器固有のサービスを提供するアプリケーションサービスに関する処理を行う。このメインCPUが行う処理実行時に、データやプログラムをROM、RAMから読み出し、RAMへの書き込みを実行する。そして、このとき、ユーザI/Oを通じて、ユーザからの入力受付やサービスに関する情報の表示等を実行する。また、ネットワークI/Fを通じて、宅内ネットワークの通信機器やルータとデータのやりとりを実行する。   FIG. 3 shows an example of a basic hardware configuration of the communication device according to Embodiment 1 of the present invention. The communication device includes a main CPU, ROM, RAM, user I / O, and network I / F. The main CPU performs processing related to a communication service for transmitting / receiving data to / from another communication device and an application service in which the communication device provides a service unique to the communication device to a user or another communication device. When the main CPU performs processing, data and programs are read from the ROM and RAM and written to the RAM. At this time, input from the user, display of information on the service, and the like are executed through the user I / O. In addition, data is exchanged with communication devices and routers in the home network through the network I / F.

ここで述べたアプリケーションサービスとは、前述のAVレコーダの例で言うと、コンテンツ一覧情報の提供やコンテンツデータの送信等のサービス等に該当する。また、通信サービスとは、通信相手の通信機器との間で情報のやりとりを行うための通信制御等に該当する。   The application service described here corresponds to a service such as provision of content list information and transmission of content data in the example of the AV recorder described above. The communication service corresponds to communication control for exchanging information with the communication device of the communication partner.

[サーバ機能付き通信機器の機能構成]
図4は、本発明の実施の形態1におけるサーバ機能付き通信機器4aの構成を示す機能ブロック図である。なお、本実施の形態における他のサーバ機能付き通信機器も同じ構成をとるものとする。
[Functional configuration of communication equipment with server function]
FIG. 4 is a functional block diagram showing the configuration of the communication device 4a with a server function in the first embodiment of the present invention. In addition, the other communication apparatus with a server function in this Embodiment shall also have the same structure.

図4において、サーバ機能付き通信機器4aは、通信I/F部400と、上位サブネットワーク判断部401と、記憶部402と、サーバ機能探索・応答部403とサーバ適正判断部404と、サーバ機能切り替え部405と、サーバ機能部/クライアント機能部406とを備えている。   In FIG. 4, the communication device with server function 4a includes a communication I / F unit 400, a higher-level subnetwork determination unit 401, a storage unit 402, a server function search / response unit 403, a server suitability determination unit 404, and a server function. A switching unit 405 and a server function unit / client function unit 406 are provided.

[通信I/F部]
通信I/F部400は、ネットワークI/Fを制御し、ネットワークからの情報の受信とネットワークへの情報の送信を実行する。
[Communication I / F part]
The communication I / F unit 400 controls the network I / F, and receives information from the network and transmits information to the network.

なお、通信I/F部400において通信に用いる自身のアドレス情報を管理し、下位のルータ配下の通信機器からサーバ機能を有効にした通信機器を発見しやすくするために、ネットワークで実際に設定可能なアドレスの内、ある決められたアドレス範囲内のアドレスを設定するアドレスの再設定処理を実行するようにしてもよい。このときアドレス情報として管理する情報の一例としては、自身のIPアドレス、ネットマスク、デフォルトゲートウエイアドレス等が考えられる。   In addition, the communication I / F unit 400 manages its own address information used for communication, and can be actually set on the network to make it easier to find communication devices with the server function enabled from communication devices under the lower router. Of these addresses, an address resetting process for setting an address within a predetermined address range may be executed. As an example of information managed as address information at this time, an own IP address, a netmask, a default gateway address, or the like can be considered.

[上位サブネットワーク判断部]
上位サブネットワーク判断部401は、上位サブネットワーク解析(後述)を実施し、自身が接続されているルータのより上位(インターネット側)に接続されたルータ配下のネットワーク情報を取得する。例えば、図1のルータ3bに接続されたサーバ機能付き通信機器4bの上位サブネットワーク判断部は、ルータ3a配下のネットワーク情報を取得する。上位サブネットワーク解析を簡単に記述すると、trace routeを用いて上位ルータのLAN側アドレスを取得、又はUPnP IGD使用を用いて自身が接続しているルータのWAN側アドレスを取得し、取得したアドレスを用いて上位サブネットワークのネットワークアドレスを特定することによって、上位ルータに接続される通信機器に設定可能なアドレスを推測する処理である。
[High-level subnetwork judgment unit]
The upper subnetwork determination unit 401 performs upper subnetwork analysis (described later), and acquires network information under the router connected to the higher level (Internet side) of the router to which the higher level subnetwork is determined. For example, the upper sub-network determining unit of the server-equipped communication device 4b connected to the router 3b in FIG. 1 acquires network information under the router 3a. When the upper subnetwork analysis is simply described, the LAN address of the upper router is obtained using trace route, or the WAN address of the router to which the router is connected is obtained using UPnP IGD, and the obtained address is This is a process of inferring an address that can be set for a communication device connected to the upper router by specifying the network address of the upper subnetwork.

上位サブネットワーク判断部401は上位サブネットワーク解析で取得した上位サブネットワーク情報を記憶部402に記憶する。上位サブネットワーク情報の一例としては、上位サブネットワークのネットワークアドレス情報があげられる。つまり、ルータ3a配下のネットワークアドレスが、192.168.1.0/24である場合、ルータ3bに接続されたサーバ機能付き通信機器4bの上位サブネットワーク情報には、192.168.1.0/24が記憶される。ここで、192.168.1.0はネットワークアドレスを示しており、/24はネットマスクのビット数を示している。同様に、ルータ3b配下のネットワークアドレスが192.168.2.0/24である場合、ルータ3cに接続されたサーバ機能付き通信機器4cの上位サブネットワーク情報には、192.168.1.0/24と192.168.2.0/24の2つのネットワークアドレスが記憶される。なお、ネットワークアドレスが分かれば、ホストアドレスの取り得る値が容易に類推できるため、そのネットワークに接続される通信機器に設定される可能性があるアドレスを容易に特定することが可能である。   The upper subnetwork determining unit 401 stores the upper subnetwork information acquired by the upper subnetwork analysis in the storage unit 402. An example of the upper subnetwork information is network address information of the upper subnetwork. That is, when the network address under the router 3a is 192.168.1.0/24, the upper subnetwork information of the communication device 4b with a server function connected to the router 3b is 192.168.1.0. / 24 is stored. Here, 192.168.1.0 indicates a network address, and / 24 indicates the number of bits of the netmask. Similarly, when the network address under the router 3b is 192.168.2.0/24, the upper subnetwork information of the communication device 4c with a server function connected to the router 3c is 192.168.1.0. / 24 and 192.168.2.0/24 are stored as two network addresses. If the network address is known, the possible values of the host address can be easily inferred, so that it is possible to easily identify an address that may be set in a communication device connected to the network.

[記憶部]
記憶部402は、上位サブネットワーク情報、ルータの識別情報、通信相手の通信機器の情報、現在サーバ機能を有効にしているサーバ機能付き通信機器の情報などを記憶する。
[Storage unit]
The storage unit 402 stores higher-level subnetwork information, router identification information, communication partner communication device information, information about a communication device with a server function that currently enables the server function, and the like.

[サーバ機能探索・応答部]
サーバ機能探索・応答部403は、記憶部402に記憶されている上位サブネットワーク情報を利用し、上位のルータに属するネットワーク上に”サーバ機能が有効である通信機器”が接続されていないかを探索する処理と、同位のルータに属するネットワーク上に”サーバ機能が有効である通信機器”が接続されていないかを探索する処理と、自身のサーバ機能が有効になっている場合、他の通信機器から受信したサーバ機能探索要求に対して応答を返信する機能を提供する機能である。このとき、探索処理によりサーバ機能が有効になっている他の通信機器を発見した場合は、その旨をサーバ適正判断部404に通知し、発見した通信機器の情報をサーバ機能切り替え部405に通知する。探索によりサーバ機能が有効になっている他の通信機器を発見できなかった場合は、その旨をサーバ適正判断部404に通知する。また、サーバ機能探索・応答部403は、他の通信機器からのサーバ機能探索要求の受信を常に待つ。他の通信機器からサーバ機能探索要求を受信した場合は、自身のサーバ機能が有効であればサーバ機能探索要求の応答を送信する。
[Server function search / response section]
The server function search / response unit 403 uses the upper subnetwork information stored in the storage unit 402 to check whether a “communication device having a valid server function” is connected to the network belonging to the upper router. Processing to search, processing to search for “communication equipment with server function enabled” connected to the network belonging to the peer router, and other communication when its own server function is enabled This is a function that provides a function of returning a response to a server function search request received from a device. At this time, when another communication device in which the server function is valid is found by the search processing, the server appropriateness determination unit 404 is notified to that effect, and information of the found communication device is notified to the server function switching unit 405. To do. If no other communication device in which the server function is valid can be found by the search, the server appropriateness determination unit 404 is notified accordingly. The server function search / response unit 403 always waits for reception of a server function search request from another communication device. When a server function search request is received from another communication device, a response to the server function search request is transmitted if the server function is valid.

[サーバ適正判断部]
サーバ適正判断部404は、サーバ機能を有効にするべき通信機器を判断する機能部である。サーバ適正判断部404は、サーバ機能探索・応答部403から、探索によりサーバ機能が有効になっている通信機器を発見した旨の通知を受けると上位サブネットワークまたは同位ネットワークにサーバ機能が有効になっている通信機器が存在すると判断する。また、探索によりサーバ機能が有効になっている通信機器を発見できなかった旨の通知を受けると上位サブネットワークまたは同位ネットワークにサーバ機能が有効になっている通信機器が存在しないと判断する。これは、家庭用ルータのNAPT機能やファイアウォール機能が妨げとなりWAN側に位置する通信機器からLAN側に位置する通信機器に対して通信を開始することができないことにより、自身を通信の開始者として通信可能な通信機器は、自身と同じネットワークに存在する通信機器、または自身に対しWAN側に位置する通信機器であると判断できるからである。よって、探索によりサーバ機能が有効である通信機器を発見した場合は発見した機器は上位サブネットワークまたは同位ネットワークに存在すると判断できる。また、WAN側に位置する通信機器から通信を開始してLAN側に位置する通信機器と通信することができないという問題は、LAN側に位置する通信機器からWAN側に位置する通信機器に通信を開始することで回避可能である。つまり、サーバ機能を有効にした通信機器を最上位サブネットワークに設置することで各通信機器はサーバ機能を有効にした通信機器に対してLAN側に位置することになり、自身を通信の開始者として通信することが可能となる。よって、サーバ機能探索・応答部403から探索によりサーバ機能が有効になっている通信機器を発見した旨の通知を受けると、発見した通信機器は上位サブネットワークまたは同位ネットワークに存在するため自身はサーバ機能を無効にするべき通信機器であると判断し、判断結果をサーバ機能切り替え部405に通知する。一方、探索によりサーバ機能が有効になっている通信機器を発見できなかった旨の通知を受けると、サーバ機能付き通信機器はネットワーク上に存在しない、もしくは下位サブネットワークに存在するため自身はサーバ機能を有効にするべき通信機器であると判断し、判断結果をサーバ機能切り替え部405に通知する。
[Server suitability determination section]
The server suitability determination unit 404 is a function unit that determines a communication device whose server function should be validated. When the server suitability determination unit 404 receives a notification from the server function search / response unit 403 that a communication device in which the server function is enabled by discovery is found, the server function is enabled in the upper subnetwork or peer network. It is determined that there is a communication device. Further, upon receiving a notification that a communication device with the server function enabled cannot be found by the search, it is determined that there is no communication device with the server function enabled in the upper subnetwork or peer network. This is because the NAPT function and firewall function of the home router are obstructed, and communication cannot be started from a communication device located on the WAN side to a communication device located on the LAN side. This is because the communicable communication device can be determined to be a communication device existing in the same network as itself or a communication device located on the WAN side with respect to itself. Therefore, when a communication device having an effective server function is found by searching, it can be determined that the found device exists in the upper subnetwork or the peer network. In addition, the problem that communication cannot be established from a communication device located on the WAN side and communication with a communication device located on the LAN side cannot be communicated from the communication device located on the LAN side to the communication device located on the WAN side. It can be avoided by starting. In other words, by installing a communication device with the server function enabled in the highest-level subnetwork, each communication device is positioned on the LAN side with respect to the communication device with the server function enabled. It becomes possible to communicate as. Therefore, when the server function search / response unit 403 receives a notification indicating that a communication device for which the server function is enabled by discovery is found, the discovered communication device exists in the upper subnetwork or peer network, so It is determined that the communication device is to disable the function, and the determination result is notified to the server function switching unit 405. On the other hand, when receiving a notification that the communication function with the server function enabled cannot be found by the search, the communication function with the server function does not exist on the network or exists in the lower subnetwork, so Is determined to be a communication device to be enabled, and the determination result is notified to the server function switching unit 405.

[サーバ機能切り替え部]
サーバ機能切り替え部405は、サーバ機能切り替えの指示を受けてサーバ機能部/クライアント機能部406の機能を切り替える機能部である。サーバ機能切り替えの指示としては、他のサーバ機能付き通信機器からのサーバ機能切り替えメッセージ、サーバ適正判断部404からの判断結果がある。サーバ機能切り替え部405は、サーバ機能を有効化する場合は、サーバ機能部/クライアント機能部406のサーバ機能部を有効化し、クライアント機能部を無効化する。一方、サーバ機能を無効化する場合は、サーバ機能部/クライアント機能部406のサーバ機能部を無効化し、クライアント機能部を有効化する。なお、本実施の形態の初期状態では、サーバ機能部/クライアント機能部406のサーバ機能部は無効化、クライアント機能部は有効化されているものとする。
[Server function switching section]
The server function switching unit 405 is a function unit that switches the function of the server function unit / client function unit 406 in response to an instruction to switch the server function. The server function switching instruction includes a server function switching message from another communication device with a server function and a determination result from the server suitability determination unit 404. When the server function is to be validated, the server function switching unit 405 validates the server function unit of the server function unit / client function unit 406 and invalidates the client function unit. On the other hand, when disabling the server function, the server function unit of the server function unit / client function unit 406 is disabled and the client function unit is enabled. In the initial state of the present embodiment, it is assumed that the server function unit / server function unit 406 of the server function unit / client function unit 406 is disabled and the client function unit is enabled.

また、サーバ機能を有効な状態から無効な状態へ切り替える場合は、切り替える前にサービスを提供している通信機器に対し交代するサーバ機能付き通信機器の情報を通知し、該情報をサーバ機能が有効になっている通信機器の情報として記憶部402に記憶する。サーバ機能を無効な状態から有効な状態へ切り替える場合は、有効化後自身の情報をサーバ機能が有効になっている通信機器の情報として記憶部402に記憶する。なお、交代するサーバ機能付き通信機器の情報は、サーバ機能探索・応答部403から通知されるか、他のサーバ機能付き通信機器からのサーバ機能切り替えメッセージから取得する。   In addition, when switching the server function from the valid state to the invalid state, before switching, the communication device with the server function is notified to the communication device providing the service, and the server function is valid. Is stored in the storage unit 402 as information on the communication device. When the server function is switched from the invalid state to the valid state, the information on the server function after the activation is stored in the storage unit 402 as information on the communication device in which the server function is valid. The information on the communication device with the server function to be replaced is notified from the server function search / response unit 403 or is acquired from the server function switching message from another communication device with the server function.

また、サーバ適正判断部404からの判断結果によりサーバ機能を切り替える場合は、サーバ機能を切り替える前に発見したサーバ機能付き通信機器に対しサーバ適正判断部404からの判断結果の指示をサーバ機能切り替えメッセージとして通知する。   In addition, when switching the server function based on the determination result from the server suitability determination unit 404, the server function switching message indicates the determination result instruction from the server suitability determination unit 404 to the communication device with server function discovered before switching the server function. Notify as.

[サーバ機能部/クライアント機能部]
サーバ機能部/クライアント機能部406は、他の通信機器にサービスを提供するサーバ機能と、サーバ機能が有効になっている通信機器と通信する(サービスを受ける)ためのクライアント機能部とからなり、サーバ機能切り替え部405により制御され、一方の機能が有効な場合は他方の機能は無効となるように制御される。
[Server Function / Client Function]
The server function unit / client function unit 406 includes a server function that provides a service to another communication device, and a client function unit that communicates (receives a service) with a communication device in which the server function is enabled. Control is performed by the server function switching unit 405 so that when one function is valid, the other function is invalidated.

サーバ機能部として機能する場合は、記憶部402に記憶されている他の通信機器の情報を用いて通信を行い、クライアント機能部として機能する場合は、記憶部402に記憶されているサーバ機能が有効になっている通信機器の情報を用いて該通信機器と通信する。   When functioning as a server function unit, communication is performed using information of other communication devices stored in the storage unit 402. When functioning as a client function unit, the server function stored in the storage unit 402 is Communication with the communication device is performed using information of the communication device that is enabled.

[サーバ機能付き通信機器の動作の概要]
以上のように構成されたサーバ機能付き通信機器4a〜4cの動作概要について、図6、図7、図8、図9、図10を用いて説明する。
[Overview of operation of communication equipment with server function]
An outline of the operation of the server-equipped communication devices 4 a to 4 c configured as described above will be described with reference to FIGS. 6, 7, 8, 9, and 10.

図6は本発明の実施の形態におけるサーバ機能付き通信機器の全体的な処理フローである。   FIG. 6 is an overall processing flow of the communication device with a server function in the embodiment of the present invention.

サーバ機能付き通信機器はメッセージを受信すると(ステップS600でYes)メッセージ受信処理(ステップS601)を、また、一定時間ごとにサーバ機能付き通信機器探索処理(ステップS603)を実行している。   When the communication device with a server function receives a message (Yes in step S600), the communication device search processing with a server function (step S603) is executed (step S601).

[サーバ機能付き通信機器探索処理]
図7は本発明の実施の形態1におけるサーバ機能付き通信機器のサーバ機能付き通信機器探索処理(ステップS603)の処理フローである。
[Communication device search processing with server function]
FIG. 7 is a processing flow of the communication device searching process with a server function (step S603) of the communication apparatus with a server function according to the first embodiment of the present invention.

まず、上位サブネットワーク判断部401が上位サブネットワーク解析(ステップS700、詳細は後述)を実施して、自身が接続されているルータのより上位(インターネット側)に接続されたルータ配下のネットワークアドレスの情報(上位サブネットワーク情報)を取得し、記憶部402に記憶する。そして、サーバ機能探索・応答部403が、上位サブネットワーク情報を利用して上位の各ルータに接続された”サーバ機能が有効である通信機器”のアドレスを推定し、サーバ機能探索要求をユニキャストで送信する(ステップS701)。また、同時に自身が属するルータ配下のネットワーク内にサーバ機能探索要求をマルチキャストまたはブロードキャスト送信する(ステップS701)。なお、上位サブネットワーク解析で上位にルータの存在を検知しなかった場合は、自身が属するルータ内にのみサーバ機能探索要求をマルチキャストまたはブロードキャスト送信する(ステップS701)。   First, the upper subnetwork determining unit 401 performs upper subnetwork analysis (step S700, details will be described later), and the network address under the router connected to the higher level (Internet side) of the router to which it is connected is determined. Information (upper subnetwork information) is acquired and stored in the storage unit 402. Then, the server function search / response unit 403 uses the upper subnetwork information to estimate the address of the “communication device in which the server function is valid” connected to each upper router, and unicasts the server function search request. (Step S701). At the same time, a server function search request is multicast or broadcasted within the network under the router to which it belongs (step S701). If the presence of the upper router is not detected in the upper subnetwork analysis, a server function search request is transmitted by multicast or broadcast only within the router to which it belongs (step S701).

例えば、図1のルータ3cに接続されたサーバ機能付き通信機器4cは、ルータ3a及びルータ3bのネットワークアドレス情報を元にして、ルータ3a及びルータ3bに接続された”サーバ機能が有効である通信機器”のアドレスを推定し、サーバ機能探索要求をユニキャスト送信する。なお、この”サーバ機能が有効である通信機器”のアドレスを推定する処理において、”サーバ機能が有効である通信機器”が特定のアドレス範囲を取るように制御される(アドレスの再設定処理を実行している)場合、候補となるアドレスにのみサーバ機能探索要求を送信する。この処理によって、ルータ3a及びルータ3cの有効なホストアドレス全体(例えば、クラスCのプライベートアドレス場合、192.168.x.1〜192.168.x.254)にサーバ機能索要求を送信する必要がなくなり、定められたアドレス範囲にだけ、サーバ機能探索要求を送信すればよくなる。結果として、処理の高速化、通信トラヒックの削減が可能となる。   For example, the communication device 4c with a server function connected to the router 3c in FIG. 1 is based on the network address information of the router 3a and the router 3b, and the “server function connected to the router 3a and the router 3b is effective. The device address is estimated and a server function search request is unicasted. In addition, in the process of estimating the address of the “communication device in which the server function is effective”, the “communication device in which the server function is effective” is controlled to take a specific address range (address reset processing is performed). In the case of execution), a server function search request is transmitted only to candidate addresses. With this processing, it is necessary to send a server function search request to all valid host addresses of the router 3a and the router 3c (for example, 192.168.x.1 to 192.168.x.254 in the case of a class C private address). Therefore, it is only necessary to send a server function search request to a predetermined address range. As a result, the processing speed can be increased and communication traffic can be reduced.

図12にサーバ機能探索要求の一例を示す。サーバ機能探索要求では、ボディ内のメッセージIDフィールドに本メッセージがサーバ機能探索要求であることを示すIDをセットする。また、送信元IDとして、送信元通信機器固有のIDを設定する。なお、サーバ機能探索要求送信元の通信機器がサーバ機能を有するか有さないかの情報は通信機器固有のIDに含めてもよいし、他のフィールドを用意してもよい。   FIG. 12 shows an example of a server function search request. In the server function search request, an ID indicating that this message is a server function search request is set in the message ID field in the body. Also, an ID unique to the transmission source communication device is set as the transmission source ID. Information indicating whether the communication device that is the server function search request transmission source has the server function may be included in the ID unique to the communication device, or another field may be prepared.

上位ルータに接続されたサーバ機能付き通信機器は、サーバ機能探索要求を受信すると、自身のサーバ機能が有効である場合にのみ、サーバ機能探索・応答部403がサーバ機能探索応答をサーバ機能探索要求の送信元アドレス(IPアドレス、ポート番号)宛てに送信する。サーバ機能探索応答のフォーマットの一例は、サーバ機能探索要求と同一である。但し、メッセージIDとしてはサーバ機能探索応答であることを示すID値がセットされる。   When the server function communication device connected to the upper router receives the server function search request, the server function search / response unit 403 sends the server function search response to the server function search request only when its server function is valid. To the source address (IP address, port number). An example of the format of the server function search response is the same as the server function search request. However, an ID value indicating a server function search response is set as the message ID.

ここで、一般にルータはLAN側ネットワークに接続された機器からWAN側ネットワークに接続された機器に通信を開始した場合、自動的にアドレス変換設定(NAPT設定)が実行され、WAN側のネットワークに接続された機器に送信される。そのため、WAN側ネットワークに接続された機器は、受信したパケットの送信元アドレス(IPアドレス、ポート番号)宛にパケットを送信することで、LAN側ネットワークに接続された機器と通信が可能である。このため、上記のようなサーバ機能探索要求パケットを上位のルータに接続された通信機器に向けて送信することにより、上位側のルータに接続された”サーバ機能が有効である通信機器”からの応答を受信することが可能となり、結果として”サーバ機能が有効である通信機器”を発見することができる。   Here, in general, when a router starts communication from a device connected to the LAN side network to a device connected to the WAN side network, address conversion setting (NAPT setting) is automatically executed and connected to the WAN side network. Sent to the connected device. Therefore, a device connected to the WAN side network can communicate with a device connected to the LAN side network by transmitting the packet to the source address (IP address, port number) of the received packet. For this reason, by transmitting the server function search request packet as described above to the communication device connected to the upper router, the “communication device having an effective server function” connected to the upper router is transmitted. A response can be received, and as a result, a “communication device in which the server function is effective” can be found.

次に、サーバ機能探索・応答部403がサーバ機能探索応答を受信できたかを判断する(ステップS702)。   Next, it is determined whether the server function search / response unit 403 has received the server function search response (step S702).

サーバ機能探索応答を受信できなかった場合は(ステップS702でNo)、サーバ適正判断部404において、上位サブネットワークまたは同位ネットワークにサーバ機能が有効である通信機器が存在しないため、自身はサーバ機能を有効にするべき通信機器であると判断する(ステップS703)。その後、サーバ機能がすでに有効であるかどうかを判断し(ステップS704)、すでに有効であれば(ステップS704でYes)処理を終了し、サーバ機能が有効でなければ(ステップS704でNo)、サーバ機能切り替え部405において適正判断によるサーバ機能切り替え処理を行う(ステップS705)。   If the server function search response has not been received (No in step S702), the server suitability determination unit 404 does not have a communication device in which the server function is valid in the higher-level subnetwork or peer network. It is determined that the communication device is to be validated (step S703). Thereafter, it is determined whether or not the server function is already valid (step S704). If it is already valid (Yes in step S704), the process is terminated, and if the server function is not valid (No in step S704), the server The function switching unit 405 performs server function switching processing based on appropriateness determination (step S705).

一方、サーバ機能探索応答を受信した場合は(ステップS702でYes)、サーバ適正判断部404において、発見したサーバ機能が有効である通信機器は上位サブネットワークまたは同位ネットワークに存在するため自身はサーバ機能を無効にするべき通信機器であると判断する(ステップS706)。その後、サーバ機能がすでに有効であるかどうかを判断し(ステップS707)、サーバ機能が有効でなければ(ステップS707でNo)処理を終了し、有効であれば(ステップS707でYes)サーバ機能切り替え部405において適正判断によるサーバ機能切り替え処理を行う(ステップS705)。   On the other hand, if the server function search response is received (Yes in step S702), the server suitability determination unit 404 finds that the communication device for which the found server function is valid exists in the upper subnetwork or the peer network, so that the server function itself Is determined to be a communication device to be invalidated (step S706). Thereafter, it is determined whether or not the server function is already valid (step S707). If the server function is not valid (No in step S707), the process is terminated, and if it is valid (Yes in step S707), the server function is switched. The server function switching process based on appropriateness determination is performed in the unit 405 (step S705).

[メッセージ受信処理]
図8は本発明の実施の形態1におけるサーバ機能付き通信機器のメッセージ受信処理(ステップS601)の処理フローである。
[Message reception processing]
FIG. 8 is a processing flow of message reception processing (step S601) of the communication device with server function according to the first embodiment of the present invention.

サーバ機能付き通信機器4aのサーバ機能探索・応答部403は、常に、下位のルータに接続された通信機器からのサーバ機能探索要求の受信(ステップS800)、およびサーバ機能付き通信機器からのサーバ機能切り替えメッセージの受信(ステップS803)を待っている。下位のルータに接続された通信機器からのサーバ機能探索要求を受信すると(ステップS800でYes)、自身のサーバ機能が有効であるかどうかを判断し(ステップS801)、有効であれば(ステップS801でYes)サーバ機能探索要求の応答を送信する(ステップS802)。サーバ機能が有効でなければ(ステップS801でNo)処理を終了する。   The server function search / response unit 403 of the communication device with server function 4a always receives the server function search request from the communication device connected to the lower router (step S800), and the server function from the communication device with server function. Waiting for reception of a switching message (step S803). When a server function search request is received from a communication device connected to a lower router (Yes in step S800), it is determined whether or not its own server function is valid (step S801), and if it is valid (step S801). Yes) A server function search request response is transmitted (step S802). If the server function is not valid (No in step S801), the process is terminated.

一方、受信したメッセージが他のサーバ機能付き通信機器からのサーバ機能探索要求ではなく(ステップS800でNo)サーバ機能切り替えメッセージであった場合は(ステップS808でYes)、サーバ機能切り替え部405においてメッセージ受信によるサーバの切り替え処理を行い(ステップS804)、処理を終了する。   On the other hand, when the received message is not a server function search request from another communication device with a server function (No in step S800) but a server function switching message (Yes in step S808), the server function switching unit 405 sends a message A server switching process by reception is performed (step S804), and the process ends.

サーバ機能探索要求もサーバ機能切り替えメッセージも受信しなかった場合は(ステップS800でNo、かつステップS803でNo)、その他のメッセージ受信処理を行い(ステップS805)、処理を終了する。   If neither a server function search request nor a server function switching message is received (No in step S800 and No in step S803), other message reception processing is performed (step S805), and the processing is terminated.

[メッセージ受信によるサーバ機能切り替え処理]
図9は、図8のステップS804におけるメッセージ受信によるサーバ機能切り替え処理を示す図である。
[Server function switching processing by message reception]
FIG. 9 is a diagram showing server function switching processing by message reception in step S804 of FIG.

サーバ機能切り替え処理のトリガとして、他のサーバ機能付き通信機器からサーバ機能の有効化を指示するサーバ機能切り替えメッセージを受信した場合(ステップS900でYes)、自身のサーバ機能が有効化されているかどうかを判断する(ステップS902)。有効化されていれば(ステップS902でYes)特に何もせず処理を終了し、自身のサーバ機能が有効化されていなければ(ステップS902でNo)サーバ機能部/クライアント機能部406のクライアント機能部を無効化・サーバ機能部を有効化して(ステップS903)処理を終了する。一方、他のサーバ機能付き通信機器からサーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信した場合は(ステップS900でNo、かつステップS901でYes)、自身のサーバ機能が有効化されているかどうかを判断する(ステップS904)。有効化されていなければ(ステップS904でNo)特に何もせず処理を終了し、自身のサーバ機能が有効化されていれば(ステップS904でYes)自身がサービスを提供している通信機器にサーバ機能を交代する他の通信機器の情報を送信し(ステップS905)、サーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS906)処理を終了する。   If a server function switching message for instructing activation of the server function is received from another communication device with a server function as a trigger for the server function switching process (Yes in step S900), whether or not the server function is enabled Is determined (step S902). If enabled (Yes in step S902), the process is terminated without doing anything, and if the server function is not enabled (No in step S902), the client function unit of the server function unit / client function unit 406 The server function unit is invalidated (step S903), and the process is terminated. On the other hand, if a server function switching message for instructing the server function to be disabled is received from another communication device with a server function (No in step S900 and Yes in step S901), is the server function enabled? It is determined whether or not (step S904). If it has not been activated (No in step S904), the process is terminated without doing anything, and if its own server function has been activated (Yes in step S904), the server is provided to the communication device that provides the service itself. Information on other communication devices whose functions are changed is transmitted (step S905), the server function unit of the server function unit / client function unit 406 is invalidated and the client function unit is validated (step S906), and the process is terminated.

[適性判断によるサーバ機能切り替え処理]
図10は、図7のステップS705における適性判断によるサーバ機能切り替え処理を示す図である。
[Server function switching processing based on suitability judgment]
FIG. 10 is a diagram showing server function switching processing based on suitability determination in step S705 of FIG.

サーバ機能切り替え処理のトリガとして、サーバ適正判断部404から自身はサーバ機能を有効にするべき通信機器である判断通知を受信すると(ステップS1000でYes)、探索により発見したサーバ機能付き通信機器にサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し(ステップS1005)、サーバ機能部/クライアント機能部406のクライアント機能部を無効化・サーバ機能部を有効化して(ステップS1006)処理を終了する。サーバ適正判断部404から自身はサーバ機能を無効にするべき通信機器である判断通知を受信すると(ステップS1000でNo、ステップS1001でYes)、探索により発見したサーバ機能付き通信機器にサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し(ステップS1002)、自身がサービスを提供している通信機器にサーバ機能を交代する他のサーバ機能付き通信機器の情報を送信し(ステップS1003)、サーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS1004)処理を終了する。   As a trigger for the server function switching process, when receiving a determination notification indicating that the server function is to be enabled by the server suitability determination unit 404 (Yes in step S1000), the server function communication device with the server function discovered by the search is sent to the server. A server function switching message for instructing the function invalidation is transmitted (step S1005), the client function unit of the server function unit / client function unit 406 is invalidated and the server function unit is validated (step S1006), and the process is terminated. . When the server appropriateness determination unit 404 receives a determination notification indicating that it is a communication device whose server function should be disabled (No in step S1000, Yes in step S1001), the server function is enabled for the communication device with the server function found by the search. The server function switching message for instructing to be transmitted is transmitted (step S1002), the information of the communication device with other server function that replaces the server function is transmitted to the communication device that provides the service (step S1003), and the server The server function unit of the function unit / client function unit 406 is invalidated and the client function unit is validated (step S1004), and the process ends.

[上位サブネットワーク解析処理]
次に、通信機器が実行する上位サブネットワーク解析処理について説明する。
[Upper subnetwork analysis processing]
Next, upper subnetwork analysis processing executed by the communication device will be described.

上位サブネットワーク解析処理は、“サーバ機能が有効である通信機器”を含めた各通信機器で実行される処理であり、自身が接続しているルータ配下のネットワークと、その上位側(すなわち、インターネット側)のルータ配下のネットワークのネットワークアドレスを取得する処理である。まず、自身が接続しているルータ配下のネットワークのネットワークアドレス情報は、通信I/F部400から取得する。   The upper sub-network analysis process is a process executed by each communication device including “communication device in which the server function is valid”. The network under the router to which it is connected and its upper side (that is, the Internet) This is a process of acquiring the network address of the network under the router on the side). First, network address information of a network under a router to which it is connected is acquired from the communication I / F unit 400.

そして、上位側のルータのネットワークアドレスを取得する処理の一例としては、特願2005−103059と同様の方法を用いることができる。ここでは、その概要を説明する。   As an example of processing for acquiring the network address of the upper router, the same method as in Japanese Patent Application No. 2005-103059 can be used. Here, the outline will be described.

上位サブネットワーク解析処理は、2つのステップからなる。最初のステップは、上位側ルータのネットワークアドレス情報を取得するために、宅内ネットワーク内の上位側ルータのアドレスを取得するステップである。そして、次のステップは、取得したルータのアドレスを用いて、そのルータのネットワークアドレス(又は、そのネットワークで有効なアドレスの範囲)を取得するステップである。   The upper subnetwork analysis process consists of two steps. The first step is a step of acquiring the address of the upper router in the home network in order to acquire the network address information of the upper router. The next step is a step of acquiring the network address of the router (or a range of addresses effective in the network) using the acquired address of the router.

ここでルータのネットワークアドレス(又は、そのネットワークで有効なアドレスの範囲)をそのネットワークのアドレス空間と呼ぶことにする。また、ルータのアドレス情報を用いて、このネットワークのアドレス空間を推定する処理をアドレス空間推定処理と呼ぶことにする。   Here, a network address of a router (or a range of addresses effective in the network) is referred to as an address space of the network. In addition, a process for estimating the address space of the network using the address information of the router is referred to as an address space estimation process.

この宅内ネットワーク内の上位側ルータのアドレスを取得する方法として、TTL(Time To Live)を変化させたパケットを用いてアドレスを取得する方法(trace routeと同様な方法)と、UPnP(Universal Plug and Play) IGD(Internet Gateway Device)仕様を用いてアドレスを取得する方法を利用することができる。   As a method of acquiring the address of the upper router in the home network, a method of acquiring an address using a packet in which TTL (Time To Live) is changed (a method similar to trace route), UPnP (Universal Plug and Play) A method of acquiring an address using an IGD (Internet Gateway Device) specification can be used.

(TTLを変化させたパケットを利用する方法)
まず、TTLを変化させたパケットを利用してルータのアドレスを取得する方法を説明する。図27は、宅内ネットワークの構成例である。図27において、宅内ネットワーク2及びインターネット1の異なる2つのネットワークが接続している。なお、宅内ネットワーク2は、ローカルネットワークであれば、家庭内のネットワークでなくても良い。図27に示すように、宅内ネットワーク2は、通信機器10と、ルータA20と、ルータB30と、ルータC40とを備える。ルータA20は、WAN側通信I/F2721と、LAN側通信I/F2722とを含む。ルータB30は、WAN側通信I/F2731と、LAN側通信I/F2732とを含む。ルータC40は、WAN側通信I/F2741と、LAN側通信I/F2742とを含む。なお、ルータA20、ルータB30、及びルータC40において、WAN側通信I/F及びLAN側通信I/F以外の構成の記載を省略している。
(Method of using packet with changed TTL)
First, a method of acquiring a router address using a packet whose TTL has been changed will be described. FIG. 27 is a configuration example of a home network. In FIG. 27, two different networks, the home network 2 and the Internet 1, are connected. The home network 2 may not be a home network as long as it is a local network. As shown in FIG. 27, the home network 2 includes a communication device 10, a router A20, a router B30, and a router C40. The router A20 includes a WAN side communication I / F 2721 and a LAN side communication I / F 2722. The router B30 includes a WAN side communication I / F 2731 and a LAN side communication I / F 2732. The router C40 includes a WAN side communication I / F 2741 and a LAN side communication I / F 2742. Note that in the router A20, the router B30, and the router C40, descriptions of configurations other than the WAN side communication I / F and the LAN side communication I / F are omitted.

ルータC40は、インターネット1のルータD50と接続することによって、宅内ネットワーク2とインターネット1とを接続するゲートウェイである。ルータC40において、WAN側通信I/F2741には、グローバルアドレスが割り当てられ、LAN側I/F2742には、プライベートアドレスが割り当てられる。ルータA20のWAN側通信I/F2721及びLAN側通信I/F2722と、ルータB30のWAN側通信I/F2731及びLAN側通信I/F2732とには、それぞれプライベートアドレスが割り当てられる。   The router C40 is a gateway that connects the home network 2 and the Internet 1 by connecting to the router D50 of the Internet 1. In the router C40, a global address is allocated to the WAN side communication I / F 2741, and a private address is allocated to the LAN side I / F 2742. Private addresses are assigned to the WAN side communication I / F 2721 and the LAN side communication I / F 2722 of the router A20, and the WAN side communication I / F 2731 and the LAN side communication I / F 2732 of the router B30, respectively.

図28は、通信機器10が行う、TTLを変化させたパケットを利用してルータのネットワークアドレス(又は、ルータ配下の端末が取ることが可能な有効なアドレスの範囲)を取得する処理を示すフローチャートである。通信機器10は、上位サブネットワーク解析処理を開始すると、TTLパケット送信処理を起動する(ステップS101)。ここで、起動したTTLパケット送信処理は、TTL応答パケット受信処理(ステップS102)などと並行して実行される。通信機器10は、TTLパケット送信処理の起動後、TTL応答パケットを受信したか否かを判断する(ステップS102)。TTL応答パケットを受信すると(ステップS102でYes)、通信機器10は、ルータを検出したと判断して、TTL応答パケットの受信処理を実行する(ステップS103)。TTL応答パケットは、具体的には、ICMP(Internet Control Message Protocol) TIME EXCEEDED MESSAGEである。ICMP TIME EXCEEDED MESSAGEとは、中継するパケットの生存時間(TTL:Time To Live)の超過によるパケットの破棄を、送信元に報告するメッセージである。   FIG. 28 is a flowchart showing a process performed by the communication device 10 to acquire a network address of a router (or a range of valid addresses that can be taken by a terminal under the router) using a packet whose TTL has been changed. It is. When starting the upper subnetwork analysis process, the communication device 10 activates the TTL packet transmission process (step S101). Here, the activated TTL packet transmission processing is executed in parallel with the TTL response packet reception processing (step S102). After starting the TTL packet transmission process, the communication device 10 determines whether or not a TTL response packet has been received (step S102). When receiving the TTL response packet (Yes in step S102), the communication device 10 determines that a router has been detected, and executes a TTL response packet reception process (step S103). More specifically, the TTL response packet is ICMP (Internet Control Message Protocol) TIME EXCEEDED MESSAGE. The ICMP TIME EXCEEDED MESSAGE is a message that reports to the transmission source that the packet is discarded due to the surviving time (TTL: Time To Live) of the packet to be relayed.

通信機器10は、TTL応答パケットの送信元アドレスが、グローバルアドレスであるか否か判断する(ステップS104)。TTL応答パケットの送信元アドレスがグローバルアドレスでない場合(ステップS104でNo)、第1の通信機器10は、アドレス空間推定処理を実行する(ステップS105)。TTL応答パケットの送信元アドレスがグローバルアドレスであった場合(ステップS104でYes)、第1の通信機器10は、TTLパケット送信処理を中止する(ステップS107)。   The communication device 10 determines whether or not the transmission source address of the TTL response packet is a global address (step S104). When the transmission source address of the TTL response packet is not a global address (No in step S104), the first communication device 10 executes an address space estimation process (step S105). When the transmission source address of the TTL response packet is a global address (Yes in step S104), the first communication device 10 stops the TTL packet transmission process (step S107).

通信機器10は、送信したTTLパケットに対するTTL応答パケットを全て受信したか否かを判断する(ステップS108)。全て受信した場合(ステップS108でYes)、第1の通信機器10は、図28に示すアドレス空間の推定処理を終了する。全て受信していない場合(ステップS108でNo)、第1の通信機器10は、ステップS102に戻り、TTL応答パケットの受信待機状態となる。送信したTTLパケットに対するTTL応答パケットを全て受信するまで、受信処理を継続する理由は、TTLパケットを送信した順にTTL応答パケットを受信するとは限らないためである。なお、送信元アドレスがグローバルアドレスであったTTL応答パケットに対応するTTLパケットにおいて、設定したTTL値をTTLgとすると、TTLg以下のTTL値のTTLパケットに対するTTL応答パケットを全て受信した場合、TTL応答パケットを全て受信したと判断してもよい。   The communication device 10 determines whether or not all TTL response packets for the transmitted TTL packet have been received (step S108). If all have been received (Yes in step S108), the first communication device 10 ends the address space estimation processing shown in FIG. If not all have been received (No in step S108), the first communication device 10 returns to step S102 and enters a TTL response packet reception standby state. The reason for continuing the reception process until all the TTL response packets for the transmitted TTL packet are received is that the TTL response packets are not necessarily received in the order in which the TTL packets are transmitted. In the TTL packet corresponding to the TTL response packet whose source address is the global address, if the set TTL value is TTLg, the TTL response is received when all the TTL response packets for the TTL packet having a TTL value equal to or less than TTLg are received. It may be determined that all packets have been received.

図29〜図31を用いて、TTLパケット送信処理の詳細を説明する。図29は、TTLパケット送信処理のフローチャートである。図30は、TTLパケットの送信にUDP(User Datagram Protocol)を用いる場合の、TTLパケットの構成を示す図である。図31は、TTLパケットにおける、TTLと宛先ポート番号との対応関係の一例を示す図である。   Details of the TTL packet transmission processing will be described with reference to FIGS. FIG. 29 is a flowchart of TTL packet transmission processing. FIG. 30 is a diagram illustrating a configuration of a TTL packet when UDP (User Datagram Protocol) is used for transmission of the TTL packet. FIG. 31 is a diagram illustrating an example of a correspondence relationship between a TTL and a destination port number in a TTL packet.

図29を用いて、TTLパケット送信処理を説明する。通信機器10は、TTLパケットの作成の続行をするか否かを確認する(ステップS111)。このTTLパケット作成続行かの判断は、後で記述するTTLパケット応答受信で、送信元がグローバルアドレスの応答パケットを受信したかで判断する。グローバルアドレスの応答を受信している場合、パケット続行を中止と判断し(ステップS111でNo)、グローバルアドレスの応答を受信していない場合、続行と判断する(ステップS111でYes)。   The TTL packet transmission process will be described with reference to FIG. The communication device 10 confirms whether or not to continue the creation of the TTL packet (step S111). The determination as to whether or not the TTL packet creation is continued is made based on whether or not the transmission source has received a response packet of the global address in the reception of a TTL packet response described later. If the response of the global address is received, it is determined that the packet continuation is to be stopped (No in step S111), and if the response of the global address is not received, it is determined to continue (Yes in step S111).

TTLパケット作成の中止と判断する場合、TTLパケット送信処理を終了する。TTLパケット作成の続行と判断した場合、TTLと宛先ポート番号とを、1つずつインクリメントしたTTLパケットを作成する(ステップS112)。上位サブネットワーク判断部401は、通信I/F部400を介して、作成したTTLパケットを送信する(ステップS113)。なお、上位サブネットワーク判断部401は、送信したTTLパケットに対応するTTL応答パケットの受信を待つことなく、TTLをインクリメントした次のTTLパケットを送信してもよい。この場合、通信機器10は、複数のTTLパケットを同時に送信できるため、高速にルータを検出することが可能となる。また、TTLパケットは、インターネット上の特定のグローバルアドレス宛(例えば、ルータD50のLAN側I/F501、あるいはインターネット上の特定サーバのアドレス(例えば、panasonic.comなど)に向けて送信してもよい。   When it is determined that the TTL packet creation is to be stopped, the TTL packet transmission process is terminated. If it is determined that the TTL packet creation is to be continued, a TTL packet is created by incrementing the TTL and the destination port number by one (step S112). The upper subnetwork determining unit 401 transmits the created TTL packet via the communication I / F unit 400 (step S113). Note that the upper subnetwork determining unit 401 may transmit the next TTL packet incremented by TTL without waiting for the reception of the TTL response packet corresponding to the transmitted TTL packet. In this case, since the communication device 10 can transmit a plurality of TTL packets at the same time, the router can be detected at high speed. The TTL packet may be transmitted to a specific global address on the Internet (for example, the LAN side I / F 501 of the router D50 or a specific server address on the Internet (for example, panasonic.com)). .

上位サブネットワーク判断部401は、図31に示すように、IPヘッダのTTLフィールドの値を1からインクリメントするとともに、UDPヘッダの宛先ポート番号フィールドを10001からインクリメントしながら、TTLパケットを作成する。宛先ポート番号は、図31に示す例に限られず、他のポート番号でもよい。宛先ポート番号は、宛先ポート番号からTTLが一意に判別できればよい。   As shown in FIG. 31, the upper subnetwork determining unit 401 creates a TTL packet while incrementing the value of the TTL field of the IP header from 1 and incrementing the destination port number field of the UDP header from 10001. The destination port number is not limited to the example shown in FIG. 31, and may be another port number. The destination port number only needs to be able to uniquely determine the TTL from the destination port number.

また、TTLパケットは図30のようなUDPを用いた例に限られず、例えば、図32に示すICMPを用いてもよい。この場合、図33に示すようにIPヘッダのTTLとシーケンス番号を対応付ける方法が利用できる。   Further, the TTL packet is not limited to the example using UDP as shown in FIG. 30, and for example, ICMP shown in FIG. 32 may be used. In this case, as shown in FIG. 33, a method of associating the TTL of the IP header with the sequence number can be used.

図27、図34を用いて、TTL応答パケットの受信処理を説明する。図27は、TTLパケットと、TTL応答パケットとの対応を示している。図34は、TTL応答パケットの一例を示す図である。   TTL response packet reception processing will be described with reference to FIGS. FIG. 27 shows the correspondence between TTL packets and TTL response packets. FIG. 34 is a diagram illustrating an example of a TTL response packet.

図27において、ルータA20、ルータB30、ルータC40、及びルータD50は、それぞれのLAN側通信I/Fで受信したTTLパケットを、TTL値を1だけ引いてWAN側のルータに送信する。それぞれのルータは、TTL値を1引いて、TTL=0となった場合、TTLパケットをWAN側のルータに送信せずに廃棄する。そして、それぞれのルータは、TTL値が原因であるパケットの廃棄が発生したことを示すために、TTL応答パケットをTTLパケットの送信元へ送信する。図34に示すTTL応答パケットのデータ部には、廃棄したルータディスカバリ用パケットのIPヘッダと、それに続くUDPヘッダを含む64ビットのデータが付加される。   In FIG. 27, a router A20, a router B30, a router C40, and a router D50 transmit the TTL packet received by each LAN side communication I / F to the WAN side router by subtracting the TTL value by one. Each router decrements the TTL value by 1 and discards the TTL packet without transmitting it to the router on the WAN side when TTL = 0. Then, each router transmits a TTL response packet to the transmission source of the TTL packet to indicate that the packet discard due to the TTL value has occurred. In the data portion of the TTL response packet shown in FIG. 34, 64-bit data including the discarded router discovery packet IP header and the subsequent UDP header is added.

通信機器10が、TTL=1に設定したTTLパケットを、インターネット1上の特定のIPアドレスに向けて送信した場合を考える。TTL=1のTTLパケットは、ルータA20のLAN側I/F2722で受信される。TTL=1に設定したTTLパケットは、WAN側I/F2721から送信される前に、TTL=0となる。このため、ルータA20は、TTL=1のTTLパケットは廃棄する。ルータA20は、TTL=1のTTLパケットを廃棄したことを通知するために、TTL応答パケットを第1の通信機器10に送信する。このとき、TTL応答パケットの送信元IPアドレス(以下、送信元アドレスという)は、ルータA20のLAN側通信I/F2722のIPアドレスとなる(以下、各ルータのLAN側通信I/FのIPアドレスを、各ルータのLAN側アドレスという)。第1の通信機器10は、TTL応答パケットの送信元アドレスを確認することによって、ルータA20のLAN側アドレスを知ることが可能となる。   Consider a case in which the communication device 10 transmits a TTL packet set to TTL = 1 toward a specific IP address on the Internet 1. The TTL packet with TTL = 1 is received by the LAN side I / F 2722 of the router A20. The TTL packet set to TTL = 1 is set to TTL = 0 before being transmitted from the WAN I / F 2721. Therefore, the router A20 discards the TTL packet with TTL = 1. The router A 20 transmits a TTL response packet to the first communication device 10 in order to notify that the TTL packet with TTL = 1 has been discarded. At this time, the transmission source IP address of the TTL response packet (hereinafter referred to as the transmission source address) is the IP address of the LAN side communication I / F 2722 of the router A20 (hereinafter, the IP address of the LAN side communication I / F of each router). Is referred to as the LAN address of each router). The first communication device 10 can know the LAN address of the router A20 by confirming the transmission source address of the TTL response packet.

同様に、第1の通信機器10が、TTL=2に設定したTTLパケットを、インターネット上の特定のIPアドレスに向けて送信すると、ルータB30は、ルータB30自身のLAN側アドレスを送信元アドレスとしたTTL応答パケットを、通信機器10に送信する。また、通信機器10が、TTL=3に設定したTTLパケットを、インターネット上の特定のIPアドレスに向けて送信すると、ルータC40は、ルータC40自身のLAN側アドレスを送信元アドレスとしたTTL応答パケットを、通信機器10に送信する。このように、通信機器10は、TTLパケットに対応するTTL応答パケットを受信することで、それぞれのルータを検出するとともに、それぞれのルータのLAN側アドレスを取得することができる。第1の通信機器10は、自身とインターネット1との間に接続されているルータの接続順序に関する接続順序情報を取得することができる。   Similarly, when the first communication device 10 transmits a TTL packet set to TTL = 2 toward a specific IP address on the Internet, the router B30 uses the LAN address of the router B30 itself as the source address. The transmitted TTL response packet is transmitted to the communication device 10. Also, when the communication device 10 transmits a TTL packet set to TTL = 3 toward a specific IP address on the Internet, the router C40 uses a TTL response packet with the LAN side address of the router C40 itself as the transmission source address. Is transmitted to the communication device 10. In this way, the communication device 10 can detect each router and obtain the LAN side address of each router by receiving the TTL response packet corresponding to the TTL packet. The first communication device 10 can acquire connection order information related to the connection order of routers connected between itself and the Internet 1.

次に、通信機器10が行うアドレス空間の推定処理を説明する。ここで述べるアドレス空間推定処理とは、ルータ配下のネットワークに接続される端末に設定できるアドレスの範囲を推定する処理である。端末に設定できるアドレスの範囲は、すなわち、ホストアドレスの範囲に対応するため、これからネットワークアドレスを求めることが可能である。   Next, address space estimation processing performed by the communication device 10 will be described. The address space estimation process described here is a process for estimating a range of addresses that can be set in a terminal connected to a network under a router. Since the address range that can be set in the terminal corresponds to the host address range, the network address can be obtained from this range.

通信機器10は、TTL応答パケットの送信元アドレスがローカルアドレスであった場合に、TTL応答パケットの送信元ルータを対象として、TTL応答パケットに対応するTTLパケットで指定したTTL値を用いて、送信先アドレスを変化させたアドレス範囲推定パケットを送信する。例えば、ルータA20であればTTL値は1、ルータB30であれば、TTL値は2を用いることになる。   When the transmission source address of the TTL response packet is a local address, the communication device 10 transmits the transmission using the TTL value specified by the TTL packet corresponding to the TTL response packet, targeting the transmission source router of the TTL response packet. An address range estimation packet in which the destination address is changed is transmitted. For example, the router A20 uses a TTL value of 1, and the router B30 uses a TTL value of 2.

また、通信機器10は、TTL応答パケットから得られたルータのLAN側アドレスを基に、そのルータのアドレス空間を一次推測し記憶する。アドレス空間の一次推測の具体的な方法は、アドレス空間をクラスCのアドレスとして推測する方法が考えられる。例えば、ルータA20のLAN側アドレスが、192.168.0.1であれば、ルータA20のアドレス空間は、192.168.0.1〜192.168.0.254と推測できる。なお、得られたルータのLAN側アドレスが、クラスAまたはクラスBのプライベートアドレスである場合、得られたルータのアドレス空間が、それぞれのクラスに応じたアドレス空間であると一次推測してもよい。例えば、ルータA20のプライベートアドレスが10.1.0.130であった場合、そのルータのアドレス空間を10.0.0.1〜10.255.255.254であると一次推測する。また、10.1.0.1〜10.1.0.254(最下位8ビットだけを変化)又は10.1.0.129〜10.1.0.254(最下位7ビットだけを変化)などのように一次推測してもよい。   Also, the communication device 10 primarily estimates and stores the address space of the router based on the LAN address of the router obtained from the TTL response packet. As a specific method of the primary estimation of the address space, a method of estimating the address space as a class C address can be considered. For example, if the LAN address of the router A20 is 192.168.0.1, the address space of the router A20 can be estimated as 192.168.0.1 to 192.168.0.254. When the obtained router's LAN address is a class A or class B private address, it may be presumed that the obtained router's address space is an address space corresponding to each class. . For example, when the private address of the router A 20 is 10.1.0.130, the router presumes that the address space of the router is 10.0.0.1-10.255.255.254. Also, 10.1.0.1-10.0.2554 (only the least significant 8 bits are changed) or 10.1.0.129 to 10.1.0.254 (only the least significant 7 bits are changed) ) Or the like.

通信機器10は、アドレス空間を一次推測する際に、少なくとも得られたルータのLAN側アドレスが含まれるように得られたルータのアドレス空間を一次推測して記憶する。そして、上位サブネットワーク判断部401は、記憶したアドレス空間のアドレスを順に送信先として指定し、アドレス範囲推定パケットを送信する。このとき、得られたルータのLAN側アドレスは必ず一次推測したアドレス空間に含まれていると考えることができるので、通信機器10は、得られたルータのLAN側アドレスにアドレス範囲推定パケットを送信しなくてもよい。   When the communication device 10 primarily estimates the address space, the communication device 10 primarily stores and stores the obtained router address space so that the LAN address of the obtained router is included. Then, the upper subnetwork determining unit 401 sequentially designates the addresses in the stored address space as a transmission destination, and transmits an address range estimation packet. At this time, it can be considered that the obtained LAN address of the router is always included in the primary estimated address space, so the communication device 10 transmits an address range estimation packet to the obtained router LAN address. You don't have to.

アドレス範囲推定パケットとは、通信機器10が、対象となるルータのアドレス空間として推定したアドレス空間が、対象ルータのアドレス空間であるか否かを確認するためのパケットである。アドレス範囲推定パケットは、図30に示すUDPパケットまたは、図32に示すICMPパケットを用いる。TTLパケットとアドレス範囲推定パケットとの相違点は、TTLパケットの送信先アドレスが、インターネット上の特定のアドレスであるのに対し、アドレス範囲推定パケットの送信先アドレスが、対象ルータのアドレス空間内と思われるローカルアドレスである点である。   The address range estimation packet is a packet for confirming whether or not the address space estimated by the communication device 10 as the address space of the target router is the address space of the target router. As the address range estimation packet, the UDP packet shown in FIG. 30 or the ICMP packet shown in FIG. 32 is used. The difference between the TTL packet and the address range estimation packet is that the destination address of the TTL packet is a specific address on the Internet, whereas the destination address of the address range estimation packet is different from the address space of the target router. This is a possible local address.

また、通信I/F部400において、TTL応答パケットと、アドレス範囲推定パケットの応答であるICMP TIME EXCEEDED MESSAGEとを識別可能とするために、通信機器10は、図30に示すUDPパケットを用いる場合、TTLパケットで使用しないポート番号を指定したUDPパケットを、アドレス範囲推定パケットとして送信する。この結果、アドレス範囲推定パケットの応答であるICMP TIME EXCEEDED MESSAGEのデータ部には、アドレス範囲推定パケットで指定したポート番号が含まれることになる。このように、通信機器10は、ポート番号を参照することによって、TTL応答パケットと、アドレス範囲推定パケットの応答であるICMP TIME EXCEEDED MESSAGEとを識別することができる。同様に、アドレス範囲推定パケットとしてICMPを使用する場合、シーケンス番号等にTTLパケットでは使用しない値を設定する。なお、アドレス範囲推定パケットの応答を用いたルータのアドレス空間の推定方法は後述する。   Further, in the communication I / F unit 400, the communication device 10 uses the UDP packet shown in FIG. 30 so that the TTL response packet and the ICMP TIME EXCEEDED MESSAGE that is the response of the address range estimation packet can be identified. The UDP packet specifying the port number not used in the TTL packet is transmitted as an address range estimation packet. As a result, the port number specified by the address range estimation packet is included in the data portion of ICMP TIME EXCEEDED MESSAGE which is a response to the address range estimation packet. In this way, the communication device 10 can identify the TTL response packet and the ICMP TIME EXCEEDED MESSAGE that is a response to the address range estimation packet by referring to the port number. Similarly, when ICMP is used as the address range estimation packet, a value not used in the TTL packet is set for the sequence number and the like. A router address space estimation method using the address range estimation packet response will be described later.

アドレス範囲推定パケットに対する応答があった場合、通信機器10は、応答がICMP TIME EXCEEDED MESSAGEであるか否かを判定する。応答がICMP TIME EXCEEDED MESSAGEでない場合、アドレス範囲推定パケットの送信先アドレスが、ルータのアドレス空間内であると判定する。そして、通信機器10は、判定結果に基づきルータのアドレス空間の推定情報を更新して記憶する。   When there is a response to the address range estimation packet, the communication device 10 determines whether the response is ICMP TIME EXCEEDED MESSAGE. If the response is not ICMP TIME EXCEEDED MESSAGE, it is determined that the destination address of the address range estimation packet is within the address space of the router. Then, the communication device 10 updates and stores the estimated address space information of the router based on the determination result.

アドレス範囲推定パケットの応答としてICMP TIME EXCEEDED MESSAGEを受信することによって、アドレス範囲推定パケットの送信先が、ルータのアドレス空間の範囲外のアドレスと判断できる理由について説明する。アドレス範囲推定パケットは、ルータのLAN側アドレスを取得するために送信したTTLパケットと同一のTTL値を指定して送信される(例えば、ルータA20のアドレス空間を推測する場合、TTL値は1が指定される)。ルータのアドレス空間の範囲外のアドレスを指定してパケットを送信すると、ルータは、上位のルータにパケットを送信しようとする。このとき、TTL値の減算が実行され、TTL=0となるため、ルータはアドレス範囲推定パケットを廃棄し、ICMP TIME EXCEEDED MESSAGEを送信する。ゆえに、アドレス範囲推定パケットの応答としてICMP TIME EXCEEDED MESSAGEを受信すると、アドレス範囲推定パケットの送信先アドレスは、ルータのアドレス空間の範囲外であることがわかる。   The reason why the destination of the address range estimation packet can be determined as an address outside the range of the router address space by receiving ICMP TIME EXCEEDED MESSAGE as a response to the address range estimation packet will be described. The address range estimation packet is transmitted by designating the same TTL value as the TTL packet transmitted to acquire the router's LAN address (for example, when estimating the address space of the router A20, the TTL value is 1). It is specified). When a packet is transmitted by specifying an address outside the range of the router address space, the router attempts to transmit the packet to the upper router. At this time, since the TTL value is subtracted and TTL = 0, the router discards the address range estimation packet and transmits ICMP TIME EXCEEDED MESSAGE. Therefore, when ICMP TIME EXCEEDED MESSAGE is received as a response to the address range estimation packet, it is understood that the transmission destination address of the address range estimation packet is outside the range of the router address space.

なお、アドレス範囲推定パケットに対する応答がない場合も、通信機器10は、アドレス範囲推定パケットの送信先アドレスが対象ルータのアドレス空間内であると判定してよい。応答がICMP TIME EXCEEDED MESSAGEである場合、通信機器10は、アドレス範囲推定パケットの送信先アドレスが、ルータのアドレス空間外であると判定する。そして、通信機器10は、判定結果に基づきルータのLAN側アドレス空間の推定情報を更新して記憶する。その後、通信機器10は、アドレス空間の推定が終了したか否かを判定する。具体的には、アドレス空間は、アドレス範囲推定パケットの送信及びアドレス範囲推定パケットに対する応答を全て受信したか否かを確認する。終了していない場合、上位サブネットワーク判断部は、処理を続行する。終了と判断した場合、通信機器は、アドレス空間の推定処理を終了、すなわち、上位サブネットワーク解析を終了する。   Even if there is no response to the address range estimation packet, the communication device 10 may determine that the destination address of the address range estimation packet is within the address space of the target router. When the response is ICMP TIME EXCEEDED MESSAGE, the communication device 10 determines that the transmission destination address of the address range estimation packet is outside the address space of the router. And the communication apparatus 10 updates and memorize | stores the estimated information of the LAN side address space of a router based on the determination result. Thereafter, the communication device 10 determines whether or not the estimation of the address space has been completed. Specifically, the address space confirms whether or not all of the transmission of the address range estimation packet and the response to the address range estimation packet have been received. If not completed, the upper subnetwork determining unit continues the process. When it is determined that the communication has ended, the communication device ends the address space estimation process, that is, ends the upper subnetwork analysis.

なお、通信機器10は、アドレス空間内と判定されるアドレスと、アドレス空間外と判定されるアドレスとの境界のアドレスを検出した時に、アドレス空間の推定処理を終了してよい。これは、一般にルータのアドレス空間が、連続するアドレスで構成されるためである。例えば、192.268.2.2から順に(192.168.2.3、192.168.2.4、・・・)、通信機器10が送信先としてアドレス範囲推定パケットを送信した場合(192.168.2.1はルータのアドレスであり、必ずアドレス空間内であると分かっているため送信しない)、192.168.2.128で初めてアドレス空間の範囲外と判断された場合を説明する。この場合、アドレス空間が連続なら、192.168.2.128以降のアドレスは、全てアドレス空間の範囲外と判断されると予測することができる。このため、通信機器10は、192.168.2.128をアドレス空間の範囲外と判断した時点で、実際に一次推測したアドレス空間全体のアドレスにアドレス範囲推定パケットを送信せず、アドレス空間の判定処理を終了してよい。このとき、通信機器10が記憶するルータのアドレス空間情報は、判定結果に基づき更新される。   Note that the communication device 10 may end the address space estimation process when detecting an address at a boundary between an address determined to be within the address space and an address determined to be outside the address space. This is because the address space of the router is generally composed of continuous addresses. For example, when the communication device 10 transmits an address range estimation packet as a transmission destination in order from 192.268.2.2 (192.168.2.3, 192.168.2.4, ...) (192) .168.2.1 is the address of the router and is not transmitted because it is always known to be in the address space.) The case where it is first determined that the address space is out of range in 192.168.2.128 will be explained. . In this case, if the address space is continuous, it can be predicted that all addresses after 192.168.2.128 are determined to be outside the range of the address space. For this reason, when the communication device 10 determines that 192.168.2.128 is out of the range of the address space, the communication device 10 does not transmit the address range estimation packet to the address of the entire address space that is actually primarily estimated, The determination process may be terminated. At this time, the router address space information stored in the communication device 10 is updated based on the determination result.

(UPnP IGD仕様を利用する方法)
次に、UPnP IGD仕様を利用して、ルータのアドレスを取得する方法を説明する。
(Method using UPnP IGD specification)
Next, a method for acquiring a router address using the UPnP IGD specification will be described.

なお、ルータアドレスを取得した後に、アドレス空間の範囲を推定する処理については、TTLを変化させたパケットを利用する方法と同様である。   Note that, after obtaining the router address, the process of estimating the range of the address space is the same as the method of using the packet with the TTL changed.

TTLを変化させたパケットを利用する方法では、TTLを変化させたTTLパケットと、ICMP TIME EXCEEDED MESSAGEとを利用したTTL応答パケットとを用いて、宅内ネットワーク2に存在するルータの検出を行った。しかし、TTL処理を行わないルータや、ICMPパケットをフィルタリングするルータ等が市販されている。このため、TTLを変化させたパケットを利用する方法で説明した上位サブネットワーク解析処理が適用できないルータが存在する。UPnP IGD仕様を利用する方法では、この問題を解決するための上位サブネットワーク解析処理を説明する。   In the method of using the packet with the TTL changed, the router existing in the home network 2 is detected using the TTL packet with the TTL changed and the TTL response packet using the ICMP TIME EXCEEDED MESSAGE. However, routers that do not perform TTL processing, routers that filter ICMP packets, and the like are commercially available. For this reason, there is a router to which the upper subnetwork analysis process described in the method of using a packet with TTL changed cannot be applied. In the method using the UPnP IGD specification, an upper subnetwork analysis process for solving this problem will be described.

図35は、UPnP IGD仕様を利用する上位サブネットワーク解析処理が用いられるネットワークの一例を示す図である。図35において、宅内ネットワーク2は、通信機器10に代えて、第2の通信機器11を備える点が異なる。第2の通信機器11は、IGD仕様を利用する上位サブネットワーク解析処理を実行する通信端末である。第2の通信機器11(以下、単に通信機器11と記す)は、ルータA20、ルータB30、及びルータC40のLAN側アドレスの他に、それぞれのWAN側アドレスを取得する点が、通信機器10と異なる。   FIG. 35 is a diagram illustrating an example of a network in which the upper subnetwork analysis process using the UPnP IGD specification is used. In FIG. 35, the home network 2 is different from the communication device 10 in that a second communication device 11 is provided. The second communication device 11 is a communication terminal that executes an upper subnetwork analysis process that uses the IGD specifications. The second communication device 11 (hereinafter simply referred to as “communication device 11”) obtains each WAN side address in addition to the LAN side addresses of the router A20, the router B30, and the router C40. Different.

通信機器11の上位サブネットワーク解析処理の動作を説明する。通信機器11は、UPnP IGD(Internet Gateway Device)仕様などを用いて、自身が接続されているルータのLAN側アドレスを取得後、さらにWAN側アドレスを取得する。そして、通信機器11は、上位のルータのLAN側アドレスを取得しながら、上位のルータのアドレス空間の範囲の推定を行う。図35に示す例の場合、通信機器11が取得するアドレスの順序は、A→B→C→D→E→Fのようになる。   The operation of the upper subnetwork analysis process of the communication device 11 will be described. Using the UPnP IGD (Internet Gateway Device) specification or the like, the communication device 11 acquires the LAN address of the router to which it is connected, and further acquires the WAN address. Then, the communication device 11 estimates the range of the address space of the upper router while acquiring the LAN address of the upper router. In the example shown in FIG. 35, the order of addresses acquired by the communication device 11 is A → B → C → D → E → F.

図36を用いて、通信機器11が行うアドレス空間の推定処理を説明する。図36は、通信機器11が行う上位サブネットワーク解析処理を示すフローチャートである。図36に示す処理は、通信機器11は、自身が接続されたルータ(図35の場合、ルータA20)に対してUPnPのディスカバリメッセージである“M−SEARCH”を用いたルータディスカバリ用パケット(以下、推定ルータパケットという)をマルチキャスト送信する(ステップS201)。通信機器11は、送信した推定ルータパケットに対する応答パケット(以下、推定ルータ応答パケットという)を受信したか否かを判断する(ステップS202)。図37に、推定ルータパケットのデータ部の一例を示す。また、図38に推定ルータ応答パケットのデータ部の一例を示す。   The address space estimation process performed by the communication device 11 will be described with reference to FIG. FIG. 36 is a flowchart showing the upper subnetwork analysis process performed by the communication device 11. In the process shown in FIG. 36, the communication device 11 uses a router discovery packet (hereinafter referred to as “M-SEARCH”) that is a UPnP discovery message to the router to which it is connected (router A20 in the case of FIG. 35). , Which is referred to as an estimated router packet) (step S201). The communication device 11 determines whether or not a response packet to the transmitted estimated router packet (hereinafter referred to as an estimated router response packet) has been received (step S202). FIG. 37 shows an example of the data portion of the estimated router packet. FIG. 38 shows an example of the data portion of the estimated router response packet.

通信機器11は、推定ルータ応答パケットを受信した場合(ステップS202でYes)、推定ルータ応答パケットを解析して、送信元ルータのLAN側アドレスを取得する(ステップS203)。なお、通信機器11は、UPnPを使用しているため、推定ルータ応答パケットに含まれる情報から、デバイスディスクリプション及びサービスディスクリプションを取得する。これらの情報は、アクション送信のための情報として用いられる。そして、通信機器11は、推定ルータパケットの送信処理中止する(ステップS204)。通信機器11は、推定ルータ応答パケットの送信元のルータのWAN側アドレスを取得する(ステップS205)。   When the communication device 11 receives the estimated router response packet (Yes in step S202), the communication device 11 analyzes the estimated router response packet and acquires the LAN side address of the transmission source router (step S203). Note that since the communication device 11 uses UPnP, the device description and the service description are acquired from information included in the estimated router response packet. These pieces of information are used as information for action transmission. Then, the communication device 11 stops the estimated router packet transmission process (step S204). The communication device 11 acquires the WAN address of the router that is the source of the estimated router response packet (step S205).

ルータのWAN側アドレスを、UPnP IGD仕様を用いて取得する手順を説明する。推定ルータ応答パケットの送信元ルータのLAN側アドレスに対して、通信機器11は、GetExternalIPAddressアクションを送信する。図39は、GetExternalIPAddressアクションの一例を示す図である。GetExternalIPAddressアクションを受信したルータは、応答を第2の通信機器11に返信することよって、第2の通信機器11は、ルータのWAN側アドレスを取得する。図40は、GetExternalIPAddressアクションに対する応答の一例を示す図である。本応答において、ルータのLAN側アドレスは、<NewExternalIPAddress>タグで囲まれた部分にセットされる。そのため、通信機器11は、<NewExternalIPAddress>タグの値を取り出すことで、ルータのWAN側アドレスを取得することができる。なお、ルータは、通常、Webベースでのユーザインターフェースが実装されている。このため、通信機器11は、Webベースのユーザインターフェースを用いて、推定ルータ応答パケットの送信元ルータのWAN側アドレスを取得してもよい。具体的には、httpメッセージを推定ルータ応答パケットの送信元ルータに送信して、その応答を受信することによって、推定ルータ応答パケットの送信元ルータのWAN側アドレスを取得できる。   A procedure for acquiring the WAN address of the router using the UPnP IGD specification will be described. The communication device 11 transmits a GetExternalIPAddress action to the LAN address of the transmission source router of the estimated router response packet. FIG. 39 is a diagram illustrating an example of the GetExternalIPAddress action. The router that has received the GetExternalIPAddress action returns a response to the second communication device 11 so that the second communication device 11 obtains the WAN address of the router. FIG. 40 is a diagram illustrating an example of a response to the GetExternalIPAddress action. In this response, the LAN side address of the router is set in the part enclosed by the <NewExternalIPAddress> tag. Therefore, the communication device 11 can obtain the WAN address of the router by extracting the value of the <NewExternalIPAddress> tag. Note that a router usually has a web-based user interface. For this reason, the communication device 11 may acquire the WAN side address of the transmission source router of the estimated router response packet using a Web-based user interface. Specifically, the WAN address of the source router of the estimated router response packet can be obtained by transmitting an http message to the source router of the estimated router response packet and receiving the response.

通信機器11は、推定ルータ応答パケットの送信元ルータのWAN側アドレスが、ローカルアドレスであるか否かを確認する(ステップS206)。通信機器11は、取得したWAN側アドレスがグローバルアドレスである場合(ステップS206でNo)、推定ルータ応答パケットの送信元ルータの上位ルータがインターネット1上のルータであると特定する。すなわち、通信機器11は、宅内ネットワーク2の全てのルータの検出が完了したと推測して、処理を終了する。一方、通信機器11は、取得したWAN側アドレスがローカルアドレスである場合(ステップS206でYes)、推定ルータ応答パケットの送信元ルータの上位に、宅内ネットワーク2に属するルータが存在すると判断する。そして、再び、ルータのWAN側アドレス情報を用いて、推定ルータパケットの送信処理を行う(ステップS207)。この推定ルータパケットの送信処理については、後述する。   The communication device 11 checks whether or not the WAN address of the source router of the estimated router response packet is a local address (step S206). When the acquired WAN side address is a global address (No in step S206), the communication device 11 specifies that the upper router of the source router of the estimated router response packet is a router on the Internet 1. That is, the communication device 11 estimates that all the routers in the home network 2 have been detected and ends the process. On the other hand, when the acquired WAN address is a local address (Yes in step S206), the communication device 11 determines that there is a router belonging to the home network 2 above the source router of the estimated router response packet. Then, again using the WAN address information of the router, the estimated router packet is transmitted (step S207). The estimated router packet transmission process will be described later.

そして、推定ルータ応答パケットの送信元ルータの情報(LAN側アドレスやWAN側アドレスなど)を用いて、アドレス空間推定処理を実行する(ステップS208)。   Then, address space estimation processing is executed using information on the source router of the estimated router response packet (LAN side address, WAN side address, etc.) (step S208).

ここでのアドレス空間推定処理は、TTLを変化させたパケットを利用する場合とは若干異なり、通知されたWAN側アドレスを基に、上位ルータのアドレス空間を推測する。例えば、図35において、第2の通信機器11は、ルータB30のWAN側アドレスを取得すると、アドレス空間推定処理(ステップS208)が起動される。具体的には、上位サブネットワーク判断部は、ルータB30のWAN側アドレスを用いて、ルータC40のアドレス空間を一次推測し、推定したアドレス空間情報を記憶する。そして、上位サブネットワーク判断部は、実施の形態1と同様のアドレス範囲推定パケットを用いたアドレス空間推定を実行し、アドレス空間情報を更新する。TTLを変化させたパケットを利用する方法との違いは、アドレス空間に必ず含まれるアドレスが、推定対象のルータのLAN側アドレス(ルータC40のLAN側アドレス)ではなく、下位ルータのWAN側アドレス(ルータB30のWAN側アドレス)である点のみである。   The address space estimation process here is slightly different from the case of using a packet whose TTL is changed, and the address space of the upper router is estimated based on the notified WAN address. For example, in FIG. 35, when the second communication device 11 acquires the WAN address of the router B30, the address space estimation process (step S208) is activated. Specifically, the upper subnetwork determining unit primarily estimates the address space of the router C40 using the WAN side address of the router B30, and stores the estimated address space information. Then, the upper subnetwork determination unit performs address space estimation using the same address range estimation packet as in Embodiment 1, and updates the address space information. The difference from the method using the packet with the TTL changed is that the address always included in the address space is not the LAN address of the router to be estimated (the LAN address of the router C40), but the WAN address ( This is only the point that is the WAN side address of the router B30.

通信機器11が直接接続されたルータ(ルータA20)のWAN側アドレスを取得した場合、ルータA20のWAN側アドレスを用いて、上述のようにルータB30のアドレス空間を推定し、記憶する。それに加えて、通信機器11自身のIPアドレスとネットマスク情報とを用いて、ルータA20のLAN側アドレス情報を推測し、記憶する。   When the WAN address of the router (router A20) to which the communication device 11 is directly connected is acquired, the address space of the router B30 is estimated and stored using the WAN address of the router A20 as described above. In addition, the LAN address information of the router A20 is estimated and stored using the IP address and netmask information of the communication device 11 itself.

そして、再度推定ルータパケット送信処理を起動し、推定ルータ応答パケットを受信するため、ステップS202に戻る。   Then, the estimated router packet transmission process is started again, and the process returns to step S202 to receive the estimated router response packet.

図36に示すフローチャートを用いることによって、通信機器11は、自身に接続されているルータから上位のルータの存在を確認することができるため、宅内ネットワーク2のルータの接続順序情報を記憶することができる。   By using the flowchart shown in FIG. 36, the communication device 11 can confirm the presence of a higher-order router from the router connected to itself, and therefore can store connection order information of routers in the home network 2. it can.

なお、上記では、アドレス空間推定処理において、アドレス範囲推定パケットを用いたアドレス空間推定処理を実行するとして説明した。TTLを変化させたパケットを利用する方法と同様に、アドレス範囲推定パケットを用いたアドレス空間推定処理を実行せず、一次推測したアドレス空間情報を用いて、上位サブネットワーク解析処理を完了してもよい。   In the above description, the address space estimation process using the address range estimation packet is executed in the address space estimation process. Similar to the method of using a packet whose TTL is changed, the address space estimation process using the address range estimation packet is not executed, and the upper subnetwork analysis process is completed using the address space information estimated first. Good.

(推定ルータパケット送信処理)
なお、UPnPを用いて推定ルータパケットを送信処理おいて、推測した上位ルータのLAN側アドレスに対して、ユニキャストでM−SEARCHを送信するようにすることができる(UPnP Forumの規格上では、M−SEARCHはマルチキャストのみであるが、ほとんどのルータは、ユニキャストのM−SEARCHも受信可能としている)。
(Estimated router packet transmission processing)
In addition, it is possible to transmit the estimated router packet using UPnP and transmit M-SEARCH by unicast to the estimated LAN address of the upper router (in the UPnP Forum standard, M-SEARCH is only multicast, but most routers can also receive unicast M-SEARCH).

図41に、通信機器11が、推定ルータパケットの送信先として推測する上位ルータのLAN側アドレスの一例を示す。通常、ルータのLAN側アドレスは、工場出荷時の状態で使用すると、クラスCのローカルアドレスが使用されている。この場合、ローカルアドレスの下位8ビットの値は、1または254である。このため、上位サブネットワーク判断部401は、上位ルータのLAN側アドレスを推測する場合、制御部101が検出したルータのWAN側アドレスの下位8ビットを1または254に置き換えたアドレスを、上位ルータのLAN側アドレスとして優先的に推測する。このように推測することで、上位サブネットワーク判断部401は、高速に上位ルータを検出することが可能となる。また、ユーザは、ルータのLAN側アドレスを変更する場合、LAN側アドレスの下位8ビットの値を64または128などの特定の値に設定することが多い。このため、上位サブネットワーク判断部401は、LAN側アドレスの下位8ビットの値を、ユーザが設定する頻度が高い特定の値に設定したアドレスを、上位ルータのアドレスとして、優先的に推測する。   FIG. 41 shows an example of the LAN address of the upper router that the communication device 11 estimates as the destination of the estimated router packet. Normally, the local address of class C is used as the LAN address of the router when it is used in the factory default state. In this case, the value of the lower 8 bits of the local address is 1 or 254. Therefore, when the upper subnetwork determining unit 401 estimates the LAN address of the upper router, the upper router's LAN address is detected by replacing the lower 8 bits of the router WAN address detected by the control unit 101 with 1 or 254. Preferentially inferred as a LAN side address. By guessing in this way, the upper subnetwork determining unit 401 can detect the upper router at high speed. Also, when changing the router's LAN address, the user often sets the lower 8 bits of the LAN address to a specific value such as 64 or 128. For this reason, the upper subnetwork determining unit 401 preferentially estimates an address in which the lower 8 bits of the LAN side address are set to a specific value that is frequently set by the user as the address of the upper router.

原理的には、通信機器11は、図41のように推測可能な全てのアドレスを宛先とした多量の推定ルータパケットを作成し、一度に送信することが可能である。しかし、多量の推定ルータパケットを一度に送信すると、ネットワークが輻輳状態になり、他の通信に悪影響が出る場合がある。また、送信した推定ルータパケットが廃棄され、ルータのLAN側アドレス獲得に悪影響が出ることも考えられる。このような影響を避けるため、上位サブネットワーク判断部401は、一定期間に規定の数以下の推定ルータパケットを送信するように制御する。また、推定ルータパケットは、図37に示すように、ルータだけが応答を返すように指定して送信される。   In principle, the communication device 11 can create a large number of estimated router packets whose destinations are all the addresses that can be estimated as shown in FIG. 41 and transmit them at a time. However, if a large number of estimated router packets are transmitted at once, the network may be congested and other communications may be adversely affected. In addition, it is conceivable that the estimated router packet transmitted is discarded, and the router side LAN address acquisition is adversely affected. In order to avoid such an influence, the upper subnetwork determining unit 401 controls to transmit an estimated router packet equal to or less than a predetermined number in a certain period. Further, as shown in FIG. 37, the estimated router packet is transmitted by designating that only the router returns a response.

図37の例では、ST(SearchTarget)として、“urn:schemas−upnp−org:device:InternetGatewayDevice:1”を設定することにより、ルータだけが応答を返すようになる。このため、第2の通信機器11は、複数のアドレスに対して推定ルータパケットを送信しても、ルータ以外のアドレスから応答を受信しない。一方、ルータのアドレスを指定した推定ルータパケットに対して、第2の通信機器11は、図37の例のような推定ルータ応答パケットを受信する。第2の通信機器11は、推定ルータ応答パケットのIPヘッダの送信元アドレスを参照することで、ルータのLAN側アドレスを入手することができる。   In the example of FIG. 37, by setting “urn: schemas-upnp-org: device: InternetGatewayDevice: 1” as ST (SearchTarget), only the router returns a response. For this reason, even if the second communication device 11 transmits the estimated router packet to a plurality of addresses, it does not receive a response from an address other than the router. On the other hand, the second communication device 11 receives the estimated router response packet as shown in the example of FIG. 37 with respect to the estimated router packet in which the router address is specified. The second communication device 11 can obtain the router's LAN address by referring to the source address of the IP header of the estimated router response packet.

このように、第2の通信機器11は、自身が接続するルータのLAN側アドレスを取得した後に、WAN側アドレスを取得する。そして、得られたWAN側アドレスを基に、上位ルータのアドレス空間の推定処理を行う。さらに、自身が接続するルータのWAN側アドレスから、上位のルータのLAN側アドレスを取得する。この動作を繰り返すことによって、第2の通信機器11は、宅内ネットワーク2内の全てのルータのアドレスとルータの接続情報とを取得して、宅内ネットワーク2内の各ルータのLAN側アドレス空間の推定処理を行う。これにより、第2の通信機器11は、TTLパケットに含まれるTTLの操作や、ICMP TIME EXCEEDED MESSAGEの受信処理を行う必要がない。また、TTL処理を行わない市販のルータや、ICMPパケットをフィルタリングする市販のルータに対しても適用することが可能となる。   In this way, the second communication device 11 acquires the WAN address after acquiring the LAN address of the router to which it is connected. Based on the obtained WAN address, the address space of the upper router is estimated. Furthermore, the LAN address of the higher router is acquired from the WAN address of the router to which it is connected. By repeating this operation, the second communication device 11 acquires the addresses of all routers in the home network 2 and the connection information of the routers, and estimates the LAN-side address space of each router in the home network 2. Process. Accordingly, the second communication device 11 does not need to perform the operation of the TTL included in the TTL packet or the reception process of the ICMP TIME EXCEEDED MESSAGE. Further, the present invention can be applied to a commercially available router that does not perform TTL processing and a commercially available router that filters ICMP packets.

[サーバ機能をもたない通信機器の機能構成]
図5は、本発明の実施の形態1におけるサーバ機能をもたない通信機器5aの構成を示す機能ブロック図である。サーバ機能を持たない通信機器の機能構成は、サーバ機能を持つ通信機器からサーバ機能の処理に関する機能部を取り除いた構成となる。なお、本実施の形態におけるサーバ機能をもたない他の通信機器も同じ構成をとるものとする。以下、その機能構成について説明する。
[Functional configuration of communication equipment without server function]
FIG. 5 is a functional block diagram showing a configuration of the communication device 5a having no server function in the first embodiment of the present invention. The functional configuration of a communication device that does not have a server function is a configuration in which a functional unit related to processing of the server function is removed from a communication device that has a server function. In addition, the other communication apparatus which does not have a server function in this Embodiment shall also have the same structure. The functional configuration will be described below.

図5において、サーバ機能をもたない通信機器5aは、通信I/F部500と、上位サブネットワーク判断部501と、記憶部502と、サーバ機能探索部503と、クライアント機能部506とを備えている。   In FIG. 5, the communication device 5 a having no server function includes a communication I / F unit 500, a higher-level subnetwork determination unit 501, a storage unit 502, a server function search unit 503, and a client function unit 506. ing.

[通信I/F部]
通信I/F部500は、ネットワークI/Fを制御し、ネットワークからの情報の受信とネットワークへの情報の送信を実行する。
[Communication I / F part]
The communication I / F unit 500 controls the network I / F, and receives information from the network and transmits information to the network.

[上位サブネットワーク判断部]
上位サブネットワーク判断部501は、前述の上位サブネットワーク判断部401と同様の上位サブネットワーク解析を実施し、自身が接続されているルータのより上位(インターネット側)に接続されたルータ配下のネットワーク情報を取得し、記憶部502に記憶する。
[High-level subnetwork judgment unit]
The upper subnetwork determining unit 501 performs the same upper subnetwork analysis as the above-described upper subnetwork determining unit 401, and the network information under the router connected to the higher level (Internet side) of the router to which it is connected. Is stored in the storage unit 502.

[サーバ機能探索部]
サーバ機能探索部503は、前述のサーバ機能探索・応答部403により”サーバ機能が有効である通信機器”の探索処理のみを行う。
[Server Function Search Unit]
The server function search unit 503 performs only a search process of “communication equipment in which the server function is valid” by the server function search / response unit 403 described above.

[クライアント機能部]
クライアント機能部506は、前述のサーバ機能部/クライアント機能部406のサーバ機能が有効になっている通信機器と通信する(サービスを受ける)処理のみを行う。
[Client Function]
The client function unit 506 performs only a process of communicating (receiving a service) with a communication device in which the server function of the server function unit / client function unit 406 described above is valid.

[サーバ機能をもたない通信機器の動作の概要]
以上のように構成されたサーバ機能をもたない通信機器5a〜5cの動作概要について、図11を用いて説明する。
[Overview of operation of communication equipment without server function]
An outline of operations of the communication devices 5a to 5c having no server function configured as described above will be described with reference to FIG.

図11は本発明の実施の形態1におけるサーバ機能をもたない通信機器の処理フローである。   FIG. 11 is a processing flow of a communication device having no server function in Embodiment 1 of the present invention.

サーバ機能をもたない通信機器は、サーバ機能付き通信機器と同様に一定時間ごとに上位サブネットワーク判断部501により上位サブネットワーク解析(ステップS1105)を実施し、上位サブネットワーク解析の結果を基に”サーバ機能が有効である通信機器”を探すためにサーバ機能探索要求を送信する(ステップS1106)。なお、本動作は前述のサーバ機能付き通信機器の動作と同様であるため詳細な説明は省略する。   A communication device having no server function performs upper subnetwork analysis (step S1105) by the upper subnetwork determining unit 501 at regular intervals in the same manner as the communication device with server function, and based on the result of the upper subnetwork analysis. A server function search request is transmitted to search for a “communication device in which the server function is valid” (step S1106). Since this operation is the same as the operation of the communication device with the server function described above, detailed description thereof is omitted.

サーバ機能探索要求送信後、サーバ機能探索部503はサーバ機能探索応答受信を待ち(ステップS1100)、サーバ機能探索応答を受信すると(ステップS1100でYes)、サーバ機能探索応答の送信元であるサーバ機能付き通信機器に対し通信路を接続して(ステップS1101)サービスを受ける。   After transmitting the server function search request, the server function search unit 503 waits for reception of the server function search response (step S1100). When the server function search response is received (Yes in step S1100), the server function that is the transmission source of the server function search response A communication path is connected to the attached communication device (step S1101) to receive a service.

一方、サーバ機能探索応答以外のメッセージを受信した場合は(ステップS1100でNo,かつ、ステップS1102でYes)、その他のメッセージ受信処理を行う(ステップS1103)。   On the other hand, when a message other than the server function search response is received (No in step S1100 and Yes in step S1102), other message reception processing is performed (step S1103).

なお、上位サブネットワーク解析およびサーバ機能探索要求の送信は定期的に行うとして説明したが、サーバ機能付き通信機器との通信路が切断された場合にのみ実施してもよいし、ユーザが通信機器に信号を入力する入力手段を備え、前記入力手段の信号に応じて行ってもよい。   Although it has been described that the upper subnetwork analysis and the transmission of the server function search request are periodically performed, the upper subnetwork analysis and the server function search request may be performed only when the communication path with the communication device with the server function is disconnected. An input means for inputting a signal may be provided, and the input may be performed in accordance with a signal from the input means.

以下、このような環境において、サーバ機能切り替え処理が行われる例を説明する。   Hereinafter, an example in which server function switching processing is performed in such an environment will be described.

[サーバ機能付き通信機器が上位サブネットワークに新規に接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能付き通信機器4aがネットワークに新規に接続された例を用いて、上位サブネットワークにサーバ機能付き通信機器が新規に接続された場合の処理について説明する。
[When a communication device with a server function is newly connected to the upper subnetwork]
In FIG. 1, using the example in which the server-equipped communication device 4b is newly connected to the network while the server-function-equipped communication device 4b is valid, the server-function-equipped communication device is newly added to the upper subnetwork. The processing when connected to will be described.

サーバ機能付き通信機器4aはネットワークに新規に接続されると、初回のみ一定時間を待たずにすぐにサーバ機能付き通信機器探索処理(ステップS603)を行う。サーバ機能付き通信機器探索処理(ステップS603)において上位サブネットワーク解析を実施する(ステップS700)。その結果、本実施の形態1においてはサーバ機能付き通信機器4aが接続されているルータ3aが最上位ルータであり自身より上位にネットワークが存在しないと判断されるため、同位ネットワークにのみサーバ機能探索要求をマルチキャストで送信する(ステップS701)。同位ネットワークに”サーバ機能が有効である通信機器”が存在しないため探索要求の応答はなく(ステップS702でNo)、自身はサーバ機能を有効にするべき通信機器であると判断する(ステップS703)。またサーバ機能付き通信機器4aはネットワークに新規に接続され、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態であるため(ステップS704でNo)適正判断によるサーバ機能切り替え処理を行う(ステップS705)。適正判断によるサーバ機能切り替え処理においては、自身はサーバ機能を有効にするべき通信機器であると判断しているため(ステップS1000でYes)、自身のサーバ機能を有効化する(ステップS1006)。   When the server-equipped communication device 4a is newly connected to the network, the server device-equipped communication device search process (step S603) is performed immediately without waiting for a predetermined time only for the first time. In the communication function search processing with a server function (step S603), an upper subnetwork analysis is performed (step S700). As a result, in the first embodiment, since it is determined that the router 3a to which the communication device 4a with a server function is connected is the highest router and there is no network above itself, the server function search is performed only in the peer network. The request is transmitted by multicast (step S701). Since there is no “communication device in which the server function is valid” in the peer network, there is no response to the search request (No in step S702), and it is determined that it is a communication device in which the server function should be validated (step S703). . Further, since the server-equipped communication device 4a is newly connected to the network and the server function of the server function unit / client function unit 406 is not activated (No in step S704), the server function switching process based on appropriateness determination is performed. This is performed (step S705). In the server function switching process based on appropriateness determination, since it is determined that it is a communication device that should enable the server function (Yes in step S1000), the server function is enabled (step S1006).

ここで、自身のサーバ機能を有効化した後にサーバ機能を有効にしている他のサーバ機能付き通信機器から発見された場合の処理について説明する。   Here, a description will be given of processing in a case where the server function is discovered from another communication device with a server function that has been validated after the server function is validated.

サーバ機能付き通信機器4bは定期的に上位サブネットワークに対してサーバ機能探索要求を送信している。サーバ機能付き通信機器4aはサーバ機能付き通信機器4bよりサーバ機能探索要求を受信すると(ステップS800でYes)、自身のサーバ機能が有効化されているため(ステップS801でYes)サーバ機能付き通信機器4bに対しサーバ機能探索応答を送信する(ステップS802)。このとき、サーバ機能付き通信機器4aがサーバ機能を有効化する前にサーバ機能付き通信機器4bよりサーバ機能探索要求を受信した場合は(ステップS801でNo)、特に何もしない。   The server-equipped communication device 4b periodically transmits a server function search request to the upper subnetwork. When the server function communication device 4a receives the server function search request from the server function communication device 4b (Yes in step S800), the server function is enabled (Yes in step S801). A server function search response is transmitted to 4b (step S802). At this time, if the server function search request is received from the server function communication device 4b before the server function communication device 4a validates the server function (No in step S801), nothing is done.

サーバ機能付き通信機器4bは、サーバ機能付き通信機器4aからサーバ機能探索応答を受信すると、自身の属するネットワークより上位のサブネットワークに存在するサーバ機能付き通信機器を発見しているため、自身はサーバ機能を無効にするべき通信機器であると判断しサーバ機能付き通信機器4aに対しサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信する。サーバ機能付き通信機器は4aは、サーバ機能付き通信機器4bからサーバ機能切り替えメッセージを受信すると(ステップS803でYes)、メッセージ受信によるサーバ機能切り替え処理を行う(ステップS804)。メッセージ受信によるサーバ機能切り替え処理においては、サーバ機能の有効化を指示するサーバ機能切り替えメッセージを受信し(ステップS900でYes)かつ、サーバ機能自体はすでに有効化されているため(ステップS902でYes)切り替えずそのまま処理を終了する。   When the server-equipped communication device 4b receives the server function search response from the server-equipped communication device 4a, the server-equipped communication device 4b has found a communication device with the server function that exists in a higher subnetwork than the network to which it belongs. A server function switching message for instructing activation of the server function is transmitted to the communication apparatus 4a with a server function by determining that the communication apparatus should be disabled. When the communication device with server function 4a receives the server function switching message from the communication device 4b with server function (Yes in step S803), the server function switching processing by receiving the message is performed (step S804). In the server function switching process by message reception, a server function switching message for instructing activation of the server function is received (Yes in step S900), and the server function itself has already been activated (Yes in step S902). The process ends without switching.

[サーバ機能付き通信機器が下位サブネットワークに新規に接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能付き通信機器4cがネットワークに新規に接続された例を用いて、下位サブネットワークにサーバ機能付き通信機器が新規に接続された場合の処理について説明する。なお、図1においては、サーバ機能付き通信機器4aが図示されているが本実施の形態ではサーバ機能付き通信機器4aは存在しないものとして説明する。
[When a communication device with server function is newly connected to a lower subnetwork]
In FIG. 1, a communication device with a server function is newly added to a lower subnetwork by using an example in which the communication device 4c with a server function is newly connected to the network while the communication device with a server function 4b is valid. The processing when connected to will be described. In FIG. 1, the communication device 4a with a server function is illustrated, but in the present embodiment, the description will be made assuming that the communication device 4a with a server function does not exist.

サーバ機能付き通信機器4cはネットワークに新規に接続されると、初回のみ一定時間を待たずにすぐにサーバ機能付き通信機器探索処理(ステップS603)を行う。サーバ機能付き通信機器探索処理(ステップS603)において上位サブネットワーク解析を実施する(ステップS700)。その結果得られたルータ3a及びルータ3bのネットワークアドレス情報を元にして、ルータ3a及びルータ3bに接続された”サーバ機能が有効である通信機器”のアドレスを推定し、サーバ機能探索要求を送信する(ステップS701)。また、自身が接続されているルータ3cのネットワークに対しサーバ機能探索要求をマルチキャストで送信する(ステップS701)。ここで、上位サブネットワークのルータ3bに接続されるサーバ機能付き通信機器4bはサーバ機能を有効にしており、サーバ機能付通信機器4cからサーバ機能探索要求を受信すると(ステップS800でYes)、自身のサーバ機能が有効化されているので(ステップS801でYes)サーバ機能付き通信機器4cに対しサーバ機能探索応答を送信する(ステップS802)。サーバ機能付き通信機器4cはサーバ機能付通信機器4bからサーバ機能探索応答を受信し(ステップS702でYes)、上位サブネットワークにサーバ機能を有効にしたサーバ機能付き通信機器が存在するため自身はサーバ機能を無効にするべき通信機器であると判断し(ステップS706)、かつ、ネットワークに新規に接続されており自身のサーバ機能が有効化されていない状態であるため(ステップS707でNo)、サーバ機能を切り替えず処理を終了する。   When the server-equipped communication device 4c is newly connected to the network, the server-equipped communication device search process (step S603) is performed immediately without waiting for a certain time only for the first time. In the communication function search processing with a server function (step S603), an upper subnetwork analysis is performed (step S700). Based on the network address information of the router 3a and the router 3b obtained as a result, the address of the “communication device in which the server function is valid” connected to the router 3a and the router 3b is estimated, and a server function search request is transmitted. (Step S701). Also, a server function search request is transmitted by multicast to the network of the router 3c to which it is connected (step S701). Here, the server-equipped communication device 4b connected to the router 3b of the higher-level subnetwork has enabled the server function, and when receiving a server function search request from the server-equipped communication device 4c (Yes in step S800), itself Since the server function is enabled (Yes in step S801), a server function search response is transmitted to the communication device with server function 4c (step S802). The server-equipped communication device 4c receives the server function search response from the server-equipped communication device 4b (Yes in step S702), and since there is a server-equipped communication device in which the server function is enabled in the higher-level subnetwork, Since it is determined that the function is a communication device whose function should be invalidated (step S706), and since it is newly connected to the network and its own server function is not activated (No in step S707), the server Ends processing without switching functions.

[サーバ機能を有効にしたサーバ機能付き通信機器を含む上位サブネットワークが接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能を有効にしたサーバ機能付き通信機器4aを含むネットワーク(ルータ3aとルータ3aに接続する通信機器)が新規に接続された例を用いて、上位サブネットワークが新規に接続された場合の処理について説明する。
[When a higher-level subnetwork that includes a server-equipped communication device with the server function enabled is connected]
In FIG. 1, a network (router 3a and a communication device connected to the router 3a) including the communication device 4a with the server function in which the server function is enabled while the communication device 4b with the server function is enabled is newly provided. A process when a higher-level subnetwork is newly connected will be described using a connected example.

サーバ機能付き通信機器4bは定期的に上位サブネットワーク解析を実施している(ステップS700)。上位サブネットワーク(ルータ3aに接続されたネットワーク)が接続されたことを上位サブネットワーク解析により発見した場合、サーバ機能付き通信機器4bは上位サブネットワークに対してサーバ機能探索要求を送信する(ステップS701)。ここで、上位サブネットワークのルータ3aに接続されるサーバ機能付き通信機器4aがサーバ機能を有効にしているためサーバ機能探索応答を受信する(ステップS702でYes)。上位サブネットワークにサーバ機能を有効にしたサーバ機能付き通信機器が存在するため、自身はサーバ機能を無効にするべき通信機器であると判断し(ステップS706)、サーバ機能が有効であるため(ステップS707でYes)、適正判断によるサーバ機能切り替え処理を行う(ステップS705)。適正判断によるサーバ機能切り替え処理において、自身はサーバ機能を無効にするべき通信機器であると判断しているため(ステップS1001でYes)、発見したサーバ機能付き通信機器4aに対しサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信する(ステップS1002)。同時に現在サービスを提供している他の通信機器に対し、交代するサーバ機能付き通信機器であるサーバ機能付き通信機器4aの情報、例えばIPアドレスなどを通知する(ステップS1003)。そして、自身のサーバ機能を無効化(サーバ機能部・クライアント機能部406のサーバ機能部を無効化、かつクライアント機能部を有効化)し(ステップS1004)、切り替え処理を終了する。   The server-equipped communication device 4b periodically performs upper subnetwork analysis (step S700). When the upper subnetwork analysis discovers that the upper subnetwork (network connected to the router 3a) is connected, the server-equipped communication device 4b transmits a server function search request to the upper subnetwork (step S701). ). Here, since the server function-equipped communication device 4a connected to the router 3a of the upper subnetwork has validated the server function, a server function search response is received (Yes in step S702). Since there is a communication device with a server function in which the server function is enabled in the upper subnetwork, it is determined that it is a communication device that should disable the server function (step S706), and the server function is enabled (step S706). In step S707, the server function switching process based on the appropriateness determination is performed (step S705). In the server function switching process based on the appropriate determination, since the server function itself is determined to be a communication device whose server function should be disabled (Yes in step S1001), the server function is validated for the discovered communication device with server function 4a. A server function switching message is sent (step S1002). At the same time, information on the communication device 4a with the server function, which is the communication device with the server function to be replaced, such as an IP address, is notified to the other communication devices currently providing the service (step S1003). Then, its own server function is invalidated (the server function unit of the server function unit / client function unit 406 is invalidated and the client function unit is validated) (step S1004), and the switching process is terminated.

一方、サーバ機能付き通信機器4aは前述の[サーバ機能付き通信機器が上位サブネットワークに新規に接続された場合]のサーバ機能付き通信機器4aと同様の動作を行い、自身のサーバ機能を有効化のまま切り替えない。   On the other hand, the communication device 4a with a server function performs the same operation as the communication device 4a with a server function described above [when the communication device with a server function is newly connected to a higher-level subnetwork], and validates its own server function. Do not switch.

[サーバ機能を有効にしたサーバ機能付き通信機器を含む下位サブネットワークが接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能を有効にしたサーバ機能付き通信機器4cを含むネットワーク(ルータ3cとルータ3cに接続する通信機器)が新規に接続された例を用いて、下位サブネットワークが新規に接続された場合の処理について説明する。
[When a sub-network including a server-equipped communication device with the server function enabled is connected]
In FIG. 1, a network (router 3c and a communication device connected to the router 3c) including the communication device 4c with the server function in which the server function is enabled while the communication device 4b with the server function is enabled is newly provided. Processing when a lower subnetwork is newly connected will be described using a connected example.

サーバ機能付き通信機器4cは定期的に上位サブネットワーク解析(ステップS700)を実施している。ネットワーク接続後、上位サブネットワーク解析により上位サブネットワーク(ルータ3bに接続されたネットワーク)が接続されていることを発見した場合、前述の[サーバ機能を有効にしたサーバ機能付き通信機器を含む上位サブネットワークが接続された場合]のサーバ機能付き通信機器4bと同様の動作を行い、自身のサーバ機能を無効化する。   The server-equipped communication device 4c periodically performs upper subnetwork analysis (step S700). After the network connection, if it is found by the upper subnetwork analysis that the upper subnetwork (the network connected to the router 3b) is connected, the above-mentioned [upper subs including the communication device with the server function with the server function enabled) The same operation as that of the communication device 4b with a server function in the case where the network is connected] is performed, and its own server function is invalidated.

一方、サーバ機能付き通信機器4bは前述の[サーバ機能付き通信機器が上位サブネットワークに新規に接続された場合]のサーバ機能付き通信機器4aと同様の動作を行い、自身のサーバ機能を有効化のまま切り替えない。   On the other hand, the communication device 4b with a server function performs the same operation as the communication device 4a with a server function described above [when the communication device with a server function is newly connected to a higher-level subnetwork], and validates its own server function. Do not switch.

なお、本実施の形態では、定期的に上位サブネットワーク解析を行うとして説明したが、ユーザが通信機器に信号を入力する入力手段を備え、前記入力手段の信号に応じて上位サブネットワーク解析を行ってもよい。   In the present embodiment, the upper subnetwork analysis is periodically performed. However, the user has input means for inputting a signal to the communication device, and the upper subnetwork analysis is performed according to the signal of the input means. May be.

(実施の形態2)
[サーバ交代方法の適用環境]
図26は、本発明の実施の形態2における宅内ネットワークの一構成例である。
(Embodiment 2)
[Applicable environment for server replacement method]
FIG. 26 is a configuration example of a home network according to Embodiment 2 of the present invention.

宅内ネットワーク2は、4台のルータ3a〜3dが接続され構成されており、ルータ3aがインターネット1に接続している最上位ルータであり、ルータ3cとルータ3dはルータ3bの下位に並列に接続されている。各ルータには、サーバ機能を有したサーバ機能付き通信機器4a〜4dとサーバ機能を持たない通信機器5a〜5dが接続されている。この宅内ネットワーク2の構成は有線でも無線でもよい。なお、各通信機器4a〜4d、5a〜5dが提供する機能は下位サブネットワーク判断機能を除いて本発明の実施の形態1における通信機器と同様である。また、ハードウエア構成も実施の形態1における通信機器と同様である。また、4台のルータで構成された宅内ネットワークの構成は一例であり、4台より少ないルータで構成されたネットワーク又は4台以上のルータで構成されたネットワークでも同様に適用可能である。   The home network 2 is configured by connecting four routers 3a to 3d. The router 3a is a top-level router connected to the Internet 1, and the router 3c and the router 3d are connected in parallel below the router 3b. Has been. Each router is connected to communication devices 4a to 4d with a server function having a server function and communication devices 5a to 5d having no server function. The configuration of the home network 2 may be wired or wireless. The functions provided by the communication devices 4a to 4d and 5a to 5d are the same as those of the communication device according to the first embodiment of the present invention except for the lower subnetwork determination function. The hardware configuration is the same as that of the communication device in the first embodiment. The configuration of the home network configured with four routers is an example, and the present invention can be similarly applied to a network configured with fewer than four routers or a network configured with four or more routers.

[サーバ機能付き通信機器の機能構成]
図13は、本発明の実施の形態2におけるサーバ機能付き通信機器4aの構成を示す機能ブロック図である。図13に示す機能ブロック図は、図4に示す機能ブロック図と比較し、下位サブネットワーク判断部1307を備えている点で相違する。その他の構成要素は、図4と同様であるため、図4と同様の構成要素には同一の符号を付し、詳細な説明は省略する。なお、本実施の形態における他のサーバ機能付き通信機器も同じ構成をとるものとする。以下、その機能構成について説明する。
[Functional configuration of communication equipment with server function]
FIG. 13 is a functional block diagram showing a configuration of the communication device 4a with a server function according to the second embodiment of the present invention. The functional block diagram shown in FIG. 13 is different from the functional block diagram shown in FIG. 4 in that a lower subnetwork determining unit 1307 is provided. Since the other components are the same as those in FIG. 4, the same components as those in FIG. 4 are denoted by the same reference numerals, and detailed description thereof is omitted. In addition, the other communication apparatus with a server function in this Embodiment shall also have the same structure. The functional configuration will be described below.

図4において、サーバ機能付き通信機器4aは、通信I/F部400と、上位サブネットワーク判断部401と、記憶部402と、サーバ機能探索・応答部403とサーバ適正判断部404と、サーバ機能切り替え部405と、サーバ機能部/クライアント機能部406と、下位サブネットワーク判断部1307とを備えている。   4, the communication device with server function 4a includes a communication I / F unit 400, a higher-level subnetwork determination unit 401, a storage unit 402, a server function search / response unit 403, a server suitability determination unit 404, and a server function. A switching unit 405, a server function unit / client function unit 406, and a lower subnetwork determination unit 1307 are provided.

通信I/F部400、上位サブネットワーク判断部401、記憶部402、サーバ機能探索・応答部403およびサーバ機能部/クライアント機能部406は実施の形態1に示す同機能部と処理機能が同様であるため説明を省略する。   The communication I / F unit 400, the upper subnetwork determination unit 401, the storage unit 402, the server function search / response unit 403, and the server function unit / client function unit 406 have the same processing functions as those of the first embodiment. Since there is, explanation is omitted.

[下位サブネットワーク判断部]
下位サブネットワーク判断部1307は、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する機能部である。下位サブネットワーク判断部1307は、自身以外の通信機器から通信を開始して受信したパケットのボディに含まれるルータの識別情報、およびIPヘッダに含まれる送信元のIPアドレスを比較して複数の異なるルータの存在を検知した場合に、自身が属するルータの下位に複数の異なるルータが並列に接続されている旨をサーバ適正判断部404に通知する。これは、家庭用ルータのNAPT機能やファイアウォール機能が妨げとなり、WAN側に位置する通信機器からLAN側に位置する通信機器に対して通信を開始することができないことから、受信したパケットは下位サブネットワークに属する通信機器からのものであると判断でき、また自身の属するルータの識別情報と異なるルータの識別情報を含み、かつIPヘッダに含まれる送信元のIPアドレス(ルータのWAN側アドレス)が異なるパケットを2つ以上受信することで、自身が属するルータの下位に複数の異なるルータが並列に接続されていると判断できるからである。
[Low-level subnetwork judgment unit]
The lower subnetwork determining unit 1307 is a functional unit that determines that a plurality of different routers are connected in parallel below the router to which the lower subnetwork belongs. The lower subnetwork determining unit 1307 compares the router identification information included in the body of the packet received by starting communication from a communication device other than itself, and the source IP address included in the IP header, so that a plurality of different information is obtained. When the presence of the router is detected, the server appropriateness determination unit 404 is notified that a plurality of different routers are connected in parallel below the router to which the router belongs. This is because the NAPT function and firewall function of the home router are hindered, and communication cannot be started from a communication device located on the WAN side to a communication device located on the LAN side. It can be determined that the communication device belongs to the network, and includes the identification information of the router different from the identification information of the router to which it belongs, and the source IP address (router WAN address) included in the IP header is This is because by receiving two or more different packets, it can be determined that a plurality of different routers are connected in parallel below the router to which the packet belongs.

[サーバ適正判断部]
サーバ適正判断部404は、サーバ機能を有効にするべき通信機器を判断する機能部である。サーバ機能が無効化されている状態で、一定時間内に他のサーバ機能付き通信機器からのサーバ機能探索要求を受信するか、もしくは、サーバ機能探索・応答部403における探索処理によりサーバ機能が有効になっている他のサーバ機能付き通信機器を発見した通知を受けると、すでにネットワーク内に他のサーバ機能付き通信機器が存在するため、自身はサーバ機能を無効にするべき通信機器であると判断する。このとき、サーバ機能を切り替える必要はないので判断結果をサーバ機能切り替え部405に通知しない。また、サーバ機能が無効化されている状態で、一定時間内に他のサーバ機能付き通信機器からのサーバ機能探索要求を受信せず、かつ、サーバ機能探索・応答部403における探索処理によりサーバ機能が有効になっている他のサーバ機能付き通信機器を発見できなかった旨の通知を受けると、ネットワーク内に他にサーバ機能付き通信機器が存在しないため、自身はサーバ機能を有効にするべき通信機器であると判断し、判断結果をサーバ機能切り替え部405に通知する。
[Server suitability determination section]
The server suitability determination unit 404 is a function unit that determines a communication device whose server function should be validated. In a state where the server function is disabled, a server function search request is received from another communication device with a server function within a certain period of time, or the server function is enabled by a search process in the server function search / response unit 403 If you receive a notification that another server-equipped communication device is found, it is determined that it is a communication device that should disable the server function because another communication device with a server function already exists in the network. To do. At this time, since it is not necessary to switch the server function, the determination result is not notified to the server function switching unit 405. In addition, when the server function is disabled, a server function search request is not received from another communication device with a server function within a predetermined time, and the server function search / response unit 403 performs a server function search process. If you receive a notification that another server-equipped communication device that is enabled cannot be found, there is no other server-equipped communication device in the network. It is determined that the device is a device, and the determination result is notified to the server function switching unit 405.

一方、サーバ機能が有効化されている状態で、サーバ機能探索・応答部403における探索処理によりサーバ機能が有効になっている他のサーバ機能付き通信機器を発見した通知を受けると、サーバ機能調停処理(後述)によりサーバ機能を有効にするべき通信機器を判断する。   On the other hand, when the server function is activated and the server function search / response unit 403 receives a notification that another server-equipped communication device with the server function is found by a search process, the server function arbitration A communication device whose server function should be validated is determined by processing (described later).

また、下位サブネットワーク判断部1307から自身が属するルータの下位に複数の異なるルータが並列に接続されていると通知されると、サーバ機能を有効化する通信機器を変更する必要があるかどうかを判断する。自身のサーバ機能が有効化されているか、もしくは上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在する場合は、サーバ機能を有効化する通信機器を変更する必要がないと判断する。このとき、サーバ機能を切り替える必要はないので判断結果をサーバ機能切り替え部405に通知しない。一方、自身のサーバ機能が有効化されておらず、かつ、上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在しない場合は、サーバ機能を有効化する通信機器を変更すべきと判断し、判断結果をサーバ機能切り替え部405に通知する。   Also, if the lower subnetwork determining unit 1307 notifies that a plurality of different routers are connected in parallel below the router to which the subordinate network belongs, whether or not it is necessary to change the communication device that activates the server function. to decide. If your server function is enabled, or if there is a server-equipped communication device that enables the server function in the host or peer network, there is no need to change the communication device that enables the server function to decide. At this time, since it is not necessary to switch the server function, the determination result is not notified to the server function switching unit 405. On the other hand, if the server function is not enabled and there is no communication device with the server function that enables the server function in the host or peer network, change the communication device that enables the server function. The server function switching unit 405 is notified of the determination result.

これは、実施の形態1で述べたようにネットワーク構成が変化するたびにサーバ機能を有効にした通信機器を最上位に設置して接続性を向上させるのではなく、通信不可能な状態が発生した場合にのみサーバ機能を有効にした通信機器を交代させて、通信不可な状態を回避させることにより、サーバ機能を有効にした通信機器をできるだけ変更させたくない場合などに対応可能である。一般に家庭用ルータでは、NAPT機能やファイアウォール機能の影響により、WAN側に位置する通信機器から通信を開始してLAN側に位置する通信機器と通信することができないが、LAN側に位置する通信機器からWAN側に位置する通信機器に通信を開始することは可能である。よって、直列にルータが接続されている場合は、LAN側に位置する通信機器からWAN側に位置する通信機器に通信を開始しさえすれば通信が可能であり、下位にサーバ機能を有効にした通信機器を配置して通信を行うことも不可能ではない。しかし、ルータが並列に接続された場合は、並列に接続されたルータ配下の通信機器同士は、どちらから通信を開始しても必ず通信相手に対してWAN側から開始することになり通信を行うことができない。そのため、並列にルータが接続され、それぞれのルータ配下の通信機器同士が必ず通信ができない状況を検知した場合のみ、上位サブネットワークにサーバ機能を有効にした通信機器を切り替えることにより、必要最低限の切り替え回数で通信機器同士が通信可能となる。   This is because, as described in Embodiment 1, every time the network configuration changes, a communication device with the server function enabled is not installed at the highest level to improve connectivity, but a state where communication is impossible occurs. In such a case, the communication device with the server function enabled is changed to avoid the communication disabled state, so that the communication device with the server function enabled is not changed as much as possible. In general, a home router cannot start communication from a communication device located on the WAN side and communicate with a communication device located on the LAN side due to the influence of the NAPT function or firewall function, but the communication device located on the LAN side. It is possible to start communication from a communication device to a communication device located on the WAN side. Therefore, when routers are connected in series, communication is possible as long as communication is started from a communication device located on the LAN side to a communication device located on the WAN side, and the server function is enabled at the lower level. It is not impossible to perform communication by arranging communication devices. However, when routers are connected in parallel, communication devices under the router connected in parallel will always start from the WAN side with respect to the communication partner regardless of which communication is started. I can't. Therefore, only when the routers are connected in parallel and the communication devices under the respective routers cannot always communicate with each other, it is necessary to switch the communication device with the server function enabled to the upper subnetwork. Communication devices can communicate with each other by the number of switching times.

[サーバ機能切り替え部]
サーバ機能切り替え部405は、サーバ機能切り替えの指示を受けてサーバ機能部/クライアント機能部406の機能を切り替える機能部である。サーバ機能切り替えの指示としては、他のサーバ機能付き通信機器からのサーバ機能切り替えメッセージ、サーバ適正判断部404からの判断結果がある。サーバ機能切り替えの指示としては、他のサーバ機能付き通信機器からのサーバ機能切り替えメッセージ、サーバ適正判断部404からの判断結果がある。サーバ機能切り替え部405は、サーバ機能を有効化する場合は、サーバ機能部/クライアント機能部406のサーバ機能部を有効化し、クライアント機能部を無効化する。一方、サーバ機能を無効化する場合は、サーバ機能部/クライアント機能部406のサーバ機能部を無効化し、クライアント機能部を有効化する。
[Server function switching section]
The server function switching unit 405 is a function unit that switches the function of the server function unit / client function unit 406 in response to an instruction to switch the server function. The server function switching instruction includes a server function switching message from another communication device with a server function and a determination result from the server suitability determination unit 404. The server function switching instruction includes a server function switching message from another communication device with a server function and a determination result from the server suitability determination unit 404. When the server function is to be validated, the server function switching unit 405 validates the server function unit of the server function unit / client function unit 406 and invalidates the client function unit. On the other hand, when disabling the server function, the server function unit of the server function unit / client function unit 406 is disabled and the client function unit is enabled.

また、サーバ機能を有効化する通信機器の変更を示す指示を受けた場合は、現在のサーバ機能を有効化している通信機器にサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し、自身のサーバ機能を有効化するか、または、上位および同位ネットワークにサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し、サーバ機能を有効化する通信機器を交代させる。   In addition, when receiving an instruction to change the communication device that activates the server function, it sends a server function switching message to instruct the server device to disable the server function to the communication device that is currently enabling the server function. The server function is activated or a server function switching message for instructing the activation of the server function is transmitted to the upper and peer networks, and the communication device for activating the server function is replaced.

また、サーバ機能を有効な状態から無効な状態へ切り替える場合は、切り替える前にサービスを提供している通信機器に対し交代するサーバ機能付き通信機器の情報を通知し、該情報をサーバ機能が有効になっている通信機器の情報として記憶部402に記憶する。サーバ機能を無効な状態から有効な状態へ切り替える場合は、有効化後、自身の情報をサーバ機能が有効になっている通信機器の情報として記憶部402に記憶する。なお、交代するサーバ機能付き通信機器の情報は、サーバ機能探索・応答部403から通知されるか、あるいは他のサーバ機能付き通信機器からのサーバ機能切り替えメッセージから取得する。   In addition, when switching the server function from the valid state to the invalid state, before switching, the communication device with the server function is notified to the communication device providing the service, and the server function is valid. Is stored in the storage unit 402 as information on the communication device. When the server function is switched from the invalid state to the valid state, the information is stored in the storage unit 402 as information of the communication device in which the server function is valid after the server function is validated. The information on the communication device with a server function to be replaced is notified from the server function search / response unit 403 or is acquired from a server function switching message from another communication device with a server function.

また、サーバ適正判断部404からの判断結果によりサーバ機能を切り替える場合は、サーバ機能を切り替える前に発見したサーバ機能付き通信機器に対し、サーバ適正判断部404からの判断結果の指示をサーバ機能切り替えメッセージとして通知する。   In addition, when switching the server function according to the determination result from the server suitability determination unit 404, the server function switch is used to instruct the determination result from the server suitability determination unit 404 to the communication device with the server function discovered before switching the server function. Notify as a message.

[サーバ機能付き通信機器の動作の概要]
以上のように構成されたサーバ機能付き通信機器4a〜4dの動作概要について、図15〜図21、図25を用いて説明する。
[Overview of operation of communication equipment with server function]
An outline of operations of the communication devices 4a to 4d with a server function configured as described above will be described with reference to FIGS. 15 to 21 and FIG.

図25は本発明の実施の形態におけるサーバ機能付き通信機器の全体的な処理フローである。   FIG. 25 is an overall processing flow of the communication device with a server function in the embodiment of the present invention.

サーバ機能付き通信機器はメッセージを受信すると(ステップS2500でYes)メッセージ受信処理(ステップS2501)を実行し、また、一定時間ごとにサーバ機能付き通信機器探索処理(ステップS2503)を実行している。また、サーバ機能付き通信機器探索処理(ステップS2503)において上位または同位ネットワークにサーバ機能付き通信機器を発見できなかった場合は、サーバ機能付き通信機器探索処理(ステップS2508)では探索不能な下位サブネットワークにサーバ機能付き通信機器が存在するかどうかを検出するために、一定時間サーバ機能付き通信機器からのサーバ機能探索要求を受信したかどうかを判断する。   When the communication device with the server function receives the message (Yes in step S2500), the communication device with the server function is executed (step S2501), and the communication device search process with the server function (step S2503) is executed at regular intervals. In addition, if a communication device with a server function cannot be found in the host or peer network in the communication device search process with a server function (step S2503), the lower subnetwork that cannot be searched with the communication device search process with a server function (step S2508) In order to detect whether or not a communication device with a server function exists, it is determined whether a server function search request has been received from the communication device with a server function for a certain period of time.

サーバ機能付き通信機器は、メッセージを受信すると(ステップS2500でYes)メッセージ受信処理(ステップS2501)を実行する。メッセージを受信しなかった場合(ステップS2500でNo)、および、メッセージ受信処理(ステップS2501)後、一定時間経過していれば(ステップS2502でYes)、サーバ機能付き通信機器探索処理を行う(ステップS2503)。サーバ機能付き通信機器探索処理(ステップS2503)において、サーバ機能探索要求の応答を受信した場合(ステップS2504でYes)は、再びメッセージ受信待ちの状態に戻る。一方、サーバ機能付き通信機器探索処理(ステップS2503)において、サーバ機能探索要求の応答を受信しなかった場合(ステップS2504でNo)、または、一定時間経過しておらず(ステップS2502でNo)、サーバ機能付き通信機器探索処理を実行していない場合は、自身のサーバ機能がすでに有効であるかどうかを判断する(ステップS2505)。自身のサーバ機能がすでに有効である場合は(ステップS2505でYes)、再びメッセージ受信待ちの状態に戻る。一方、自身のサーバ機能が有効化されていない場合(ステップS2505でNo)は、一定時間内にサーバ機能付き通信機器からサーバ機能探索要求を受信したかどうかを判断する。これにより、下位サブネットワークにサーバ機能付き通信機器が存在しているかどうか検知することができる。一定時間内にサーバ機能付き通信機器からサーバ機能探索要求を受信していない場合(ステップS2506でNo、かつ、ステップS2507でYes)は、ネットワーク内に他にサーバ機能付き通信機器が存在しないため、自身はサーバ機能を有効にするべき通信機器であると判断し(ステップS2508)、サーバ機能切り替え部405において適正判断によるサーバ機能切り替え処理を行い(ステップS2509)、再びメッセージ受信待ちの状態に戻る。一方、サーバ機能付き通信機器からサーバ機能探索要求を受信したことがある場合(ステップS2506でYes)は、下位サブネットワークにすでにサーバ機能付き通信機器が存在するため、再びメッセージ受信待ちの状態に戻る。   When the server-equipped communication device receives the message (Yes in step S2500), the communication device with the server function executes a message reception process (step S2501). If a message has not been received (No in step S2500), and if a certain time has elapsed after the message reception process (step S2501) (Yes in step S2502), a communication device search process with a server function is performed (step S2502). S2503). In the server device-equipped communication device search process (step S2503), when a response to the server function search request is received (Yes in step S2504), the process again returns to a message reception wait state. On the other hand, in the server device-equipped communication device search process (step S2503), when a response to the server function search request is not received (No in step S2504), or a certain time has not elapsed (No in step S2502), If the server-equipped communication device search process has not been executed, it is determined whether or not its own server function is already valid (step S2505). If its own server function is already valid (Yes in step S2505), it returns to the message reception waiting state again. On the other hand, if the server function is not enabled (No in step S2505), it is determined whether a server function search request is received from the communication device with the server function within a certain time. Thereby, it is possible to detect whether or not a communication device with a server function exists in the lower subnetwork. If no server function search request is received from the communication device with server function within a certain time (No in step S2506 and Yes in step S2507), there is no other communication device with server function in the network. The server itself determines that it is a communication device whose server function should be validated (step S2508), the server function switching unit 405 performs server function switching processing based on appropriateness determination (step S2509), and returns to the message reception waiting state again. On the other hand, if a server function search request has been received from a communication device with a server function (Yes in step S2506), the communication device with the server function already exists in the lower subnetwork, and the state again returns to a message reception waiting state. .

[サーバ機能付き通信機器探索処理]
図15は本発明の実施の形態2におけるサーバ機能付き通信機器のサーバ機能付き通信機器探索処理(ステップS2503)の処理フローである。
[Communication device search processing with server function]
FIG. 15 is a processing flow of the communication device search processing with server function (step S2503) of the communication device with server function according to the second embodiment of the present invention.

探索によりサーバ機能付き通信機器を発見した場合の処理(ステップS1500〜ステップS1501)については前述の実施の形態1と処理が同様であるので説明を省略する。   Since processing (step S1500 to step S1501) when a communication device with a server function is found by searching is the same as that in the first embodiment, description thereof is omitted.

図24にサーバ機能探索要求の一例を示す。サーバ機能探索要求では、ボディ内のメッセージIDフィールドに本メッセージがサーバ機能探索要求であることを示すIDをセットする。また、送信元IDとして、送信元通信機器固有のIDを設定する。また、どのルータに属する通信機器か判別できるようにルータの識別情報として、例えばルータのMACアドレスや製品番号などを設定する。なお、サーバ機能探索要求送信元の通信機器がサーバ機能を有するか有さないかの情報は送信元通信機器固有のIDに含めてもよいし、他のフィールドを用意してもよい。   FIG. 24 shows an example of a server function search request. In the server function search request, an ID indicating that this message is a server function search request is set in the message ID field in the body. Also, an ID unique to the transmission source communication device is set as the transmission source ID. In addition, for example, a router MAC address or a product number is set as router identification information so that it can be determined which router a communication device belongs to. Information on whether or not the communication device of the server function search request transmission source has the server function may be included in the ID unique to the transmission source communication device, or other fields may be prepared.

上位ルータに接続されたサーバ機能付き通信機器は、サーバ機能探索要求を受信すると、自身のサーバ機能が有効である場合にのみ、サーバ機能探索・応答部403がサーバ機能探索応答をサーバ機能探索要求の送信元アドレス(IPアドレス、ポート番号)宛てに送信する。サーバ機能探索応答のフォーマットの一例は、サーバ機能探索要求と同一である。但し、メッセージIDとしてはサーバ機能探索応答であることを示すID値がセットされる。   When the server function communication device connected to the upper router receives the server function search request, the server function search / response unit 403 sends the server function search response to the server function search request only when its server function is valid. To the source address (IP address, port number). An example of the format of the server function search response is the same as the server function search request. However, an ID value indicating a server function search response is set as the message ID.

サーバ機能付き通信機器は、サーバ機能探索要求送信後サーバ機能探索応答を受信できたかを判断する(ステップS1502)。   The server-equipped communication device determines whether a server function search response has been received after transmitting the server function search request (step S1502).

サーバ機能探索応答を受信できなかった場合は(ステップS1502でNo)、何もせず処理を終了する。   If the server function search response cannot be received (No in step S1502), the process ends without doing anything.

サーバ機能探索応答を受信した場合は(ステップS1502でYes)、自身のサーバ機能がすでに有効であるかどうかを判断する(ステップS1503)。サーバ機能が有効でなければ(ステップS1503でNo)、サーバ機能が有効である通信機器がすでにネットワーク内に存在するため自身はサーバ機能を無効にするべき通信機器であると判断し(ステップS1505)、サーバ機能を切り替える必要はないので処理を終了する。サーバ機能が有効である場合は(ステップS1503でYes)、発見したサーバ機能が有効である通信機器との間でどちらがサーバ機能を有効にするべきかサーバ機能調停処理を行う(ステップS1504・後述)。   If a server function search response has been received (Yes in step S1502), it is determined whether or not its own server function is already valid (step S1503). If the server function is not valid (No in step S1503), it is determined that the server device is a communication device whose server function should be invalidated because a communication device in which the server function is valid already exists in the network (step S1505). Since it is not necessary to switch the server function, the process is terminated. When the server function is valid (Yes in step S1503), server function arbitration processing is performed to determine which server function should be validated with the communication device for which the discovered server function is valid (step S1504, which will be described later). .

[メッセージ受信処理]
図16は、本発明の実施の形態2におけるサーバ機能付き通信機器のメッセージ受信処理(ステップS2501)の処理フローである。
[Message reception processing]
FIG. 16 is a process flow of the message reception process (step S2501) of the communication device with a server function according to the second embodiment of the present invention.

サーバ機能付き通信機器4aのサーバ機能探索・応答部403は、常に、下位のルータに接続された通信機器からのサーバ機能探索要求の受信(ステップS1600)、他のサーバ機能付き通信機器からサーバ機能切り替えメッセージの受信(ステップS1602)、およびサーバ機能を持たない通信機器からの自身が属するルータの下位に複数の異なるルータが並列に接続されている旨のネットワーク構成変更通知メッセージの受信(ステップS1604)を待っている。下位のルータに接続された通信機器からのサーバ機能探索要求を受信すると(ステップS1600でYes)、後述のサーバ機能探索要求受信処理(ステップS1601)を行う。   The server function search / response unit 403 of the communication device with server function 4a always receives a server function search request from a communication device connected to a lower router (step S1600), and receives server functions from other communication devices with server function. Receiving the switching message (step S1602) and receiving a network configuration change notification message indicating that a plurality of different routers are connected in parallel below the router to which the communication device does not have a server function (step S1604). Waiting for. When a server function search request is received from a communication device connected to a lower router (Yes in step S1600), a server function search request reception process (step S1601) described later is performed.

一方、他のサーバ機能付き通信機器からサーバ機能切り替えメッセージを受信すると(ステップS1600でNo、かつ、ステップS1602でYes)、サーバ機能切り替え部405においてメッセージ受信によるサーバの切り替え処理を行う(ステップS1603)。   On the other hand, when a server function switching message is received from another communication device with a server function (No in step S1600 and Yes in step S1602), the server function switching unit 405 performs server switching processing by receiving the message (step S1603). .

また、サーバ機能を持たない通信機器からのネットワーク構成変更通知メッセージを受信すると(ステップS1600でNo、かつ、ステップS1602でNo、かつ、ステップS1604でYes)、下位サブネットワーク判断部1307において、自身が属するルータの下位に複数の異なるルータが並列に接続されていると判断し、判断結果をサーバ適正判断部404に通知する。サーバ適正判断部404は、下位サブネットワーク判断部1307の通知を受けて、自身のサーバ機能が有効であるかどうかを判断する(ステップS1605)。自身のサーバ機能が有効であれば(ステップS1605でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていてもそれぞれのルータ配下の通信機器同士は自身を介して通信が可能なため、サーバ機能を有効化する通信機器を変更する必要がないと判断し処理を終了する。自身のサーバ機能が有効でなければ(ステップS1605でNo)、上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在するかどうかを判断する(ステップS1606)。   When a network configuration change notification message is received from a communication device that does not have a server function (No in step S1600, No in step S1602, and Yes in step S1604), the lower subnetwork determination unit 1307 determines that it is It is determined that a plurality of different routers are connected in parallel below the router to which the router belongs, and the determination result is notified to the server suitability determination unit 404. The server appropriateness determination unit 404 receives the notification of the lower subnetwork determination unit 1307 and determines whether or not its server function is valid (step S1605). If its own server function is valid (Yes in step S1605), even if a plurality of different routers are connected in parallel below the router to which it belongs, the communication devices under each router can communicate with each other. Since it is possible, it is determined that there is no need to change the communication device that validates the server function, and the process ends. If its own server function is not valid (No in step S1605), it is determined whether or not there is a communication device with a server function that enables the server function in the host or peer network (step S1606).

上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在する場合は(ステップS1606でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていてもそれぞれのルータ配下の通信機器同士は現在サーバ機能を有効にしているサーバ機能付き通信機器を介して通信が可能なため、サーバ機能を有効化する通信機器を変更する必要がないと判断し処理を終了する。上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在しない場合は(ステップS1606でNo)、自身が属するルータの下位に並列に接続されたルータ配下の通信機器同士は通信ができないため、サーバ機能を有効化する通信機器を変更すべきと判断し(ステップS1607)、判断結果をサーバ機能切り替え部405に通知し、サーバ機能切り替え部405において適正判断によるサーバ機能切り替え処理を行う(ステップS1608)。   If there is a communication device with a server function that enables the server function in the higher level or peer network (Yes in step S1606), even if a plurality of different routers are connected in parallel below the router to which it belongs, Since communication devices under the router can communicate with each other via a communication device with a server function that currently enables the server function, it is determined that there is no need to change the communication device that enables the server function, and the processing is terminated. . When there is no communication device with a server function that enables the server function in the higher level or peer network (No in step S1606), communication between the communication devices under the router connected in parallel to the lower level of the router to which the device belongs is communicating. Therefore, it is determined that the communication device that activates the server function should be changed (step S1607), the determination result is notified to the server function switching unit 405, and the server function switching unit 405 performs server function switching processing based on appropriateness determination. (Step S1608).

サーバ機能探索要求もサーバ機能切り替えメッセージもネットワーク構成変更メッセージも受信しなかった場合は(ステップS1600でNo、かつステップS1602でNo、かつS1604でNo)、その他のメッセージ受信処理を行う(ステップS1609)。   If no server function search request, server function switching message, or network configuration change message has been received (No in step S1600, No in step S1602, and No in S1604), other message reception processing is performed (step S1609). .

[サーバ機能探索要求受信処理]
図17を参照しながら、サーバ機能付き通信機器のサーバ機能探索要求受信処理(ステップS1601)について説明する。
[Server function search request reception processing]
The server function search request reception process (step S1601) of the communication device with a server function will be described with reference to FIG.

サーバ機能探索要求受信処理においては、まず自身のサーバ機能が有効であるかどうかを判断する(ステップS1700)。自身のサーバ機能が有効であれば(ステップS1700でYes)サーバ機能探索要求の応答を送信し(ステップS1701)、後述の下位サブネットワーク存在判定処理(ステップS1702)を行う。自身のサーバ機能が有効でない場合は(ステップS1700でNo)、受信したサーバ機能探索要求の送信元の機器がサーバ機能付き通信機器かどうかを判断する(ステップS1704)。受信したサーバ機能探索要求の送信元の機器がサーバ機能付き通信機器であった場合は(ステップS1704でYes)、すでに他のサーバ機能が有効になった通信機器とコネクションを接続しているかどうかを判断する(ステップS1710)。すでに、サーバ機能が有効になった通信機器とコネクションを接続している場合は(ステップS1710でYes)、下位サブネットワーク存在判定処理(ステップS1702)を行う。まだ、サーバ機能が有効になった通信機器とコネクションを接続していない場合は、サーバ機能探索要求の送信元のサーバ機能付き通信機器がすでにサーバ機能を有効にしている可能性があるため、自身はサーバ機能を無効にするべき通信機器であると判断し(ステップS1707)、下位サブネットワーク存在判定処理(ステップS1702)を行う。受信したサーバ機能探索要求の送信元の機器がサーバ機能付き通信機器でなかった場合は(ステップS1704でNo)、下位サブネットワーク存在判定処理(ステップS1702)を行う。   In the server function search request reception process, first, it is determined whether or not its own server function is valid (step S1700). If the server function is valid (Yes in step S1700), a response to the server function search request is transmitted (step S1701), and a lower subnetwork existence determination process (step S1702) described later is performed. If the server function of the server is not valid (No in step S1700), it is determined whether the device that has transmitted the received server function search request is a communication device with a server function (step S1704). If the transmission source device of the received server function search request is a communication device with a server function (Yes in step S1704), it is determined whether a connection is already established with a communication device in which another server function is enabled. Judgment is made (step S1710). If the connection is already established with the communication device in which the server function is enabled (Yes in step S1710), the lower subnetwork existence determination process (step S1702) is performed. If the connection is not yet connected to a communication device with the server function enabled, the server function communication device that sent the server function search request may have already enabled the server function. Is determined to be a communication device whose server function should be invalidated (step S1707), and lower subnetwork existence determination processing (step S1702) is performed. If the transmission source device of the received server function search request is not a communication device with a server function (No in step S1704), lower subnetwork existence determination processing (step S1702) is performed.

下位サブネットワーク存在判定処理(ステップS1702)の結果、下位サブネットワーク判断部1307が自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断した場合は(ステップS1703でNo)、処理を終了する。自身が属するルータの下位に複数の異なるルータが並列に接続されていると判断した場合は(ステップS1703でYes)、自身のサーバ機能が有効であるかどうかを判断する(ステップS1705)。自身のサーバ機能が有効であれば(ステップS1705でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていてもそれぞれのルータ配下の通信機器同士は自身を介して通信が可能なため、サーバ機能を有効化する通信機器を変更する必要がないと判断し処理を終了する。自身のサーバ機能が有効でなければ(ステップS1705でNo)、上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在するかどうかを判断する(ステップS1706)。   As a result of the lower subnetwork existence determination process (step S1702), when the lower subnetwork determination unit 1307 determines that a plurality of different routers are not connected in parallel below the router to which it belongs (No in step S1703). The process is terminated. If it is determined that a plurality of different routers are connected in parallel below the router to which it belongs (Yes in step S1703), it is determined whether or not its server function is valid (step S1705). If its own server function is valid (Yes in step S1705), even if a plurality of different routers are connected in parallel below the router to which it belongs, the communication devices under each router can communicate with each other. Since it is possible, it is determined that there is no need to change the communication device that validates the server function, and the process ends. If its own server function is not valid (No in step S1705), it is determined whether or not there is a communication device with the server function in which the server function is valid in the host or peer network (step S1706).

上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在する場合は(ステップS1706でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていてもそれぞれのルータ配下の通信機器同士は現在サーバ機能を有効にしているサーバ機能付き通信機器を介して通信が可能なため、サーバ機能を有効化する通信機器を変更する必要がないと判断し処理を終了する。上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在しない場合は(ステップS1706でNo)、自身が属するルータの下位に並列に接続されたルータ配下の通信機器同士は通信ができないため、サーバ機能を有効化する通信機器を変更すべきと判断し(ステップS1708)、判断結果をサーバ機能切り替え部405に通知し、サーバ機能切り替え部405において適正判断によるサーバ機能切り替え処理を行う(ステップS1709)。   If there is a communication device with a server function that enables the server function in the higher level or peer network (Yes in step S1706), even if a plurality of different routers are connected in parallel below the router to which the server belongs, Since communication devices under the router can communicate with each other via a communication device with a server function that currently enables the server function, it is determined that there is no need to change the communication device that enables the server function, and the processing is terminated. . If there is no server-equipped communication device that enables the server function in the upper level or peer network (No in step S1706), the communication devices under the router connected in parallel below the router to which the device belongs belong to each other. Therefore, it is determined that the communication device that activates the server function should be changed (step S1708), the determination result is notified to the server function switching unit 405, and the server function switching unit 405 performs server function switching processing based on appropriateness determination. (Step S1709).

[下位サブネットワーク存在判定処理]
図18を参照しながら、サーバ機能付き通信機器の下位サブネットワーク存在判定処理(ステップS1702)について説明する。
[Low-level subnetwork existence determination processing]
With reference to FIG. 18, the lower subnetwork presence determination process (step S1702) of the communication device with a server function will be described.

下位サブネットワーク存在判定処理(ステップS1702)においては、まず下位サブネットワーク判断部1307において、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS1800)。これは、一般の家庭用ルータがもつNAPT機能やファイアウォール機能の影響によりサーバ機能探索要求は同位ネットワークまたは自身より下位のサブネットワークに存在する通信機器からしか受信しないため、ルータの識別情報が異なる場合は自身が属するルータの下位にルータが存在すると判断するためである。受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とが同じ場合は(ステップS1800でNo)同位ネットワークに存在する通信機器より受信したパケットであるため、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断して(ステップS1801)、判断結果をサーバ適正判断部404に通知し処理を終了する。一方、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とが異なる場合(ステップS1800でYes)は、自身が属するルータの下位にルータが存在するため、パケットのボディ内のルータ識別情報およびIPヘッダの送信元アドレスを記憶部402に記憶し、受信したパケットのIPヘッダの送信元アドレスと、以前に他の通信機器から受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS1802)。これは、自身が属するルータの下位に直列に複数の異なるルータが接続されているのか、並列に複数の異なるルータが接続されているかを判断するためである。家庭用ルータのNAPT機能やファイアウォール機能により、自身より下位のサブネットワークに属する通信機器から送信されたパケットの送信元アドレスはルータのWAN側アドレスに変換されることを利用すると、パケットのIPヘッダの送信元アドレスつまりルータのWAN側アドレスを比較することで、自身のルータの識別情報とは異なりかつ送信元アドレスが同じ複数のパケットを受信した場合は、直列に接続されている複数のルータに属する複数の通信機器から受信したと判断でき、また、送信元アドレスが異なる複数のパケットを受信した場合は、並列に接続されている複数のルータに属する複数の通信機器から受信したと判断できる。ゆえに、受信したパケットのIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとが同じ場合は(ステップS1802でNo)、自身が属するルータの下位に直列に複数の異なるルータが接続されており、並列には接続されていないと判断して(ステップS1801)、判断結果をサーバ適正判断部404に通知し処理を終了する。一方、受信したパケットのIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとが異なる場合は(ステップS1802でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていると判断し(ステップS1803)、判断結果をサーバ適正判断部404に通知し処理を終了する。   In the lower subnetwork existence determination process (step S1702), first, the lower subnetwork determination unit 1307 compares the router identification information included in the received server function search request with the identification information of the router to which it belongs (step S1800). ). This is because a server function search request is received only from a peer device or a communication device existing in a sub-network lower than itself due to the influence of the NAPT function and firewall function of a general home router. This is because it is determined that a router exists below the router to which it belongs. If the identification information of the router included in the received server function search request is the same as the identification information of the router to which it belongs (No in step S1800), it is a packet received from a communication device existing in the peer network, and therefore belongs to itself. It is determined that a plurality of different routers are not connected in parallel below the router (step S1801), the determination result is notified to the server suitability determination unit 404, and the process ends. On the other hand, if the identification information of the router included in the received server function search request is different from the identification information of the router to which the router belongs (Yes in step S1800), the router exists below the router to which the router belongs, The router identification information in the body and the transmission source address of the IP header are stored in the storage unit 402, the transmission source address of the IP header of the received packet, and the server function previously received from another communication device and stored in the storage unit 402 The source address of the IP header of the search request is compared (step S1802). This is to determine whether a plurality of different routers are connected in series below the router to which the router belongs or whether a plurality of different routers are connected in parallel. By using the fact that the source address of a packet transmitted from a communication device belonging to a sub-network lower than itself is converted to the WAN address of the router by using the NAPT function or firewall function of the home router, the IP header of the packet By comparing the source address, that is, the WAN address of the router, if a plurality of packets having different source identification addresses and the same source address are received, it belongs to a plurality of routers connected in series It can be determined that the packets have been received from a plurality of communication devices, and when a plurality of packets having different source addresses are received, it can be determined that the packets have been received from a plurality of communication devices belonging to a plurality of routers connected in parallel. Therefore, if the source address of the IP header of the received packet is the same as the source address of the IP header of the server function search request that was previously received and stored in the storage unit 402 (No in step S1802), it belongs to itself. It is determined that a plurality of different routers are connected in series below the router and are not connected in parallel (step S1801), the determination result is notified to the server suitability determination unit 404, and the process ends. On the other hand, if the source address of the IP header of the received packet is different from the source address of the IP header of the server function search request that has been received and stored in the storage unit 402 (Yes in step S1802), it belongs to itself. It is determined that a plurality of different routers are connected in parallel below the router (step S1803), the determination result is notified to the server suitability determination unit 404, and the process ends.

なお、本実施の形態2では、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを、複数の異なるルータに属する通信機器からサーバ機能探索要求を受信することで判断したが、サーバ機能探索要求以外のメッセージであってもよい。また、同種のメッセージではなく、異なるメッセージのルータの識別情報および送信元通信機器の識別情報を比較してもよい。   In the second embodiment, it is determined by receiving a server function search request from a communication device belonging to a plurality of different routers that a plurality of different routers are connected in parallel below the router to which the router belongs. However, it may be a message other than the server function search request. Further, the router identification information and the transmission source communication device identification information of different messages may be compared instead of the same type of message.

また、受信したサーバ機能探索要求のルータ識別情報が自身が属するルータの識別情報と異なった場合にパケット内のルータ識別情報およびIPヘッダの送信元アドレスを記憶部402に記憶するとして説明したが、サーバ機能探索要求を受信した時点で記憶部402に記憶し、受信したサーバ機能探索要求のルータ識別情報が自身が属するルータの識別情報と異なった場合に、以前に受信し記憶部402に記憶したサーバ機能探索要求のルータ識別情報とIPヘッダの送信元アドレスとを比較してもよい。   In addition, when the router identification information of the received server function search request is different from the identification information of the router to which the server belongs, the router identification information in the packet and the source address of the IP header are described as being stored in the storage unit 402. When the server function search request is received, it is stored in the storage unit 402. When the router identification information of the received server function search request is different from the identification information of the router to which the server belongs, the server function search request is received and stored in the storage unit 402. The router identification information of the server function search request may be compared with the source address of the IP header.

また、自身が属するルータと異なるルータの識別情報であり、かつ記憶部402に登録されていないルータの識別情報をもつパケットを受信した場合のみ記憶するとしてもよい。   Further, it may be stored only when a packet having router identification information different from the router to which it belongs and having router identification information not registered in the storage unit 402 is received.

また、ルータの識別情報としてMACアドレスや製造番号、ルータのLAN側アドレスなどが考えられるがこれに限定するものではなく、ルータを唯一に識別可能な情報であればよい。   The router identification information may be a MAC address, serial number, router LAN address, etc., but is not limited to this, and any information that can uniquely identify the router may be used.

また、IPヘッダの送信元アドレスを比較することにより、自身が属するルータの下位に直列に複数の異なるルータが存在するのか、あるいは並列に複数の異なるルータが存在するのかを判断するとして説明したが、直列であるか並列であるかを判断できる方法であればよくこれに限定するものではない。   In addition, although it has been described that by comparing the source address of the IP header, it is determined whether there are a plurality of different routers in series below the router to which the IP header belongs, or a plurality of different routers in parallel. Any method can be used as long as it can determine whether it is serial or parallel.

また、受信したサーバ機能探索要求に含まれるルータの識別情報が自身が属するルータと異なる場合に、以前受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスと比較するとして説明したが、先に記憶部402に記憶されているサーバ機能探索要求のIPヘッダの送信元アドレスを比較し、異なる場合にルータの識別情報を比較してもよく、比較の順番をこれ一つに定めるものではない。   In addition, when the identification information of the router included in the received server function search request is different from the router to which the server belongs, it is compared with the source address of the IP header of the server function search request received and stored in the storage unit 402. However, the source address of the IP header of the server function search request previously stored in the storage unit 402 may be compared, and if they are different, the router identification information may be compared. It is not defined.

[メッセージ受信によるサーバ機能切り替え処理]
図19は、図16のステップS1603におけるメッセージ受信によるサーバ機能切り替え処理を示す図である。
[Server function switching processing by message reception]
FIG. 19 is a diagram showing server function switching processing by message reception in step S1603 of FIG.

サーバ機能切り替え処理のトリガとして、他のサーバ機能付き通信機器からサーバ機能の有効化を指示するサーバ機能切り替えメッセージを受信した場合(ステップS1900でYes)、サーバ機能切り替え部405は、サーバ機能部/クライアント機能部406のサーバ機能部を有効化し(ステップS1901)、上位サブネットワーク解析(ステップS1500)の結果から判明した上位ルータのネットワークおよび同位ネットワークに通信機器に対し、サーバ機能探索要求を送信する(ステップS1902)。サーバ探索要求送信後、上位サブネットワークに属する通信機器からサーバ機能探索応答の受信を待ち(ステップS1903)、上位サブネットワークに属する通信機器からサーバ機能探索応答を受信した場合は(ステップS1903でYes)、自身より接続性を向上できる上位サブネットワークにサーバ機能付き通信機器が存在するためサーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS1904)処理を終了する。一方、上位サブネットワークに存在する通信機器からサーバ機能探索応答を受信できなかった場合は(ステップS1903でNo)、同位ネットワークに存在する通信機器からのサーバ機能探索応答の受信を待つ(ステップS1905)。同位ネットワークに存在する通信機器からサーバ機能探索応答を受信した場合は(ステップS1905でYes)、後述のサーバ機能調停処理を行い(ステップS1906)、サーバ機能調停処理の結果、自身のサーバ機能が有効化されたままの場合は(ステップS1907でYes)、サーバ機能の有効化を指示したサーバ機能切り替えメッセージの送信元であるサーバ機能付き通信機器に対しサーバ機能有効化応答を送信して(ステップS1909)、処理を終了する。サーバ機能調停処理の結果、自身のサーバ機能が無効化された場合は(ステップS1907でNo)、そのまま処理を終了する。同位ネットワークに存在する通信機器からサーバ機能探索応答を受信しなかった場合は(ステップS1905でNo)、現在までサーバ機能を有効化していた通信機器に対しサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し(ステップS1908)、サーバ機能の有効化を指示したサーバ機能切り替えメッセージの送信元であるサーバ機能付き通信機器に対しサーバ機能有効化応答を送信して(ステップS1909)、処理を終了する。   When a server function switching message instructing activation of the server function is received from another communication device with a server function as a trigger for the server function switching process (Yes in step S1900), the server function switching unit 405 The server function unit of the client function unit 406 is activated (step S1901), and a server function search request is transmitted to the communication device to the network of the upper router and the peer network determined from the result of the upper subnetwork analysis (step S1500) ( Step S1902). After transmitting the server search request, the server waits for a server function search response from a communication device belonging to the upper subnetwork (step S1903). If a server function search response is received from a communication device belonging to the upper subnetwork (Yes in step S1903). Since the communication device with the server function exists in the higher-level sub-network that can improve the connectivity, the server function unit of the server function unit / client function unit 406 is disabled and the client function unit is enabled (step S1904). finish. On the other hand, if the server function search response cannot be received from the communication device existing in the higher-level subnetwork (No in step S1903), the reception of the server function search response from the communication device existing in the peer network is awaited (step S1905). . When a server function search response is received from a communication device existing in the peer network (Yes in step S1905), a server function arbitration process described later is performed (step S1906). As a result of the server function arbitration process, its own server function is valid. If the server function has been activated (Yes in step S1907), a server function activation response is transmitted to the communication apparatus with the server function that is the transmission source of the server function switching message instructing activation of the server function (step S1909). ), The process is terminated. If the server function is disabled as a result of the server function arbitration process (No in step S1907), the process ends. If a server function search response has not been received from a communication device that exists in the peer network (No in step S1905), the server function switch that instructs the communication device that has already enabled the server function to disable the server function A message is transmitted (step S1908), a server function activation response is transmitted to the communication device with the server function that is the transmission source of the server function switching message instructing activation of the server function (step S1909), and the process is terminated. To do.

一方、他のサーバ機能付き通信機器からサーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信した場合は(ステップS1900でNo、かつ、ステップS1910でYes)、自身がサービスを提供している通信機器にサーバ機能を交代する他の通信機器の情報を送信し(ステップS1911)、サーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS1912)処理を終了する。   On the other hand, when a server function switching message for instructing invalidation of the server function is received from another communication device with a server function (No in step S1900 and Yes in step S1910), the communication that provides the service itself Information on other communication devices that replace the server function is transmitted to the device (step S 1911), the server function unit of the server function unit / client function unit 406 is disabled, and the client function unit is enabled (step S 1912). finish.

[適正判断によるサーバ機能切り替え処理]
図20は、図16のステップS1608、図17のステップS1709、および、図25のステップS2509における適性判断によるサーバ機能切り替え処理を示す図である。
[Server function switching process based on appropriate judgment]
FIG. 20 is a diagram showing server function switching processing based on suitability determination in step S1608 in FIG. 16, step S1709 in FIG. 17, and step S2509 in FIG.

サーバ機能切り替え処理のトリガとして、サーバ適正判断部404から自身はサーバ機能を有効にするべき通信機器である判断通知を受信すると(ステップS2000でYes)、サーバ機能部/クライアント機能部406のサーバ機能部を有効化・クライアント機能部を無効化して(ステップS2003)処理を終了する。サーバ適正判断部404から自身はサーバ機能を無効にするべき通信機器である判断通知を受信すると(ステップS2000でNo、かつ、ステップS2001でYes)、サーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS2004)処理を終了する。   When the server function switching process trigger is received from the server suitability determination unit 404 as a communication notification that the server function is to be enabled (Yes in step S2000), the server function unit / client function unit 406 server function The part is validated and the client function part is invalidated (step S2003), and the process is terminated. When the server appropriateness determination unit 404 receives a determination notification that it is a communication device that should invalidate the server function (No in step S2000 and Yes in step S2001), the server function unit of the server function unit / client function unit 406 The client function unit is disabled (step S2004), and the process is terminated.

一方、サーバ適正判断部404からサーバ機能を有効化する通信機器を変更するべきである判断通知を受信すると(S2000でNo、かつ、S2001でNo、かつ、ステップS2002でYes)、上位、および同位ネットワークに対してサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し(ステップS2005)、サーバ機能有効化応答の受信を待つ(ステップS2006)。一定時間内にサーバ機能有効化応答を受信した場合は(ステップS2007でNo、かつ、ステップS2006でYes)、上位または同位ネットワークに存在するいずれかのサーバ機能付き通信機器がサーバ機能を有効化したため何もせずに処理を終了する。一方、一定時間内にサーバ機能有効化応答を受信しなかった場合は(ステップS2006でNo、かつ、ステップS2007でYes)、上位および同位ネットワークにサーバ機能付き通信機器が存在しないためサーバ機能部/クライアント機能部406のサーバ機能部を有効化・クライアント機能部を無効化し(ステップS2008)、現在サーバ機能を有効化しているサーバ機能付き通信機器に対しサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信して(ステップS2009)処理を終了する。   On the other hand, when a notification of determination that the communication device that activates the server function should be changed is received from the server suitability determination unit 404 (No in S2000, No in S2001, and Yes in step S2002), the higher rank and the peer A server function switching message for instructing activation of the server function is transmitted to the network (step S2005), and reception of a server function activation response is awaited (step S2006). If a server function activation response is received within a certain time (No in step S2007 and Yes in step S2006), either one of the communication devices with the server function in the upper level or peer network has activated the server function. The process ends without doing anything. On the other hand, if the server function activation response is not received within a certain time (No in step S2006 and Yes in step S2007), the server function unit / Server function switching message for instructing to disable the server function for the server function communication device that currently enables the server function by enabling the server function part of the client function unit 406 and disabling the client function unit (step S2008). Is transmitted (step S2009), and the process is terminated.

なお、本実施の形態では、自身のサーバ機能が有効化されておらず、かつ、上位または同位ネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在しない場合に、サーバ機能を有効化する通信機器を変更すべきと判断するとして説明したが、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを検知した際に常に最上位にサーバ機能を有効化する通信装置を設置するように交代したい場合は、自身のサーバ機能が有効化されている場合であっても、上位サブネットワークにサーバ機能を有効にしているサーバ機能付き通信機器が存在していなければ、サーバ機能を有効化する通信機器を変更すべきと判断して上位サブネットワークに対しサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信してもよい。   In this embodiment, the server function is enabled when the server function is not enabled and there is no communication device with the server function that enables the server function in the host or peer network. It is explained that it is determined that the communication device to be changed should be changed. However, when it is detected that multiple different routers are connected in parallel under the router to which it belongs, communication that always enables the server function at the highest level. If you want to switch to install the device, even if your server function is enabled, if there is no communication device with server function that enables the server function in the upper subnetwork, A server function switching message that determines that the communication device that activates the server function should be changed and instructs the higher-level subnetwork to activate the server function. It may be transmitted di.

なお、本実施の形態では、上位、および同位ネットワークに対しサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信するとして説明したが、自身のサーバ機能が有効でなければサーバ機能切り替えメッセージを送信せずに自身のサーバ機能を有効にしてもよい。また、複数のサーバ機能付き通信機器に対しサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信するのではなく、上位または同位ネットワークに存在するサーバ機能付き通信機器の中であらかじめ決めておいた1台に対してサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信してもよい。   In this embodiment, the server function switching message for instructing the server function to be activated is transmitted to the host and peer networks. However, if the server function is not valid, the server function switching message is transmitted. Instead, the server function may be validated. Also, instead of sending a server function switching message for instructing the server function to be activated to a plurality of communication devices with a server function, it is determined in advance among communication devices with a server function existing in a higher level or peer network. You may transmit the server function switching message which instruct | indicates validation of a server function with respect to 1 unit | set.

[サーバ機能調停処理]
図21を参照しながら、図15のステップS1504、および図19のステップS1908におけるサーバ機能調停処理について説明する。
[Server function arbitration]
The server function arbitration process in step S1504 in FIG. 15 and step S1908 in FIG. 19 will be described with reference to FIG.

サーバ機能調停処理は、サーバ機能を有効化してサービスを提供する通信機器を1台に調停するための処理である。   The server function arbitration process is a process for mediating one communication device that provides a service by enabling the server function.

サーバ機能調停処理においては、発見したサーバ機能を有効化しているサーバ機能通信機器と自身とのサーバ機能を有効化している時間を比較し(ステップS2100)、自身の方が短ければ(ステップS2101でNo)、現在サービスを提供している通信機器が存在するかどうかを判断する(ステップS2102)。現在ネットワーク上のいずれかの通信機器にサービスを提供している場合は(ステップS2102でYes)、自身がサービスを提供している通信機器にサーバ機能を交代する他の通信機器の情報を送信し(ステップS2104)、サーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS2103)処理を終了する。現在ネットワーク上の通信機器にサービスを提供していない場合は(ステップS2102でNo)、サーバ機能部/クライアント機能部406のサーバ機能部を無効化・クライアント機能部を有効化して(ステップS2103)処理を終了する。サーバ機能を有効化している時間が自身のほうが長ければ(ステップS2101でYes)、発見したサーバ機能を有効化していた通信機器に対しサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し(ステップS2105)、処理を終了する。   In the server function arbitration process, the server function communication device that activates the found server function is compared with the time during which the server function is activated (step S2100), and if the server function is shorter (in step S2101) No), it is determined whether there is a communication device that currently provides a service (step S2102). If a service is currently being provided to any communication device on the network (Yes in step S2102), information on the other communication device that replaces the server function is transmitted to the communication device that is providing the service. (Step S2104) The server function unit / client function unit 406 of the server function unit / client function unit 406 is invalidated and the client function unit is validated (Step S2103), and the process is terminated. If the service is not currently provided to the communication device on the network (No in step S2102), the server function unit of the server function unit / client function unit 406 is disabled and the client function unit is enabled (step S2103). Exit. If the time during which the server function is enabled is longer (Yes in step S2101), a server function switching message for instructing to disable the server function is transmitted to the communication device that has enabled the found server function ( Step S2105), the process is terminated.

なお、同位ネットワークに存在するサーバ機能付き通信機器からサーバ機能探索応答を受信した場合にサーバ機能を有効化しいている時間を比較するとして説明したが、サーバ機能を有効化している時間はサーバ機能探索要求およびサーバ機能探索応答にフィールドを用意して情報交換してもよいし、その他のメッセージを使用してもよい。   Although it has been described that the server function search time is compared when a server function search response is received from a communication device with a server function that exists in the peer network, the server function search time is the server function search time. Information may be exchanged by preparing fields in the request and server function search response, or other messages may be used.

また、本実施の形態においては調停のための判断材料としてサーバ機能を有効化している時間を用いるが、サーバ機能の調停方法は本記述に限るものではなく、サーバ機能を有効化している時間以外の判断基準、例えば、サービスを提供している通信機器の台数、備えている機能や処理能力、製造月日(通信機器としての新しさ)などを用いて比較してもよく、これに限定するものではなく、他の方法によって1台に調停してもよい。   In this embodiment, the time for which the server function is activated is used as a judgment material for arbitration. However, the arbitration method for the server function is not limited to this description, and other than the time for which the server function is activated. May be compared using, for example, the number of communication devices providing services, the functions and processing capabilities provided, the date of manufacture (newness as a communication device), etc. It may not be a thing but may mediate to one by other methods.

[サーバ機能をもたない通信機器の機能構成]
図14は、本発明の実施の形態2におけるサーバ機能をもたない通信機器5aの構成を示す機能ブロック図である。サーバ機能を持たない通信機器の機能構成は、サーバ機能を持つ通信機器からサーバ機能の処理に関する機能部を取り除いた構成となる。図14に示す機能ブロック図は、図5に示す機能ブロック図と比較し、下位サブネットワーク判断部1407を備えている点で相違する。その他の構成要素は、図5と同様であるため、図5と同様の構成要素には同一の符号を付し、詳細な説明は省略する。なお、本実施の形態におけるサーバ機能をもたない他の通信機器も同じ構成をとるものとする。以下、その機能構成について説明する。
[Functional configuration of communication equipment without server function]
FIG. 14 is a functional block diagram showing the configuration of the communication device 5a having no server function in Embodiment 2 of the present invention. The functional configuration of a communication device that does not have a server function is a configuration in which a functional unit related to processing of the server function is removed from a communication device that has a server function. The functional block diagram shown in FIG. 14 is different from the functional block diagram shown in FIG. 5 in that a lower subnetwork determining unit 1407 is provided. Since the other components are the same as those in FIG. 5, the same components as those in FIG. 5 are denoted by the same reference numerals, and detailed description thereof is omitted. In addition, the other communication apparatus which does not have a server function in this Embodiment shall also have the same structure. The functional configuration will be described below.

図14において、サーバ機能をもたない通信機器5aは、通信I/F部500と、上位サブネットワーク判断部501と、記憶部502と、サーバ機能探索部503と、クライアント機能部506と、下位サブネットワーク判断部1407を備えている。   In FIG. 14, the communication device 5a having no server function includes a communication I / F unit 500, an upper subnetwork determination unit 501, a storage unit 502, a server function search unit 503, a client function unit 506, A sub-network determination unit 1407 is provided.

通信I/F部500、上位サブネットワーク判断部501、記憶部502と、サーバ機能探索部503およびクライアント機能部506は実施の形態1に示す同機能部と処理機能が同様であるため説明を省略する。   The communication I / F unit 500, the higher-level subnetwork determination unit 501, the storage unit 502, the server function search unit 503, and the client function unit 506 have the same function units and processing functions as those described in the first embodiment, and thus description thereof is omitted. To do.

[下位サブネットワーク判断部]
下位サブネットワーク判断部1407は、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する機能部である。下位サブネットワーク判断部1407は、自身以外の通信機器から通信を開始して受信したパケットのボディに含まれるルータの識別情報、およびIPヘッダに含まれる送信元のIPアドレスを比較して複数の異なるルータの存在を検知した場合に、自身が属するネットワークおよび上位サブネットワーク宛に自身が属するルータの下位に複数の異なるルータが並列に接続されている旨のネットワーク構成変更通知メッセージを送信する。
[Low-level subnetwork judgment unit]
The lower subnetwork determining unit 1407 is a functional unit that determines that a plurality of different routers are connected in parallel below the router to which the lower subnetwork belongs. The lower subnetwork determining unit 1407 compares the router identification information included in the body of the packet received by starting communication from a communication device other than itself, and the source IP address included in the IP header, so that a plurality of different information is obtained. When the presence of a router is detected, a network configuration change notification message is transmitted to the effect that a plurality of different routers are connected in parallel below the router to which the router belongs to the network to which the router belongs and the upper subnetwork.

[サーバ機能をもたない通信機器の動作の概要]
以上のように構成されたサーバ機能をもたない付き通信機器5a〜5dの動作概要について、図22、図23を用いて説明する。
[Overview of operation of communication equipment without server function]
An outline of operations of the attached communication devices 5a to 5d having no server function configured as described above will be described with reference to FIGS.

図22は本発明の実施の形態2におけるサーバ機能をもたない通信機器の処理フローである。   FIG. 22 is a processing flow of a communication device having no server function in Embodiment 2 of the present invention.

サーバ機能をもたない通信機器は、サーバ機能付き通信機器と同様に一定時間ごとに上位サブネットワーク判断部501により上位サブネットワーク解析(ステップS2208)を実施し、上位サブネットワーク解析の結果を基に”サーバ機能が有効である通信機器”を探すためにサーバ機能探索要求を送信する(ステップS2209)。なお、本動作は実施の形態1におけるサーバ機能をもたない通信機器の動作と同様であるため詳細な説明は省略する。ただし、サーバ機能探索要求およびサーバ機能探索応答は図24に示すフォーマットに従うものとする。   The communication device having no server function performs upper subnetwork analysis (step S2208) by the upper subnetwork determining unit 501 at regular intervals in the same manner as the communication device with server function, and based on the result of the upper subnetwork analysis. A server function search request is transmitted to search for a “communication device in which the server function is valid” (step S2209). Since this operation is the same as the operation of the communication device having no server function in the first embodiment, detailed description thereof is omitted. However, it is assumed that the server function search request and the server function search response follow the format shown in FIG.

サーバ機能探索要求送信後、サーバ機能探索部503はサーバ機能探索応答受信を待ち(ステップS2200)、サーバ機能探索応答を受信すると(ステップS2200でYes)、サーバ機能探索応答の送信元であるサーバ機能付き通信機器に対し通信路を接続して(ステップS2201)サービスを受ける。   After transmitting the server function search request, the server function search unit 503 waits for reception of the server function search response (step S2200). When the server function search response is received (Yes in step S2200), the server function that is the source of the server function search response A communication path is connected to the attached communication device (step S2201) to receive a service.

また、サーバ機能探索要求を受信すると(ステップS2203でYes)、後述の下位サブネットワーク存在判定処理(ステップS2204)を行う。   Further, when a server function search request is received (Yes in step S2203), a lower subnetwork existence determination process (step S2204) described later is performed.

一方、サーバ機能探索応答以外のメッセージを受信した場合は(ステップS2200でNo、かつ、ステップS2203でNo、かつ、ステップS2205でYes)、その他のメッセージ受信処理を行う(ステップS2206)。   On the other hand, when a message other than the server function search response is received (No in step S2200, No in step S2203, and Yes in step S2205), other message reception processing is performed (step S2206).

[下位サブネットワーク存在判定処理]
図23を参照しながら、サーバ機能をもたない通信機器の下位サブネットワーク存在判定処理(ステップS2204)について説明する。
[Low-level subnetwork existence determination processing]
With reference to FIG. 23, the lower subnetwork existence determination process (step S2204) of the communication device having no server function will be described.

下位サブネットワーク存在判定処理(ステップS2204)においては、まず下位サブネットワーク判断部1407において、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS2300)。受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とが同じ場合は(ステップS2300でNo)同位ネットワークに存在する通信機器より受信したパケットであるため、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断し処理を終了する。一方、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とが異なる場合(ステップS2300でYes)は、自身が属するルータの下位にルータが存在するため、パケットのボディ内のルータ識別情報およびIPヘッダの送信元アドレスを記憶部502に記憶し、受信したパケットのIPヘッダの送信元アドレスと、以前に他の通信機器から受信し記憶部502に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS2301)。受信したパケットのIPヘッダの送信元アドレスと、以前に受信し記憶部502に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとが同じ場合は(ステップS2301でNo)、自身が属するルータの下位に直列に複数の異なるルータが接続されており、並列には接続されていないと判断して処理を終了する。一方、受信したパケットのIPヘッダの送信元アドレスと、以前に受信し記憶部502に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとが異なる場合は(ステップS2301でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていると判断し、上位サブネットワーク解析(ステップS2308)の結果から判明した上位または同位ネットワークにサーバ機能を有効化したサーバ機能付き通信機器が存在していれば(ステップS2302でYes)特に何もせず処理を終了し、存在していなければ(ステップS2302でNo)、上位および同位ネットワークに対し、下位に複数の異なるルータが並列に接続された旨を示すネットワーク構成変更通知を送信して(ステップS2303)処理を終了する。   In the lower subnetwork existence determination process (step S2204), first, the lower subnetwork determination unit 1407 compares the router identification information included in the received server function search request with the identification information of the router to which it belongs (step S2300). ). If the identification information of the router included in the received server function search request is the same as the identification information of the router to which it belongs (No in step S2300), it is a packet received from a communication device existing in the peer network, and therefore belongs to itself. It is determined that a plurality of different routers are not connected in parallel below the router, and the process ends. On the other hand, if the identification information of the router included in the received server function search request is different from the identification information of the router to which the router belongs (Yes in step S2300), the router exists below the router to which the router belongs, The router identification information in the body and the source address of the IP header are stored in the storage unit 502, the source address of the IP header of the received packet, and the server function previously received from other communication devices and stored in the storage unit 502 The source address of the IP header of the search request is compared (step S2301). If the source address of the IP header of the received packet is the same as the source address of the IP header of the server function search request that was previously received and stored in the storage unit 502 (No in step S2301), the router of the router to which it belongs. A plurality of different routers are connected in series at the lower level, and it is determined that they are not connected in parallel, and the process ends. On the other hand, if the source address of the IP header of the received packet is different from the source address of the IP header of the server function search request received and stored in the storage unit 502 (Yes in step S2301), it belongs to itself. There is a communication device with a server function that determines that a plurality of different routers are connected in parallel below the router, and the server function is enabled in the upper or peer network determined from the result of the upper subnetwork analysis (step S2308). If so (Yes in step S2302), the process is terminated without doing anything, and if it does not exist (No in step S2302), a plurality of different routers are connected in parallel to the lower and peer networks. A network configuration change notification indicating this is transmitted (step S2303), and the process is terminated. .

以下、このような環境において、サーバ機能切り替え処理が行われる例を説明する。   Hereinafter, an example in which server function switching processing is performed in such an environment will be described.

[サーバ機能付き通信機器が上位サブネットワークに新規に接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能付き通信機器4aがネットワークに新規に接続された例を用いて、上位サブネットワークにサーバ機能付き通信機器が新規に接続された場合の処理について説明する。なお、ルータ3aのMACアドレスは00−0E−7F−F9−87−28、送信元アドレスは192.168.1.1、ルータ3bのMACアドレスは00−08−02−0A−DA−86、送信元アドレスは192.168.2.220、ルータ3cのMACアドレスは00−11−43−BD−BE−43、送信元アドレスは192.168.3.10、とする。
[When a communication device with a server function is newly connected to the upper subnetwork]
In FIG. 1, using the example in which the server-equipped communication device 4b is newly connected to the network while the server-function-equipped communication device 4b is valid, the server-function-equipped communication device is newly added to the upper subnetwork. The processing when connected to will be described. Note that the MAC address of the router 3a is 00-0E-7F-F9-87-28, the transmission source address is 192.168.1.1, the MAC address of the router 3b is 00-08-02-0A-DA-86, The source address is 192.168.2.220, the MAC address of the router 3c is 00-11-43-BD-BE-43, and the source address is 192.168.3.10.

サーバ機能付き通信機器4aはネットワークに新規に接続されると、初回のみ一定時間を待たずにすぐにサーバ機能付き通信機器探索処理(ステップS2503)を行う。サーバ機能付き通信機器探索処理(ステップS2503)において上位サブネットワーク解析を実施する(ステップS1500)。その結果、本実施の形態2においてはサーバ機能付き通信機器4aが接続されているルータ3aが最上位ルータであり自身より上位にネットワークが存在しないと判断されるため、同位ネットワークにのみサーバ機能探索要求をマルチキャストで送信する(ステップS1501)。同位ネットワークに”サーバ機能が有効である通信機器”が存在しないため探索要求の応答はなく(ステップS1502でNo)、サーバ機能付き通信機器探索処理(ステップS2503)を終了する。サーバ機能付き通信機器4aは、サーバ機能付き通信機器探索処理(ステップS2503)において、サーバ機能探索要求の応答を受信しておらず(ステップS2504でNo)、かつ、新規にネットワークに接続されており、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態であるため(ステップS2505でYes)、一定時間下位のサブネットワークからのサーバ機能探索要求の受信を待つ。ルータ3aの下位には、ルータ3bおよびルータ3cが存在し、それぞれにサーバ機能付き通信機器4bおよび4cが接続されているため、サーバ機能付き通信機器4aはいずれかのサーバ機能付き通信機器からサーバ機能探索要求を受信し(ステップS2500でYes、ステップS2501を実行し、ステップS1600でYes)、サーバ機能探索要求受信処理(ステップS1601)を実行する。ここでは、仮にサーバ機能付き通信機器4bからサーバ機能探索要求を受信したことにする。サーバ機能探索要求受信処理(ステップS1601)において、サーバ機能が有効でないため(ステップS1700でNo)サーバ機能探索応答は送信しない。また、サーバ機能探索要求の送信元の通信機器はサーバ機能付き通信機器4bであり(ステップS1704でYes)、かつ、サーバ機能付き通信機器4aはサーバ機能を有効化しているサーバ機能付き通信機器4bとはコネクションを接続していないため(ステップS1710でNo)、自身はサーバ機能を無効にするべき通信機器であると判断し(ステップS1707)、下位サブネットワーク存在判定処理(ステップS1702)を行う。下位サブネットワーク存在判定処理(ステップS1702)においては、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS1800)。自身が属するルータ3aのMACアドレス00−0E−7F−F9−87−28と受信したパケットに含まれるルータの識別情報であるルータ3bのMACアドレス00−08−02−0A−DA−86とは異なるため(ステップS1800でYes)、受信したサーバ機能探索要求のIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS1802)。ここで、サーバ機能付き通信機器4aは新規に接続されたばかりで他にサーバ機能探索要求を受信していないため比較することができない(ステップS1802でNo)。サーバ機能付き通信機器4bから受信したサーバ機能探索要求に含まれるルータの識別情報とIPヘッダの送信元アドレスを記憶部402に記憶し、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断して(ステップS1801)下位サブネットワーク存在判定処理(ステップS1702)を終了する。下位サブネットワーク存在判定処理(ステップS1702)の結果、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断したため(ステップS1703でYes)、メッセージ受信処理を終了し、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態で以降の動作を行う。   When the server-equipped communication device 4a is newly connected to the network, the server device-equipped communication device search process (step S2503) is performed immediately without waiting for a predetermined time only for the first time. In the communication function search processing with a server function (step S2503), the upper subnetwork analysis is performed (step S1500). As a result, in the second embodiment, since it is determined that the router 3a to which the communication device with server function 4a is connected is the highest router and there is no network above itself, the server function search is performed only in the peer network. The request is transmitted by multicast (step S1501). Since there is no “communication device in which the server function is valid” in the peer network, there is no response to the search request (No in step S1502), and the server-equipped communication device search process (step S2503) is terminated. The communication device with server function 4a has not received a response to the server function search request in the communication device search process with server function (step S2503) (No in step S2504), and is newly connected to the network. Since the server function of the server function unit / client function unit 406 is not activated (Yes in step S2505), it waits for reception of a server function search request from a subnetwork lower than a certain time. Since the router 3b and the router 3c exist below the router 3a, and the communication devices 4b and 4c with server functions are connected to the router 3a, the communication device 4a with server function is changed from any of the communication devices with server function to the server. A function search request is received (Yes in step S2500, step S2501 is executed, and step S1600 is Yes), and a server function search request reception process (step S1601) is executed. Here, it is assumed that a server function search request is received from the communication device 4b with a server function. In the server function search request reception process (step S1601), the server function search response is not transmitted because the server function is not valid (No in step S1700). In addition, the communication device with the server function search request is the communication device 4b with the server function (Yes in step S1704), and the communication device 4a with the server function is the communication device 4b with the server function that enables the server function. Since the connection is not connected (No in step S1710), it is determined that it is a communication device whose server function should be disabled (step S1707), and the lower subnetwork existence determination process (step S1702) is performed. In the lower subnetwork existence determination process (step S1702), the router identification information included in the received server function search request is compared with the identification information of the router to which it belongs (step S1800). What is the MAC address 00-0E-7F-F9-87-28 of the router 3a to which the router itself belongs and the MAC address 00-08-02-0A-DA-86 of the router 3b, which is router identification information included in the received packet? Because they are different (Yes in step S1800), the source address of the IP header of the received server function search request is compared with the source address of the IP header of the server function search request that has been received and stored in the storage unit 402 ( Step S1802). Here, the server function-equipped communication device 4a has just been newly connected and has not received another server function search request, and therefore cannot be compared (No in step S1802). The router identification information and the IP header source address included in the server function search request received from the server function communication device 4b are stored in the storage unit 402, and a plurality of different routers are arranged in parallel below the router to which the server belongs. It is determined that they are not connected (step S1801), and the lower subnetwork existence determination process (step S1702) is terminated. As a result of the lower subnetwork existence determination processing (step S1702), since it is determined that a plurality of different routers are not connected in parallel below the router to which the subnetwork belongs (Yes in step S1703), the message reception processing ends, and the server The subsequent operations are performed in a state where the server function of the function unit / client function unit 406 is not activated.

[サーバ機能付き通信機器が下位サブネットワークに新規に接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能付き通信機器4cがネットワークに新規に接続された例を用いて、上位サブネットワークにサーバ機能付き通信機器が新規に接続された場合の処理について説明する。なお、ルータ3aのMACアドレスは00−0E−7F−F9−87−28、送信元アドレスは192.168.1.1、ルータ3bのMACアドレスは00−08−02−0A−DA−86、送信元アドレスは192.168.2.220、ルータ3cのMACアドレスは00−11−43−BD−BE−43、送信元アドレスは192.168.3.10、とする。
[When a communication device with server function is newly connected to a lower subnetwork]
In FIG. 1, a communication device with a server function is newly added to a higher-level subnetwork using an example in which the communication device with a server function 4b is newly connected to the network while the communication device with a server function 4b is enabled. The processing when connected to will be described. Note that the MAC address of the router 3a is 00-0E-7F-F9-87-28, the transmission source address is 192.168.1.1, the MAC address of the router 3b is 00-08-02-0A-DA-86, The source address is 192.168.2.220, the MAC address of the router 3c is 00-11-43-BD-BE-43, and the source address is 192.168.3.10.

サーバ機能付き通信機器4cはネットワークに新規に接続されると、初回のみ一定時間を待たずにすぐにサーバ機能付き通信機器探索処理(ステップS2503)を行う。サーバ機能付き通信機器探索処理(ステップS2503)において上位サブネットワーク解析を実施する(ステップS1500)。その結果得られたルータ3a及びルータ3bのネットワークアドレス情報を元にして、ルータ3a及びルータ3bに接続された”サーバ機能が有効である通信機器”のアドレスを推定し、サーバ機能探索要求を送信する(ステップS1501)。また、自身が接続されているルータ3cのネットワークに対しサーバ機能探索要求をマルチキャストで送信する(ステップS1501)。ここで、上位サブネットワークのルータ3bに接続されるサーバ機能付き通信機器4bはサーバ機能を有効にしており、サーバ機能付通信機器4cからサーバ機能探索要求を受信すると(ステップS2500でYes、ステップS2501を実行し、ステップS1600でYes)、サーバ機能探索要求受信処理(ステップS1601)を実行する。サーバ機能探索要求受信処理(ステップS1601)において、サーバ機能付き通信機器4bは自身のサーバ機能が有効化されているので(ステップS1700でYes)サーバ機能付き通信機器4cに対しサーバ機能探索応答を送信する(ステップS1701)。サーバ機能付き通信機器4cはサーバ機能付通信機器4bからサーバ機能探索応答を受信し(ステップS1502でYes)、かつ、新規にネットワークに接続されており、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態であるため(ステップS1503でNo)、自身はサーバ機能を無効にするべき通信機器であると判断して(ステップS706)サーバ機能付き通信機器探索処理を終了し、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態で以降の動作を行う。   When the server-equipped communication device 4c is newly connected to the network, the server-equipped communication device search process (step S2503) is performed immediately without waiting for a certain time only for the first time. In the communication function search processing with a server function (step S2503), the upper subnetwork analysis is performed (step S1500). Based on the network address information of the router 3a and the router 3b obtained as a result, the address of the “communication device in which the server function is valid” connected to the router 3a and the router 3b is estimated, and a server function search request is transmitted. (Step S1501). Also, a server function search request is transmitted by multicast to the network of the router 3c to which it is connected (step S1501). Here, the server-equipped communication device 4b connected to the router 3b of the higher-level subnetwork has enabled the server function, and when a server function search request is received from the server-equipped communication device 4c (Yes in step S2500, step S2501). And the server function search request reception process (step S1601) is executed. In the server function search request receiving process (step S1601), since the server function-equipped communication device 4b has its server function enabled (Yes in step S1700), a server function search response is transmitted to the server function-equipped communication device 4c. (Step S1701). The server function communication device 4c receives the server function search response from the server function communication device 4b (Yes in step S1502), and is newly connected to the network. The server function of the server function unit / client function unit 406 Is not activated (No in step S1503), it is determined that it is a communication device whose server function should be invalidated (step S706), and the server-equipped communication device search process is terminated. The subsequent operations are performed in a state where the server function of the function unit / client function unit 406 is not activated.

一方、サーバ機能付き通信機器4cよりサーバ機能探索要求を受信したサーバ機能付き通信機器4は、サーバ機能付き通信機器4cに対しサーバ機能探索応答を送信後(ステップS1701)、下位サブネットワーク存在判定処理(ステップS1702)を行う。下位サブネットワーク存在判定処理(ステップS1702)においては、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS1800)。自身が属するルータ3bのMACアドレス00−08−02−0A−DA−86と受信したパケットに含まれるルータの識別情報であるルータ3cのMACアドレス00−11−43−BD−BE−43とは異なるため(ステップS1800でYes)、受信したサーバ機能探索要求のIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS1802)。ここで、サーバ機能付き通信機器4bはサーバ機能を有効化しているため、ルータ3cに接続された下位サブネットワークに存在するサーバ機能をもたない通信機器5cとコネクションを接続しているとすると、記憶部402にはサーバ機能をもたない通信機器5cからサーバ機能探索要求を受信した際にルータ3cのMACアドレスとIPヘッダの送信元アドレス192.168.3.10が記憶されている。サーバ機能付き通信機器4bは、サーバ機能付き通信機器4cから受信したサーバ機能探索要求の送信元アドレス192.168.3.10と、記憶部402に記憶されているサーバ機能をもたない通信機器5cから受信したサーバ機能探索要求の送信元アドレス192.168.3.10とが同じなため(ステップS1802でNo)、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断して(ステップS1801)下位サブネットワーク存在判定処理(ステップS1702)を終了する。下位サブネットワーク存在判定処理(ステップS1702)の結果、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断したため(ステップS1703でYes)、メッセージ受信処理を終了する。   On the other hand, the server-equipped communication device 4 that has received the server function search request from the server-equipped communication device 4c transmits a server function search response to the server-function-equipped communication device 4c (step S1701), and then performs a lower subnetwork existence determination process. (Step S1702) is performed. In the lower subnetwork existence determination process (step S1702), the router identification information included in the received server function search request is compared with the identification information of the router to which it belongs (step S1800). What is the MAC address 00-08-02-0A-DA-86 of the router 3b to which it belongs and the MAC address 00-11-43-BD-BE-43 of the router 3c, which is router identification information included in the received packet? Because they are different (Yes in step S1800), the source address of the IP header of the received server function search request is compared with the source address of the IP header of the server function search request that has been received and stored in the storage unit 402 ( Step S1802). Here, since the communication device 4b with the server function has validated the server function, assuming that the connection is made with the communication device 5c that does not have the server function and exists in the lower subnetwork connected to the router 3c. The storage unit 402 stores the MAC address of the router 3c and the source address 192.168.3.10 of the IP header when a server function search request is received from the communication device 5c having no server function. The communication device 4b with a server function includes a transmission source address 192.168.3.10 of the server function search request received from the communication device 4c with a server function, and a communication device having no server function stored in the storage unit 402. Since the source address 192.168.3.10 of the server function search request received from 5c is the same (No in step S1802), a plurality of different routers are not connected in parallel below the router to which the server belongs. (Step S1801), the lower subnetwork existence determination process (Step S1702) is terminated. As a result of the lower subnetwork existence determination process (step S1702), since it is determined that a plurality of different routers are not connected in parallel below the router to which the subnetwork belongs (Yes in step S1703), the message reception process is terminated.

一方、サーバ機能付き通信機器3cが送信したサーバ機能探索要求はサーバ機能付き通信機器4aも受信する。サーバ機能付き通信機器4aもサーバ機能付き4b同様に下位サブネットワーク存在判定処理を行うが、ルータ3bおよびルータ3cが直列に接続されているため、下位サブネットワークに存在するいかなる通信機器より受信するサーバ機能探索要求も全てルータ3bのMACアドレスおよび送信元アドレスで構成されるため、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断し、メッセージ受信処理を終了する。   On the other hand, the server function search request transmitted by the server function communication device 3c is also received by the server function communication device 4a. The communication device 4a with the server function also performs the lower subnetwork existence determination process similarly to the server function 4b. However, since the router 3b and the router 3c are connected in series, the server receives from any communication device existing in the lower subnetwork. Since all the function search requests are also composed of the MAC address and the source address of the router 3b, it is determined that a plurality of different routers are not connected in parallel below the router to which the function search request belongs, and the message reception process ends.

[サーバ機能を有効にしたサーバ機能付き通信機器を含む上位サブネットワークが接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能を有効にしたサーバ機能付き通信機器4aを含むネットワーク(ルータ3aとルータ3aに接続する通信機器)が新規に接続された例を用いて、上位サブネットワークが新規に接続された場合の処理について説明する。なお、ルータ3aのMACアドレスは00−0E−7F−F9−87−28、送信元アドレスは192.168.1.1、ルータ3bのMACアドレスは00−08−02−0A−DA−86、送信元アドレスは192.168.2.220、ルータ3cのMACアドレスは00−11−43−BD−BE−43、送信元アドレスは192.168.3.10、とする。
[When a higher-level subnetwork that includes a server-equipped communication device with the server function enabled is connected]
In FIG. 1, a network (router 3a and a communication device connected to the router 3a) including the communication device 4a with the server function in which the server function is enabled while the communication device 4b with the server function is enabled is newly provided. A process when a higher-level subnetwork is newly connected will be described using a connected example. Note that the MAC address of the router 3a is 00-0E-7F-F9-87-28, the transmission source address is 192.168.1.1, the MAC address of the router 3b is 00-08-02-0A-DA-86, The source address is 192.168.2.220, the MAC address of the router 3c is 00-11-43-BD-BE-43, and the source address is 192.168.3.10.

サーバ機能付き通信機器4bは定期的にサーバ機能探索付き通信機器探索処理(ステップS2503)を実施している。サーバ機能付き通信機器探索処理(ステップS2503)において、上位サブネットワーク解析(ステップS1500)を実施し、上位サブネットワーク(ルータ3aに接続されたネットワーク)が新たに接続されていることを上位サブネットワーク解析により発見した場合、サーバ機能付き通信機器4bは上位サブネットワークに対してサーバ機能探索要求を送信する(ステップS1501)。また、同位ネットワークに対しても同様にサーバ機能探索要求を送信する(ステップS1501)。ここで、上位サブネットワークのルータ3aに接続されるサーバ機能付き通信機器4aがサーバ機能を有効にしているためサーバ機能探索応答を受信する(ステップS1502でYes)。上位サブネットワークにサーバ機能を有効にしたサーバ機能付き通信機器が存在し、かつ自身のサーバ機能は有効であるため(ステップS1503でYes)、サーバ機能を有効にするサーバ機能付き通信機器をどちらか一方にしぼるべくサーバ機能調停処理を行う(ステップS1504)。サーバ機能調停処理(ステップS1504)において、発見したサーバ機能付き通信機器4aと自身とのサーバ機能を有効化している時間を比較する(ステップS2100)。ここでは、仮にサーバ機能付き通信機器4aがサーバ機能を有効化している時間を5分、サーバ機能付き通信機器4bがサーバ機能を有効化している時間を1時間とする。発見したサーバ機能付き通信機器4aと自身とのサーバ機能を有効化している時間を比較した結果、自身の方がサーバ機能を有効化している時間が長いため(ステップS2101でYes)、サーバ機能付き通信機器4bは、サーバ機能付き通信機器4aに対しサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し(ステップS2105)、サーバ機能調停処理(ステップS2503)を終了する。   The communication device with server function 4b periodically performs communication device search processing with server function search (step S2503). In the communication device search processing with a server function (step S2503), the upper subnetwork analysis (step S1500) is performed, and the upper subnetwork analysis (network connected to the router 3a) is newly connected. If found, the server function-equipped communication device 4b transmits a server function search request to the upper subnetwork (step S1501). Similarly, a server function search request is transmitted to the peer network (step S1501). Here, since the server function-equipped communication device 4a connected to the router 3a of the higher-level subnetwork has validated the server function, the server function search response is received (Yes in step S1502). Since there is a server-equipped communication device in which the server function is enabled in the upper subnetwork and the server function is valid (Yes in step S1503), either of the communication devices with the server function that enables the server function is selected. On the other hand, server function arbitration processing is performed to reduce the number (step S1504). In the server function arbitration process (step S1504), the time for which the server function with the discovered server function-equipped communication device 4a is validated is compared (step S2100). Here, it is assumed that the communication function 4a with the server function activates the server function for 5 minutes, and the communication apparatus 4b with the server function activates the server function for 1 hour. As a result of comparing the time during which the server function with the server function with server function 4a and the server function enabled is found, the server function is enabled for a longer time (Yes in step S2101). The communication device 4b transmits a server function switching message for instructing invalidation of the server function to the communication device 4a with a server function (step S2105), and ends the server function arbitration process (step S2503).

一方、サーバ機能付き通信機器4aは自身が属しているルータ3aの下位にルータ3bおよびルータ3cが接続されそれぞれにサーバ機能付き通信機器4bおよび4cが接続されているため、いずれかのサーバ機能付き通信機器からサーバ機能探索要求を受信し(ステップS2500でYes、ステップS2501を実行し、ステップS1600でYes)、サーバ機能探索要求受信処理(ステップS1601)を実行する。ここでは、仮にサーバ機能付き通信機器4bからサーバ機能探索要求を受信したことにする。サーバ機能探索要求受信処理(ステップS1601)において、サーバ機能が有効であるため(ステップS1700でYes)、サーバ機能付き通信機器4bに対しサーバ機能探索応答を送信し(ステップS1701)、下位サブネットワーク存在判定処理(ステップS1702)を行う。下位サブネットワーク存在判定処理(ステップS1702)においては、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS1800)。自身が属するルータ3aのMACアドレス00−0E−7F−F9−87−28と受信したパケットに含まれるルータの識別情報であるルータ3bのMACアドレス00−08−02−0A−DA−86とは異なるため(ステップS1800でYes)、受信したサーバ機能探索要求のIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS1802)。ここで、サーバ機能付き通信機器4aを含むネットワークは新規に接続されたばかりであり、ルータ3bおよびルータ3cに接続された通信機器とコネクションを接続していないとすると、下位サブネットワークに存在する通信機器からは他にサーバ機能探索要求を受信していないため比較することができない(ステップS1802でNo)。サーバ機能付き通信機器4bから受信したサーバ機能探索要求に含まれるルータの識別情報とIPヘッダの送信元アドレスを記憶部402に記憶し、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断して(ステップS1801)下位サブネットワーク存在判定処理(ステップS1702)を終了する。下位サブネットワーク存在判定処理(ステップS1702)の結果、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断したため(ステップS1703でYes)、メッセージ受信処理を終了する。その後サーバ機能通信機器4bよりサーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信し(ステップS2500でYes、ステップS2501を実行し、ステップS1600でNo、かつ、S1602でYes)、メッセージ受信によるサーバ機能切り替え処理を行う(ステップS1603)。メッセージ受信によるサーバ機能切り替え処理(ステップS1603)において、メッセージ受信によるサーバ機能切り替え処理を行う(ステップS1603)。メッセージ受信によるサーバ機能切り替え処理(ステップS1603)においては、サーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信しているため(ステップS1900でNo、かつ、ステップS1910でYes)、サービスを提供している通信機器に対し交代するサーバ機能付き通信機器4bの情報を通知し(ステップS1911)、自身のサーバ機能を無効化する(ステップS1912)。   On the other hand, since the communication device 4a with a server function is connected to the router 3b and the router 3c below the router 3a to which the server function belongs, and the communication devices 4b and 4c with a server function are respectively connected to the communication device 4a. A server function search request is received from the communication device (Yes in step S2500, step S2501 is executed, and step S1600 is Yes), and a server function search request reception process (step S1601) is executed. Here, it is assumed that a server function search request is received from the communication device 4b with a server function. In the server function search request reception process (step S1601), since the server function is valid (Yes in step S1700), a server function search response is transmitted to the communication device 4b with a server function (step S1701), and a lower subnetwork exists. A determination process (step S1702) is performed. In the lower subnetwork existence determination process (step S1702), the router identification information included in the received server function search request is compared with the identification information of the router to which it belongs (step S1800). What is the MAC address 00-0E-7F-F9-87-28 of the router 3a to which the router itself belongs and the MAC address 00-08-02-0A-DA-86 of the router 3b, which is router identification information included in the received packet? Because they are different (Yes in step S1800), the source address of the IP header of the received server function search request is compared with the source address of the IP header of the server function search request that has been received and stored in the storage unit 402 ( Step S1802). Here, if the network including the server-equipped communication device 4a has just been newly connected, and no connection is connected to the communication device connected to the router 3b and the router 3c, the communication device existing in the lower subnetwork Since no other server function search request has been received, comparison cannot be made (No in step S1802). The router identification information and the IP header source address included in the server function search request received from the server function communication device 4b are stored in the storage unit 402, and a plurality of different routers are arranged in parallel below the router to which the server belongs. It is determined that they are not connected (step S1801), and the lower subnetwork existence determination process (step S1702) is terminated. As a result of the lower subnetwork existence determination process (step S1702), since it is determined that a plurality of different routers are not connected in parallel below the router to which the subnetwork belongs (Yes in step S1703), the message reception process is terminated. Thereafter, a server function switching message for instructing the server function to be invalidated is received from the server function communication device 4b (Yes in Step S2500, Step S2501 is executed, No in Step S1600, and Yes in S1602), and the server by message reception A function switching process is performed (step S1603). In server function switching processing by message reception (step S1603), server function switching processing by message reception is performed (step S1603). In the server function switching process (step S1603) by receiving a message, since the server function switching message instructing invalidation of the server function is received (No in step S1900 and Yes in step S1910), the service is provided. Information on the communication device with server function 4b to be replaced is notified to the communication device being replaced (step S1911), and its own server function is invalidated (step S1912).

[サーバ機能を有効にしたサーバ機能付き通信機器を含む下位サブネットワークが接続された場合]
図1において、サーバ機能付き通信機器4bがサーバ機能を有効にしている状態でサーバ機能を有効にしたサーバ機能付き通信機器4cを含むネットワーク(ルータ3cとルータ3cに接続する通信機器)が新規に接続された例を用いて、下位サブネットワークが新規に接続された場合の処理について説明する。なお、ルータ3aのMACアドレスは00−0E−7F−F9−87−28、送信元アドレスは192.168.1.1、ルータ3bのMACアドレスは00−08−02−0A−DA−86、送信元アドレスは192.168.2.220、ルータ3cのMACアドレスは00−11−43−BD−BE−43、送信元アドレスは192.168.3.10、とする。
[When a sub-network including a server-equipped communication device with the server function enabled is connected]
In FIG. 1, a network (router 3c and a communication device connected to the router 3c) including the communication device 4c with the server function in which the server function is enabled while the communication device 4b with the server function is enabled is newly provided. Processing when a lower subnetwork is newly connected will be described using a connected example. Note that the MAC address of the router 3a is 00-0E-7F-F9-87-28, the transmission source address is 192.168.1.1, the MAC address of the router 3b is 00-08-02-0A-DA-86, The source address is 192.168.2.220, the MAC address of the router 3c is 00-11-43-BD-BE-43, and the source address is 192.168.3.10.

サーバ機能付き通信機器4cは定期的にサーバ機能探索付き通信機器探索処理(ステップS2503)を実施している。サーバ機能付き通信機器探索処理(ステップS2503)において、上位サブネットワーク解析(ステップS1500)を実施し、上位サブネットワーク(ルータ3aに接続されたネットワークおよびルータ3bに接続されたネットワーク)が新たに接続されていることを上位サブネットワーク解析により発見した場合、サーバ機能付き通信機器4cは上位サブネットワークに対してサーバ機能探索要求を送信する(ステップS1501)。また、同位ネットワークに対しても同様にサーバ機能探索要求を送信する(ステップS1501)。ここで、上位サブネットワークのルータ3bに接続されるサーバ機能付き通信機器4bがサーバ機能を有効にしているためサーバ機能探索応答を受信する(ステップS1502でYes)。上位サブネットワークにサーバ機能を有効にしたサーバ機能付き通信機器が存在し、かつ自身のサーバ機能は有効であるため(ステップS1503でYes)、サーバ機能を有効にするサーバ機能付き通信機器をどちらか一方にしぼるべくサーバ機能調停処理を行う(ステップS1504)。サーバ機能調停処理(ステップS1504)において、発見したサーバ機能付き通信機器4bと自身とのサーバ機能を有効化している時間を比較する(ステップS2100)。ここでは、仮にサーバ機能付き通信機器4cがサーバ機能を有効化している時間を5分、サーバ機能付き通信機器4bがサーバ機能を有効化している時間を1時間とする。発見したサーバ機能付き通信機器4bと自身とのサーバ機能を有効化している時間を比較した結果、自身の方がサーバ機能を有効化している時間が短く(ステップS2101でNo)、かつ、サーバ機能を持たない通信機器4cにサービスを提供しているため(ステップS2102でYes)、サービスを提供しているサーバ機能をもたない通信機器3cに対して交代するサーバ機能付き通信機器4bの情報を通知し(ステップS2104)、自身のサーバ機能を無効化して(ステップS2103)以降の動作を行う。   The server-equipped communication device 4c periodically performs communication device search processing with server function search (step S2503). In the communication device search processing with a server function (step S2503), the upper subnetwork analysis (step S1500) is performed, and the upper subnetwork (the network connected to the router 3a and the network connected to the router 3b) is newly connected. Is detected by the upper subnetwork analysis, the server-equipped communication device 4c transmits a server function search request to the upper subnetwork (step S1501). Similarly, a server function search request is transmitted to the peer network (step S1501). Here, since the server function-equipped communication device 4b connected to the router 3b of the higher-level subnetwork has validated the server function, the server function search response is received (Yes in step S1502). Since there is a server-equipped communication device in which the server function is enabled in the upper subnetwork and the server function is valid (Yes in step S1503), either of the communication devices with the server function that enables the server function is selected. On the other hand, server function arbitration processing is performed to reduce the number (step S1504). In the server function arbitration process (step S1504), the time during which the server function with the server function-equipped communication device 4b that has been discovered is validated is compared (step S2100). Here, it is assumed that the time when the communication device with server function 4c validates the server function is 5 minutes, and the time when the communication device with server function 4b validates the server function is 1 hour. As a result of comparing the time during which the server function with the server function with the server function 4b and the server function enabled is found, the time during which the server function is enabled is shorter (No in step S2101), and the server function Since the service is provided to the communication device 4c that does not have the service (Yes in step S2102), the information on the communication device 4b with the server function that replaces the communication device 3c that does not have the server function that provides the service is displayed. Notification is made (step S2104), the server function is invalidated (step S2103), and the subsequent operations are performed.

一方、サーバ機能付き通信機器4bは自身が属しているルータ3bの下位にルータ3cが接続されそれぞれにサーバ機能付き通信機器4cが接続されているため、サーバ機能付き通信機器4cからサーバ機能探索要求を受信し(ステップS2500でYes、ステップS2501を実行し、ステップS1600でYes)、サーバ機能探索要求受信処理(ステップS1601)を実行する。サーバ機能探索要求受信処理(ステップS1601)において、サーバ機能が有効であるため(ステップS1700でYes)、サーバ機能付き通信機器4cに対しサーバ機能探索応答を送信し(ステップS1701)、下位サブネットワーク存在判定処理(ステップS1702)を行う。下位サブネットワーク存在判定処理(ステップS1702)においては、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS1800)。自身が属するルータ3bのMACアドレス00−08−02−0A−DA−86と受信したパケットに含まれるルータの識別情報であるルータ3cのMACアドレス00−11−43−BD−BE−43とは異なるため(ステップS1800でYes)、受信したサーバ機能探索要求のIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS1802)。ここで、サーバ機能付き通信機器4bを含むネットワークの下位にはこれまでサブネットワークが存在しなかったため他に下位サブネットワークに存在する通信機器からはサーバ機能探索要求を受信しておらず比較することができない(ステップS1802でNo)。サーバ機能付き通信機器4cから受信したサーバ機能探索要求に含まれるルータの識別情報とIPヘッダの送信元アドレスを記憶部402に記憶し、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断して(ステップS1801)下位サブネットワーク存在判定処理(ステップS1702)を終了する。下位サブネットワーク存在判定処理(ステップS1702)の結果、自身が属するルータの下位には複数の異なるルータは並列に接続されていないと判断したため(ステップS1703でYes)、メッセージ受信処理を終了し、再びメッセージ受信処理待ちの状態に戻る。   On the other hand, since the communication device 4b with a server function is connected to the router 3c below the router 3b to which the server function belongs, and the communication device 4c with a server function is connected to each of the communication devices 4b with a server function, (Yes in Step S2500, Step S2501 is executed and Yes in Step S1600), and server function search request reception processing (Step S1601) is executed. In the server function search request reception process (step S1601), since the server function is valid (Yes in step S1700), a server function search response is transmitted to the communication device 4c with a server function (step S1701), and a lower subnetwork exists. A determination process (step S1702) is performed. In the lower subnetwork existence determination process (step S1702), the router identification information included in the received server function search request is compared with the identification information of the router to which it belongs (step S1800). What is the MAC address 00-08-02-0A-DA-86 of the router 3b to which it belongs and the MAC address 00-11-43-BD-BE-43 of the router 3c, which is router identification information included in the received packet? Because they are different (Yes in step S1800), the source address of the IP header of the received server function search request is compared with the source address of the IP header of the server function search request that has been received and stored in the storage unit 402 ( Step S1802). Here, since no subnetwork has existed in the lower level of the network including the communication device with server function 4b so far, a server function search request has not been received from any other communication device in the lower subnetwork. Cannot be performed (No in step S1802). The router identification information and the source address of the IP header included in the server function search request received from the server function communication device 4c are stored in the storage unit 402, and a plurality of different routers are arranged in parallel below the router to which the server belongs. It is determined that they are not connected (step S1801), and the lower subnetwork existence determination process (step S1702) is terminated. As a result of the lower subnetwork existence determination process (step S1702), since it is determined that a plurality of different routers are not connected in parallel below the router to which the subnetwork belongs (Yes in step S1703), the message reception process ends, and again Return to message reception waiting state.

[サーバ機能付き通信機器が下位に複数の異なるルータが並列に接続されていることを検知した場合]
図26において、サーバ機能付き通信機器4cがサーバ機能を有効化している状態で、サーバ機能付き通信機器4bが自身が属するルータ3bの下位に複数の異なるルータが並列に接続されていることを検知してサーバ機能切り替え処理が行われる例を説明する。なお、ルータ3bのMACアドレスは00−08−02−0A−DA−86、送信元アドレスは192.168.2.220、ルータ3cのMACアドレスは00−11−43−BD−BE−43、送信元アドレスは192.168.3.10、ルータ3dのMACアドレスは00−D0−59−67−7A−FE、送信元アドレスは192.168.3.20とする。
[When a communication device with a server function detects that multiple different routers are connected in parallel underneath]
In FIG. 26, when the communication device with server function 4c has enabled the server function, the communication device with server function 4b detects that a plurality of different routers are connected in parallel below the router 3b to which it belongs. An example in which server function switching processing is performed will be described. The MAC address of the router 3b is 00-08-02-0A-DA-86, the transmission source address is 192.168.2.220, the MAC address of the router 3c is 00-11-43-BD-BE-43, The transmission source address is 192.168.3.10, the router 3d MAC address is 00-D0-59-67-7A-FE, and the transmission source address is 192.168.3.20.

ルータ3dおよびサーバ機能付き通信機器4dが新規にネットワークに接続されると、サーバ機能付き通信機器4dは初回のみ一定時間を待たずにすぐにサーバ機能付き通信機器探索処理(ステップS2503)を行う。サーバ機能付き通信機器探索処理(ステップS2503)において上位サブネットワーク解析を実施し(ステップS1500)、上位サブネットワーク解析の結果をうけて上位の各ルータに接続された”サーバ機能が有効である通信機器”のアドレスを推定し、サーバ機能探索要求をユニキャストで送信する(ステップS1501)、また、同時に同位ネットワーク内にサーバ機能探索要求をマルチキャストで送信する(ステップS1501)。現在サーバ機能を有効化しているサーバ機能付き通信機器は4cであり、サーバ機能付き通信機器4dの上位サブネットワークおよび同位ネットワークにサーバ機能を有効化しているサーバ機能付き通信機器が存在しないためサーバ機能探索要求の応答はなく(ステップS1502でNo)、サーバ機能付き通信機器探索処理(ステップS2503)を終了する。サーバ機能付き通信機器4dは、サーバ機能付き通信機器探索処理(ステップS2503)において、サーバ機能探索要求の応答を受信しておらず(ステップS2504でNo)、かつ、新規にネットワークに接続されており、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態であるため(ステップS2505でYes)、一定時間下位のサブネットワークからのサーバ機能探索要求の受信を待つ。しかし、下位サブネットワークが存在しないため一定時間内にメッセージを受信しない(ステップS2506でNo、かつ、ステップS2507でYes)。そのため自身のサーバ機能を有効化するべきと判断し(ステップS2508)、適正判断によるサーバ機能切り替え処理(ステップS2509)を行う。適正判断によるサーバ機能切り替え処理(ステップS2509)においては、自身はサーバ機能を有効にするべき通信機器であると判断しているため(ステップS2000でYes)、自身のサーバ機能を有効化する(ステップS2003)。   When the router 3d and the server-equipped communication device 4d are newly connected to the network, the server-equipped communication device 4d immediately performs the server-equipped communication device search process (step S2503) without waiting for a certain period of time. In the communication device search processing with a server function (step S2503), a higher-level subnetwork analysis is performed (step S1500), and the result of the higher-level subnetwork analysis is received. The server function search request is transmitted by unicast (step S1501), and at the same time, the server function search request is transmitted by multicast within the peer network (step S1501). The server function communication device that currently enables the server function is 4c, and there is no server function communication device that enables the server function in the upper subnetwork and peer network of the server function communication device 4d. There is no response to the search request (No in step S1502), and the server-equipped communication device search process (step S2503) is terminated. The communication device with server function 4d has not received a response to the server function search request in the communication device search processing with server function (step S2503) (No in step S2504), and is newly connected to the network. Since the server function of the server function unit / client function unit 406 is not activated (Yes in step S2505), it waits for reception of a server function search request from a subnetwork lower than a certain time. However, since there is no lower subnetwork, the message is not received within a predetermined time (No in step S2506 and Yes in step S2507). Therefore, it is determined that its own server function should be validated (step S2508), and server function switching processing (step S2509) based on appropriateness determination is performed. In the server function switching process (step S2509) based on appropriateness determination, since it is determined that it is a communication device that should enable the server function (Yes in step S2000), the server function is enabled (step S2000). S2003).

一方、サーバ機能付き通信機器4bは常にメッセージの受信を待っている(ステップS2500)。ルータ3dおよびサーバ機能付き通信機器4dがネットワークに接続されると、サーバ機能付き通信機器4dからのサーバ機能探索要求を受信し(ステップS2500でYes、ステップS2501を実行し、ステップS1600でYes)、サーバ機能探索要求受信処理(ステップS1601)を実行する。サーバ機能探索要求受信処理(ステップS1601)において、サーバ機能が有効でないため(ステップS1700でNo)サーバ機能探索応答は送信しない。また、サーバ機能探索要求の送信元の通信機器は、サーバ機能付き通信機器4dであるが(ステップS1704でYes)、すでにサーバ機能を有効化しているサーバ機能付き通信機器4cとコネクションを接続しているため(ステップS1710でYes)、下位サブネットワーク存在判定処理(ステップS1702)を行う。下位サブネットワーク存在判定処理(ステップS1702)においては、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS1800)。自身が属するルータ3bのMACアドレス00−08−02−0A−DA−86と受信したパケットに含まれるルータの識別情報であるルータ3dのMACアドレス00−D0−59−67−7A−FEとは異なるため(ステップS1800でYes)、受信したサーバ機能探索要求のIPヘッダの送信元アドレスと、以前に受信し記憶部402に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS1802)。現在サーバ機能を有効化しているサーバ機能付き通信機器4cには、定期的に上位サブネットワーク解析を行い上位サブネットワークのサーバ機能付き通信機器に対してサーバ機能探索要求を送信する機能が存在するため、サーバ機能付き通信機器4bの記憶部402には、サーバ機能付き通信機器4cが属しているルータ3cのMACアドレスおよび送信元アドレスが記憶されている。サーバ機能付き通信機器4cから受信したサーバ機能探索要求の送信元アドレス192.168.3.10と、サーバ機能付き通信機器4dから受信したサーバ機能探索要求の送信元アドレス192.168.3.20とは異なるため(ステップS1802でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていると判断する(ステップS1803)。下位サブネットワーク存在判定処理(ステップS1702)の結果、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを検知し(ステップS1703でYes)、かつ、自身のサーバ機能は有効化されていないので(ステップS1705でNo)、サーバ機能を有効化した通信機器が上位または同位ネットワークに存在するかどうか判断する(ステップS1706)。現在サーバ機能を有効化しているサーバ機能付き通信機器は3cであり、自身が属するルータの下位に存在するルータに属しているため(ステップS1706でNo)、サーバ機能を有効化するべき通信機器を変更するべきと判断し(ステップS1708)、適正判断によるサーバ機能切り替え処理を行う(ステップS1709)。適正判断によるサーバ機能切り替え処理(ステップS1709)においては、サーバ機能を有効化する通信機器を変更するべきと判断しているため(ステップS200でNo、かつ、ステップS2001でNo、かつ、ステップS2002でYes)、上位ルータ3aのネットワークおよび同位ネットワークに対し、サーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し(ステップS2005)、サーバ機能有効化応答の受信を待つ(ステップS2006)。   On the other hand, the communication device with server function 4b always waits for reception of a message (step S2500). When the router 3d and the server-equipped communication device 4d are connected to the network, a server function search request is received from the server-equipped communication device 4d (Yes in Step S2500, Step S2501 is executed, and Yes in Step S1600). Server function search request reception processing (step S1601) is executed. In the server function search request reception process (step S1601), the server function search response is not transmitted because the server function is not valid (No in step S1700). The communication device that is the transmission source of the server function search request is the communication device 4d with the server function (Yes in step S1704), and the connection is made with the communication device 4c with the server function that has already enabled the server function. (Yes in step S1710), lower subnetwork existence determination processing (step S1702) is performed. In the lower subnetwork existence determination process (step S1702), the router identification information included in the received server function search request is compared with the identification information of the router to which it belongs (step S1800). What is the MAC address 00-08-02-0A-DA-86 of the router 3b to which the router itself belongs and the MAC address 00-D0-59-67-7A-FE of the router 3d which is router identification information included in the received packet? Because they are different (Yes in step S1800), the source address of the IP header of the received server function search request is compared with the source address of the IP header of the server function search request that has been received and stored in the storage unit 402 ( Step S1802). The server-equipped communication device 4c that currently has the server function enabled has a function of periodically performing higher-level subnetwork analysis and transmitting a server function search request to the higher-level subnetwork-equipped communication device with server function. The storage unit 402 of the communication device with server function 4b stores the MAC address and the transmission source address of the router 3c to which the communication device with server function 4c belongs. Server function search request source address 192.168.3.10 received from the server function communication device 4c and server function search request source address 192.168.3.20 received from the server function communication device 4d. (Yes in step S1802), it is determined that a plurality of different routers are connected in parallel below the router to which it belongs (step S1803). As a result of the lower subnetwork existence determination process (step S1702), it is detected that a plurality of different routers are connected in parallel below the router to which it belongs (Yes in step S1703), and its own server function is valid. Therefore, it is determined whether or not the communication device with the server function enabled exists in the host or peer network (step S1706). Since the server-equipped communication device that currently activates the server function is 3c and belongs to a router that exists below the router to which it belongs (No in step S1706), the communication device that should activate the server function is selected. It is determined that it should be changed (step S1708), and server function switching processing based on appropriateness determination is performed (step S1709). In the server function switching process (step S1709) based on appropriateness determination, it is determined that the communication device that activates the server function should be changed (No in step S200, No in step S2001, and in step S2002). Yes), a server function switching message for instructing activation of the server function is transmitted to the network and peer network of the upper router 3a (step S2005), and reception of a server function activation response is awaited (step S2006).

このとき、上位ルータ3aに接続するサーバ機能付き通信機器4aはサーバ機能付き通信機器4bからのサーバ機能の有効化を指示するサーバ機能切り替えメッセージを受信し(ステップS2500でYes、ステップS2501を実行し、ステップS1600でNo、かつステップS1602でYes)、メッセージ受信によるサーバ機能切り替え処理を行う(ステップS1603)。メッセージ受信によるサーバ機能切り替え処理(ステップS1603)においては、サーバ機能の有効化を指示するサーバ機能切り替えメッセージを受信しているため(ステップS1900でYes)、自身のサーバ機能を有効化する(ステップS1901)。次に、上位サブネットワーク解析(ステップS1500)の結果サーバ機能付き通信機器4aが接続されているルータ3aが最上位ルータであると判明しているため、同位ネットワークにのみサーバ機能探索要求をマルチキャストで送信する(ステップS1902)。同位ネットワークにサーバ機能付き通信機器は4aしか存在せず、サーバ機能探索応答を受信しないため(ステップS1903でNo、かつ、ステップS1905でNo)、サーバ機能を有効化しているサーバ機能付き通信機器4cおよび4dに対しサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し(ステップS1908)、サーバ機能付き通信機器4bに対しサーバ機能有効化応答を送信する(ステップS1909)。   At this time, the communication device 4a with a server function connected to the upper router 3a receives a server function switching message instructing the activation of the server function from the communication device 4b with a server function (Yes in step S2500, and executes step S2501). No in step S1600 and Yes in step S1602), server function switching processing by message reception is performed (step S1603). In the server function switching process (step S1603) by receiving a message, since the server function switching message for instructing the server function is received (Yes in step S1900), the server function is enabled (step S1901). ). Next, as a result of the upper subnetwork analysis (step S1500), it has been found that the router 3a to which the communication device with server function 4a is connected is the highest router, so that a server function search request is multicast only to the peer network. Transmit (step S1902). The communication device with server function 4c exists only in the peer network, and the server function search response is not received (No in step S1903 and No in step S1905). A server function switching message for instructing the server function to be invalidated is transmitted to 4d and 4d (step S1908), and a server function validation response is transmitted to the communication device with server function 4b (step S1909).

サーバ機能付き通信機器4bは一定時間内にサーバ機能付き通信機器4aからのサーバ機能有効化応答を受信したため(ステップS2007でNo、かつ、ステップS2006でYes)、サーバ機能を有効化する通信機器を切り替えられたとして処理を終了する。   Since the server-equipped communication device 4b has received the server function validation response from the server-equipped communication device 4a within a predetermined time (No in step S2007 and Yes in step S2006), the communication device that activates the server function is selected. The processing is terminated as it is switched.

一方、サーバ機能付き通信機器4aからサーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信(ステップS2500でYes、ステップS2501を実行し、ステップS1600でNo、かつステップS1602でYes)したサーバ機能付き通信機器4cおよび4dは、メッセージ受信によるサーバ機能切り替え処理を行う(ステップS1603)。メッセージ受信によるサーバ機能切り替え処理(ステップS1603)においては、サーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信しているため(ステップS1900でNo、かつ、ステップS1910でYes)、サービスを提供している通信機器に対し交代するサーバ機能付き通信機器4aの情報を通知し(ステップS1911)、自身のサーバ機能を無効化する(ステップS1912)。   On the other hand, a server function switching message for instructing invalidation of the server function is received from the communication device with server function 4a (Yes in Step S2500, Step S2501 is executed, No in Step S1600, and Yes in Step S1602). The communication devices 4c and 4d perform server function switching processing by message reception (step S1603). In the server function switching process (step S1603) by receiving a message, since the server function switching message instructing invalidation of the server function is received (No in step S1900 and Yes in step S1910), the service is provided. Information on the communication device 4a with server function to be replaced is notified to the communication device being replaced (step S1911), and its own server function is invalidated (step S1912).

なお、ルータ3dおよびサーバ機能をもたない通信機器5dが新規に接続された場合についても同様に、サーバ機能付き通信機器4bがサーバ機能をもたない通信機器5dによるサーバ機能探索要求を受信することで自身が属するルータの下位に複数の異なるルータが並列に接続されていることを検知してサーバ機能を有効化するべき通信機器を変更する。   Similarly, when the router 3d and the communication device 5d that does not have a server function are newly connected, the communication device 4b with a server function receives a server function search request from the communication device 5d that does not have a server function. As a result, it detects that a plurality of different routers are connected in parallel below the router to which it belongs, and changes the communication device to enable the server function.

[サーバ機能をもたない通信機器が下位に複数の異なるルータが並列に接続されていることを検知した場合]
図26において、サーバ機能付き通信機器4cがサーバ機能を有効化している状態で、サーバ機能をもたない通信機器5bが下位に複数の異なるルータが並列に接続されていることを検知してサーバ機能切り替え処理が行われる例を説明する。なお、図26においては、サーバ機能付き通信機器4bが図示されているが本実施の形態ではサーバ機能付き通信機器4bは存在しないものとして説明する。なお、ルータ3bのMACアドレスは00−08−02−0A−DA−86、送信元アドレスは192.168.2.220、ルータ3cのMACアドレスは00−11−43−BD−BE−43、送信元アドレスは192.168.3.10、ルータ3dのMACアドレスは00−D0−59−67−7A−FE、送信元アドレスは192.168.3.20とする。
[When a communication device that does not have a server function detects that multiple different routers are connected in parallel underneath]
In FIG. 26, when the communication device 4c with a server function is valid, the communication device 5b having no server function detects that a plurality of different routers are connected in parallel at the lower level. An example in which function switching processing is performed will be described. In FIG. 26, the communication device 4b with a server function is illustrated, but in the present embodiment, it is assumed that the communication device 4b with a server function does not exist. The MAC address of the router 3b is 00-08-02-0A-DA-86, the transmission source address is 192.168.2.220, the MAC address of the router 3c is 00-11-43-BD-BE-43, The transmission source address is 192.168.3.10, the router 3d MAC address is 00-D0-59-67-7A-FE, and the transmission source address is 192.168.3.20.

ルータ3dおよびサーバ機能付き通信機器4dが新規にネットワークに接続されると、サーバ機能付き通信機器4dは初回のみ一定時間を待たずにすぐにサーバ機能付き通信機器探索処理(ステップS2503)を行う。サーバ機能付き通信機器探索処理(ステップS2503)において上位サブネットワーク解析を実施し(ステップS1500)、上位サブネットワーク解析の結果をうけて上位の各ルータに接続された”サーバ機能が有効である通信機器”のアドレスを推定し、サーバ機能探索要求をユニキャストで送信する(ステップS1501)、また、同時に同位ネットワーク内にサーバ機能探索要求をマルチキャストで送信する(ステップS1501)。現在サーバ機能を有効化しているサーバ機能付き通信機器は4cであり、サーバ機能付き通信機器4dの上位サブネットワークおよび同位ネットワークにサーバ機能を有効化しているサーバ機能付き通信機器が存在しないためサーバ機能探索要求の応答はなく(ステップS1502でNo)、サーバ機能付き通信機器探索処理(ステップS2503)を終了する。サーバ機能付き通信機器4dは、サーバ機能付き通信機器探索処理(ステップS2503)において、サーバ機能探索要求の応答を受信しておらず(ステップS2504でNo)、かつ、新規にネットワークに接続されており、サーバ機能部/クライアント機能部406のサーバ機能が有効化されていない状態であるため(ステップS2505でYes)、一定時間下位のサブネットワークからのサーバ機能探索要求の受信を待つ。しかし、下位サブネットワークが存在しないため一定時間内にメッセージを受信しない(ステップS2506でNo、かつ、ステップS2507でYes)。そのため自身のサーバ機能を有効化するべきと判断し(ステップS2508)、適正判断によるサーバ機能切り替え処理を行う(ステップS2509)。適正判断によるサーバ機能切り替え処理(ステップS2509)においては、自身はサーバ機能を有効にするべき通信機器であると判断しているため(ステップS2000でYes)、自身のサーバ機能を有効化する(ステップS2003)。   When the router 3d and the server-equipped communication device 4d are newly connected to the network, the server-equipped communication device 4d immediately performs the server-equipped communication device search process (step S2503) without waiting for a certain period of time. In the communication device search processing with a server function (step S2503), a higher-level subnetwork analysis is performed (step S1500), and the result of the higher-level subnetwork analysis is received. The server function search request is transmitted by unicast (step S1501), and at the same time, the server function search request is transmitted by multicast within the peer network (step S1501). The server function communication device that currently enables the server function is 4c, and there is no server function communication device that enables the server function in the upper subnetwork and peer network of the server function communication device 4d. There is no response to the search request (No in step S1502), and the server-equipped communication device search process (step S2503) is terminated. The communication device with server function 4d has not received a response to the server function search request in the communication device search processing with server function (step S2503) (No in step S2504), and is newly connected to the network. Since the server function of the server function unit / client function unit 406 is not activated (Yes in step S2505), it waits for reception of a server function search request from a subnetwork lower than a certain time. However, since there is no lower subnetwork, the message is not received within a predetermined time (No in step S2506 and Yes in step S2507). Therefore, it is determined that its own server function should be validated (step S2508), and server function switching processing based on appropriateness determination is performed (step S2509). In the server function switching process (step S2509) based on appropriateness determination, since it is determined that it is a communication device that should enable the server function (Yes in step S2000), the server function is enabled (step S2000). S2003).

一方、サーバ機能をもたない通信機器5bは下位のルータに接続された通信機器からのサーバ機能探索要求の受信を含むメッセージの受信を常に待っている。”サーバ機能が有効である通信機器”のアドレスを推定する処理において、”サーバ機能が有効である通信機器”が特定のアドレス範囲を取るように制御される場合、かつ、同位ネットワークにサーバ機能付き通信機器が存在しない場合は、サーバ機能をもたない通信機器は定められたアドレス範囲にIPアドレスを変更してもよく、これにより、サーバ機能をもたない通信機器も下位サブネットワークに存在する通信機器からユニキャストで送信されるサーバ機能探索要求をサーバ機能付き通信機器と同様に受信可能となる。ルータ3dおよびサーバ機能付き通信機器4dがネットワークに接続されると、サーバ機能付き通信機器4dからのサーバ機能探索要求を受信し(ステップS2200でNo、かつ、ステップS2203でYes)、下位サブネットワーク存在判定処理(ステップS2204)を行う。下位サブネットワーク存在判定処理(ステップS2204)においては、受信したサーバ機能探索要求に含まれるルータの識別情報と自身が属するルータの識別情報とを比較する(ステップS2300)。自身が属するルータ3bのMACアドレス00−08−02−0A−DA−86と受信したパケットに含まれるルータの識別情報であるルータ3dのMACアドレス00−D0−59−67−7A−FEとは異なるため(ステップS2300でYes)、受信したサーバ機能探索要求のIPヘッダの送信元アドレスと、以前に受信し記憶部502に記憶したサーバ機能探索要求のIPヘッダの送信元アドレスとを比較する(ステップS2301)。現在サーバ機能を有効化しているサーバ機能付き通信機器4cには、定期的に上位サブネットワーク解析を行い上位サブネットワークのサーバ機能付き通信機器に対してサーバ機能探索要求を送信する機能が存在するため、サーバ機能をもたない通信機器5bの記憶部502には、サーバ機能付き通信機器4cが属しているルータ3cのMACアドレスおよび送信元アドレスが記憶されている。サーバ機能付き通信機器4cから受信したサーバ機能探索要求の送信元アドレスは192.168.3.10であり、サーバ機能付き通信機器4dから受信したサーバ機能探索要求の送信元アドレス192.168.3.20とは異なるため(ステップS2301でYes)、自身が属するルータの下位に複数の異なるルータが並列に接続されていることを検知し、サーバ機能を有効化した通信機器が上位または同位ネットワークに存在するかどうか判断する(ステップS2302)。現在サーバ機能を有効化しているサーバ機能付き通信機器は3cであり、自身が属するルータの下位に存在するルータに属しているため(ステップS2302でNo)、上位ルータ3aのネットワークおよび同位ネットワークに対し、自身が属するルータの下位に複数の異なるルータが並列に接続されている旨のネットワーク構成変更通知メッセージを送信する(ステップS2303)。   On the other hand, the communication device 5b having no server function always waits for reception of a message including reception of a server function search request from a communication device connected to a lower router. In the process of estimating the address of a “communication device for which the server function is valid”, if the “communication device for which the server function is valid” is controlled to take a specific address range, and the peer network has a server function When there is no communication device, the communication device that does not have the server function may change the IP address to a predetermined address range, so that the communication device that does not have the server function also exists in the lower subnetwork. A server function search request transmitted by unicast from a communication device can be received in the same manner as a communication device with a server function. When the router 3d and the communication device with server function 4d are connected to the network, a server function search request is received from the communication device with server function 4d (No in step S2200 and Yes in step S2203). A determination process (step S2204) is performed. In the lower subnetwork existence determination process (step S2204), the router identification information included in the received server function search request is compared with the identification information of the router to which it belongs (step S2300). What is the MAC address 00-08-02-0A-DA-86 of the router 3b to which the router itself belongs and the MAC address 00-D0-59-67-7A-FE of the router 3d which is router identification information included in the received packet? Since they are different (Yes in step S2300), the source address of the IP header of the received server function search request is compared with the source address of the IP header of the server function search request that has been received and stored in the storage unit 502 ( Step S2301). The server-equipped communication device 4c that currently has the server function enabled has a function of periodically performing higher-level subnetwork analysis and transmitting a server function search request to the higher-level subnetwork-equipped communication device with server function. The storage unit 502 of the communication device 5b having no server function stores the MAC address and the transmission source address of the router 3c to which the communication device with server function 4c belongs. The source address of the server function search request received from the server-equipped communication device 4c is 192.168.3.10, and the source address of server function search request received from the server-equipped communication device 4d is 192.168.8.3. .20 (Yes in step S2301), it is detected that a plurality of different routers are connected in parallel below the router to which the router belongs, and the communication device with the server function enabled is connected to the upper or peer network. It is determined whether it exists (step S2302). The server-equipped communication device that currently enables the server function is 3c, and belongs to a router that exists below the router to which the server function belongs (No in step S2302), so the network and peer network of the upper router 3a A network configuration change notification message indicating that a plurality of different routers are connected in parallel below the router to which it belongs is transmitted (step S2303).

一方、ネットワーク構成変更通知を受信した(ステップS2500でYes、ステップS2501を実行し、ステップS1600でNo、かつステップS1602でNo、かつステップS1604でYes)サーバ機能付き通信機器4aは、いずれかの下位サブネットワークにおいて複数の異なるルータが並列に接続されたネットワーク構成が発見されたことを検知し、かつ、自身のサーバ機能は有効化されていないので(ステップS1605でNo)、サーバ機能を有効化した通信機器が上位または同位ネットワークに存在するかどうか判断する(ステップS1606)。現在サーバ機能を有効化しているサーバ機能付き通信機器は3cであり、自身が属するルータの下位に存在するルータに属しているため(ステップS1606でNo)、サーバ機能を有効化するべき通信機器を変更するべきと判断し(ステップS1607)、適正判断によるサーバ機能切り替え処理を行う(ステップS1608)。適正判断によるサーバ機能切り替え処理(ステップS1608)においては、上位ルータ3aに接続するサーバ機能付き通信機器4aはサーバ機能を有効化する通信機器を変更するべきと判断しており(ステップS200でNo、かつ、ステップS2001でNo、かつ、ステップS2002でYes)、かつ、上位サブネットワーク解析(ステップS1500)の結果からサーバ機能付き通信機器4aが接続されているルータ3aが最上位ルータであり、同位ネットワークにサーバ機能を有効化した通信機器が存在しないと判断されるため、同位ネットワークにのみサーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し(ステップS2005)、一定時間サーバ機能有効化応答の受信を待つ(ステップS2006)。ルータ3aは最上位ルータであり、同位ネットワークに他にサーバ機能付き通信機器も存在せず一定時間内にサーバ機能探索応答を受信しないため(ステップS2006でNo、かつ、ステップS2007でYes)、自身のサーバ機能を有効化し(ステップS2008)、現在サーバ機能を有効化しているサーバ機能付き通信機器4cおよび4dに対しサーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信する(ステップS2009)。   On the other hand, the network configuration change notification is received (Yes in Step S2500, Step S2501 is executed, No in Step S1600, No in Step S1602, and Yes in Step S1604). Since it is detected that a network configuration in which a plurality of different routers are connected in parallel in the sub-network is found, and the server function is not activated (No in step S1605), the server function is activated. It is determined whether or not the communication device exists in the higher level or peer network (step S1606). Since the server-equipped communication device that currently activates the server function is 3c and belongs to a router that exists below the router to which it belongs (No in step S1606), the communication device that should activate the server function is selected. It is determined that it should be changed (step S1607), and server function switching processing based on appropriateness determination is performed (step S1608). In the server function switching process (step S1608) based on appropriateness determination, it is determined that the communication device with server function 4a connected to the upper router 3a should change the communication device that activates the server function (No in step S200). In addition, the router 3a to which the communication device 4a with the server function is connected based on the result of the upper subnetwork analysis (step S1500) is the highest-level router from the result of the upper subnetwork analysis (step S1500). Therefore, it is determined that there is no communication device that has activated the server function, and therefore, a server function switching message instructing activation of the server function is transmitted only to the peer network (step S2005). Waiting for reception (step S2006). Since the router 3a is the highest-level router and there is no other communication device with a server function in the peer network and does not receive a server function search response within a certain time (No in step S2006 and Yes in step S2007), itself The server function is activated (step S2008), and a server function switching message for instructing invalidation of the server function is transmitted to the server functions-equipped communication devices 4c and 4d that are currently validating the server function (step S2009).

一方、サーバ機能付き通信機器4aからサーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信(ステップS2500でYes、ステップS2501を実行し、ステップS1600でNo、かつステップS1602でYes)したサーバ機能付き通信機器4cおよび4dは、メッセージ受信によるサーバ機能切り替え処理を行う(ステップS1603)。メッセージ受信によるサーバ機能切り替え処理(ステップS1603)においては、サーバ機能の無効化を指示するサーバ機能切り替えメッセージを受信しているため(ステップS1900でNo、かつ、ステップS1910でYes)、サービスを提供している通信機器に対し、交代するサーバ機能付き通信機器4aの情報を通知し(ステップS1911)、自身のサーバ機能を無効化する(ステップS1912)。   On the other hand, a server function switching message for instructing invalidation of the server function is received from the communication device with server function 4a (Yes in Step S2500, Step S2501 is executed, No in Step S1600, and Yes in Step S1602). The communication devices 4c and 4d perform server function switching processing by message reception (step S1603). In the server function switching process (step S1603) by receiving a message, since a server function switching message instructing invalidation of the server function is received (No in step S1900 and Yes in step S1910), the service is provided. Information of the communication device 4a with a server function to be replaced is notified to the communication device being replaced (step S1911), and its own server function is invalidated (step S1912).

なお、ルータ3dおよびサーバ機能をもたない通信機器5dが新規に接続された場合についても同様に、サーバ機能をもたない通信機器5bがサーバ機能をもたない通信機器5dによるサーバ機能探索要求を受信することで自身が属するルータの下位に複数の異なるルータが並列に接続されていることを検知してサーバ機能を有効化するべき通信機器を変更する。   Similarly, when the router 3d and the communication device 5d having no server function are newly connected, the communication device 5b having no server function is similarly requested by the communication device 5d having no server function. , It detects that a plurality of different routers are connected in parallel below the router to which it belongs, and changes the communication device to enable the server function.

なお、本実施の形態では、定期的に上位サブネットワーク解析を行うとして説明したが、ユーザが通信機器に信号を入力する入力手段を備え、前記入力手段の信号に応じて上位サブネットワーク解析を行ってもよい。   In the present embodiment, the upper subnetwork analysis is periodically performed. However, the user has input means for inputting a signal to the communication device, and the upper subnetwork analysis is performed according to the signal of the input means. May be.

本発明にかかる通信機器の交代方法、および通信機器は、1つ以上のルータにより構成されるローカルネットワークにおいて、ネットワーク構成が変化した際にサービスを供給する通信機器をより最適な通信機器に交代する方法等として有用である。本発明により通信機器はネットワーク構成に依存することなくサービスを受給することが可能となる。また、下位サブネットワーク存在判断手段は、ネットワーク構成を把握する用途にも応用できる。   A communication device replacement method and a communication device according to the present invention replace a communication device that supplies a service when a network configuration changes in a local network including one or more routers with a more optimal communication device. It is useful as a method. According to the present invention, a communication device can receive a service without depending on a network configuration. Further, the lower subnetwork presence determination means can be applied to the purpose of grasping the network configuration.

本発明の実施の形態1における宅内ネットワークの構成の一例を示す図The figure which shows an example of a structure of the home network in Embodiment 1 of this invention 本発明の実施の形態2における宅内ネットワークの構成の一例を示す図The figure which shows an example of a structure of the home network in Embodiment 2 of this invention 本発明の実施の形態における通信機器のハードウエア構成の一例を示す図The figure which shows an example of the hardware constitutions of the communication apparatus in embodiment of this invention 本発明の実施の形態1におけるサーバ機能付き通信機器の機能ブロックを示す図The figure which shows the functional block of the communication apparatus with a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能をもたない通信機器の機能ブロックを示す図The figure which shows the functional block of the communication apparatus which does not have a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能付き通信機器の全体的な処理フローを示す図The figure which shows the whole processing flow of the communication apparatus with a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能付き通信機器のサーバ機能付き通信機器探索処理の処理フローを示す図The figure which shows the processing flow of the communication apparatus search process with a server function of the communication apparatus with a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能付き通信機器のメッセージ受信処理の処理フローを示す図The figure which shows the processing flow of the message reception process of the communication apparatus with a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能付き通信機器のメッセージ受信によるサーバ機能切り替え処理の処理フローを示す図The figure which shows the processing flow of the server function switching process by the message reception of the communication apparatus with a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能付き通信機器の適正判断によるサーバ機能切り替え処理の処理フローを示す図The figure which shows the processing flow of the server function switching process by the appropriate judgment of the communication apparatus with a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能をもたない通信機器の処理フローを示す図The figure which shows the processing flow of the communication apparatus which does not have a server function in Embodiment 1 of this invention. 本発明の実施の形態1におけるサーバ機能探索要求/応答の一例を示す図The figure which shows an example of the server function search request / response in Embodiment 1 of this invention 本発明の実施の形態2におけるサーバ機能付き通信機器の機能ブロックを示す図The figure which shows the functional block of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能をもたない通信機器の機能ブロックを示す図The figure which shows the functional block of the communication apparatus which does not have a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器のサーバ機能付き通信機器探索処理の処理フローを示す図The figure which shows the processing flow of the communication apparatus search process with a server function of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器のメッセージ受信処理の処理フローを示す図The figure which shows the processing flow of the message reception process of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器のサーバ機能探索要求受信処理の処理フローを示す図The figure which shows the processing flow of the server function search request reception process of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器の下位サブネットワーク存在判定処理の処理フローを示す図The figure which shows the processing flow of the low-order subnetwork presence determination process of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器のメッセージ受信によるサーバ機能切り替え処理の処理フローを示す図The figure which shows the processing flow of the server function switching process by the message reception of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器の適正判断によるサーバ機能切り替え処理の処理フローを示す図The figure which shows the processing flow of the server function switching process by the appropriate judgment of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能付き通信機器のサーバ機能調停処理の処理フローを示す図The figure which shows the processing flow of the server function arbitration process of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能をもたない通信機器の処理フローを示す図The figure which shows the processing flow of the communication apparatus which does not have a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能をもたない通信機器の下位サブネットワーク存在判定処理の処理フローを示す図The figure which shows the processing flow of the low subnetwork presence determination process of the communication apparatus which does not have a server function in Embodiment 2 of this invention. 本発明の実施の形態2におけるサーバ機能探索要求/応答の一例を示す図The figure which shows an example of the server function search request / response in Embodiment 2 of this invention 本発明の実施の形態2におけるサーバ機能付き通信機器の全体的な処理フローを示す図The figure which shows the whole processing flow of the communication apparatus with a server function in Embodiment 2 of this invention. 本発明の実施の形態2における宅内ネットワークの構成の一例を示す図The figure which shows an example of a structure of the home network in Embodiment 2 of this invention TTLを変化させたパケットを利用する上位サブネットワーク解析処理が用いられるネットワークの構成とTTLパケットの関係の一例を示す図The figure which shows an example of the structure of the network in which the high-order subnetwork analysis process using the packet which changed TTL is used, and a TTL packet TTLを変化させたパケットを利用してルータのネットワークアドレスを取得する処理の処理フローを示す図The figure which shows the processing flow of the process which acquires the network address of a router using the packet which changed TTL. TTLパケット送信処理の処理フローを示す図The figure which shows the processing flow of a TTL packet transmission process UDPを用いたTTLパケットの一例を示す図The figure which shows an example of the TTL packet using UDP TTLパケットのTTLと宛先ポート番号との対応関係の一例を示す図The figure which shows an example of the correspondence of TTL of a TTL packet, and a destination port number ICMPを用いたTTLパケットの一例を示す図The figure which shows an example of the TTL packet using ICMP TTLパケットのTTLとシーケンス番号との対応関係の一例を示す図The figure which shows an example of the correspondence of TTL of a TTL packet, and a sequence number TTL応答パケットの一例を示す図The figure which shows an example of a TTL response packet UPnP IGD仕様を利用する上位サブネットワーク解析処理が用いられるネットワークの一例を示す図The figure which shows an example of the network where the high-order subnetwork analysis process using a UPnP IGD specification is used 上位サブネットワーク解析処理の処理フローを示す図The figure which shows the processing flow of upper subnetwork analysis processing 推定ルータパケットのデータ部の一例を示す図The figure which shows an example of the data part of an estimation router packet 推定ルータ応答パケットのデータ部の一例を示す図The figure which shows an example of the data part of an estimation router response packet GetExternalIPAddressアクションの一例を示す図The figure which shows an example of a GetExternalIPAddress action GetExternalIPAddressアクションに対する応答の一例を示す図The figure which shows an example of the response with respect to GetExternalIPAddress action 推定ルータパケットの送信先として推測する上位ルータのLAN側アドレスの一例を示す図The figure which shows an example of the LAN side address of the high-order router guessed as a transmission destination of an estimated router packet 従来の通信機器の交代方法のシーケンスを示す図The figure which shows the sequence of the replacement method of the conventional communication apparatus

符号の説明Explanation of symbols

1 インターネット
2 宅内ネットワーク
3a,3b,3c,3d ルータ
4a,4b,4c,4d サーバ機能付き通信機器
5a,5b,5c,5d サーバ機能をもたない通信機器
400,500 通信I/F部
401,501 上位サブネットワーク判断部
402,502 記憶部
403 サーバ機能探索・応答部
404 サーバ適正判断部
405 サーバ機能切り替え部
406 サーバ機能部/クライアント機能部
503 サーバ機能探索部
506 クライアント機能部
1307,1407 下位サブネットワーク判断部
1 Internet 2 Home network 3a, 3b, 3c, 3d Router 4a, 4b, 4c, 4d Communication device with server function 5a, 5b, 5c, 5d Communication device 400, 500 Communication I / F unit 401 without server function 501 Upper sub-network determination unit 402, 502 Storage unit 403 Server function search / response unit 404 Server appropriateness determination unit 405 Server function switching unit 406 Server function unit / client function unit 503 Server function search unit 506 Client function unit 1307, 1407 Lower sub Network judgment part

Claims (18)

外部ネットワークに接続するローカルネットワークにおいて、
前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、
前記ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、
前記ローカルネットワークのいずれかのルータに接続され、
前記ローカルネットワーク内の他の通信装置にサービスを提供する機能(サーバ機能)を有する通信装置であって、
前記ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を発見するサーバ機能発見手段と、
少なくとも、前記サーバ機能発見手段の結果を用いてサーバ機能を有効にするべき通信装置を判断するサーバ機能適正判断手段と、
前記サーバ機能適正判断手段の結果、または、他の通信装置からのサーバ機能切り替えメッセージの受信により、サーバ機能の有効及び無効を切り替えるサーバ機能切り替え手段と、を備えるサーバ機能を有する通信装置。
In a local network connected to an external network,
One or more routers exist between the communication device in the local network and the external network;
The local network is divided into one or more different subnetworks by the one or more routers;
Connected to any router of the local network,
A communication device having a function (server function) for providing a service to another communication device in the local network,
Server function discovery means for discovering another communication device having a server function existing in the local network;
At least server function appropriateness determining means for determining a communication device that should validate the server function using the result of the server function finding means,
A communication device having a server function, comprising: a server function switching unit that switches between valid and invalid of a server function based on a result of the server function appropriateness determining unit or a server function switching message from another communication device.
前記サーバ機能発見手段は、
前記ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を探索するサーバ機能探索手段と、
サーバ機能を有する他の通信装置からサーバ機能探索用パケットを受信し、前記サーバ機能探索用パケットに対して応答パケットを送信する探索応答手段を備え
前記サーバ機能探索手段が、前記ローカルネットワーク内に存在するサーバ機能を有する他の通信装置宛にサーバ機能探索用パケットを送信し、
サーバ機能を有する他の通信装置からの応答パケットを受信する、
または
前記探索応答手段が、サーバ機能を有する他の通信装置からサーバ機能探索用パケットを受信する、
ことでサーバ機能を有する通信装置を発見する、
請求項1に記載のサーバ機能を有する通信装置。
The server function discovery means includes:
Server function search means for searching for another communication device having a server function existing in the local network;
A search response means for receiving a server function search packet from another communication device having a server function and transmitting a response packet to the server function search packet is provided. The server function search means exists in the local network. Send a server function search packet to another communication device having a server function to
Receiving a response packet from another communication device having a server function;
Or the search response means receives a server function search packet from another communication device having a server function.
To find a communication device having a server function,
A communication apparatus having the server function according to claim 1.
前記サーバ機能を有する通信装置が接続されたルータから外部ネットワークとの間に位置するルータの内1つ以上のルータのLAN側アドレス情報又は、LAN側アドレス情報とWAN側アドレス情報を取得して、取得したアドレス情報を用いて、取得したアドレス情報が属する第1のネットワークに接続される通信装置が取ることが可能なアドレスの範囲を推測して記憶する上位サブネットワーク存在判断手段をさらに備え、
前記サーバ機能探索手段は、
前記上位サブネットワーク存在判断手段が記憶した1つ以上の前記第1のネットワークのアドレス範囲の情報を用いて、サーバ機能を有する通信装置が取りうるアドレスを得て、前記アドレス宛にサーバ機能探索用パケットを送信する、
請求項2に記載のサーバ機能を有する通信装置。
Obtaining LAN side address information or LAN side address information and WAN side address information of one or more routers among routers located between a router to which the communication device having the server function is connected and an external network, Using the acquired address information, further comprising a higher-level subnetwork presence determination means for estimating and storing a range of addresses that can be taken by a communication device connected to the first network to which the acquired address information belongs,
The server function search means includes
Using the information of the address range of one or more of the first networks stored by the upper subnetwork presence determination means, an address that can be taken by a communication device having a server function is obtained, and a server function search addressed to the address Send packets,
A communication apparatus having the server function according to claim 2.
前記探索応答手段は、
サーバ機能を有する他の通信装置からサーバ機能探索用パケットを受信し、
前記サーバ機能適正判断手段が、自身はサーバ機能を有効にするべき通信装置であると判断している場合に、
請求項2に記載のサーバ機能を有する通信装置。
The search response means includes
Receive a server function search packet from another communication device having a server function,
When the server function appropriateness determining means determines that the server function is a communication device that should enable the server function,
A communication apparatus having the server function according to claim 2.
前記サーバ機能適正判断手段は、
前記サーバ機能発見手段が、
前記サーバ機能を有する通信装置が接続されたルータまたは、前記サーバ機能を有する通信装置が接続されたルータと外部ネットワークとの間に存在する他のルータ(上位ルータ)に属するネットワークにおいて、
サーバ機能を有する他の通信装置を発見しなかった場合に、自身はサーバ機能を有効にするべき通信装置であると判断し、
サーバ機能を有する他の通信装置を発見した場合に、自身はサーバ機能を無効にするべき通信装置である、と判断する、
請求項1に記載のサーバ機能を有する通信装置。
The server function suitability determining means includes
The server function discovery means is
In a network that belongs to a router to which a communication device having the server function is connected or another router (upper router) that exists between a router to which the communication device having the server function is connected and an external network,
If no other communication device having the server function is found, the device itself determines that the communication device should enable the server function,
When another communication device having a server function is found, it determines that it is a communication device whose server function should be disabled.
A communication apparatus having the server function according to claim 1.
前記サーバ機能切り替え手段は、
自身のサーバ機能を有効化から無効化に切り替える場合、
自身がサービスを提供している通信装置に、サーバ機能を交代する他の通信装置の情報を送信する、
請求項1に記載のサーバ機能を有する通信装置。
The server function switching means includes
If you switch your server function from enabled to disabled,
Send information of other communication devices that replace the server function to the communication device that is providing the service,
A communication apparatus having the server function according to claim 1.
前記サーバ機能切り替え手段は、
自身のサーバ機能を無効化する場合、
サーバ機能を交代する他の通信装置に自身がサービスを提供している通信装置の情報を送信する、
請求項1に記載のサーバ機能を有する通信装置。
The server function switching means includes
When disabling its own server function,
Send information about the communication device that is providing the service to other communication devices that replace the server function.
A communication apparatus having the server function according to claim 1.
前記サーバ機能切り替え手段は、
前記サーバ機能適正判断手段が自身はサーバ機能を有効にするべき通信装置であると判断した場合に、
前記サーバ機能発見手段が発見したサーバ機能を有する他の通信装置に、サーバ機能の無効化を指示するサーバ機能切り替えメッセージを送信し、
自身のサーバ機能が有効化されていなければ自身のサーバ機能を有効化し、
前記サーバ機能適正判断手段が自身はサーバ機能を無効にするべき通信装置であると判断した場合に、
自身のサーバ機能が有効化されていれば、
前記サーバ機能発見手段が発見したサーバ機能を有する他の通信装置に、サーバ機能の有効化を指示するサーバ機能切り替えメッセージを送信し、
自身のサーバ機能を無効化する、
請求項1に記載のサーバ機能を有する通信装置。
The server function switching means includes
When the server function appropriateness determining means determines that it is a communication device that should enable the server function,
A server function switching message for instructing invalidation of the server function is transmitted to another communication device having the server function discovered by the server function discovery unit;
If your server function is not enabled, enable your server function,
When the server function appropriateness determining means determines that it is a communication device that should invalidate the server function,
If your server function is enabled,
A server function switching message for instructing the activation of the server function is transmitted to another communication device having the server function discovered by the server function discovery means;
Disable its own server functionality,
A communication apparatus having the server function according to claim 1.
前記サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する下位サブネットワーク存在判断手段をさらに備え、
前記下位サブネットワーク存在判断手段は、
他の通信装置から受信するネットワーク構成変更通知メッセージを用いるか、
または、
ローカルネットワーク内の他の通信装置から受信するパケットに含まれる情報を用いて、
前記サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断し、
前記サーバ機能適正判断手段は、
前記下位サブネットワーク存在判断手段の結果によりサーバ機能を有効にする通信装置を判断する、
請求項1に記載のサーバ機能を有する通信装置。
A lower subnetwork existence determination means for determining that a plurality of different routers are connected in parallel below a router to which the communication device having the server function belongs;
The lower subnetwork existence determination means includes:
Use a network configuration change notification message received from another communication device, or
Or
Using information contained in packets received from other communication devices in the local network,
It is determined that a plurality of different routers are connected in parallel below the router to which the communication device having the server function belongs,
The server function suitability determining means includes
Determining a communication device that enables a server function according to a result of the lower subnetwork presence determination means;
A communication apparatus having the server function according to claim 1.
前記ローカルネットワーク内の他の通信装置から受信するパケットには、前記ローカルネットワーク内の他の通信装置が接続されたルータを識別可能な情報が含まれ、
前記下位サブネットワーク存在判断手段は、
少なくとも前記ローカルネットワーク内の他の通信装置から受信するパケットに含まれる前記ルータを識別可能な情報を比較することで、
前記サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する
請求項9に記載のサーバ機能を有する通信装置。
A packet received from another communication device in the local network includes information that can identify a router to which the other communication device in the local network is connected.
The lower subnetwork existence determination means includes:
By comparing at least information identifying the router included in a packet received from another communication device in the local network,
The communication device having a server function according to claim 9, wherein it is determined that a plurality of different routers are connected in parallel below a router to which the communication device having the server function belongs.
前記下位サブネットワーク存在判断手段は、
前記サーバ機能を有する通信装置が接続されたルータの識別情報と異なるルータの識別情報を含むパケットを複数受信し、
かつ、
受信した前記異なるルータの識別情報を含むパケットのIPヘッダに含まれる送信元アドレスが同一でない場合、
前記サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する
請求項10に記載のサーバ機能を有する通信装置。
The lower subnetwork existence determination means includes:
Receiving a plurality of packets containing router identification information different from the router identification information to which the communication device having the server function is connected;
And,
When the source address included in the IP header of the packet containing the received identification information of the different router is not the same,
The communication apparatus having a server function according to claim 10, wherein it is determined that a plurality of different routers are connected in parallel below a router to which the communication apparatus having the server function belongs.
前記サーバ機能適正判断手段は、
前記サーバ機能発見手段が、
前記外部ネットワークに接続するローカルネットワークにおいて、
サーバ機能を有する他の通信装置を発見しなかった場合に、自身はサーバ機能を有効にするべき通信装置であると判断し、
サーバ機能を有する他の通信装置を発見した場合に、自身はサーバ機能を無効にするべき通信装置である、と判断する、
請求項9に記載のサーバ機能を有する通信装置。
The server function suitability determining means includes
The server function discovery means is
In a local network connected to the external network,
If no other communication device having the server function is found, the device itself determines that the communication device should enable the server function,
When another communication device having a server function is found, it determines that it is a communication device whose server function should be disabled.
A communication apparatus having the server function according to claim 9.
前記サーバ機能適正判断手段は、
前記サーバ機能発見手段が、
前記サーバ機能を有する通信装置が属するルータの下位に、サーバ機能を有効化したサーバ機能を有する他の通信装置を発見しており、
かつ、
前記下位サブネットワーク存在判断手段が、
前記サーバ機能を有する通信装置が属するルータの下位に複数の異なるルータが並列に接続されていると判断した場合に、
サーバ機能を有効化する通信装置を変更すべきと判断する、
請求項9に記載のサーバ機能を有する通信装置。
The server function suitability determining means includes
The server function discovery means is
Under the router to which the communication device having the server function belongs, another communication device having a server function that enables the server function has been found,
And,
The lower subnetwork existence determination means includes
When it is determined that a plurality of different routers are connected in parallel below the router to which the communication device having the server function belongs,
Judge that the communication device that activates the server function should be changed,
A communication apparatus having the server function according to claim 9.
外部ネットワークに接続するローカルネットワークにおいて、
前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、
前記ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、
前記ローカルネットワークのいずれかのルータに接続され、
前記ローカルネットワーク内のサーバ機能を有する通信装置および、他の通信装置とメッセージ通信を行う通信装置であって、
前記サーバ機能を有する通信装置が接続されたルータと外部ネットワークとの間に位置するルータの内1つ以上のルータについて、LAN側ネットワークに接続される通信装置に設定することが可能なアドレスの範囲に関する情報を得て、記憶する上位サブネットワーク存在判断手段と、
前記通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する下位サブネットワーク存在判断手段を備え、
前記ローカルネットワーク内の他の通信装置から受信するパケットには、前記ローカルネットワーク内の他の通信装置が接続されたルータを識別可能な情報が含まれ、
前記下位サブネットワーク存在判断手段は、
少なくとも前記ローカルネットワーク内の他の通信装置から受信するパケットに含まれる前記ルータを識別可能な情報を比較することで、
前記通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する、
通信装置。
In a local network connected to an external network,
One or more routers exist between the communication device in the local network and the external network;
The local network is divided into one or more different subnetworks by the one or more routers;
Connected to any router of the local network,
A communication device having a server function in the local network, and a communication device that performs message communication with other communication devices,
Address range that can be set in the communication device connected to the LAN side network for one or more routers located between the router connected to the communication device having the server function and the external network An upper subnetwork existence determination means for obtaining and storing information on
Lower subnetwork existence determination means for determining that a plurality of different routers are connected in parallel below the router to which the communication device belongs,
A packet received from another communication device in the local network includes information that can identify a router to which the other communication device in the local network is connected.
The lower subnetwork existence determination means includes:
By comparing at least information identifying the router included in a packet received from another communication device in the local network,
Determining that a plurality of different routers are connected in parallel below the router to which the communication device belongs;
Communication device.
前記下位サブネットワーク存在判断手段は、
前記サーバ機能を有する通信装置が接続されたルータの識別情報と異なるルータの識別情報を含むパケットを複数受信し、
かつ、
受信した前記異なるルータの識別情報を含むパケットのIPヘッダに含まれる送信元アドレスが同一でない場合、
前記通信装置が属するルータの下位に複数の異なるルータが並列に接続されていることを判断する
請求項14に記載の通信装置。
The lower subnetwork existence determination means includes:
Receiving a plurality of packets containing router identification information different from the router identification information to which the communication device having the server function is connected;
And,
When the source address included in the IP header of the packet containing the received identification information of the different router is not the same,
The communication apparatus according to claim 14, wherein it is determined that a plurality of different routers are connected in parallel below a router to which the communication apparatus belongs.
前記下位サブネットワーク存在判断手段は、
前記通信装置が属するルータの下位に複数の異なるルータが並列に接続されていると判断した場合に、
前記上位サブネットワーク存在判断手段が記憶した1つ以上の前記第1のネットワークのアドレス範囲の情報を用いて、
前記通信装置が接続されたルータまたは、前記通信装置が接続されたルータと外部ネットワークとの間に存在する他のルータ(上位ルータ)に属するネットワークに対し、
ネットワーク構成変更通知メッセージを送信する、
請求項14に記載の通信装置。
The lower subnetwork existence determination means includes:
When it is determined that a plurality of different routers are connected in parallel below the router to which the communication device belongs,
Using the information of the address range of one or more of the first networks stored by the upper subnetwork presence determination means,
For a network that belongs to a router to which the communication device is connected or another router (upper router) that exists between the router to which the communication device is connected and an external network,
Send network configuration change notification messages,
The communication apparatus according to claim 14.
外部ネットワークに接続するローカルネットワークにおいて、
前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、
前記ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、
前記ローカルネットワークのいずれかのルータに接続され、
前記ローカルネットワーク内の他の通信装置にサービスを提供する機能(サーバ機能)を有する通信装置の交代方法であって、
前記ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を発見するステップと、
サーバ機能を有効にするべき通信装置を判断するステップと、
サーバ機能の有効及び無効を切り替えるステップと、を備える、通信装置交代方法。
In a local network connected to an external network,
One or more routers exist between the communication device in the local network and the external network;
The local network is divided into one or more different subnetworks by the one or more routers;
Connected to any router of the local network,
A method of replacing a communication device having a function (server function) for providing a service to another communication device in the local network,
Discovering another communication device having a server function existing in the local network;
Determining a communication device for which the server function should be enabled;
And a step of switching between enabling and disabling the server function.
通信システムであって、
外部ネットワークに接続するローカルネットワークにおいて、
前記ローカルネットワーク内の通信装置と前記外部ネットワークとの間に1つ以上のルータが存在し、
前記ローカルネットワークは前記1つ以上のルータにより1つ以上の異なるサブネットワークに区切られており、
前記ローカルネットワークのいずれかのルータに接続され、
前記ローカルネットワーク内の他の通信装置にサービスを提供する機能(サーバ機能)を有する通信装置と、
前記ローカルネットワークのいずれかのルータに接続され、前記ローカルネットワーク内のサーバ機能を有する通信装置および、他の通信装置とメッセージ通信を行う通信装置とを備え、
前記サーバ機能を有する通信装置は、
前記ローカルネットワーク内に存在するサーバ機能を有する他の通信装置を発見するサーバ発見部と、
サーバ機能を有効にする通信装置を判断するサーバ適正判断部と、
サーバ機能の有効及び無効を切り替えるサーバ機能切り替え部と含む、
通信システム。
A communication system,
In a local network connected to an external network,
One or more routers exist between the communication device in the local network and the external network;
The local network is divided into one or more different subnetworks by the one or more routers;
Connected to any router of the local network,
A communication device having a function (server function) for providing a service to another communication device in the local network;
A communication device connected to any router of the local network and having a server function in the local network, and a communication device that performs message communication with other communication devices;
The communication device having the server function is:
A server discovery unit for discovering other communication devices having a server function existing in the local network;
A server suitability determination unit that determines a communication device that enables the server function;
Including a server function switching unit that switches between enabling and disabling the server function,
Communications system.
JP2006326598A 2006-12-04 2006-12-04 Communication device with switchable server function, and switching method therefor and system Pending JP2008140209A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006326598A JP2008140209A (en) 2006-12-04 2006-12-04 Communication device with switchable server function, and switching method therefor and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006326598A JP2008140209A (en) 2006-12-04 2006-12-04 Communication device with switchable server function, and switching method therefor and system

Publications (1)

Publication Number Publication Date
JP2008140209A true JP2008140209A (en) 2008-06-19

Family

ID=39601580

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006326598A Pending JP2008140209A (en) 2006-12-04 2006-12-04 Communication device with switchable server function, and switching method therefor and system

Country Status (1)

Country Link
JP (1) JP2008140209A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012128190A1 (en) * 2011-03-23 2012-09-27 ソニー株式会社 Information processing device and method, program, recording medium, and information processing system
JP2015100074A (en) * 2013-11-20 2015-05-28 株式会社リコー Image projection device, and image processing apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012128190A1 (en) * 2011-03-23 2012-09-27 ソニー株式会社 Information processing device and method, program, recording medium, and information processing system
CN103458979A (en) * 2011-03-23 2013-12-18 索尼公司 Information processing device and method, program, recording medium, and information processing system
JP2015100074A (en) * 2013-11-20 2015-05-28 株式会社リコー Image projection device, and image processing apparatus

Similar Documents

Publication Publication Date Title
US11075802B2 (en) Methods for dynamic router configuration in a mesh network
US8457014B2 (en) Method for configuring control tunnel and direct tunnel in IPv4 network-based IPv6 service providing system
JP4327852B2 (en) COMMUNICATION DEVICE, COMMUNICATION SETTING METHOD, COMMUNICATION SETTING PROGRAM, AND RECORDING MEDIUM CONTAINING COMMUNICATION SETTING PROGRAM
KR100975046B1 (en) A system and method for self propagating information in ad-hoc peer-to-peer networks
Ravindran et al. Information-centric networking based homenet
EP3656095B1 (en) Method and system for communicating between private mesh network and public network
EP3025453B1 (en) Probe routing in a network
US20100332605A1 (en) Mesh network bridge routing
CN112654049B (en) Method, system, node and medium for configuring a wireless communication coverage extension system
JP2009038653A (en) Radio communications terminal unit and telecommunication network program
JPWO2007114251A1 (en) Communication device, method executed by communication device, and storage medium storing software implementing the method
JP2018061267A (en) Probe routing of network
KR100785482B1 (en) Method and apparatus for discoverying component in at least one of sub-network
US11683275B2 (en) Device and method for interconnecting two subnetworks
JP2008140209A (en) Communication device with switchable server function, and switching method therefor and system
KR20120072060A (en) Apparatus, system and method for managing node based on network lacked continuous network connectivity
CN113810288B (en) Message backhaul method and device
WO2008069504A1 (en) Method for configuring control tunnel and direct tunnel in ipv4 network-based ipv6 service providing system
JP2004080671A (en) Autonomous communication path decision method, information terminal and server using the same, autonomous communication path decision program and record medium therefor
CN105472060B (en) A kind of node identifier generation method of Kademlia network
CN101753419A (en) Send method, equipment and the multi-address space mobile network of data, forwarding data
Khalid et al. Design and Implementation of ID based MANET Auto-configuration Protocol
JP2005340983A (en) Hierarchical network and configuration method thereof, and apparatus
Baccelli et al. IP Links in multihop ad hoc wireless networks?
Grajzer et al. Neighbor Discovery++− a Scalable and Robust Address Auto-Configuration for Future Internet of Things Networks