JP6489837B2 - Control device and system - Google Patents

Control device and system Download PDF

Info

Publication number
JP6489837B2
JP6489837B2 JP2015005291A JP2015005291A JP6489837B2 JP 6489837 B2 JP6489837 B2 JP 6489837B2 JP 2015005291 A JP2015005291 A JP 2015005291A JP 2015005291 A JP2015005291 A JP 2015005291A JP 6489837 B2 JP6489837 B2 JP 6489837B2
Authority
JP
Japan
Prior art keywords
node
packet
address
node information
search
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.)
Active
Application number
JP2015005291A
Other languages
Japanese (ja)
Other versions
JP2016131330A (en
Inventor
山田 雄介
雄介 山田
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.)
Sharp Corp
Original Assignee
Sharp Corp
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 Sharp Corp filed Critical Sharp Corp
Priority to JP2015005291A priority Critical patent/JP6489837B2/en
Publication of JP2016131330A publication Critical patent/JP2016131330A/en
Application granted granted Critical
Publication of JP6489837B2 publication Critical patent/JP6489837B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本開示は、制御装置およびシステムに関し、ネットワーク上の目的機器を探索するための制御装置およびシステムに関する。   The present disclosure relates to a control apparatus and system, and relates to a control apparatus and system for searching for a target device on a network.

従来、探索機器が、ネットワーク上の目的機器(以下、被探索機器ともいう)を探索するには、一般的に探索のためのパケットを用いる。具体的には、探索機器は、予め定められたマルチキャスト・アドレスを宛先アドレスに、予め定められたポートを宛先ポートにした、特定の形式の「探索要求パケット」を送信し、それに対する「探索応答パケット」を受信することによって、目的機器を見つける。あるいは、マルチキャスト・アドレスの代わりに、ブロードキャスト・アドレスが用いられることもある。   Conventionally, a search device generally uses a search packet in order to search for a target device (hereinafter also referred to as a search target device) on a network. Specifically, the searching device transmits a “search request packet” in a specific format in which a predetermined multicast address is a destination address and a predetermined port is a destination port, and a “search response” The target device is found by receiving the “packet”. Alternatively, a broadcast address may be used instead of a multicast address.

しかし、ネットワーク環境によっては、マルチキャスト・パケットやブロードキャスト・パケットが転送されない場合がある。マルチキャスト・パケットを転送するのはルーターの役割であり、ルーターに依存する。
つまり、ネットワーク内のルーターがマルチキャスト転送機能を備えていない場合には、マルチキャスト・パケットは転送されない。また、ルーターがマルチキャスト転送機能を備えていたとしても、しばしばマルチキャスト・パケットが転送されないことがある。その例としては、ルーターのマルチキャストSnooping機能がオンに設定されていると、マルチキャスト・パケットが転送されないことがある。マルチキャストSnooping機能自体は、マルチキャスト・グループに参加しているノードにだけマルチキャスト・パケットを転送するという機能であり、適切に実装されていれば問題はない。
However, depending on the network environment, multicast packets and broadcast packets may not be transferred. It is the router's responsibility to forward multicast packets and is dependent on the router.
That is, when the router in the network does not have the multicast forwarding function, the multicast packet is not forwarded. Also, even if the router has a multicast forwarding function, multicast packets are often not forwarded. For example, if the multicast snooping function of the router is set to ON, multicast packets may not be transferred. The multicast snooping function itself is a function of transferring multicast packets only to nodes participating in the multicast group, and there is no problem if it is properly implemented.

しかし、あるルーターでは、どちらも同じマルチキャスト・グループに参加している機器Aと機器Bがある状況で、機器Aから送出されるマルチキャスト・パケットは機器Bには届くが、機器Bから送出されるマルチキャスト・パケットは機器Aには届かない、といったことが実際に起こっている。   However, in a certain router, both devices A and B are participating in the same multicast group, and the multicast packet sent from device A reaches device B but is sent from device B. Actually, the multicast packet does not reach the device A.

また、ルーターと機器とを起動する順序に依存して、マルチキャスト・パケットが届かなくなる場合がある。マルチキャストSnooping機能をオフにすると、そのような症状は起こらないので、マルチキャストSnooping機能による影響と考えられる。   Also, depending on the order of starting the router and the device, the multicast packet may not reach. When the multicast snooping function is turned off, such a symptom does not occur.

また、ルーターだけではなく、ネットワークの経路途中にスイッチングハブ等があれば、それらのマルチキャストSnooping機能の影響によって、マルチキャスト・パケットが転送されないこともある。   Also, if there is a switching hub or the like in the middle of the network path as well as the router, multicast packets may not be transferred due to the multicast snooping function.

また、ルーターの一部には、(IPレベルの)ブロードキャスト・パケットを転送しないものがある。例えば、あるルーターでは、IP(Internet Protocol)ヘッダに含まれるDon't fragmentフラグが1を示すブロードキャスト・パケットを、有線LAN(Local Area Network)側から無線LAN側へ転送しない、ということが実際に起こっている。   Some routers do not forward (IP level) broadcast packets. For example, a router actually does not transfer a broadcast packet whose Don't fragment flag included in an IP (Internet Protocol) header indicates 1 from a wired LAN (Local Area Network) side to a wireless LAN side. is happening.

また、無線LAN環境では、マルチキャスト・パケットまたはブロードキャスト・パケットはしばしばドロップされる。これらのパケットは、MAC(Media Access Control)レベルにおいて再送されないため、通信の信頼性が低いからである。   Also, in a wireless LAN environment, multicast packets or broadcast packets are often dropped. This is because these packets are not retransmitted at the MAC (Media Access Control) level, and therefore the communication reliability is low.

このようなネットワーク環境においては、被探索機器に「探索要求パケット」が届かないので、被探索機器は「探索応答パケット」を返信することもない。従って、探索機器は被探索機器を見つけることができない。   In such a network environment, since the “search request packet” does not reach the search target device, the search target device does not return a “search response packet”. Therefore, the searching device cannot find the searched device.

そこで、マルチキャストまたはブロードキャストによる送信に加えて、宛先アドレスを特定のIPアドレスにした「探索要求パケット」をユニキャストで送信する方法が考えられる。この方法では、どのIPアドレスに対して「探索要求パケット」を送信するかが問題となる。   Therefore, in addition to transmission by multicast or broadcast, a method of transmitting a “search request packet” with a destination address as a specific IP address by unicast is conceivable. This method has a problem as to which IP address the “search request packet” is transmitted.

例えば、特許文献1(特開2011−193223号公報)は、『自己のIPアドレスとサブネットマスクに基づいて特定のサブネット内に存在し得る各端末装置の対象IPアドレスを生成するリクエスト生成部と、リクエスト生成部で生成した対象IPアドレスのMACアドレスを問うARP(Address Resolution Protocol)リクエストを特定のサブネットに送信するリクエスト送信部と、特定のサブネットから送信されてくるARPリプライを受信し、ARPリプライに格納されたソースIPアドレスならびにソースMACアドレスを確認する学習部を備えたネットワーク接続装置』を開示する。   For example, Patent Document 1 (Japanese Patent Laid-Open No. 2011-193223) states that “a request generation unit that generates a target IP address of each terminal device that can exist in a specific subnet based on its own IP address and subnet mask; A request transmission unit that transmits an ARP (Address Resolution Protocol) request that inquires about the MAC address of the target IP address generated by the request generation unit to a specific subnet, an ARP reply that is transmitted from the specific subnet, and the ARP reply Disclosed is a “network connection apparatus including a learning unit for confirming a stored source IP address and a source MAC address”.

また、特許文献2(特開2004−228878号公報)は、『ローカルエリアネットワークを構成する各ノードと定期的に所定のパケット通信を行うことにより各ノードの状態を監視し、起動しているノードが存在しないと判断した場合には、広域ネットワークとのコネクションを終了する、ネットワーク接続装置』、『所定のパケット通信とは、各ノードへのARP要求パケットの送信と、当該ARP要求パケットに対応したARP応答パケットの受信とである』、および『所定のパケット通信は、各ノードへのICMP Neighbor Solicitationパケットの送信と、当該ICMP Neighbor Solicitationパケットに対応したICMP Neighbor Advertisementパケットの受信とである』ことを開示している。特許文献2に開示された技術によれば、所定のパケット通信により、起動しているノードが存在するか否かが確認される。   Patent Document 2 (Japanese Patent Application Laid-Open No. 2004-228878) states that “a node that monitors the state of each node by periodically performing predetermined packet communication with each node that constitutes the local area network and is activated. The network connection device that terminates the connection with the wide area network ”,“ predetermined packet communication corresponds to the transmission of the ARP request packet to each node and the ARP request packet ” ARP response packet reception ”and“ predetermined packet communication is the transmission of an ICMP Neighbor Solicitation packet to each node and an ICMP Neighbor Advertisement packet corresponding to the ICMP Neighbor Solicitation packet. It is received and "disclose that. According to the technique disclosed in Patent Document 2, it is confirmed whether or not there is an active node by predetermined packet communication.

特開2011−193223号公報JP 2011-193223 A 特開2004−228878号公報JP 2004-228878 A

しかし、特許文献1は、ネットワークに存在するかどうかも分からない端末のIPアドレスを対象にして、ARPリクエストを送信することは、無駄なネットワークトラフィックを発生させることになる。望ましくは、無駄なネットワークトラフィックを発生させずに(受動的に)起動しているノードを検出することが望ましい。   However, in Patent Document 1, sending an ARP request for an IP address of a terminal that does not know whether it exists in the network causes useless network traffic. Desirably, it is desirable to detect a node that is up (passively) without generating wasted network traffic.

また、サブネットマスクが255.255.255.0である場合(ホスト部が8ビット)は、生成される対象IPアドレスは256個=216個程度であるが、サブネットマスクが255.255.0.0のような場合(ホスト部が16ビット)は、生成される対象IPアドレスは65536個=232個程度となり、大量のIPアドレスが生成されてしまう。これら大量のIPアドレスに対してARPリクエストを送信することは無駄なネットワークトラフィックを発生させるだけでなく、時間がかかり過ぎて効率的とは言えない。 Also, if the subnet mask is 255.255.255.0 (the host unit is eight bits) is subject IP address generated is 256 = 2 16 mm, subnet mask 255.255.0 If .0 like (host part 16 bits), destination IP address generated becomes 65,536 = 2 32 or so, a large amount of IP addresses being generated. Sending ARP requests to these large numbers of IP addresses not only generates useless network traffic, but is too time consuming and inefficient.

また、特許文献2は、上記に述べた起動しているノードを確認するために、段落0030で『次に探索器202は、定期的に、先に取得したサブネットに属する全てのIPアドレスに対してARP要求のパケットをブロードキャストで送信する。』と記載する。したがって、特許文献2においても、特許文献1と同様に、サブネットマスクの設定によっては、ARP要求のパケットが大量に送信されて無駄なトラフィックが発生することになる。   Further, in Patent Document 2, in order to confirm the active node described above, in paragraph 0030, “Next, the searcher 202 periodically checks all IP addresses belonging to the previously acquired subnet. The ARP request packet is transmitted by broadcast. ]. Therefore, in Patent Document 2, as in Patent Document 1, depending on the setting of the subnet mask, a large amount of ARP request packets are transmitted and wasteful traffic occurs.

本開示は、かかる実情に鑑み考え出されたものであり、ある局面における目的は、無駄なトラフィックを発生させずにサブネット上にある起動ノードの存在を受動的に検出し、目的ノードを確実に探索する制御装置およびシステムを提供することである。   The present disclosure has been devised in view of such circumstances, and an object in one aspect is to passively detect the presence of an activation node on a subnet without generating unnecessary traffic, and to reliably identify the target node. It is to provide a control device and system for searching.

一実施の形態に従うと、ネットワークの同一サブネット上にある目的ノードを探索する制御装置は、サブネット上のパケットを送受信する通信部と、通信部を介して探索要求パケットを送信し、探索応答パケットを受信することによって目的ノードを探索する探索部と、通信部を介してパケットを受信する毎に、サブネット上にある起動ノードの存在を受動的に検出して、ノード情報として管理するノード情報管理部と、を備える。探索部は、探索要求パケットを送信する際に、ノード情報管理部にあるノード情報のアドレスを宛先にしてユニキャストで送信する。   According to one embodiment, a control device that searches for a target node on the same subnet of a network transmits a search request packet via a communication unit that transmits and receives packets on the subnet, and transmits a search response packet. A search unit that searches for a target node by receiving, and a node information management unit that passively detects the presence of an activation node on a subnet and manages it as node information each time a packet is received via a communication unit And comprising. When transmitting the search request packet, the search unit transmits the address of the node information in the node information management unit as a destination by unicast.

好ましくは、探索部は、探索要求パケットを送信する際に、マルチキャストで送信するとともに、ノード情報管理部にあるノード情報のアドレスを宛先にしてユニキャストで送信する。   Preferably, when the search request packet is transmitted, the search unit transmits the packet by multicast, and transmits the address of the node information in the node information management unit by unicast.

好ましくは、探索部は、探索要求パケットを送信する際に、ブロードキャストで送信するとともに、ノード情報管理部にあるノード情報のアドレスを宛先にしてユニキャストで送信する。   Preferably, when transmitting the search request packet, the search unit transmits it by broadcast, and transmits it by unicast using the address of the node information in the node information management unit as a destination.

好ましくは、ノード情報管理部は、ノード情報が所定の時間更新されなければ、当該ノードが離脱されているかどうかを確認するパケットを、通信部を介して送信し、確認するパケットに呼応する応答の受信がなければノード情報を削除する。   Preferably, if the node information is not updated for a predetermined time, the node information management unit transmits a packet for confirming whether or not the node is disconnected via the communication unit, and returns a response corresponding to the packet to be confirmed. If there is no reception, the node information is deleted.

好ましくは、制御装置は、マルチキャスト・グループに参加しているノードの存在確認のために、通信部を介して、マルチキャスト・ノード問合せパケットを送信する、マルチキャスト・ノード問合せ送信部、をさらに備える。   Preferably, the control device further includes a multicast node inquiry transmission unit that transmits a multicast node inquiry packet via the communication unit in order to confirm the presence of a node participating in the multicast group.

他の実施の形態に従うと、ネットワークの同一サブネット上にある複数のノードと、複数のノードから目的ノードを探索する制御装置とを備えるシステムが提供される。制御装置は、サブネット上のパケットを送受信する通信部と、通信部を介して探索要求パケットを送信し、探索応答パケットを受信することによって目的ノードを探索する探索部と、通信部を介してパケットを受信する毎に、サブネット上にある起動ノードの存在を受動的に検出して、ノード情報として管理するノード情報管理部と、を含む。   According to another embodiment, a system is provided that includes a plurality of nodes on the same subnet of a network and a control device that searches for a target node from the plurality of nodes. The control device includes: a communication unit that transmits and receives packets on the subnet; a search unit that transmits a search request packet through the communication unit and receives a search response packet; and a packet through the communication unit. A node information management unit that passively detects the presence of an activation node on the subnet and manages it as node information.

探索部は、探索要求パケットを送信する際に、ノード情報管理部にあるノード情報のアドレスを宛先にしてユニキャストで送信する。   When transmitting the search request packet, the search unit transmits the address of the node information in the node information management unit as a destination by unicast.

本開示のある局面によれば、無駄なトラフィックを発生させずに、サブネット上にある起動ノードの存在を受動的に検出し、起動ノードに関する情報をノード情報としてノード情報管理部に管理し、ノード情報管理部にあるノード情報を宛先アドレスとして探索要求パケットを送信することによって、目的ノードを確実に探索することができる。   According to an aspect of the present disclosure, the presence of an activation node on a subnet is passively detected without generating unnecessary traffic, and information about the activation node is managed as node information in the node information management unit. By transmitting a search request packet using the node information in the information management unit as a destination address, the target node can be reliably searched.

実施の形態1に係る通信ネットワーク1の概略構成を説明するための図である。2 is a diagram for explaining a schematic configuration of a communication network 1 according to Embodiment 1. FIG. 図1のHEMS(Home Energy Management System)コントローラ100のブロック図である。FIG. 2 is a block diagram of a HEMS (Home Energy Management System) controller 100 in FIG. 1. 図1のHEMSコントローラ100のソフトウェア構成を説明するための図である。It is a figure for demonstrating the software structure of the HEMS controller 100 of FIG. 実施の形態1に係るノードリスト123の構成の一例を示す図である。6 is a diagram illustrating an example of a configuration of a node list 123 according to Embodiment 1. FIG. 実施の形態1に係るノード情報の構成の一例を示す図である。6 is a diagram showing an example of a configuration of node information according to Embodiment 1. FIG. ARPパケットの構成を示す図である。It is a figure which shows the structure of an ARP packet. 任意のIPパケットの構成を示す図である。It is a figure which shows the structure of arbitrary IP packets. 実施の形態1に係るHEMSコントローラ100の機能的構成を説明するための機能ブロック図である。3 is a functional block diagram for explaining a functional configuration of a HEMS controller 100 according to Embodiment 1. FIG. 実施の形態1に係るノード情報の削除処理を示すフローチャートである。6 is a flowchart showing node information deletion processing according to the first embodiment. 実施の形態1に係るARPリクエストまたはARPリプライを受信した時のノードリストの情報更新の処理を示すフローチャートである。6 is a flowchart showing a node list information update process when receiving an ARP request or an ARP reply according to the first embodiment. 実施の形態1に係るIPパケットを受信した時のノードリスト123の情報更新の処理を示すフローチャートである。7 is a flowchart showing information update processing of the node list 123 when an IP packet according to the first embodiment is received. 本実施の形態1に係る目的ノードを探索する処理を示すフローチャートである。It is a flowchart which shows the process which searches the target node which concerns on this Embodiment 1. 本実施の形態2に係る目的ノードを探索する処理を示すフローチャートである。It is a flowchart which shows the process which searches the target node which concerns on this Embodiment 2. FIG. 実施の形態3に係るIGMPv2(Internet Group Management Protocol version 2) General Queryの送信処理を示すフローチャートである。14 is a flowchart showing transmission processing of IGMPv2 (Internet Group Management Protocol version 2) General Query according to the third embodiment.

以下、図面を参照しつつ、本開示の実施の形態について説明する。以下の説明では、同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがって、それらについての詳細な説明は繰り返さない。   Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. In the following description, the same parts are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.

[実施の形態1]
<通信ネットワーク1の概略構成>
図1は、実施の形態1に係る通信ネットワーク1の概略構成を説明するための図である。図1を参照して、通信ネットワーク1は、無線LANルーター302およびサブネット10を備える。無線LANルーター302は、インターネット等の外部のネットワーク900と接続する。
[Embodiment 1]
<Schematic configuration of communication network 1>
FIG. 1 is a diagram for explaining a schematic configuration of a communication network 1 according to the first embodiment. With reference to FIG. 1, the communication network 1 includes a wireless LAN router 302 and a subnet 10. The wireless LAN router 302 is connected to an external network 900 such as the Internet.

サブネット10は、HEMSコントローラ100、複数のノード201,202,203…、およびスイッチングハブ300を備える。「ノード」とは、IPアドレスを持つ通信機器(IP対応機器)である。一般的に、ノードは、パーソナルコンピュータ、プリンタ、NAS(Network Attached Storage、ネットワークストレージともいう)、タブレット端末、AV(Audio Visual)機器、および白物家電等を含む。図1では、無線LANルーター302は、有線LAN803を介してHEMSコントローラ100、ノード202、およびスイッチングハブ300に接続され、また、無線LAN802を介してノード203に接続される。ノード201は、スイッチングハブ300に接続され、さらに、スイッチングハブ300を経由して無線LANルーター302に接続される。   The subnet 10 includes a HEMS controller 100, a plurality of nodes 201, 202, 203..., And a switching hub 300. A “node” is a communication device (IP compatible device) having an IP address. In general, the node includes a personal computer, a printer, a NAS (Network Attached Storage, also referred to as network storage), a tablet terminal, an AV (Audio Visual) device, and white goods. In FIG. 1, the wireless LAN router 302 is connected to the HEMS controller 100, the node 202, and the switching hub 300 via the wired LAN 803, and is connected to the node 203 via the wireless LAN 802. The node 201 is connected to the switching hub 300 and further connected to the wireless LAN router 302 via the switching hub 300.

無線LANルーター302に接続される複数のノード201,202,203,…のうちいくつかが、ECHONET Lite機器に相当する「ECHONET Liteノード」である。本実施の形態では、例えば、ノード202と203がECHONET Liteノードである。ノード201は電力モニタである。   Some of the plurality of nodes 201, 202, 203,... Connected to the wireless LAN router 302 are “ECHONET Lite nodes” corresponding to ECHONET Lite devices. In the present embodiment, for example, the nodes 202 and 203 are ECHONET Lite nodes. Node 201 is a power monitor.

HEMSコントローラ100は、通信ネットワーク1において制御装置として機能する。具体的には、HEMSコントローラ100は、複数のノード201,202,203,…と通信することにより、複数のノード201,202,203,…を制御する。   The HEMS controller 100 functions as a control device in the communication network 1. Specifically, the HEMS controller 100 controls the plurality of nodes 201, 202, 203,... By communicating with the plurality of nodes 201, 202, 203,.

本実施の形態では、新規ノード209がサブネット10に参加し、またサブネット10に参加しているノード(以下、「既存ノード」とも称する)がサブネット10から離脱することがある。なお、新規ノード209がネットワークに参加した場合には、新規ノード209は既存ノードとして扱われる。   In the present embodiment, the new node 209 may join the subnet 10, and a node participating in the subnet 10 (hereinafter also referred to as “existing node”) may leave the subnet 10. When the new node 209 joins the network, the new node 209 is treated as an existing node.

図1を参照して、無線LANルーター302、HEMSコントローラ100、および各ノードに関連して示される括弧内の数字(たとえば、192.168.11.1)は、当該機器またはノードのIPアドレスを表している。無線LANルーター302は、DHCP(Dynamic Host Configuration Protocol)機能を有する。無線LANルーター302は、DHCP機能により、HEMSコントローラ100、および複数のノード201,202,203,…に対して、図示されるようなIPアドレスを自動的に付与する。付与されたIPアドレスは、各ノードが有する記憶部に格納されるとともに、HEMSコントローラ100では、後述する記憶部160に格納される。また、HEMSコントローラ100および各ノードは、固有の番号を示すMACアドレスが予め設定(記憶)されたLANカード等のネットワークアダプタ(図示せず)を有する。ここでは、MACアドレスは、ノードまたはHEMSコントローラ100に「固有の識別情報」の一実施例であり、また、IPアドレスはノードまたはHEMSコントローラ100に割当てられる「可変の識別情報」の一実施例である。   Referring to FIG. 1, the numbers in parentheses (for example, 192.168.11.1) shown in relation to the wireless LAN router 302, the HEMS controller 100, and each node represent the IP address of the device or node. The wireless LAN router 302 has a DHCP (Dynamic Host Configuration Protocol) function. The wireless LAN router 302 automatically assigns IP addresses as illustrated to the HEMS controller 100 and the plurality of nodes 201, 202, 203,... By the DHCP function. The assigned IP address is stored in a storage unit included in each node, and in the HEMS controller 100, is stored in a storage unit 160 described later. The HEMS controller 100 and each node have a network adapter (not shown) such as a LAN card in which a MAC address indicating a unique number is preset (stored). Here, the MAC address is an example of “unique identification information” for the node or the HEMS controller 100, and the IP address is an example of “variable identification information” assigned to the node or the HEMS controller 100. is there.

図1を参照して、無線LANルーター302のサブネットマスクが255.255.255.0に設定されていたとする。無線LANルーター302によって付与されたIPアドレスから分かるように、IPアドレスのうちのネットワークアドレスとして使用される部分(たとえば“192.168.11.5”であれば“192.168.11”の部分)が共通であるノードの集合が1つのサブネット(分割されたネットワーク)を構成している。   Referring to FIG. 1, it is assumed that the subnet mask of wireless LAN router 302 is set to 255.255.255.0. As can be seen from the IP address assigned by the wireless LAN router 302, the node used as a network address in the IP address (for example, “192.168.11” if “192.168.11.5”) is common. A group consists of one subnet (divided network).

なお、本実施の形態では、HEMSコントローラ100は、サブネット10に存在する目的ノードを探索する主体である探索機器の一例であり、ノード201,202,203,…それぞれは、探索の対象となり得る被探索機器の一例である。探索機器による探索処理については、後述する。   In the present embodiment, the HEMS controller 100 is an example of a search device that is a subject that searches for a target node existing in the subnet 10, and each of the nodes 201, 202, 203,... It is an example of a search device. The search process by the search device will be described later.

<HEMSコントローラの構成>
図2は、図1のHEMSコントローラ100のブロック図である。図2を参照して、HEMSコントローラ100は、CPU(Central Processing Unit)1101を備える。HEMSコントローラ100は、さらに、CPU1101に接続されたROM(Read Only Memory)1107、発光素子1103、高速通信インターフェイス1104、電源1105、時間(時刻)を測定するタイマ1106、RAM(Random Access Memory)1102、プッシュボタン1108、スライドスイッチ1109、およびリセットスイッチ(図示しない)を備える。
<Configuration of HEMS controller>
FIG. 2 is a block diagram of the HEMS controller 100 of FIG. Referring to FIG. 2, HEMS controller 100 includes a CPU (Central Processing Unit) 1101. The HEMS controller 100 further includes a ROM (Read Only Memory) 1107 connected to the CPU 1101, a light emitting element 1103, a high-speed communication interface 1104, a power source 1105, a timer 1106 for measuring time (time), a RAM (Random Access Memory) 1102, A push button 1108, a slide switch 1109, and a reset switch (not shown) are provided.

CPU1101は、HEMSコントローラ100の全体的な動作を制御する。CPU1101は、プッシュボタン1108およびスライドスイッチ1109からの入力を受け付ける。また、CPU1101は、発光素子1103に発光指示を出力する。   The CPU 1101 controls the overall operation of the HEMS controller 100. The CPU 1101 receives input from the push button 1108 and the slide switch 1109. In addition, the CPU 1101 outputs a light emission instruction to the light emitting element 1103.

ROM1107はプログラムや変更不可なデータ等が格納される不揮発性のメモリデバイスである。RAM1102はプログラムがロードされ、プログラムのワークエリアやファイルシステム、変更可能なデータ等が格納される揮発性のメモリデバイスである。高速通信インターフェイス1104は、無線LANルーター302との間でEthernet(登録商標)を用いた通信を行なうインターフェイスである。電源1105は、HEMSコントローラ100の各部に電力を供給する。   The ROM 1107 is a non-volatile memory device that stores programs, data that cannot be changed, and the like. The RAM 1102 is a volatile memory device in which a program is loaded and a work area and file system of the program, changeable data, and the like are stored. The high-speed communication interface 1104 is an interface that performs communication with the wireless LAN router 302 using Ethernet (registered trademark). The power source 1105 supplies power to each unit of the HEMS controller 100.

<HEMSコントローラ100のソフトウェア構成>
図3は、図1のHEMSコントローラ100のソフトウェア構成を説明するための図である。図3を参照して、HEMSコントローラ100は、デバイス側アプリケーション110、ホスト側アプリケーション120、および上位層130を少なくとも備える。デバイス側アプリケーション110はUDP(User Datagram Protocol)ソケット111を含む。UDPソケット111は送信用と受信用に使用される。また、ホスト側アプリケーション120は、送信用のUDPソケット121、および送受信用のRAWソケット122を含む。また、ホスト側アプリケーション120は、RAM1102にノードリスト123(後述する)を記憶する。
<Software configuration of HEMS controller 100>
FIG. 3 is a diagram for explaining a software configuration of the HEMS controller 100 of FIG. Referring to FIG. 3, the HEMS controller 100 includes at least a device-side application 110, a host-side application 120, and an upper layer 130. The device side application 110 includes a UDP (User Datagram Protocol) socket 111. The UDP socket 111 is used for transmission and reception. The host-side application 120 includes a UDP socket 121 for transmission and a RAW socket 122 for transmission / reception. The host-side application 120 stores a node list 123 (described later) in the RAM 1102.

デバイス側アプリケーション110は、HEMSコントローラ100自身が、ECHONET Liteにおけるコントローラとして振る舞うためのアプリケーションである。デバイス側アプリケーション110は、ノード201,202,203,…からの要求を受信して、当該要求に対して応答または通知を送信する。デバイス側アプリケーション110は、本発明にとって必要ではない。   The device-side application 110 is an application for the HEMS controller 100 itself to behave as a controller in ECHONET Lite. The device-side application 110 receives requests from the nodes 201, 202, 203,... And transmits a response or notification to the request. The device side application 110 is not necessary for the present invention.

ホスト側アプリケーション120は、RAWソケット122を通じて、サブネット10に接続された起動ノードからパケットを受信する。本実施の形態において「起動ノード」とは、電源が入り起動中のノードをいう。ホスト側アプリケーション120は、ノードリスト123の情報を最新の状態に維持する。   The host-side application 120 receives a packet from the activation node connected to the subnet 10 through the RAW socket 122. In the present embodiment, the “startup node” refers to a node that is turned on and starting up. The host-side application 120 maintains the information in the node list 123 in the latest state.

ホスト側アプリケーション120は、さらに、上位層130(家電制御アプリケーション等)にAPI(Application Programming Interface)を提供する。ホスト側アプリケーション120は、上位層130からの指示を受けて、最新のECHONET Lite機器のリストなどを上位層130に返す。また、ホスト側アプリケーション120は、上位層130からの指示を受けて、ノードへ要求を送信する。また、ホスト側アプリケーション120は、通知または当該要求に対する応答を当該ノードから受信し、上位層130へ返す。   The host-side application 120 further provides an API (Application Programming Interface) to the upper layer 130 (home appliance control application or the like). The host-side application 120 receives an instruction from the upper layer 130 and returns a list of the latest ECHONET Lite devices and the like to the upper layer 130. In addition, the host-side application 120 receives an instruction from the upper layer 130 and transmits a request to the node. Further, the host-side application 120 receives a notification or a response to the request from the node and returns it to the upper layer 130.

なお、上位層130としては、家電制御アプリケーション、家電制御CGI(Common Gateway Interface)、家電管理情報取得CGI(図示せず)がある。これらは互いに独立である。各々が独立して、ホスト側アプリケーション120と通信する。   The upper layer 130 includes a home appliance control application, a home appliance control CGI (Common Gateway Interface), and a home appliance management information acquisition CGI (not shown). These are independent of each other. Each communicates with the host-side application 120 independently.

デバイス側アプリケーション110およびホスト側アプリケーション120の各々は、パケットを送信するときは送信先UDPポート番号を3610にする。送信元UDPポート番号は任意で良い。デバイス側アプリケーション110およびホスト側アプリケーション120の各々は、パケットを受信するときは、送信先UDPポート番号3610を処理する。   Each of the device-side application 110 and the host-side application 120 sets the destination UDP port number to 3610 when transmitting a packet. The source UDP port number may be arbitrary. Each of the device-side application 110 and the host-side application 120 processes the destination UDP port number 3610 when receiving a packet.

ホスト側アプリケーション120は、送信用にUDPソケット121を開く。なお、上述したように、ホスト側アプリケーション120は、UDPソケット121の送信元ポート番号を任意に設定する。   The host-side application 120 opens the UDP socket 121 for transmission. As described above, the host-side application 120 arbitrarily sets the transmission source port number of the UDP socket 121.

ホスト側アプリケーション120は、送受信用にRAWソケット122を開く。RAWソケット122を開くのは、パケットを受信すると同時に送信元MACアドレスも得るためである。RAWソケット122は、サブネット10上を伝送されるデータのうち、ネットワークインターフェイス“eth0”で受信できるデータをすべて受信する。ホスト側アプリケーション120は、受信した全てのデータの中から、UDP/IPかつ宛先UDPポート番号が3610であるデータを利用する。あるいは、後述するARPパケットまたは任意のIPパケットなどを利用する。   The host-side application 120 opens the RAW socket 122 for transmission / reception. The reason why the RAW socket 122 is opened is that the source MAC address is obtained at the same time when the packet is received. The RAW socket 122 receives all data that can be received by the network interface “eth0” among the data transmitted on the subnet 10. The host-side application 120 uses data having UDP / IP and destination UDP port number 3610 out of all received data. Alternatively, an ARP packet described later or an arbitrary IP packet is used.

上記の構成を有したHEMSコントローラ100は、サブネット10上の目的ノードを制御するために、目的ノードを探索する。より詳しくは、HEMSコントローラ100は、探索要求パケットをマルチキャストあるいはブロードキャストでサブネット10に送信する。それに加えて、探索要求パケットをユニキャストでも送信する。   The HEMS controller 100 having the above configuration searches for a target node in order to control the target node on the subnet 10. More specifically, the HEMS controller 100 transmits a search request packet to the subnet 10 by multicast or broadcast. In addition, the search request packet is also transmitted by unicast.

本実施の形態では、HEMSコントローラ100は、サブネット10における起動ノードの最新の情報(後述するノード情報)を、ノードリスト123(詳細は後述する)によって管理する。HEMSコントローラ100は、探索要求パケットを送信する場合は、マルチキャストあるいはブロードキャストで送信するとともに、サブネット10上に起動しているノードのノード情報に基づき、当該ノード情報のIPアドレスを宛先アドレスとする探索要求パケットをユニキャストで送信する。これにより、マルチキャストあるいはブロードキャストが転送されないようなネットワーク環境であっても、HEMSコントローラ100は、目的ノードを見つけることができる。   In the present embodiment, the HEMS controller 100 manages the latest information (node information to be described later) of the startup node in the subnet 10 using the node list 123 (details will be described later). When transmitting the search request packet, the HEMS controller 100 transmits the search request packet by multicast or broadcast, and based on the node information of the node activated on the subnet 10, the search request having the IP address of the node information as the destination address Send the packet by unicast. Thereby, even in a network environment where multicast or broadcast is not transferred, the HEMS controller 100 can find the target node.

(ノードリストの構成)
HEMSコントローラ100が有するノードリスト123には、サブネット10における「起動ノード」の情報を管理するためのノード情報が登録される。
(Node list configuration)
In the node list 123 included in the HEMS controller 100, node information for managing the information of the “starting node” in the subnet 10 is registered.

図4は、ノードリスト123の構成を説明するための図である。ノードリスト123は複数のノード情報を含むコンテナである。サブネット10で見つかった1つのノードにつき1つのノード情報がある。ノードリスト123の構成方法は、いろいろ考えられるが、目的とするノード情報を高速に検索できるようにハッシュテーブルの構成とするのが良い。可変長の配列(図4の例では、[0]から[22]まで23個の配列要素がある)と、配列要素のそれぞれはリンクリストで構成される。配列の長さは、ノード情報の個数が増えるに従って動的に拡張される。図4の構成は、ハッシュテーブルの構成としては一般的なものである。ノード情報は、当該ノードのMACアドレスとIPアドレスを少なくとも含む。   FIG. 4 is a diagram for explaining the configuration of the node list 123. The node list 123 is a container including a plurality of node information. There is one node information for each node found in the subnet 10. Various methods of configuring the node list 123 are conceivable, but it is preferable to configure a hash table so that target node information can be searched at high speed. A variable-length array (in the example of FIG. 4, there are 23 array elements from [0] to [22]) and each array element is configured by a link list. The length of the array is dynamically expanded as the number of node information increases. The configuration of FIG. 4 is a general hash table configuration. The node information includes at least the MAC address and IP address of the node.

ノードリスト123からノード情報を読み出す時には、パケットを受信した送信元MACアドレスに基づき検索される。具体的には、当該MACアドレスから所定ハッシュ演算により算出されたハッシュ値が、ノードリスト123の配列の長さ(図4の例では、値23)で除算される。そして、ノードリスト123において、当該余りを示す値に対応した要素のリンクリストをたどっていき、当該MACアドレスに一致するMACアドレスを有したノード情報が読み出される。   When reading node information from the node list 123, a search is performed based on the source MAC address that received the packet. Specifically, the hash value calculated from the MAC address by a predetermined hash operation is divided by the length of the array of the node list 123 (value 23 in the example of FIG. 4). Then, in the node list 123, the link list of the element corresponding to the value indicating the remainder is traced, and node information having a MAC address that matches the MAC address is read out.

ノード情報の書き込み時には、先ほどと同様に、パケットを受信した送信元のMACアドレスから算出されたハッシュ値が、ノードリスト123の配列の長さ(図4の例では、値23)で除算される。そして、ノードリスト123において、当該余りを示す値に対応した要素のリンクリストの先頭または最後に、当該ノード情報が登録される。   At the time of writing the node information, the hash value calculated from the MAC address of the transmission source that received the packet is divided by the length of the array of the node list 123 (value 23 in the example of FIG. 4) as before. . In the node list 123, the node information is registered at the beginning or end of the link list of the element corresponding to the value indicating the remainder.

図5は、本実施の形態1に係るノード情報の構成の一例を示す図である。図5を参照して、ノード情報は、当該ノードのMACアドレス、IPアドレス、当該ノード情報をノードリスト123から削除すべき時刻、削除前ARP(Address Resolution Protocol)リクエスト送信済みフラグ、および探索要求パケット送信カウンタを少なくとも含む。   FIG. 5 is a diagram showing an example of the configuration of the node information according to the first embodiment. Referring to FIG. 5, the node information includes the MAC address and IP address of the node, the time at which the node information should be deleted from the node list 123, the pre-deletion ARP (Address Resolution Protocol) request transmitted flag, and the search request packet. At least a transmission counter is included.

サブネット10においては、上述したようにノードが参加または離脱する可能性がある等、サブネット10の状態は変化する。この変化に追従するために、ノードリスト123からは起動が確認されないノード情報は削除されなければならない。ノード情報には、削除すべき時刻が含まれており、削除すべき時刻に到達すれば削除される。例えば、削除すべき時刻は、HEMSコントローラ100が、当該ノード情報のパケットを最後に(最近に)受信したときから、所定時間後(例えば15分経過後の)時刻とする。HEMSコントローラ100は、削除すべき時刻を、当該ノードからパケットを受信する毎に更新する。削除すべき時刻の設定方法の詳細は後述する。   In the subnet 10, the state of the subnet 10 changes, such as the possibility that a node may join or leave as described above. In order to follow this change, node information whose activation is not confirmed must be deleted from the node list 123. The node information includes the time to be deleted, and is deleted when the time to be deleted is reached. For example, the time to be deleted is a time after a predetermined time (for example, after 15 minutes) from when the HEMS controller 100 last (recently) received the packet of the node information. The HEMS controller 100 updates the time to be deleted every time a packet is received from the node. Details of the method for setting the time to be deleted will be described later.

削除前ARPリクエスト送信済みフラグは、HEMSコントローラ100がノード情報を削除する直前にARPリクエスト送信済みであるか否かを判断するために使われる。削除前ARPリクエスト送信済みフラグが0であれば、当該ノードのIPアドレスを探索IPアドレスにしてARPリクエストを送信する。その応答があれば、ノード情報は削除されない。削除前ARPリクエスト送信済みフラグの初期値は0とする。   The pre-deletion ARP request transmitted flag is used to determine whether or not the EMS request has been transmitted immediately before the HEMS controller 100 deletes the node information. If the pre-deletion ARP request transmission flag is 0, the ARP request is transmitted with the IP address of the node as the search IP address. If there is a response, the node information is not deleted. The initial value of the pre-deletion ARP request transmission flag is set to zero.

探索要求パケット送信カウンタは、HEMSコントローラ100が、当該ノードが目的とするノードであるかどうかを調べるために探索要求パケットを送信した回数をカウントしたものである。探索要求パケットが届かない可能性もあるので、同一ノードに対して探索要求パケットを何度も送信することとする。探索要求パケット送信カウンタの初期値は0である。   The search request packet transmission counter counts the number of times that the HEMS controller 100 transmits a search request packet in order to check whether or not the node is the target node. Since the search request packet may not arrive, the search request packet is transmitted to the same node many times. The initial value of the search request packet transmission counter is zero.

<パケットの構成>
サブネット10上を伝送されるデータを説明する。本実施の形態では、伝送データはパケットの構成を有する。
<Packet configuration>
Data transmitted on the subnet 10 will be described. In the present embodiment, the transmission data has a packet configuration.

図6は、ARPパケットの構成を示す図である。ARPリクエストまたはARPリプライは、図6のARPパケットの構成を有する。   FIG. 6 is a diagram illustrating a configuration of an ARP packet. The ARP request or ARP reply has the configuration of the ARP packet shown in FIG.

図6を参照して、ARPパケットは、Ethernetヘッダ部と、ARPプロトコル部を含む。Ethernetヘッダ部は、宛先ノードのMACアドレス、送信元ノードのMACアドレス、および上位層プロトコルのタイプを含む。上位層がARPパケットである場合は、このプロトコルのタイプは“ARP”を示す。   Referring to FIG. 6, the ARP packet includes an Ethernet header part and an ARP protocol part. The Ethernet header part includes the MAC address of the destination node, the MAC address of the source node, and the type of the upper layer protocol. When the upper layer is an ARP packet, the type of this protocol indicates “ARP”.

ARPプロトコル部は、ネットワークの物理的な媒体(本実施の形態ではEthernet)の種類、ARPプロトコルで取り扱う上位のプロトコルの種類(本実施の形態ではIP)、物理層で利用されるアドレスの長さを示すハードウェアサイズ、および上位プロトコルで利用されるアドレスの長さを示すプロトコルサイズを含む。さらに、ARPの動作の種類を表すためのOPコード、送信者MACアドレス、送信者IPアドレス、探索MACアドレス、および探索IPアドレスを含む。OPコードには、ARP要求を表す“request”およびARP要求に対する応答を表す“reply”のいずれかがセットされる。   The ARP protocol section includes the type of physical network medium (Ethernet in this embodiment), the type of higher-level protocol handled by the ARP protocol (IP in this embodiment), and the length of the address used in the physical layer. And a protocol size indicating the length of an address used in the upper protocol. Furthermore, an OP code for indicating the type of ARP operation, a sender MAC address, a sender IP address, a search MAC address, and a search IP address are included. In the OP code, either “request” indicating an ARP request or “reply” indicating a response to the ARP request is set.

送信者MACアドレスおよび送信者IPアドレスは、ARPリクエストまたはARPリプライを送信したノード自身のMACアドレスおよびIPアドレスをそれぞれ示す。   The sender MAC address and the sender IP address indicate the MAC address and IP address of the node itself that transmitted the ARP request or ARP reply, respectively.

ARPパケットがARPリクエストを示す場合には、探索MACアドレスには0にセットされ、探索IPアドレスには探索したいIPアドレスがセットされる。ARPパケットがARPリプライを示す場合には、探索MACアドレスおよび探索IPアドレスには、対応するARPリクエストの送信ノードのMACアドレスおよびIPアドレスがそれぞれセットされる。   When the ARP packet indicates an ARP request, the search MAC address is set to 0, and the search IP address is set to the IP address to be searched. When the ARP packet indicates an ARP reply, the MAC address and IP address of the transmission node of the corresponding ARP request are set in the search MAC address and the search IP address, respectively.

図7は、任意のIPパケットの構成示す図である。図7を参照して、任意のIPパケットは、Ethernetヘッダ部と、IPヘッダ部とペイロード部(図示しない)を含む。Ethernetヘッダ部は、宛先ノードのMACアドレス、送信元ノードのMACアドレス、および上位層プロトコルのタイプを含む。上位層がIPパケットである場合は、このプロトコルのタイプは“IP”を示す。   FIG. 7 is a diagram showing the configuration of an arbitrary IP packet. Referring to FIG. 7, an arbitrary IP packet includes an Ethernet header part, an IP header part, and a payload part (not shown). The Ethernet header part includes the MAC address of the destination node, the MAC address of the source node, and the type of the upper layer protocol. When the upper layer is an IP packet, this protocol type indicates “IP”.

IPヘッダ部は、IPプロトコルのバージョンとIPヘッダ部分のサイズとを示すヘッダ長、サービスタイプ、パケット長、IPパケットに識別子、フラグとフラグメントオフセット、TTL(time to live)、上位層のプロトコル番号、および整合性検査のためのヘッダチェックサムを含む。上位層のプロトコル番号には、例えば、上位層がUDPパケットまたはDHCPパケットならば“17”が入る。IGMPパケットならば“2”が入る。   The IP header part includes a header length indicating the version of the IP protocol and the size of the IP header part, a service type, a packet length, an identifier for the IP packet, a flag and a fragment offset, a TTL (time to live), an upper layer protocol number, And a header checksum for consistency checking. For example, if the upper layer is a UDP packet or a DHCP packet, “17” is entered in the upper layer protocol number. If the packet is an IGMP packet, “2” is entered.

さらに、IPヘッダ部は、当該IPパケットの送信元ノードのIPアドレスを示す送信元IPアドレス、および当該IPパケットの宛先ノードのIPアドレスを含む。さらにペイロード部には、上位層の具体的なデータが含まれる。例えば、上位層がUDPパケットの場合ならばUDPヘッダ部が続く。   Furthermore, the IP header part includes a source IP address indicating the IP address of the source node of the IP packet and an IP address of the destination node of the IP packet. Further, the payload portion includes specific data of the upper layer. For example, if the upper layer is a UDP packet, a UDP header portion follows.

本実施の形態では、HEMSコントローラ100および各ノードは、パケットを受信した場合には、当該パケットのタイプに基づき、当該パケットはARPパケットであるかIPパケットであるかを判断することができる。   In the present embodiment, when receiving a packet, the HEMS controller 100 and each node can determine whether the packet is an ARP packet or an IP packet based on the type of the packet.

<MACアドレスとIPアドレスとの組が正しくない場合>
HEMSコントローラ100が、任意のIPパケットを受信したとき、その送信元MACアドレスと送信元IPアドレスとの組が正しくない可能性がある。
<When the pair of MAC address and IP address is not correct>
When the HEMS controller 100 receives an arbitrary IP packet, there is a possibility that the combination of the source MAC address and the source IP address is not correct.

例えば、任意のIPパケットが、無線LANルーター302を超えたネットワーク(すなわち、サブネット10とは異なるネットワーク)から送信されたものである場合には、当該IPパケットの送信元IPアドレスには真の送信者のIPアドレスがセットされているが、送信元MACアドレスには、無線LANルーター302のMACアドレスがセットされている。   For example, when an arbitrary IP packet is transmitted from a network beyond the wireless LAN router 302 (that is, a network different from the subnet 10), true transmission is performed for the source IP address of the IP packet. The IP address of the wireless LAN router 302 is set as the source MAC address.

また、IPパケットがDHCPパケットである場合は、送信元IPアドレスは、一律に0.0.0.0にセットされている。このような場合は、送信元MACアドレスと送信元IPアドレスとの組が正しくないと言える。   If the IP packet is a DHCP packet, the source IP address is uniformly set to 0.0.0.0. In such a case, it can be said that the combination of the source MAC address and the source IP address is not correct.

<ノードリスト123の管理>
次に、HEMSコントローラ100によるノードリスト123の管理について説明する。ノードリスト123は初期状態で空であるが、ノードリスト123の管理処理によって、サブネット10における「起動ノード」の情報の追加または削除が行われる。
<Management of node list 123>
Next, management of the node list 123 by the HEMS controller 100 will be described. Although the node list 123 is empty in the initial state, information on the “starting node” in the subnet 10 is added or deleted by the management process of the node list 123.

図9は、実施の形態1に係るノードリスト123からノード情報を削除するための処理を示すフローチャートである。   FIG. 9 is a flowchart showing processing for deleting node information from the node list 123 according to the first embodiment.

図10は、本実施の形態1に係るARPリクエストまたはARPリプライを受信した時のノードリスト123の情報更新の処理を示すフローチャートである。   FIG. 10 is a flowchart showing information update processing of the node list 123 when receiving an ARP request or ARP reply according to the first embodiment.

図11は、本実施の形態1に係る任意のIPパケットを受信した時のノードリスト123の情報更新の処理を示すフローチャートである。   FIG. 11 is a flowchart showing information update processing of the node list 123 when an arbitrary IP packet according to the first embodiment is received.

(ノード情報の削除処理)
図9を参照して、ノードリスト123からノード情報を削除する処理を説明する。図9の処理は定期的に(例えば250ms毎に)実行される。
(Deleting node information)
A process of deleting node information from the node list 123 will be described with reference to FIG. The processing of FIG. 9 is executed periodically (for example, every 250 ms).

まず、HEMSコントローラ100は、ノードリスト123から次のノード情報を取り出す(ステップS3)。次のノード情報がなければ(ステップS5でNO)、処理を終了する。次のノード情報があれば(ステップS5でYES)、HEMSコントローラ100は、当該ノードがタイムアウトされたか(削除すべき時刻になったか)否かを判断する(ステップS7)。   First, the HEMS controller 100 takes out the next node information from the node list 123 (step S3). If there is no next node information (NO in step S5), the process is terminated. If there is next node information (YES in step S5), the HEMS controller 100 determines whether or not the node has timed out (time to be deleted) (step S7).

当該ノードがタイムアウトされていなければ(ステップS7でNO)、ステップS3に戻る。ノードリスト123から次のノード情報を取り出して、ステップS5以降の処理が同様に実行される。   If the node has not timed out (NO in step S7), the process returns to step S3. The next node information is extracted from the node list 123, and the processing from step S5 is similarly executed.

当該ノードがタイムアウトされていれば(ステップS7でYES)、HEMSコントローラ100は、当該ノードの削除前ARPリクエスト送信済みフラグが“0”であるか否かを判断する(ステップS9)。   If the node has timed out (YES in step S7), the HEMS controller 100 determines whether or not the pre-deletion ARP request transmission flag of the node is “0” (step S9).

削除前ARPリクエスト送信済みフラグが“0”であるならば(ステップS9でYES)、HEMSコントローラ100は、当該ノードのIPアドレスを探索IPアドレスとするARPリクエストを送信する。ただし、当該ノードのIPアドレスが0.0.0.0のときは(一時的なIPアドレスなので)ARPリクエストを送信せずすぐに当該ノードのノード情報を削除する(ステップS11)。   If the pre-deletion ARP request transmission flag is “0” (YES in step S9), the HEMS controller 100 transmits an ARP request with the IP address of the node as the search IP address. However, when the IP address of the node is 0.0.0.0 (since it is a temporary IP address), the node information of the node is immediately deleted without transmitting the ARP request (step S11).

HEMSコントローラ100は、上記のARPリクエストを送信した場合に、ノード情報のリクエスト送信済みフラグを“1”にセットし(ステップS13)、当該ノードの削除すべき時刻を10秒間だけ延長する(ステップS15)。その後、ステップS3に戻る。   When the HEMS controller 100 transmits the above ARP request, the HEMS controller 100 sets the request transmission completion flag of the node information to “1” (step S13), and extends the time to delete the node by 10 seconds (step S15). ). Then, it returns to step S3.

ステップS9において、削除前ARPリクエスト送信済みフラグが“0”でないならば(ステップS9でNO)、HEMSコントローラ100は、ノードリスト123から当該ノードのノード情報を削除する(ステップS17)。その後、ステップS3に戻る。   If the pre-deletion ARP request transmitted flag is not “0” in step S9 (NO in step S9), the HEMS controller 100 deletes the node information of the node from the node list 123 (step S17). Then, it returns to step S3.

このように、HEMSコントローラ100は、基本的には、各ノード情報の削除すべき時刻になれば当該ノード情報をノードリスト123から削除するが、削除する直前に当該ノードがまだ起動しているかどうかを確認するために(RAWソケット122を通じて)ARPリクエストを送信する。当該ノードからARPレスポンス(または任意のIPパケット)を10秒以内に受信できなければ当該ノード情報は削除される。当該ノードからARPレスポンス(または任意のIPパケット)を受信できれば当該ノード情報は削除されない。   As described above, the HEMS controller 100 basically deletes the node information from the node list 123 when it is time to delete each node information, but whether or not the node is still activated immediately before the deletion. Send an ARP request (via RAW socket 122) to confirm If the ARP response (or any IP packet) cannot be received from the node within 10 seconds, the node information is deleted. If the ARP response (or any IP packet) can be received from the node, the node information is not deleted.

(ノード情報の登録処理)
HEMSコントローラ100は、RAWソケット122を通じてパケットを受信したときに、送信元MACアドレスに基づきノードリスト123へノード情報を登録する。この対象となるパケットは、ARPリプライまたはARPリクエストのパケット、および任意のIPパケットである。
(Node information registration process)
When the HEMS controller 100 receives a packet through the RAW socket 122, the HEMS controller 100 registers the node information in the node list 123 based on the source MAC address. This target packet is an ARP reply or ARP request packet and an arbitrary IP packet.

−ARPリプライ/ARPリクエスト受信時の登録処理−
まず、図10を参照してARPリプライまたはARPリクエストのパケットを受信した場合の登録処理を説明する。図10の処理は、ARPリクエストまたはARPリプライを受信する毎に実行される。
-Registration process when receiving ARP reply / ARP request-
First, registration processing when an ARP reply or ARP request packet is received will be described with reference to FIG. The process of FIG. 10 is executed every time an ARP request or an ARP reply is received.

ただし、送信元MACアドレスと送信者MACアドレスとが一致しない場合もあるが、その場合は、HEMSコントローラ100は図10の処理を実施しない(重複IPアドレスを検出したときに、ルーターからもARPリプライが来ることがある)。従って、図10に記載された送信者MACアドレスは、送信元MACアドレスと同一の値である。   However, in some cases, the source MAC address and the sender MAC address do not match. In this case, the HEMS controller 100 does not perform the processing of FIG. 10 (when a duplicate IP address is detected, the router also receives an ARP reply). May come). Therefore, the sender MAC address described in FIG. 10 is the same value as the source MAC address.

まず、HEMSコントローラ100は、受信したパケット(ARPリクエストまたはARPリプライ)の送信者MACアドレスをキーに、ノードリスト123からノード情報を取り出す(ステップS20)。当該送信者MACアドレスに一致するノード情報があるか否かを判断する(ステップS21)。   First, the HEMS controller 100 extracts node information from the node list 123 using the sender MAC address of the received packet (ARP request or ARP reply) as a key (step S20). It is determined whether there is node information that matches the sender MAC address (step S21).

当該送信者MACアドレスに一致するノード情報がなければ(ステップS21でNO)、HEMSコントローラ100は、ノード情報を新規作成する(ステップS22)。このノード情報のMACアドレスおよびIPアドレスとして、受信されたパケットの送信者MACアドレスと送信者IPアドレスがそれぞれセットされる。また、当該ノード情報のパケット送信カウンタは0(初期値)にセットされる。   If there is no node information that matches the sender MAC address (NO in step S21), the HEMS controller 100 newly creates node information (step S22). The sender MAC address and sender IP address of the received packet are set as the MAC address and IP address of the node information, respectively. Further, the packet transmission counter of the node information is set to 0 (initial value).

HEMSコントローラ100は、新規作成されたノード情報を、ノードリスト123に追加して登録する(ステップS23)。また、HEMSコントローラ100は、受信した当該ノード情報の削除すべき時刻53に、現在時間よりも15分経過後の時刻をセットする。また、削除前ARPリクエスト送信済みフラグを0(初期値)にセットする(ステップS26)。   The HEMS controller 100 adds the newly created node information to the node list 123 and registers it (step S23). In addition, the HEMS controller 100 sets a time after 15 minutes from the current time to the time 53 when the received node information is to be deleted. Further, the pre-deletion ARP request transmission completion flag is set to 0 (initial value) (step S26).

ステップS21において、当該送信者MACアドレスに一致するノード情報があれば(ステップS21でYES)、HEMSコントローラ100は、当該ノード情報のIPアドレスが、受信されたパケットの送信者IPアドレスと一致するか否かを判断する(ステップS24)。一致すると判断すると(ステップS24でYES)、ステップS26において、当該ノード情報について前述(ステップS26)と同様の処理が実行される。   If there is node information that matches the sender MAC address in step S21 (YES in step S21), the HEMS controller 100 determines whether the IP address of the node information matches the sender IP address of the received packet. It is determined whether or not (step S24). If it is determined that they match (YES in step S24), in step S26, the same processing as described above (step S26) is executed for the node information.

当該ノード情報のIPアドレスが、受信されたパケットの送信者IPアドレスと一致しないならば(ステップS24でNO)、HEMSコントローラ100は、当該ノード情報のIPアドレスを送信者IPアドレスに更新する(ステップS25)。その後、ステップS26の処理が上述と同様に実行される。   If the IP address of the node information does not match the sender IP address of the received packet (NO in step S24), the HEMS controller 100 updates the IP address of the node information to the sender IP address (step S24). S25). Thereafter, the process of step S26 is executed in the same manner as described above.

図10の処理によって、HEMSコントローラ100は、ARPリクエストまたはARPリプライを受信する毎に当該ノードのノード情報の削除すべき時刻を、パケットを受信した時の時刻から15分後を示すように更新(時間を延長)する。   10, the HEMS controller 100 updates the time at which the node information of the node should be deleted every time an ARP request or ARP reply is received, so as to indicate 15 minutes after the time when the packet is received ( Extend the time).

−任意のIPパケット受信時の登録処理−
次に、図11を参照して、任意のIPパケットを受信した場合の登録処理を説明する。HEMSコントローラ100は、任意のIPパケットを受信する毎に図11の処理を実行する。任意のIPパケットには、IGMPパケット、ICMP(Internet Control Message Protocolの略)パケット、DHCPパケット、UDPパケットおよびTCP(Transmission Control Protocolの略)パケットなどが含まれる。
-Registration process when receiving any IP packet-
Next, registration processing when an arbitrary IP packet is received will be described with reference to FIG. The HEMS controller 100 executes the process of FIG. 11 every time an arbitrary IP packet is received. The arbitrary IP packet includes an IGMP packet, an ICMP (abbreviation of Internet Control Message Protocol) packet, a DHCP packet, a UDP packet, a TCP (abbreviation of Transmission Control Protocol) packet, and the like.

図11を参照して、HEMSコントローラ100は、受信したIPパケットの送信元MACアドレスをキーに、ノードリスト123からノード情報を取り出す(ステップS30)。HEMSコントローラ100は、送信元MACアドレスに一致するノード情報があるか否かを判断する(ステップS31)。送信元MACアドレスに一致するノード情報があれば(ステップS31でYES)、HEMSコントローラ100は、図10のステップS26の処理と同様に、当該ノード情報の削除すべき時刻に、現在時刻よりも15分経過後の時刻をセットし、また、リクエスト送信済みフラグを0にセットする(ステップS35)。   Referring to FIG. 11, HEMS controller 100 extracts node information from node list 123 using the source MAC address of the received IP packet as a key (step S30). The HEMS controller 100 determines whether there is node information that matches the source MAC address (step S31). If there is node information that matches the transmission source MAC address (YES in step S31), the HEMS controller 100, as in the process of step S26 of FIG. The time after the lapse of minutes is set, and the request transmission completion flag is set to 0 (step S35).

送信元MACアドレスに一致するノード情報がなければ(ステップS31でNO)、HEMSコントローラ100は、ノード情報を新規に作成する(ステップS32)。HEMSコントローラ100は、このノード情報に、受信されたパケットの送信元MACアドレスをMACアドレスとしてセットするとともに、IPアドレスには0.0.0.0をセットする。また、パケット送信カウンタには0をセットする。   If there is no node information that matches the source MAC address (NO in step S31), the HEMS controller 100 newly creates node information (step S32). The HEMS controller 100 sets the source MAC address of the received packet as the MAC address in this node information, and also sets 0.0.0.0 as the IP address. Also, 0 is set in the packet transmission counter.

本実施の形態では、上記の“(MACアドレスとIPアドレスとの組が正しくない場合)”で説明したように、受信されたIPパケットの送信元MACアドレスと送信元IPアドレスとの組は常に正しいとは限らない。したがって、HEMSコントローラ100は、新規に作成したノード情報のIPアドレスに、上述のように 0.0.0.0を一時的にセットする。   In the present embodiment, as described above in “(When the pair of MAC address and IP address is not correct)”, the pair of the source MAC address and source IP address of the received IP packet is always It is not always correct. Accordingly, the HEMS controller 100 temporarily sets 0.0.0.0 to the IP address of the newly created node information as described above.

HEMSコントローラ100は、新規作成されたノード情報を、ノードリスト123に追加する(ステップS33)。   The HEMS controller 100 adds the newly created node information to the node list 123 (step S33).

また、HEMSコントローラ100は、受信したIPパケットの送信元IPアドレスを、探索IPアドレスにセットしたARPリクエストを送信する(ステップS34)。なお、このとき、受信IPパケットの送信元IPアドレスが0.0.0.0を示す場合には、ARPリクエストを送信しない。その後、新規作成されたノード情報について、ステップS35の処理が実行される。   Further, the HEMS controller 100 transmits an ARP request in which the source IP address of the received IP packet is set to the search IP address (step S34). At this time, if the source IP address of the received IP packet indicates 0.0.0.0, the ARP request is not transmitted. Then, the process of step S35 is performed about the newly created node information.

HEMSコントローラ100は、上記のステップS34においてARPリクエストを送信した後に、これに対するARPリプライを受信した場合には、図10のフローに従って、ステップS25の処理を実行することになる。これにより、当初0.0.0.0とセットされていたノード情報のIPアドレスが正しいIPアドレスに更新される。   When the HEMS controller 100 receives the ARP reply for the ARP request after transmitting the ARP request in step S34, the HEMS controller 100 executes the process of step S25 according to the flow of FIG. As a result, the IP address of the node information initially set to 0.0.0.0 is updated to the correct IP address.

このように、図11の場合も、図10と同様に、HEMSコントローラ100は、ノードから任意のIPパケットを受信する毎に、当該ノードのノード情報の削除すべき時刻を、パケットを受信した時刻の15分後を示すように更新(時間を延長)する。   Thus, in the case of FIG. 11 as well, as in FIG. 10, every time an HEMS controller 100 receives an arbitrary IP packet from a node, the time at which the node information of the node should be deleted is the time at which the packet is received. Update (extend time) to indicate 15 minutes later.

上述の削除処理(図9参照)は、図10と図11で更新される削除すべき時刻に基づき実行されるから、起動ノードについては、起動が確認される間は、ノード情報は削除されることはない。したがって、図9〜図11の処理によって、サブネット10上の「起動ノード」に関する情報を最新の状態に維持することができる。図9〜図11の処理は、基本的には、パケットを受信したときに実行される処理である。「サブネット10上にある起動ノードの存在を受動的に検出する」というのはそれゆえのことである。   Since the above-described deletion process (see FIG. 9) is executed based on the time to be deleted updated in FIG. 10 and FIG. 11, the node information is deleted while the activation is confirmed for the activation node. There is nothing. Therefore, the information regarding the “startup node” on the subnet 10 can be maintained in the latest state by the processing of FIGS. 9 to 11. The processes in FIGS. 9 to 11 are basically processes executed when a packet is received. This is why “passive detection of the presence of an activation node on the subnet 10” is performed.

<目的ノードの探索処理>
次に、HEMSコントローラ100が目的ノードをサブネット10上で探索する処理を説明する。
<Target node search processing>
Next, processing in which the HEMS controller 100 searches for the target node on the subnet 10 will be described.

本実施の形態では、HEMSコントローラ100は、サブネット10に探索要求パケットを送信し、それに対する探索応答パケットを受信することにより、当該目的ノードを見つける。ここでは、目的ノードを見つけることを「探索に成功する」ともいう。   In the present embodiment, the HEMS controller 100 transmits the search request packet to the subnet 10 and receives the search response packet corresponding thereto, thereby finding the target node. Here, finding the target node is also referred to as “successful search”.

図12は、本実施の形態1に係る目的ノードを探索する処理のフローチャートである。HEMSコントローラ100は、図12の処理を一定間隔で(例えば、3分毎に)実行する。   FIG. 12 is a flowchart of processing for searching for a target node according to the first embodiment. The HEMS controller 100 executes the processing of FIG. 12 at regular intervals (for example, every 3 minutes).

図12を参照して、HEMSコントローラ100は、宛先IPアドレスをマルチキャスト・アドレスにセットした探索要求パケットを送信する(ステップS40)。
マルチキャスト・アドレスとポート番号については、探索機器と被探索機器との間で予め定められている。
Referring to FIG. 12, HEMS controller 100 transmits a search request packet in which the destination IP address is set to the multicast address (step S40).
The multicast address and port number are determined in advance between the searching device and the searched device.

例えば、被探索機器がECHONET Lite(登録商標)機器である場合、マルチキャスト・アドレスは224.0.23.0に、また、ポート番号は3610とする。   For example, when the searched device is an ECHONET Lite (registered trademark) device, the multicast address is 224.0.23.0 and the port number is 3610.

他の例として、被探索機器がUPnP(Universal Plug and Play- Simple Service Discovery Protocol)デバイスである場合、マルチキャスト・アドレスは239.255.255.250に、また、ポート番号は1900とする。   As another example, when the search target device is a UPnP (Universal Plug and Play-Simple Service Discovery Protocol) device, the multicast address is set to 239.255.255.250, and the port number is set to 1900.

本実施の形態では、サブネット10上の目的ノードを確実に探索するために、HEMSコントローラ100は、ノードリスト123の各ノード情報に基づいて探索要求パケットを生成して、ユニキャストで送信する(ステップS41とS42)。   In the present embodiment, in order to reliably search for a target node on the subnet 10, the HEMS controller 100 generates a search request packet based on each node information in the node list 123 and transmits it by unicast (step). S41 and S42).

具体的には、HEMSコントローラ100は、探索要求パケットの宛先IPアドレスを、ノードリスト123のノード情報から1つ選択する。この選択においては、ノードリスト123の各ノード情報から、探索要求パケット送信カウンタの値が最小であるノード情報を選択するのがよい。そのように選択したノード情報のMACアドレスおよびIPアドレスを、宛先MACアドレスおよび宛先IPアドレスにそれぞれセットして探索要求パケットを生成し、ユニキャストで送信する。   Specifically, the HEMS controller 100 selects one destination IP address of the search request packet from the node information in the node list 123. In this selection, it is preferable to select the node information having the smallest search request packet transmission counter value from each node information of the node list 123. The search request packet is generated by setting the MAC address and IP address of the node information thus selected to the destination MAC address and the destination IP address, and transmitted by unicast.

本実施の形態では、上述のステップS41におけるノード情報選択時に、IPアドレスが0.0.0.0であるノード情報を選択の対象から外す。これは、ステップS32(図11)でノード情報を新規作成した後、IPアドレスが更新されていない場合があるからである。   In the present embodiment, the node information having the IP address of 0.0.0.0 is excluded from the selection targets when the node information is selected in step S41 described above. This is because the IP address may not be updated after node information is newly created in step S32 (FIG. 11).

また、HEMSコントローラ100は、探索応答パケットを既に受信しているノードについても選択の対象から外す。これは、当該ノードについては既に探索に成功しているからであり、再度探索する必要はないからである。さらに、HEMSコントローラ100は、パケット送信カウンタが上限値(例えば、30回)に達しているノード情報も選択の対象から外す。これは、当該ノードに対して探索要求パケットを何度も繰り返し送信しているにもかかわらず、探索応答パケットを受信していないということは、当該ノードは目的とするノードではないと判断できるからである。ステップS41において、ノードリスト123で管理しているすべてのノード情報が、対象外である場合には、ステップS41にてユニキャストで送信する必要はない。   The HEMS controller 100 also excludes nodes that have already received the search response packet from selection targets. This is because the node has already been successfully searched and does not need to be searched again. Further, the HEMS controller 100 also excludes node information whose packet transmission counter has reached an upper limit (for example, 30 times) from selection targets. This is because the fact that the search response packet is not received even though the search request packet is repeatedly transmitted to the node can be determined that the node is not the target node. It is. In step S41, when all the node information managed in the node list 123 is not the target, it is not necessary to transmit by unicast in step S41.

HEMSコントローラ100は、選択されたノード情報のIPアドレスに基づいた探索要求パケットをユニキャストで送信したとき、当該ノード情報の探索要求パケット送信カウンタの値をインクリメントする(ステップS43)。   When the HEMS controller 100 transmits the search request packet based on the IP address of the selected node information by unicast, the HEMS controller 100 increments the value of the search request packet transmission counter of the node information (step S43).

なお、上記の探索要求パケットの送信元MACアドレスおよび送信元IPアドレスには、HEMSコントローラ100が有するMACアドレスおよびIPアドレスがセットされる。   The MAC address and IP address of the HEMS controller 100 are set in the source MAC address and source IP address of the search request packet.

HEMSコントローラ100は、探索要求パケットに対する探索応答パケットを受信するために所定期間(例えば、5秒間)経過するまで待つ(ステップS44)。   The HEMS controller 100 waits until a predetermined period (for example, 5 seconds) elapses in order to receive a search response packet for the search request packet (step S44).

探索応答パケットは、IPパケット(図7参照)の構成を有する。具体的には、探索応答パケットの送信元MACアドレスおよび送信元IPアドレスには、送信元ノードが有するMACアドレスおよびIPアドレスがそれぞれセットされている。   The search response packet has a configuration of an IP packet (see FIG. 7). Specifically, the MAC address and IP address of the source node are set in the source MAC address and source IP address of the search response packet, respectively.

ステップS44で、HEMSコントローラ100は、複数個の探索応答パケットを受信する場合があり得る。(探索要求パケットをマルチキャストで送信しているため)したがって、探索要求パケットを送信してから所定期間(例えば、5秒間)は必ず待つようにする。この所定期間内に探索応答パケットを受信し、その内容が先に送信した探索要求パケットに対する応答であることを確認できれば、目的ノードを見つけることができたと判断する。この場合には、HEMSコントローラは、目的ノードのノード情報を別途管理する。この管理方法は、本発明の範囲ではないので説明を省略する。   In step S44, the HEMS controller 100 may receive a plurality of search response packets. (Because the search request packet is transmitted by multicast) Therefore, it is necessary to always wait for a predetermined period (for example, 5 seconds) after transmitting the search request packet. If the search response packet is received within the predetermined period and it is confirmed that the content is a response to the previously transmitted search request packet, it is determined that the target node has been found. In this case, the HEMS controller separately manages the node information of the target node. Since this management method is not within the scope of the present invention, a description thereof will be omitted.

[実施の形態2]
実施の形態2は、実施の形態1の変形例である。実施の形態1では、HEMSコントローラ100は、目的ノードの探索時に、マルチキャストで探索要求パケットを送信する(図12のステップS40参照)。一方、実施の形態2では、HEMSコントローラ100は、ブロードキャストで探索要求パケットを送信する。
[Embodiment 2]
The second embodiment is a modification of the first embodiment. In the first embodiment, the HEMS controller 100 transmits a search request packet by multicast when searching for a target node (see step S40 in FIG. 12). On the other hand, in the second embodiment, the HEMS controller 100 transmits a search request packet by broadcast.

なお、マルチキャストで送信するか、ブロードキャストで送信するかは、被探索機器によって使い分ける。探索機器と被探索機器との間で発見プロトコルが予め定められている。   Whether to transmit by multicast or by broadcast depends on the searched device. A discovery protocol is predetermined between the searching device and the searched device.

なお、実施の形態2でも、探索要求パケットがブロードキャストで送信される点を除いた構成および機能については、実施の形態1と同様の構成および機能が実現されるので、それらの詳細説明は繰返さない。   In the second embodiment as well, the configuration and functions other than the point that the search request packet is transmitted by broadcasting are the same as those in the first embodiment, so that detailed description thereof will not be repeated. .

図13は、本実施の形態2に係る目的ノードを探索する処理を示すフローチャートである。HEMSコントローラ100は、図13の処理を一定間隔(例えば、3分毎)で実行する。   FIG. 13 is a flowchart showing processing for searching for a target node according to the second embodiment. The HEMS controller 100 executes the process of FIG. 13 at regular intervals (for example, every 3 minutes).

図13を参照して、HEMSコントローラ100は、宛先IPアドレスをブロードキャスト・アドレスにセットして探索要求パケットを送信する(ステップS40a)。   Referring to FIG. 13, the HEMS controller 100 sets a destination IP address to a broadcast address and transmits a search request packet (step S40a).

ブロードキャスト・アドレスについてはマルチキャスト・アドレスとは異なり特に取り決めはなくてもよいが、ポート番号については、探索機器と被探索機器との間で予め定められている。   Unlike the multicast address, the broadcast address does not need to be determined in particular, but the port number is determined in advance between the searching device and the searched device.

例えば、被探索機器がシャープ株式会社製の電力モニタのノードである場合、HEMSコントローラ100は、宛先IPアドレスをブロードキャスト・アドレスに、宛先ポート番号を12132にセットした探索要求パケットをブロードキャストで送信する。   For example, when the search target device is a power monitor node manufactured by Sharp Corporation, the HEMS controller 100 transmits a search request packet in which the destination IP address is set to the broadcast address and the destination port number is set to 12132 by broadcast.

なお、ブロードキャスト・アドレスについては、IPアドレスの全ビットを1にした、リミテッド・ブロードキャスト・アドレス(255.255.255.255)と、IPアドレスのホスト部だけをすべて1にしたディレクティッド・ブロードキャスト・アドレスとがある。例えば、サブネット10の各ノードのIPアドレスが192.168.11.Xで、サブネットマスクが255.255.255.0であるとき、192.168.11.255となる。いずれにせよサブネット10の各ノードに届くことが期待できるので、どちらを使ってもよい。   As for the broadcast address, a limited broadcast address (255.255.255.255) with all bits of the IP address set to 1, and a directed broadcast with all the host part of the IP address set to 1 only. There is an address. For example, the IP address of each node in the subnet 10 is 192.168.11. When X and the subnet mask is 255.255.255.0, 192.168.11.255 is obtained. In any case, since it can be expected to reach each node of the subnet 10, either one may be used.

実施の形態2でも、サブネット10上の目的ノードを確実に探索するために、HEMSコントローラ100は、ノードリスト123の各ノード情報のIPアドレスに基づいて探索要求パケットを生成して、ユニキャストで送信する(ステップS41とS42)。   Also in the second embodiment, the HEMS controller 100 generates a search request packet based on the IP address of each node information in the node list 123 and transmits it by unicast in order to reliably search for the target node on the subnet 10. (Steps S41 and S42).

図13のステップS41以降の処理は、図12で説明した処理と同様であるから、詳細説明は繰返さない。   Since the process after step S41 of FIG. 13 is the same as the process demonstrated in FIG. 12, detailed description is not repeated.

[実施の形態3]
実施の形態3では、実施の形態1と2の変形例を説明する。図14は、実施の形態3に係るIGMPv2(Internet Group Management Protocol version2) General Queryの送信処理を示すフローチャートである。HEMSコントローラ100は、図14の処理を一定間隔(例えば、250秒)で実行する。
[Embodiment 3]
In the third embodiment, a modification of the first and second embodiments will be described. FIG. 14 is a flowchart showing transmission processing of IGMPv2 (Internet Group Management Protocol version 2) General Query according to the third embodiment. The HEMS controller 100 executes the process in FIG. 14 at regular intervals (for example, 250 seconds).

実施の形態1で説明した図10と図11の処理では、HEMSコントローラ100は、RAWソケット122を通じて受信可能なパケットを受信し、当該受信されたパケットの送信元MACアドレスに基づきノードリスト123へノード情報を登録する。この方法によれば、長い期間にわたって、RAWソケット122を通じて受信可能なパケットを受信し続ければ、サブネット10上で起動されているノードのほぼ全てを検出できる。   10 and 11 described in the first embodiment, the HEMS controller 100 receives a receivable packet through the RAW socket 122, and enters the node list 123 based on the source MAC address of the received packet. Register information. According to this method, almost all the nodes activated on the subnet 10 can be detected if packets that can be received through the RAW socket 122 are continuously received over a long period of time.

例えば、WAN側にある外部サーバー(図示せず)と通信するようなノードであれば、定期的に(デフォルトゲートウェイである)無線LANルーター302を探索IPアドレスとするARPリクエストを送信するはずである。したがって、HEMSコントローラ100は、当該ARPリクエストのパケットを、RAWソケット122を通じて受信することで、当該ノードの存在を検出することができる。ARPリクエストは、MACレベルのブロードキャストで送出されるので、ルーターに依存することなく、サブネット10上のすべてのノードに届けられる。HEMSコントローラ100は、サブネット10上の各ノードから送出されるARPリクエストを受信できる。   For example, a node that communicates with an external server (not shown) on the WAN side should periodically send an ARP request with the wireless LAN router 302 (which is the default gateway) as a search IP address. . Therefore, the HEMS controller 100 can detect the presence of the node by receiving the ARP request packet through the RAW socket 122. Since the ARP request is sent by broadcast at the MAC level, the ARP request is delivered to all nodes on the subnet 10 without depending on the router. The HEMS controller 100 can receive an ARP request sent from each node on the subnet 10.

しかし、サブネット10上の起動ノードであっても、自発的に送信動作を実行しないようなノードについては、実施の形態1の方法では、そのノードの存在を検出できないおそれがある。   However, even if it is an activation node on the subnet 10, for the node that does not execute the transmission operation spontaneously, the method of the first embodiment may not detect the presence of the node.

そこで、実施の形態3では、図14に示すように、HEMSコントローラ100は、IGMPv2General Query(以下、IGMP General Queryという)のパケットを一定間隔(例えば、250秒)で送信する(ステップS50)。   Therefore, in the third embodiment, as shown in FIG. 14, the HEMS controller 100 transmits packets of IGMPv2 General Query (hereinafter referred to as IGMP General Query) at regular intervals (for example, 250 seconds) (step S50).

このIGMP General Queryは、図7のIPパケットの構成を有する。IGMPGeneral Queryの宛先IPアドレスはマルチキャスト・アドレス(224.0.0.1)がセットされている。   This IGMP General Query has the configuration of the IP packet of FIG. A multicast address (224.0.0.1) is set as the destination IP address of the IGMP General Query.

任意のマルチキャスト・グループに参加しているノードは、IGMP General Queryを受信する。当該ノードは、その応答としてIGMP Reportを送信する。当該IPパケットには、送信元MACアドレスと送信元IPアドレスとが当該ノードのMACアドレスとIPアドレスにそれぞれセットされている。   Nodes participating in any multicast group receive an IGMP General Query. The node transmits an IGMP Report as a response. In the IP packet, the source MAC address and the source IP address are set to the MAC address and IP address of the node, respectively.

HEMSコントローラ100は、IGMP Reportのパケット(図示しない)を受信する場合がある。IGMP Reportのパケットも図7のIPパケットの構成を有する。   The HEMS controller 100 may receive an IGMP Report packet (not shown). The packet of the IGMP Report also has the configuration of the IP packet of FIG.

HEMSコントローラ100は、IGMP Reportを受信すれば(任意のIPパケットの1つであるので)、図11の処理を実行する。   If the HEMS controller 100 receives IGMP Report (because it is one of arbitrary IP packets), it will perform the process of FIG.

送信元MACアドレスに一致するノードがなければ、HEMSコントローラ100は、ノード情報を新規作成してノードリスト123に追加する。この処理は、上述したように図11の処理(任意のIPパケットを受信したときの処理)と同じであるので、詳細な説明は繰返さない。   If there is no node that matches the source MAC address, the HEMS controller 100 newly creates node information and adds it to the node list 123. Since this process is the same as the process in FIG. 11 (process when an arbitrary IP packet is received) as described above, detailed description will not be repeated.

実施の形態3によれば、サブネット10上の起動ノードのうち自発的にパケットを送信しないようなノードであっても、当該ノードがマルチキャスト・グループに参加しているのであれば、HEMSコントローラ100は当該ノードのノード情報をノードリスト123に登録し管理することができる。   According to the third embodiment, even if a node that does not spontaneously transmit a packet among the startup nodes on the subnet 10, if the node is participating in the multicast group, the HEMS controller 100 Node information of the node can be registered and managed in the node list 123.

<HEMSコントローラの機能構成>
図8は、実施の形態1に係るHEMSコントローラ100の機能的構成を表す機能ブロック図である。図8を参照して、HEMSコントローラ100は、サブネット10上のパケットを送受信する通信部140、ノード情報管理部150、記憶部160、および探索部170を含む。通信部140は、高速通信インターフェイス1104を介して通信するRAWソケット122およびUDPソケット121の機能を含む。実施の形態3に係るHEMSコントローラ100は、マルチキャスト・ノード問合せ送信部180をさらに含む。
<Functional configuration of HEMS controller>
FIG. 8 is a functional block diagram illustrating a functional configuration of the HEMS controller 100 according to the first embodiment. Referring to FIG. 8, HEMS controller 100 includes a communication unit 140 that transmits and receives packets on subnet 10, node information management unit 150, storage unit 160, and search unit 170. The communication unit 140 includes functions of a RAW socket 122 and a UDP socket 121 that communicate via the high-speed communication interface 1104. The HEMS controller 100 according to the third embodiment further includes a multicast node inquiry transmission unit 180.

ノード情報管理部150は、サブネット10上にある起動ノードの存在を受動的に検出する。具体的には、通信部140を介してパケットを受信する毎に、図10と図11に示すように、パケット送信元のノードに関する情報をノード情報としてノードリスト123により管理する。   The node information management unit 150 passively detects the presence of an activation node on the subnet 10. Specifically, every time a packet is received via the communication unit 140, as shown in FIG. 10 and FIG.

探索部170は、通信部140を介して探索要求パケットを送信し、探索応答パケットを受信することによって目的ノードを探索する。探索部170は、図12に示すように、探索要求パケットを送信する際に、マルチキャストで送信するとともに、ノード情報管理部150により管理されるノード情報のアドレスを宛先にして、当該探索要求パケットをユニキャストで送信する。   The search unit 170 searches for a target node by transmitting a search request packet via the communication unit 140 and receiving a search response packet. As shown in FIG. 12, when searching for a search request packet, the search unit 170 transmits the search request packet by multicast and sends the search request packet to the address of the node information managed by the node information management unit 150 as a destination. Send by unicast.

また、探索部170は、探索要求パケットを送信する際に、上記のマルチキャストでの送信に代えて、図13に示すように、ブロードキャストで送信してもよい。   Further, when transmitting the search request packet, the search unit 170 may transmit by broadcast as shown in FIG. 13 instead of the above multicast transmission.

ノード情報管理部150は、図9に示すように、ノード情報が所定の時間更新されなければ、当該ノードが起動されているかどうかを確認するパケットを、通信部140を介して送信し、確認するパケットに呼応する応答の受信がなければノード情報を削除する。   As shown in FIG. 9, if the node information is not updated for a predetermined time, the node information management unit 150 transmits a packet for confirming whether or not the node has been activated via the communication unit 140 and confirms it. If no response corresponding to the packet is received, the node information is deleted.

マルチキャスト・ノード問合せ送信部180は、図14に示すように、マルチキャスト・グループに参加しているノードの存在確認のために、通信部140を介して、マルチキャスト・ノード問合せパケットを送信する。マルチキャスト・グループに参加しているノードは、当該問合せパケットに呼応して、通知パケットを送信する。ノード情報管理部150は、通信部140を介して当該通知パケットを受信すると、図11に示すように、当該通知パケット送信元のノードに関する情報をノード情報としてノードリスト123により管理する。   As shown in FIG. 14, the multicast node inquiry transmission unit 180 transmits a multicast node inquiry packet via the communication unit 140 in order to confirm the presence of a node participating in the multicast group. A node participating in the multicast group transmits a notification packet in response to the inquiry packet. Upon receiving the notification packet via the communication unit 140, the node information management unit 150 manages information related to the notification packet transmission source node as node information using the node list 123, as shown in FIG.

<実施の形態の効果>
このように各実施の形態では、通信部140にてパケットを受信する毎に、パケット送信元のノードに関する情報をノード情報としてノードリスト123により管理する。これにより、無駄なトラフィックを発生させずに、サブネット10上に起動しているノードを受動的に検出できる。
<Effect of Embodiment>
As described above, in each embodiment, each time a packet is received by the communication unit 140, information related to a packet transmission source node is managed by the node list 123 as node information. As a result, it is possible to passively detect a node activated on the subnet 10 without generating unnecessary traffic.

また、HEMSコントローラ100がサブネット10上の目的ノードを探索する場合には、マルチキャストまたはブロードキャストの送信に加え、ノードリスト123のノード情報に基づく探索要求パケットをユニキャストで送信する。その結果、マルチキャスト・パケットまたはブロードキャスト・パケットが目的ノードに届かないようなネットワーク環境であっても、HEMSコントローラ100は、目的ノードを確実に見つけ出すことができる。   Further, when the HEMS controller 100 searches for a target node on the subnet 10, in addition to transmission of multicast or broadcast, a search request packet based on the node information of the node list 123 is transmitted by unicast. As a result, even in a network environment where multicast packets or broadcast packets do not reach the target node, the HEMS controller 100 can reliably find the target node.

また、探索要求パケットは、ノードリスト123のノード情報に基づき生成されてサブネット10に送信されるから、HEMSコントローラ100は、当該探索要求パケットを起動しているノードに限定して送信することができる。従って、HEMSコントローラ100が目的ノード探索のために無駄なトラフィックを発生させることはない。   Further, since the search request packet is generated based on the node information in the node list 123 and transmitted to the subnet 10, the HEMS controller 100 can transmit only the search request packet to the active node. . Therefore, the HEMS controller 100 does not generate useless traffic for the target node search.

今回開示された実施の形態およびその変形例はすべての点で例示であって制限的なものではないと考えられるべきである。本開示の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   It should be thought that embodiment disclosed this time and its modification are illustrations in all the points, and are not restrictive. The scope of the present disclosure is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

1 通信ネットワーク、302 無線LANルーター、10 サブネット、100 HEMSコントローラ、110 デバイス側アプリケーション、120 ホスト側アプリケーション、140 通信部、150 ノード情報管理部、160 記憶部、170 探索部、180 マルチキャスト・ノード問合せ送信部。   1 communication network, 302 wireless LAN router, 10 subnet, 100 HEMS controller, 110 device-side application, 120 host-side application, 140 communication unit, 150 node information management unit, 160 storage unit, 170 search unit, 180 multicast node inquiry transmission Department.

Claims (6)

ネットワークの同一サブネット上にある目的ノードを探索する制御装置であって、
前記制御装置は、
サブネット上のパケットを送受信する通信部と、
前記通信部を介して探索要求パケットを送信し、探索応答パケットを受信することによって前記目的ノードを探索する探索部と、
サブネット上にある起動ノードノード情報管理するノード情報管理部と、を備え、
前記通信部を介してARP(Address Resolution Protocol)パケットを受信すると、受信したARPパケットの送信元MAC(Media Access Control)アドレスを含むノード情報を前記ノード情報管理部に登録又は更新し、
前記通信部を介してIP(Internet Protocol)パケットを受信すると、受信したIPパケットの送信元MACアドレスが前記ノード情報管理部に登録されていない場合は、受信したIPパケットの送信元IPアドレスを探索IPアドレスとするARPリクエストを送信し、
前記探索部により探索要求パケットを送信する際に、前記ノード情報管理部にあるノード情報のIPアドレスを宛先にしてユニキャストで送信する、制御装置。
A control device that searches for a target node on the same subnet of a network,
The controller is
A communication unit that transmits and receives packets on the subnet;
A search unit for searching for the target node by sending a search request packet via the communication unit, receives a search response packet,
It includes a node information management unit for managing the node information of the start node in the subnet, and
When receiving an ARP (Address Resolution Protocol) packet via the communication unit, register or update node information including a source MAC (Media Access Control) address of the received ARP packet in the node information management unit,
When an IP (Internet Protocol) packet is received via the communication unit, if the source MAC address of the received IP packet is not registered in the node information management unit, the source IP address of the received IP packet is searched. Send an ARP request with an IP address,
A control device that transmits, by unicast, an IP address of node information in the node information management unit when transmitting a search request packet by the search unit.
前記探索部は、探索要求パケットを送信する際に、マルチキャストで送信するとともに、前記ノード情報管理部にあるノード情報のアドレスを宛先にしてユニキャストで送信する、請求項1に記載の制御装置。   2. The control device according to claim 1, wherein when the search request packet is transmitted, the search unit transmits the search request packet by multicast and transmits the address of the node information in the node information management unit as a destination by unicast. 前記探索部は、探索要求パケットを送信する際に、ブロードキャストで送信するとともに、前記ノード情報管理部にあるノード情報のアドレスを宛先にしてユニキャストで送信する、請求項1に記載の制御装置。   2. The control device according to claim 1, wherein when the search request packet is transmitted, the search unit transmits by broadcast, and transmits the address of the node information in the node information management unit by unicast. 前記ノード情報管理部は、
ノード情報が所定の時間更新されなければ、当該ノードが離脱されているかどうかを確認するパケットを、前記通信部を介して送信し、
前記確認するパケットに呼応する応答の受信がなければノード情報を削除する、請求項1から3のいずれか1項に記載の制御装置。
The node information management unit
If the node information is not updated for a predetermined time, a packet for confirming whether or not the node is disconnected is transmitted via the communication unit,
The control device according to claim 1, wherein node information is deleted if no response corresponding to the packet to be confirmed is received.
前記制御装置は、
マルチキャスト・グループに参加しているノードの存在確認のために、前記通信部を介
して、マルチキャスト・ノード問合せパケットを送信する、マルチキャスト・ノード問合
せ送信部、をさらに備える、請求項1から4のいずれか1項に記載の制御装置。
The controller is
The multicast node inquiry transmission unit, further comprising: a multicast node inquiry transmission unit configured to transmit a multicast node inquiry packet via the communication unit for confirming the presence of a node participating in the multicast group. The control device according to claim 1.
ネットワークの同一サブネット上にある複数のノードと、前記複数のノードから目的ノードを探索する制御装置とを備えるシステムであって、
前記制御装置は、
サブネット上のパケットを送受信する通信部と、
前記通信部を介して探索要求パケットを送信し、探索応答パケットを受信することによって前記目的ノードを探索する探索部と、
サブネット上にある起動ノードノード情報管理するノード情報管理部と、を備え、
前記通信部を介してARPパケットを受信すると、受信したARPパケットの送信元MACアドレスを含むノード情報を前記ノード情報管理部に登録又は更新し、
前記通信部を介してIPパケットを受信すると、受信したIPパケットの送信元MACアドレスが前記ノード情報管理部に登録されていない場合は、受信したIPパケットの送信元IPアドレスを探索IPアドレスとするARPリクエストを送信し、
前記探索部により探索要求パケットを送信する際に、前記ノード情報管理部にあるノード情報のIPアドレスを宛先にしてユニキャストで送信する、システム。
A system comprising a plurality of nodes on the same subnet of a network, and a control device for searching for a target node from the plurality of nodes,
The controller is
A communication unit that transmits and receives packets on the subnet;
A search unit for searching for the target node by sending a search request packet via the communication unit, receives a search response packet,
It includes a node information management unit for managing the node information of the start node in the subnet, and
When receiving an ARP packet via the communication unit, register or update node information including a source MAC address of the received ARP packet in the node information management unit,
When an IP packet is received via the communication unit, if the source MAC address of the received IP packet is not registered in the node information management unit, the source IP address of the received IP packet is set as the search IP address. Send an ARP request,
A system in which, when a search request packet is transmitted by the search unit, the IP address of the node information in the node information management unit is transmitted as a destination by unicast.
JP2015005291A 2015-01-14 2015-01-14 Control device and system Active JP6489837B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015005291A JP6489837B2 (en) 2015-01-14 2015-01-14 Control device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015005291A JP6489837B2 (en) 2015-01-14 2015-01-14 Control device and system

Publications (2)

Publication Number Publication Date
JP2016131330A JP2016131330A (en) 2016-07-21
JP6489837B2 true JP6489837B2 (en) 2019-03-27

Family

ID=56415639

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015005291A Active JP6489837B2 (en) 2015-01-14 2015-01-14 Control device and system

Country Status (1)

Country Link
JP (1) JP6489837B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001045007A (en) * 1999-07-26 2001-02-16 Fuji Xerox Co Ltd Communication unit to dynamically acquire network parameter and method for acquiring the network parameter

Also Published As

Publication number Publication date
JP2016131330A (en) 2016-07-21

Similar Documents

Publication Publication Date Title
KR100477653B1 (en) Apparatus and method for searching DNS server on outer net
US9935781B2 (en) Managing a large network using a single point of configuration
EP3207690B1 (en) Duplicate address detection based on distributed bloom filter
KR100908320B1 (en) Method for protecting and searching host in internet protocol version 6 network
JPWO2008152807A1 (en) MAC address deduplication method, network device management system, server and information device
US10021030B2 (en) Method and system for forwarding information in distributed network
JP6665444B2 (en) Information processing apparatus, control program for information processing apparatus, control method, and information processing system
CN102025799A (en) Method for discovery and automatic configuration for IP address of device
CN103117930A (en) Method and device for detecting static route configuration
US10454884B2 (en) Terminal and multicast address distribution server
JP4054719B2 (en) Specific address use restriction device
JP6411262B2 (en) Control device and system
US10686752B2 (en) Methods for configuring and managing an IP network, corresponding devices and computer programs
JP5818272B2 (en) Home gateway apparatus and packet transfer method
CN109842692B (en) VxLAN switch, system and method for obtaining host information in physical network
JP6489837B2 (en) Control device and system
JP5105124B2 (en) Router device, packet control method and program based on prefix management
CN108632198B (en) Equipment management method and device
JP5691612B2 (en) Communication system, router, switching hub, and program
JP5572848B2 (en) Communication apparatus and communication method
JP5805575B2 (en) Relay device, relay method, and relay program
JPWO2010055583A1 (en) COMMUNICATION DEVICE, COMMUNICATION DEVICE CONTROL METHOD, AND NETWORK SYSTEM
WO2012155570A1 (en) Method, system and node for automatic recovery after internet protocol version 6 address duplication
JP4862000B2 (en) Packet transfer apparatus and packet transfer method
JP2010258972A (en) Near-field node-searching method and device therefor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170925

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180731

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180926

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190205

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190226

R150 Certificate of patent or registration of utility model

Ref document number: 6489837

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150