JP6544250B2 - Relay device - Google Patents

Relay device Download PDF

Info

Publication number
JP6544250B2
JP6544250B2 JP2016008118A JP2016008118A JP6544250B2 JP 6544250 B2 JP6544250 B2 JP 6544250B2 JP 2016008118 A JP2016008118 A JP 2016008118A JP 2016008118 A JP2016008118 A JP 2016008118A JP 6544250 B2 JP6544250 B2 JP 6544250B2
Authority
JP
Japan
Prior art keywords
communication line
acquired
communication
data
acquisition
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
JP2016008118A
Other languages
Japanese (ja)
Other versions
JP2017130756A (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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2016008118A priority Critical patent/JP6544250B2/en
Publication of JP2017130756A publication Critical patent/JP2017130756A/en
Application granted granted Critical
Publication of JP6544250B2 publication Critical patent/JP6544250B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Description

本発明は、データの中継を行う技術に関する。   The present invention relates to a technique for relaying data.

従来、通信線に接続された通信装置間で相互に通信を行う技術が周知である。また、これらの通信装置のうちの幾つかの装置を1まとまりとするグループを予め複数設定し、同一のグループに所属している通信装置間でのみ通信を可能とする技術が知られている。   Conventionally, techniques for mutually communicating between communication devices connected to communication lines are well known. In addition, there is known a technology in which a plurality of groups in which several devices of these communication devices are combined are set in advance, and communication can be performed only between communication devices belonging to the same group.

特許文献1には、スイッチングハブによるポートベースVLAN機能を利用して、同一のグループに所属している通信装置間でのみ通信を可能とする技術、すなわち、グループ毎にネットワークを分割する技術が開示されている。   Patent Document 1 discloses a technology that enables communication only between communication devices belonging to the same group using a port-based VLAN function by a switching hub, that is, a technology for dividing a network into groups. It is done.

特許第3714238号公報Patent No. 3714238 gazette

例えば、車両においても、車両内に搭載され通信線に接続された電子制御装置(「Electronic Control Unit」、以下ECUという)間で相互に通信が行われる。通信線には車両外の通信装置である外部ツールを接続可能であり、外部ツールを用いて、車載のECUとの間で通信を行うことができるように構成されている。   For example, also in a vehicle, mutual communication is performed between electronic control units ("Electronic Control Unit", hereinafter referred to as "ECU") mounted in the vehicle and connected to a communication line. An external tool, which is a communication device outside the vehicle, can be connected to the communication line, and the external tool can be used to perform communication with the on-vehicle ECU.

外部ツールを用いて車載のECUと通信を行うことで実施することのできる操作には、車両制御情報の設定及び読出しや、プログラムの書換処理など、正規の作業者以外の者が実施すべきでない操作も含まれる。例えば、通信線に非正規の作業者による外部ツール(非正規の外部ツール)が接続された場合には、これらの情報やプログラムが不正に入手されたり書き換えられたりするおそれがある。このため、外部ツールと接続されるネットワークは、車載のECU同士と接続されるネットワークと分離されていることが望ましい。   The operations that can be performed by communicating with the on-board ECU using an external tool should not be performed by persons other than authorized workers, such as setting and reading of vehicle control information, program rewriting processing, etc. Operation is also included. For example, when an external tool (a non-regular external tool) is connected to a communication line by a non-regular worker, there is a possibility that such information or program may be illegally obtained or rewritten. For this reason, it is desirable that the network connected to the external tool be separated from the network connected to the on-vehicle ECUs.

しかしながら、特許文献1に記載のポートベースVLANの技術を利用したスイッチングハブを前述の車両における構成に適用する場合、外部ツールと接続されるネットワークと車載のECU同士と接続されるネットワークとは完全に分離される。このため、外部ツールと車載のECUとの通信を実現するためには、例えば、外部ツールからのデータを一度記録し、記録したデータを車載のECUへ送信するような新たな装置が必要となり、複雑な構成になるおそれがあった。   However, when the switching hub using the technology of port-based VLAN described in Patent Document 1 is applied to the configuration in the above-described vehicle, the network connected with the external tool and the network connected with the on-vehicle ECUs are completely It is separated. For this reason, in order to realize communication between the external tool and the on-board ECU, for example, a new device is needed which once records data from the external tool and transmits the recorded data to the on-board ECU. There was a possibility that it might become a complicated configuration.

本発明は、こうした問題にかんがみてなされたものであり、通信線に接続された複数の通信装置間で相互に通信を行う際に、簡易な構成で、非正規の通信装置との通信を抑制する技術を提供することを目的としている。   The present invention has been made in view of these problems, and when communicating with a plurality of communication devices connected to a communication line, the communication with a non-regular communication device is suppressed with a simple configuration. The purpose is to provide

本発明の中継装置(30)は、複数の通信線が接続され、前記複数の通信線間でデータの中継を行う装置であって、対応取得部(S120)と、データ取得部(S100)と、通信線特定部(S110)と、一致判断部(S125)と、中継実行部(S150、S155)と、を備える。対応取得部は、通信線と前記通信線に接続された装置との対応関係を、前記通信線毎に表した情報である対応情報を取得する。   A relay device (30) according to the present invention is a device which is connected to a plurality of communication lines and relays data between the plurality of communication lines, and includes a correspondence acquisition unit (S120) and a data acquisition unit (S100). And a communication line identification unit (S110), a coincidence determination unit (S125), and a relay execution unit (S150, S155). The correspondence acquisition unit acquires correspondence information, which is information representing, for each of the communication lines, the correspondence between the communication line and the device connected to the communication line.

データ取得部は、前記複数の通信線のいずれか一つから、データの送信元を識別するための情報である送信元情報を含むデータを、取得データとして取得する。通信線特定部は、前記取得データが取得された通信線を取得通信線として特定する。一致判断部は、前記取得データに含まれる送信元情報が示す送信元装置、及び前記対応情報において通信線に接続された装置として対応付けられた装置である対応装置のうち前記取得通信線に接続された装置を除く装置、が一致しているか否かを判断する。   The data acquisition unit acquires, as acquisition data, data including transmission source information which is information for identifying a transmission source of data from any one of the plurality of communication lines. The communication line identification unit identifies the communication line from which the acquired data is acquired as the acquired communication line. The coincidence determination unit is connected to the acquired communication line among the transmission source apparatus indicated by the transmission source information included in the acquired data and the corresponding apparatus corresponding to the apparatus connected to the communication line in the correspondence information. It is determined whether or not the devices except the specified device match.

中継実行部(S150、S155)は、前記一致判断部により一致していないと判断された場合に、前記複数の通信線間で前記取得データを中継し、前記一致判断部により一致していると判断された場合に、前記取得データを中継しない。   The relay execution unit (S150, S155) relays the acquired data between the plurality of communication lines when it is determined by the match determination unit that they do not match, and that the match determination unit matches. If determined, the acquired data is not relayed.

つまり、仮に対応装置のうちの1つになりすました非正規の通信装置が通信線に接続された場合、この通信線(取得通信線)から取得されたデータに含まれる送信元情報が示す送信元装置が、対応装置のうちの取得通信線に接続された装置を除く装置のいずれかに一致するため、中継装置は取得データを中継しない。   That is, if an unauthorized communication device that has become one of the supported devices is connected to the communication line, the transmission source indicated by the transmission source information included in the data acquired from this communication line (acquisition communication line) The relay device does not relay the acquired data because the device matches any of the devices excluding the device connected to the acquisition communication line among the corresponding devices.

このような構成によれば、通信線に接続された複数の通信装置間で相互に通信を行う際に、新たな装置を必要とすることなく、簡易な構成で非正規の通信装置との通信を抑制することができる。   According to such a configuration, when performing communication between a plurality of communication devices connected to the communication line, communication with a non-regular communication device with a simple configuration without requiring a new device Can be suppressed.

なお、この欄及び特許請求の範囲に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本発明の技術的範囲を限定するものではない。   In addition, the reference numerals in the parentheses described in this column and the claims indicate the correspondence with specific means described in the embodiment described later as one aspect, and the technical scope of the present invention It is not limited.

実施形態の通信システム及びスイッチングハブの構成を示すブロック図。BRIEF DESCRIPTION OF THE DRAWINGS The block diagram which shows the structure of the communication system and switching hub of embodiment. フレームの構成を説明する図。The figure explaining the composition of a frame. スイッチングハブ処理を示すフローチャート。5 is a flowchart showing switching hub processing. 図1の構成におけるルーティングテーブルの一例を示す図。FIG. 2 is a diagram showing an example of a routing table in the configuration of FIG. 1; スイッチングハブの電源がオンされたときのルーティングテーブルの一例を示す図。The figure which shows an example of a routing table when the power supply of a switching hub is turned on. ECU10aとECU10bとが登録されているときのルーティングテーブルの一例を示す図。The figure which shows an example of a routing table when ECU10a and ECU10b are registered. ECU10bになりすました非正規外部装置が接続されている場合の通信システムの構成を示すブロック図。The block diagram which shows the structure of the communication system in case the illegitimate external apparatus which spoofed ECU10b is connected. 車内ネットワークにおけるECU10の全てについて対応関係が登録されているときのルーティングテーブルの一例を示す図。A figure showing an example of a routing table when correspondence is registered about all of ECU10 in in-vehicle network. 非正規外部装置が予め接続されているときのルーティングテーブルの一例を示す図。The figure which shows an example of a routing table when the irregular external device is connected previously. 図9において、通信線L2についての対応関係が追加されたルーティングテーブルの一例を示す図。FIG. 10 is a view showing an example of a routing table to which a correspondence for a communication line L2 is added in FIG. 9; ECU受信処理のフローチャート。The flowchart of ECU reception processing. ECU10間での通信を説明するシーケンス図。FIG. 5 is a sequence diagram for explaining communication between the ECUs 10; ECU10と正規外部装置との通信を説明するシーケンス図。The sequence diagram explaining communication with ECU10 and a regular external device. ECU10と非正規外部装置との通信を説明するシーケンス図。The sequence diagram explaining communication with ECU10 and an irregular regular device.

以下、図面を参照しながら、発明を実施するための形態を説明する。
[1.構成]
図1に示す通信システム1は、イーサネットにおけるプロトコルのうち、例えばUDPを用いた通信システムであり、ノードとして、3つのECU10a〜10cと、1つの正規外部装置20とを備える。更に、通信システム1は、中継装置としてのスイッチングハブ30を備える。尚、イーサネットは登録商標である。UDPは、「User Datagram Protocol」の略である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[1. Constitution]
The communication system 1 illustrated in FIG. 1 is a communication system using, for example, UDP among protocols in Ethernet, and includes three ECUs 10 a to 10 c and one normal external device 20 as nodes. Furthermore, the communication system 1 includes a switching hub 30 as a relay device. Ethernet is a registered trademark. UDP is an abbreviation of "User Datagram Protocol".

ECU10a〜10cは、通信線L1〜L3の各々によってスイッチングハブ30と接続されている。そして、スイッチングハブ30は、通信線L4によって正規外部装置20と接続されている。例えば、ECU10aから送信されるフレームは、スイッチングハブ2を経由して、他のEUC10b〜10c及び正規外部装置20のうちの何れかに送信される。また、正規外部装置20から送信されるフレームは、スイッチングハブ30を経由して、ECU10a〜10cの何れかに送信される。   The ECUs 10a to 10c are connected to the switching hub 30 by the communication lines L1 to L3. The switching hub 30 is connected to the normal external device 20 by a communication line L4. For example, the frame transmitted from the ECU 10 a is transmitted to one of the other EUCs 10 b to 10 c and the authorized external device 20 via the switching hub 2. Further, the frame transmitted from the normal external device 20 is transmitted to any of the ECUs 10a to 10c via the switching hub 30.

ECU10a〜10cは、それぞれ、車両の各種の制御を行うECUである。例えば、ECU10aは、トランスミッションを制御するECUであり、ECU10bは、ステアリング装置を制御するECUであり、ECU10cは、ブレーキ装置を制御するECUであってもよい。ただし、ECU10a〜10cが実行する制御はこれらに限るものではない。なお以下では、ECU10a〜10cのような個々の構成要素に共通の事項を説明するときには、ECU10というように、符号の後の添え字を省略して記載する。   The ECUs 10a to 10c are ECUs that perform various controls of the vehicle. For example, the ECU 10a may be an ECU that controls a transmission, the ECU 10b may be an ECU that controls a steering device, and the ECU 10c may be an ECU that controls a brake device. However, the control executed by the ECUs 10a to 10c is not limited to these. In the following, when describing matters common to individual components such as the ECUs 10a to 10c, suffixes after reference numerals are omitted and described, such as the ECU 10.

正規外部装置20は、車両外の通信装置であり、スイッチングハブ30を介して車両に搭載されたECU10と接続されることにより、接続されたECU10との間で通信を行って、車両制御情報の設定及び読出しや、プログラムの書換処理などの機能を実現するための装置である。   The regular external device 20 is a communication device outside the vehicle, and is connected to the ECU 10 mounted on the vehicle via the switching hub 30 to communicate with the connected ECU 10 to obtain vehicle control information It is a device for realizing functions such as setting and reading and program rewriting processing.

スイッチングハブ30は、複数の通信線が接続され、複数の通信線間でフレームの中継を行う中継装置である。本実施形態では、スイッチングハブ30は、4つの端子P1〜P4を備え、端子P1を介して通信線L1が接続され、端子P2を介して通信線L2が接続され、端子P3を介して通信線L3が接続され、端子P4を介して通信線L4が接続されている。   The switching hub 30 is a relay device to which a plurality of communication lines are connected and which relays a frame between the plurality of communication lines. In the present embodiment, the switching hub 30 includes four terminals P1 to P4, the communication line L1 is connected via the terminal P1, the communication line L2 is connected via the terminal P2, and the communication line via the terminal P3. L3 is connected, and the communication line L4 is connected via the terminal P4.

端子P4と通信線L4とは図示しないコネクタによって着脱可能に接続されている。つまり、スイッチングハブ30に対して、正規外部装置20は着脱可能に接続されている。
ECU10及び正規外部装置20から送信されるフレームは、特定の装置に送信されるフレームであってもよいし、送信元の装置以外の複数の装置に同時に送信されるマルチキャストフレームであってもよいし、送信元の装置以外の全ての装置に同時に送信されるブロードキャストフレームであってもよい。
The terminal P4 and the communication line L4 are detachably connected by a connector (not shown). That is, the normal external device 20 is detachably connected to the switching hub 30.
The frames transmitted from the ECU 10 and the authorized external device 20 may be frames transmitted to a specific device, or may be multicast frames transmitted simultaneously to a plurality of devices other than the device of the transmission source. The broadcast frame may be transmitted simultaneously to all devices other than the device of the transmission source.

通信システム1において通信されるフレームは、図2に示すイーサネットフレームである。このイーサネットフレームは、宛先MACアドレス、送信元MACアドレス、タイプ、データ部、およびFCSの各領域を備える。FCSは、「Frame Check Sequence」の略である。宛先MACアドレスは、フレームの宛先となる装置(以下、宛先装置という)のMACアドレスであり、送信元MACアドレスは、フレームの送信元となる装置(以下、送信元装置という)のMACアドレスである。MACアドレスは、装置に固有のアドレスである。   The frame communicated in the communication system 1 is an Ethernet frame shown in FIG. This Ethernet frame comprises areas of destination MAC address, source MAC address, type, data part, and FCS. FCS is an abbreviation of "Frame Check Sequence". The destination MAC address is a MAC address of a device serving as a frame destination (hereinafter referred to as a destination device), and the transmission source MAC address is a MAC address of a device serving as a frame transmission source (hereinafter referred to as a transmission source device) . The MAC address is an address unique to the device.

また、図2では図示を省略しているが、フレームにおけるデータ部には、UDPパケットが、カプセル化されて含まれる。なお、本実施形態において、UDPパケットにおけるポート番号は、「50000」がECU10a〜10c間の通信用(以下、車両制御用という)に利用され、「13400」が正規外部装置20による診断やプログラム書換えを行うための通信用(以下、診断用という)に利用される。   Also, although not shown in FIG. 2, UDP packets are encapsulated and included in the data part of the frame. In the present embodiment, as for the port number in the UDP packet, “50000” is used for communication between the ECUs 10a to 10c (hereinafter, referred to as vehicle control), and “13400” is diagnosed by the authorized external device 20 or program rewrite It is used for communication (hereinafter referred to as diagnosis) for performing

特定の装置にフレームを送信する場合、例えばECU10aを宛先として送信する場合であれば、宛先MACアドレスは、ECU10aが宛先であることを示す値になっていれば良い。また、マルチキャストフレームの場合、例えば、ECU10a〜ECU10cを宛先とするマルチキャストフレームであれば、宛先MACアドレスは、ECU10a〜0cが宛先であることを示す値になっていれば良い。また、例えば、ブロードキャストフレームの場合、宛先MACアドレスのビットが全て「1」になっていればよい。   In the case of transmitting a frame to a specific device, for example, in the case of transmitting the ECU 10 a as a destination, the destination MAC address may be a value indicating that the ECU 10 a is a destination. In the case of a multicast frame, for example, in the case of a multicast frame whose destination is the ECUs 10a to 10c, the destination MAC address may be a value indicating that the ECUs 10a to 0c are the destinations. Also, for example, in the case of a broadcast frame, all bits of the destination MAC address may be "1".

図1に戻り説明を続ける。スイッチングハブ30は、当該スイッチングハブ30の動作を司る中継制御部31を備える。スイッチングハブ30の動作は、中継制御部31の処理動作によって実現される。   Returning to FIG. 1, the explanation will be continued. The switching hub 30 includes a relay control unit 31 that controls the operation of the switching hub 30. The operation of the switching hub 30 is realized by the processing operation of the relay control unit 31.

中継制御部31は、CPU51と、RAM、ROM、フラッシュメモリ等の半導体メモリ(以下、メモリという)52と、を有する周知のマイクロコンピュータ(以下、マイコンという)を中心に構成されている。中継制御部31の機能、即ち、スイッチングハブ30の機能は、当該中継制御部31のCPU51が非遷移的実体的記録媒体に格納されたプログラムを実行することにより実現される。   The relay control unit 31 mainly includes a well-known microcomputer (hereinafter, referred to as a microcomputer) including a CPU 51 and a semiconductor memory (hereinafter, referred to as a memory) 52 such as a RAM, a ROM, and a flash memory. The function of the relay control unit 31, that is, the function of the switching hub 30 is realized by the CPU 51 of the relay control unit 31 executing a program stored in the non-transitional tangible recording medium.

例えば、上記ROMが、プログラムを格納した非遷移的実体的記録媒体に該当する。また、このプログラムの実行により、プログラムに対応する方法が実行される。尚、中継制御部31を構成するマイコンの数は1つでも複数でも良い。中継制御部31の機能を実現する手法はソフトウェアに限るものではなく、その一部又は全部の機能を、論理回路やアナログ回路等を組み合わせたハードウェアを用いて実現しても良い。   For example, the ROM corresponds to a non-transitional tangible storage medium storing a program. Also, by executing this program, a method corresponding to the program is executed. The number of microcomputers constituting the relay control unit 31 may be one or more. The method for realizing the function of the relay control unit 31 is not limited to software, and part or all of the function may be realized using hardware combining a logic circuit, an analog circuit, and the like.

また、ECU10a〜10cの各々も、当該ECU10a〜10cの動作を司る車載制御部11a〜11cを備える。ECU10a〜10cの動作は、車載制御部11a〜11cの処理動作によって実現される。また、正規外部装置20も、当該正規外部装置20の動作を司る正規制御部21を備える。正規外部装置20の動作は、正規制御部21の処理動作によって実現される。スイッチングハブ30の中継制御部31について説明したことは、ECU10a〜ECU10cの車載制御部11a〜11c、及び、正規外部装置20の正規制御部21についても同様である。   Further, each of the ECUs 10a to 10c also includes in-vehicle control units 11a to 11c that control the operation of the ECUs 10a to 10c. The operations of the ECUs 10a to 10c are realized by the processing operations of the onboard control units 11a to 11c. In addition, the normal external device 20 also includes a normal control unit 21 that controls the operation of the normal external device 20. The operation of the normal external device 20 is realized by the processing operation of the normal control unit 21. What has been described regarding the relay control unit 31 of the switching hub 30 is the same for the on-vehicle control units 11a to 11c of the ECUs 10a to 10c and the normal control unit 21 of the normal external device 20.

[2.処理]
[2−1.スイッチングハブ処理]
次に、スイッチングハブ30の中継制御部31が実行するスイッチングハブ処理について、図3のフローチャートを用いて説明する。スイッチングハブ処理は、受信したフレームを中継するための処理である。中継制御部31は、ECU10または正規外部装置20からフレームを受信する毎に、スイッチングハブ処理を実行する。なお、以下の説明で主語が省略されている場合は、中継制御部31を主語とする。
[2. processing]
[2-1. Switching hub processing]
Next, the switching hub process performed by the relay control unit 31 of the switching hub 30 will be described with reference to the flowchart of FIG. The switching hub process is a process for relaying the received frame. The relay control unit 31 executes switching hub processing each time a frame is received from the ECU 10 or the normal external device 20. In the following description, when the subject is omitted, the relay control unit 31 is taken as the subject.

中継制御部31は、まずS100では、複数の通信線L1〜L4のいずれか一つから、受信したフレーム(以下、受信フレームともいう)を取得する。受信フレームは、該フレームの送信元を識別するための情報である送信元MACアドレスと、該フレームの送信先を識別するための情報である宛先MACアドレスとを含む。   First, in S100, the relay control unit 31 acquires a received frame (hereinafter, also referred to as a reception frame) from any one of the plurality of communication lines L1 to L4. The reception frame includes a transmission source MAC address which is information for identifying a transmission source of the frame, and a destination MAC address which is information for identifying a transmission destination of the frame.

S110では、中継制御部31は、受信フレームが取得された通信線を取得通信線として特定する。具体的には、例えば、端子P1を介して受信フレームが取得された場合は通信線L1を取得通信線として特定し、端子P4を介して受信フレームが取得された場合は通信線L4を取得通信線として特定する。   In S110, the relay control unit 31 identifies the communication line from which the received frame is acquired as the acquired communication line. Specifically, for example, when the reception frame is acquired via the terminal P1, the communication line L1 is specified as an acquisition communication line, and when the reception frame is acquired via the terminal P4, the communication line L4 is acquired. Identify as a line.

S115では、中継制御部31は、送信元装置を特定する。送信元装置とは、受信フレームに含まれる送信元MACアドレスが示す装置である。本実施形態では、図1に示すように、ECU10a〜ECU10cのMACアドレスは、各々X、Y、Zで表され、正規外部装置20のMACアドレスはQで表される。例えば、中継制御部31は、受信フレームに含まれる送信元MACアドレスがYである場合はECU10bを送信元装置として特定し、受信フレームに含まれる送信元MACアドレスがQである場合は正規外部装置20を送信元装置として特定する。   At S115, the relay control unit 31 identifies the transmission source device. The transmission source device is a device indicated by the transmission source MAC address included in the received frame. In the present embodiment, as shown in FIG. 1, the MAC addresses of the ECUs 10a to 10c are represented by X, Y, Z, respectively, and the MAC address of the normal external device 20 is represented by Q. For example, when the transmission source MAC address included in the reception frame is Y, the relay control unit 31 specifies the ECU 10b as the transmission source device, and when the transmission source MAC address included in the reception frame is Q, the relay external device Identify 20 as the source device.

S120では、中継制御部31は、ルーティングテーブル521を取得する。ルーティングテーブル521とは、通信線L1〜L4と、この通信線L1〜L4に接続された装置との対応関係を、通信線毎に表した情報である。対応関係とは、どの通信線にどの装置が接続されているか、という通信線と装置との接続の関係をいう。例えば、図1に示す通信システム1の場合、一例として図4に示すように、ルーティングテーブル521では、通信線L1〜L4と、この通信線L1〜L4に接続された装置ECU10a〜10c及び正規外部装置20との対応関係が、通信線L1〜L4毎に表されている。ルーティングテーブル521はメモリ52に記録されている。   In S120, the relay control unit 31 acquires the routing table 521. The routing table 521 is information representing the correspondence between the communication lines L1 to L4 and the devices connected to the communication lines L1 to L4 for each communication line. The correspondence relationship refers to the connection between the communication line and the device, which device is connected to which communication line. For example, in the case of the communication system 1 shown in FIG. 1, as shown in FIG. 4 as an example, in the routing table 521, the communication lines L1 to L4, the devices ECUs 10a to 10c connected to the communication lines L1 to L4, and the regular outside The correspondence with the device 20 is represented for each of the communication lines L1 to L4. The routing table 521 is stored in the memory 52.

なお、ルーティングテーブル521は、図4における( )内に示すように、通信線L1〜L4を接続する端子P1〜P4毎に、端子P1〜P4と端子に接続された装置との対応関係を表すものであってもよい。   The routing table 521 indicates the correspondence between the terminals P1 to P4 and the devices connected to the terminals for each of the terminals P1 to P4 connecting the communication lines L1 to L4 as shown in () in FIG. 4. It may be one.

ルーティングテーブル521は、図4に示すような対応関係が予め表された状態でメモリに記録されているわけではない。スイッチングハブ30の電源がオンされた際、ルーティングテーブル521は、図5に示すように、通信線L1〜L4と、通信線に接続された装置との対応関係が未登録の状態にある。   The routing table 521 is not necessarily stored in the memory in a state where the correspondence as shown in FIG. 4 is represented in advance. When the switching hub 30 is powered on, as shown in FIG. 5, in the routing table 521, the correspondence between the communication lines L1 to L4 and the devices connected to the communication lines is in an unregistered state.

ここで、ルーティングテーブル521への対応関係の登録について簡単に説明する。中継制御部31は、スイッチングハブ30の電源がオンされた後、ある通信線からフレームを受信すると、そのフレームの送信元MACアドレスをその通信線に接続された装置を表すMACアドレスとして、通信線と装置との対応関係をルーティングテーブル521に登録していく。   Here, registration of the correspondence in the routing table 521 will be briefly described. When the relay control unit 31 receives a frame from a communication line after the switching hub 30 is powered on, the communication line uses the transmission source MAC address of the frame as the MAC address representing the device connected to the communication line. The correspondence between the device and the device is registered in the routing table 521.

このとき、中継制御部31は、受信フレームに含まれる宛先MACアドレスがルーティングテーブル521に登録されていない場合は、受信したフレームをブロードキャストフレームとして送信し、送信した該フレームに対する応答に基づいて、通信線L1〜L4と通信線に対応する送信元装置のMACアドレスとの対応関係を学習していく。中継制御部31は、学習した対応関係をルーティングテーブル521に記録していく(以下、ルーティング機能という)。   At this time, when the destination MAC address included in the received frame is not registered in the routing table 521, the relay control unit 31 transmits the received frame as a broadcast frame, and communication is performed based on the response to the transmitted frame. The correspondence between the lines L1 to L4 and the MAC address of the transmission source device corresponding to the communication line is learned. The relay control unit 31 records the learned correspondence in the routing table 521 (hereinafter referred to as a routing function).

中継制御部31は、このようにして対応関係を学習し、図4のような対応関係を表すルーティングテーブル521をメモリ52に記録する。このような学習(以下、登録処理という)は周知であるため、これ以上の説明を省略する。   The relay control unit 31 learns the correspondence in this manner, and records the routing table 521 representing the correspondence as shown in FIG. 4 in the memory 52. Such learning (hereinafter referred to as registration processing) is well known, and thus further description is omitted.

本実施形態では更に、ルーティングテーブル521には、通信線L1〜L4毎に予め定められた順位を表す情報が含まれている。順位は、低順位と該低順位よりも順位が高い高順位の2つの順位のいずれかで表される。具体的には、通信線L1〜L3は高順位で表され、通信線L4が低順位で表されている。   In the present embodiment, the routing table 521 further includes information indicating a predetermined order for each of the communication lines L1 to L4. The rank is represented by one of two ranks, a low rank and a high rank higher than the low rank. Specifically, the communication lines L1 to L3 are represented in the high order, and the communication line L4 is represented in the low order.

S125では、中継制御部31は、送信元装置、及び対応装置のうち取得通信線に接続された装置を除く装置、が一致しているか否かを判断する。中継制御部31は、一致している場合に処理をS140へ移行させ、一致していない場合に処理をS130へ移行させる。対応装置とは、ルーティングテーブル521において通信線に対応付けて記録されている装置、すなわち、通信線に接続されている装置をいう。ここでいう一致とは、MACアドレス等、装置を特定するための情報が同一であることをいう。   In S125, the relay control unit 31 determines whether or not the transmission source device and the devices other than the devices connected to the acquired communication line among the corresponding devices match. The relay control unit 31 shifts the processing to S140 when they match, and shifts the processing to S130 when they do not match. The corresponding device is a device recorded in the routing table 521 in association with a communication line, that is, a device connected to the communication line. The term "coincidence" as used herein means that information for identifying a device, such as a MAC address, is the same.

中継制御部31が、処理をS130へ移行させる例としては、次のような場合が考えられる。例えば、S100にて通信線L2から送信元MACアドレスとして「Y」を含む受信フレームが取得され、S120にて図6に示すルーティングテーブル521が取得された場合(以下、(例1)という)である。一例として図6に示すルーティングテーブル521は、登録処理の途中経過として取得されるものであり、MACアドレス「X」、「Z」で表される装置であるECU10a、10cと通信線L1、L3との対応関係のみが登録されている。MACアドレス「X」、「Z」で表される装置であるECU10a、10cが対応装置に相当する。   As an example in which the relay control unit 31 shifts the process to S130, the following case can be considered. For example, in the case where a received frame including “Y” as a transmission source MAC address is acquired from the communication line L2 in S100, and the routing table 521 shown in FIG. 6 is acquired in S120 (hereinafter referred to as “example 1)”. is there. The routing table 521 shown in FIG. 6 as an example is acquired as the progress of the registration process, and ECUs 10a and 10c, which are devices represented by MAC addresses "X" and "Z", and communication lines L1 and L3. Only the correspondence of is registered. The ECUs 10a and 10c that are devices represented by the MAC addresses "X" and "Z" correspond to the corresponding devices.

この場合、中継制御部31は、通信線L2を取得通信線として、送信元装置であるMACアドレス「Y」で表される装置と、対応装置のうち取得通信線であるL2に接続された装置(未登録装置)を除く残りの装置であるMACアドレス「X」、「Z」で表される装置とは、一致しないため、処理をS130へ移行させる。   In this case, the relay control unit 31 uses the communication line L2 as an acquisition communication line, and a device represented by the MAC address "Y" which is a transmission source device, and a device connected to L2 which is an acquisition communication line among corresponding devices. Since the devices represented by the MAC addresses “X” and “Z” which are the remaining devices excluding the (unregistered device) do not match, the processing is shifted to S130.

S130では、中継制御部31は、ルーティングテーブル521に、取得通信線と該取得通信線に対応する対応装置、つまり、取得通信線に接続された装置との対応関係が登録されているか否かを判断する。中継制御部31は、対応関係が登録されている場合に処理をS150へ移行させ、登録されていない場合に処理をS135へ移行させる。   In S130, the relay control unit 31 determines whether the correspondence relationship between the acquired communication line and the corresponding device corresponding to the acquired communication line, that is, the device connected to the acquired communication line is registered in the routing table 521. to decide. The relay control unit 31 shifts the processing to S150 when the correspondence is registered, and shifts the processing to S135 when the correspondence is not registered.

例えば、中継制御部31は、(例1)の場合、取得通信線である通信線L2と通信線L2に対応する対応装置との対応関係が図6に示すように未登録であるため、処理をS135へ移行させる。   For example, in the case of (Example 1), the relay control unit 31 performs processing because the correspondence between the communication line L2 which is the acquired communication line and the corresponding device corresponding to the communication line L2 is unregistered as shown in FIG. To step S135.

S135では、中継制御部31は、ルーティングテーブル521に、取得通信線と該取得通信線に対応する対応装置との対応関係を記録し、処理をS150へ移行させる。なお、本ステップでの処理は前述の登録処理の一部に相当するものである。   In S135, the relay control unit 31 records the correspondence between the acquired communication line and the corresponding device corresponding to the acquired communication line in the routing table 521, and shifts the processing to S150. The process in this step corresponds to part of the above-described registration process.

例えば、中継制御部31は、(例1)の場合、通信線L2とMACアドレス「Y」で表される装置とが接続されていることを表す対応関係をルーティングテーブル521に登録する。これにより、図8に示すように、通信線L2についての対応関係が追加されたルーティングテーブル521がメモリ52に記録される。   For example, in the case of (Example 1), the relay control unit 31 registers, in the routing table 521, a correspondence indicating that the communication line L2 and the device represented by the MAC address “Y” are connected. Thereby, as shown in FIG. 8, the routing table 521 to which the correspondence for the communication line L2 is added is recorded in the memory 52.

S140では、中継制御部31は、S125にて一致していると判断された場合(S125;YES)に、一致順位と取得順位とをルーティングテーブル521を参照することによって特定し、取得順位と一致順位とを比較する。取得順位とは取得通信線の順位であり、一致順位とは一致通信線の順位である。一致通信線とは、対応装置のうち送信元装置と一致した装置を一致装置として、該一致装置が接続された通信線のことをいう。   In S140, if the relay control unit 31 determines that there is a match in S125 (S125; YES), the relay control unit 31 identifies the match rank and the acquisition rank by referring to the routing table 521, and matches the acquisition rank. Compare with the ranks. The acquisition order is the order of the acquired communication lines, and the match order is the order of the matching communication lines. The matching communication line refers to a communication line to which the matching device is connected with a device matching the transmission source device among the corresponding devices as the matching device.

中継制御部31は、取得順位が一致順位以上であると判断された場合に処理をS145へ移行させ、取得順位が一致順位未満であると判断された場合に処理をS155へ移行させる。   The relay control unit 31 shifts the processing to S145 when it is determined that the acquisition rank is equal to or higher than the coincidence rank, and shifts the processing to S155 when it is determined that the acquisition rank is lower than the coincidence rank.

具体的には、中継制御部31が処理をS140に移行させる例としては、次のような場合が考えられる。すなわち、図7に示すように、通信線L4に、正規外部装置20に代えて、ECU10bになりすました非正規外部装置40が接続された場合である。   Specifically, as an example in which the relay control unit 31 shifts the process to S140, the following case can be considered. That is, as shown in FIG. 7, a non-regular external device 40 spoofed as the ECU 10 b is connected to the communication line L 4 in place of the normal external device 20.

非正規外部装置40とは、非正規の作業者により端子P4に接続される装置であり、車両制御情報やプログラムを不正に入手したり書き換えたりするための装置をいう。また、非正規外部装置40がECU10bになりすます、とは、非正規外部装置40が、ECU10bのMACアドレス「Y」を不正に入手し、MACアドレス「Y」を該非正規外部装置40のMACアドレスとして用いることをいう。   The non-regular external device 40 is a device connected to the terminal P4 by a non-regular worker, and means a device for illegally obtaining or rewriting vehicle control information and a program. In addition, the non-regular external device 40 becomes the ECU 10b, that is, the non-regular external device 40 illegally obtains the MAC address "Y" of the ECU 10b and sets the MAC address "Y" as the MAC address of the non-regular external device 40. It means to use.

例えば、中継制御部31は、S100にて通信線L4から送信元MACアドレスとして「Y」を含む受信フレームが取得され、S120にて図8に示すルーティングテーブル521が取得された場合(以下、(例2)という)、通信線L4を取得通信線とする。そして、中継制御部31は、送信元装置である「Y」で表される装置と、対応装置のうち取得通信線であるL4に接続された装置(未登録装置)を除く装置(通信線L2に接続された装置)とが一致するため、処理をS140へ移行させる。   For example, when the relay control unit 31 acquires a reception frame including “Y” as a transmission source MAC address from the communication line L4 in S100 and acquires the routing table 521 illustrated in FIG. Example 2)) Let communication line L4 be an acquisition communication line. Then, the relay control unit 31 removes the device (communication line L2) excluding the device represented by “Y” that is the transmission source device and the device (unregistered device) connected to L4 that is the acquired communication line among the corresponding devices. Processing matches with the device connected to (1), and the process proceeds to S140.

また、例えば、中継制御部31は、S100にて通信線L2から送信元MACアドレスとして「Y」を含む受信フレームが取得され、S120にて図9に示すルーティングテーブル521が取得された場合(以下、(例3)という)、通信線L2を取得通信線とする。そして、中継制御部31は、送信元装置である「Y」で表される装置と、対応装置のうち取得通信線であるL2に接続された装置を除く装置(通信線L4に接続された装置)とが一致するため、処理をS140へ移行させる。   Also, for example, when the relay control unit 31 acquires a reception frame including “Y” as a transmission source MAC address from the communication line L2 in S100, and acquires the routing table 521 illustrated in FIG. , (Example 3)), let the communication line L2 be an acquisition communication line. Then, relay control unit 31 is a device (a device connected to communication line L4 except a device represented by “Y” that is a transmission source device and a device connected to L2 that is an acquisition communication line among the corresponding devices. And the process shifts to S140.

ここで、中継制御部31は、(例2)の場合、図8に示すように、送信元装置と同一のMACアドレス「Y」で表される一致装置が接続された通信線L2を一致通信線として、取得通信線L4の順位である取得順位が一致通信線の順位である一致順位よりも低いため、処理をS155へ移行させる。なお、取得順位が一致順位よりも低いことを、取得順位が一致順位未満である、という。   Here, in the case of (Example 2), as illustrated in FIG. 8, the relay control unit 31 performs communication matching on the communication line L2 to which the matching device represented by the same MAC address "Y" as the transmission source device is connected. As the line, since the acquisition order, which is the order of the acquired communication line L4, is lower than the matching order, which is the order of the matching communication line, the process proceeds to S155. The fact that the acquisition order is lower than the coincidence order means that the acquisition order is lower than the coincidence order.

一方、中継制御部31は、(例3)の場合、図9に示すように、送信元装置と同一のMACアドレス「Y」で表される一致装置が接続された通信線L4を一致通信線として、取得通信線L2の順位である取得順位が一致通信線L4よりも高いため、処理をS145へ移行させる。なお、取得順位が一致順位よりも高いか同じであることを、取得順位が一致順位以上である、という。   On the other hand, in the case of (Example 3), as shown in FIG. 9, the relay control unit 31 sets the communication line L4 connected to the matching device represented by the same MAC address "Y" as the transmission source device to the matching communication line. Since the acquisition order, which is the order of the acquired communication line L2, is higher than that of the coincident communication line L4, the processing is shifted to S145. If the acquisition order is higher than or equal to the coincidence order, it is said that the acquisition order is equal to or higher than the coincidence order.

S145では、中継制御部31は、S140により取得順位が一致順位以上であると判断された場合に、ルーティングテーブル521における取得通信線に対応する装置として送信元装置を記録させる。すなわち、中継制御部31は、(例3)の場合、図10に示すように、取得通信線であるL2に対応する装置として、MACアドレスが「Y」で表される装置をルーティングテーブル521に記録する。   In S145, when it is determined in S140 that the acquisition order is equal to or higher than the coincidence order, the relay control unit 31 records the transmission source device as an apparatus corresponding to the acquired communication line in the routing table 521. That is, in the case of (example 3), as shown in FIG. 10, in the case of (example 3), the relay control unit 31 sets the device whose MAC address is represented by “Y” in the routing table 521 as a device corresponding to L2 which is an acquired communication line. Record.

S150では、中継制御部31は、送信元装置が対応装置のうちの取得通信線に接続する装置以外の装置と一致していないと判断された場合に、または、一致しているが、取得順位が一致順位以上であると判断された場合に、受信フレームを中継する。具体的には、中継制御部31は、ルーティングテーブル521を参照することにより、受信フレームに含まれる宛先MACアドレスが表す装置と一致する装置が接続された通信線を特定し、特定した通信線に、受信フレームを出力する。そして、本スイッチングハブ処理を終了する。   In S150, if the relay control unit 31 determines that the transmission source device does not match any device other than the device connected to the acquired communication line of the corresponding devices, or if it matches, the acquisition order Is determined to be equal to or higher than the matching order, the received frame is relayed. Specifically, by referring to the routing table 521, the relay control unit 31 identifies a communication line to which a device matching the device represented by the destination MAC address included in the received frame is connected, and uses the identified communication line. , Output received frame. Then, the switching hub process ends.

なお以下では、送信元装置が対応装置のうちの取得通信線に接続された装置以外の装置と一致していることを、送信元装置について一致条件が成立している、という。
S155では、中継制御部31は、送信元装置について一致条件が成立していると判断された場合であって、且つ、取得順位が一致順位未満であると判断された場合に、受信フレームを中継せず、処理をS160へ移行させる。
In the following, it is said that the matching condition is established for the transmission source device that the transmission source device matches the device other than the device connected to the acquisition communication line among the corresponding devices.
In S155, the relay control unit 31 relays the received frame when it is determined that the matching condition is established for the transmission source device, and when it is determined that the acquisition order is less than the coincidence order. Without shifting the process to S160.

S160では、中継制御部31は、ルーティングテーブル521における取得通信線に対応する装置と、この取得通信線との対応関係を、ルーティングテーブル521から削除する。そして、本スイッチングハブ処理を終了する。すなわち、中継制御部31は、(例2)の場合、取得通信線であるL4とMACアドレスが「Y」で表される装置との対応関係を、ルーティングテーブル521から削除する。   In S160, the relay control unit 31 deletes from the routing table 521 the correspondence between the device corresponding to the acquired communication line in the routing table 521 and the acquired communication line. Then, the switching hub process ends. That is, in the case of (Example 2), the relay control unit 31 deletes from the routing table 521 the correspondence between the acquired communication line L4 and the device whose MAC address is represented by “Y”.

つまり、スイッチングハブ30は、スイッチングハブ処理を実行することにより、次のように作動する。
(1)スイッチングハブ30は、送信元装置についての一致条件が成立していない場合に、受信フレームの中継を行う。
That is, the switching hub 30 operates as follows by performing the switching hub process.
(1) The switching hub 30 relays the received frame when the matching condition for the transmission source device is not satisfied.

(2)スイッチングハブ30は、送信元装置についての一致条件が成立している場合であって、且つ、取得順位が一致順位未満である場合に受信フレームの中継を行わない。また、スイッチングハブ30は、送信元装置についての一致条件が成立している場合であっても、取得順位が一致順位以上である場合は、受信フレームの中継を行う。   (2) The switching hub 30 does not relay the received frame when the matching condition for the transmission source device is satisfied and the acquisition order is less than the coincidence order. Further, even if the matching condition for the transmission source device is satisfied, the switching hub 30 relays the received frame if the acquisition order is equal to or higher than the coincidence order.

例えば、スイッチングハブ30の電源がオンされたときのルーティングテーブル521は、図5に示す通りである。電源オンがされた後、ルーティング機能によって、正規の装置であるECU10a〜ECU10cについての対応関係が登録されたときのルーティングテーブル521は、図8に示すとおりである。   For example, the routing table 521 when the switching hub 30 is powered on is as shown in FIG. After the power is turned on, the routing table 521 is as shown in FIG. 8 when the correspondence relationship with respect to the regular devices, ECUs 10a to 10c, is registered by the routing function.

ここで、図8のようにルーティングテーブル521が登録された後に、例えば、図7に示すように通信線L4にECU10bになりすました非正規外部装置40が接続されるものとする。   Here, after the routing table 521 is registered as shown in FIG. 8, for example, as shown in FIG. 7, it is assumed that the unauthorized external device 40 spoofing the ECU 10b is connected to the communication line L4.

このような場合に、通信線L4に接続された非正規外部装置40から送信元MACアドレスを「Y」とする不正なフレームを受信したとしても、図8に示すようにルーティングテーブル521には一致装置が存在し、取得通信線である通信線L4の取得順位は一致通信線である通信線L2の一致順位よりも低いので、スイッチングハブ30は該フレームの中継を行わない。   In such a case, even if an unauthorized frame whose source MAC address is "Y" is received from the non-regular external device 40 connected to the communication line L4, the routing table 521 matches as shown in FIG. Since the device exists and the acquisition order of the communication line L4 which is an acquisition communication line is lower than the matching order of the communication line L2 which is a coincident communication line, the switching hub 30 does not relay the frame.

また、例えば、図7に示すように、ECU10bになりすました非正規外部装置40が接続された後に、スイッチングハブ30の電源がオンされたとする。この場合、電源オン直後のルーティングテーブル521は図5に示すとおりであり、この後、ECU10bが登録される前に該ECU10bになりすました非正規外部装置40と通信線L4との対応関係、及びECU10a、10cが登録されたときのルーティングテーブル521は、図9に示すとおりである。   Further, for example, as illustrated in FIG. 7, it is assumed that the power of the switching hub 30 is turned on after the non-regular external device 40 spoofing the ECU 10 b is connected. In this case, the routing table 521 immediately after power-on is as shown in FIG. 5, and thereafter, the correspondence relationship between the non-regular external device 40 and the communication line L4 that spoofed the ECU 10b before the ECU 10b is registered, and the ECU 10a , 10c are registered, the routing table 521 is as shown in FIG.

ここで、仮に通信線L4に接続された非正規外部装置40から送信元MACアドレスを「Y」とする不正なフレームを受信すると、通信線L4に対応するECU10bは未登録であるため、ルーティングテーブル521には一致装置が存在しない。このため、スイッチングハブ30は該フレームの中継を行う。そして、スイッチングハブ30は、通信線L4とMACアドレス「Y」で表される装置とが接続されていることを表す対応関係を、図10に示すように、ルーティングテーブル521に登録する。   Here, if an invalid frame whose source MAC address is "Y" is temporarily received from the non-regular external device 40 connected to the communication line L4, the ECU 10b corresponding to the communication line L4 is unregistered, so the routing table There are no matching devices in 521. Therefore, the switching hub 30 relays the frame. Then, the switching hub 30 registers, in the routing table 521, a correspondence relationship indicating that the communication line L4 and the device represented by the MAC address "Y" are connected, as shown in FIG.

このように、ルーティングテーブル521の登録の状況によっては、非正規外部装置40からのフレームが、初回(1回目)については中継されることが有り得る。
但し、図10に示すルーティングテーブル521が登録された後に、再び、通信線L4に接続された非正規外部装置40からフレームを受信したとき(2回目)は、スイッチングハブ30は該フレームの中継を行わない。図10に示すルーティングテーブル521には一致装置が存在し、且つ、取得通信線である通信線L4の取得順位は一致通信線である通信線L2の一致順位よりも低いためである。
Thus, depending on the registration status of the routing table 521, the frame from the non-regular external device 40 may be relayed for the first time (first time).
However, after the routing table 521 shown in FIG. 10 is registered, when the frame is received again from the unauthorized external device 40 connected to the communication line L4 (the second time), the switching hub 30 relays the frame. Not performed. This is because a matching device exists in the routing table 521 shown in FIG. 10, and the acquisition order of the communication line L4, which is an acquired communication line, is lower than the coincidence order of the communication line L2, which is a coincidence communication line.

そして、スイッチングハブ30は、通信線L4とMACアドレス「Y」で表される装置との対応関係をルーティングテーブル521から削除する。ルーティングテーブル521は、図8に示すとおりとなり、図8に示すルーティングテーブル521が登録された以降は、通信線L4にECU10bになりすました非正規外部装置40が再び接続されたとしても、(2)に記載のように、スイッチングハブ30は非正規外部装置40からのフレームの中継を行わない。   Then, the switching hub 30 deletes the correspondence relationship between the communication line L4 and the device represented by the MAC address “Y” from the routing table 521. The routing table 521 is as shown in FIG. 8, and after the routing table 521 shown in FIG. 8 is registered, even if the unauthorized external device 40 impersonating the ECU 10b is connected to the communication line L4, (2) As described in, the switching hub 30 does not relay the frame from the non-regular external device 40.

一方、図9に示すルーティングテーブル521が登録された後に、通信線L2に接続された正規のECU10bからフレームを受信したときは、スイッチングハブ30は該フレームの中継を行う。ルーティングテーブル521に一致装置が存在するが、取得通信線である通信線L2の取得順位は一致通信線である通信線L4の一致順位よりも高いためである。   On the other hand, when the frame is received from the regular ECU 10b connected to the communication line L2 after the routing table 521 shown in FIG. 9 is registered, the switching hub 30 relays the frame. The matching device exists in the routing table 521, but the acquisition order of the communication line L2 which is an acquisition communication line is higher than the matching order of the communication line L4 which is a coincidence communication line.

なお、通信線L1〜L3とMACアドレス「X」、「Y」、「Z」で表される装置との対応関係(図8参照)を記録したテーブル(以下、初期テーブルという)を、予めメモリ52が有するROM等の不揮発メモリに記録しておいてもよい。そして、スイッチングハブ30の電源がオンされた後、ルーティング機能を有効にする前に、初期テーブルが表す対応関係をルーティングテーブル521の対応関係として登録し、その後にルーティング機能を有効にしてもよい。   Note that a table (hereinafter referred to as an initial table) in which correspondence relationships (see FIG. 8) between the communication lines L1 to L3 and devices represented by MAC addresses “X”, “Y”, and “Z” are recorded It may be recorded in a non-volatile memory such as a ROM of 52. Then, after the switching hub 30 is powered on, the correspondence represented by the initial table may be registered as the correspondence of the routing table 521 before enabling the routing function, and then the routing function may be validated.

これによれば、前述とは異なり、非正規外部装置40から初回に送信されたフレームが中継されることを、抑制することができる。
[2−2.ECU受信処理]
次に、ECU10a〜10cの車載制御部11a〜11cが実行するECU受信処理について、図11のフローチャートを用いて説明する。車載制御部11a〜11cは、同様の処理を実行するので、以下では、ECU10a〜10cを単にECU10と称し、車載制御部11a〜11cを単に車載制御部11と称し、説明する。
According to this, unlike the above-mentioned, it can suppress that the frame transmitted from the irregular external device 40 for the first time is relayed.
[2-2. ECU reception processing]
Next, ECU reception processing executed by the on-board control units 11a to 11c of the ECUs 10a to 10c will be described using the flowchart of FIG. The on-board control units 11a to 11c execute the same processing, and therefore, hereinafter, the ECUs 10a to 10c are simply referred to as the ECU 10, and the on-board control units 11a to 11c are simply referred to as the on-vehicle control unit 11.

ECU受信処理は、認証が成立した正規のECU以外のECUからの受信フレームを受信しないようにするための処理である。車載制御部11は、フレームを受信する毎に、ECU受信処理を実行する。なお、以下の説明で主語が省略されている場合は、車載制御部11を主語とする。   The ECU reception process is a process for preventing the reception frame from being received from an ECU other than the authorized ECU for which the authentication has been established. The in-vehicle control unit 11 executes an ECU reception process each time a frame is received. In addition, when the subject is abbreviate | omitted by the following description, the vehicle-mounted control part 11 is made into a subject.

S200では、車載制御部11は、受信フレームが車両制御用であるか否かを判断する。具体的には、受信フレームに含まれるポート番号が50000である場合に車両制御用であると判断し、ポート番号が13400である場合に、車両制御用ではなく診断用であると判断する。車載制御部11は、受信フレームが車両制御用である場合に処理をS210へ移行させ、診断用である場合に処理をS250へ移行させる。   In S200, the in-vehicle control unit 11 determines whether the received frame is for vehicle control. Specifically, when the port number included in the reception frame is 50000, it is determined that it is for vehicle control, and when the port number is 13400, it is determined that it is for diagnosis rather than for vehicle control. The on-vehicle control unit 11 shifts the process to S210 when the received frame is for vehicle control, and shifts the process to S250 when the received frame is for diagnosis.

S210では、受信フレームに含まれる送信元MACアドレスが認証テーブルに登録されているか否かを判断する。認証テーブルとは、認証が完了した装置を表すMACアドレスが登録されているテーブルである。認証テーブルは、車載制御部11が備えるメモリに記録されている。車載制御部11は、受信フレームに含まれる送信元MACアドレスが認証テーブルに登録されている場合に処理をS250へ移行させ、登録されていない場合に処理をS220へ移行させる。   In S210, it is determined whether the source MAC address included in the received frame is registered in the authentication table. The authentication table is a table in which a MAC address representing a device for which authentication has been completed is registered. The authentication table is stored in a memory included in the on-vehicle control unit 11. The on-vehicle control unit 11 shifts the process to S250 when the transmission source MAC address included in the received frame is registered in the authentication table, and shifts the process to S220 when it is not registered.

S220では、車載制御部11は、認証処理を実行する。本実施形態では、一例として、車両制御用のフレームにおけるデータ部には、例えば制御用の指令や応答等の各種情報を表すデータと、該データについての認証コードとが含まれるようになっている。認証コードとは、データを、ECU10間で共通の予め定められた公開鍵を用いてECU10間で共通の予め定められたアルゴリズムに従って演算した演算結果である。公開鍵は予め定められた符号であり、車載制御部11が備えるメモリに記録されている。   In S220, the in-vehicle control unit 11 executes an authentication process. In the present embodiment, as an example, the data portion in the vehicle control frame includes data representing various information such as a control command or response, and an authentication code for the data, for example. . The authentication code is a calculation result obtained by calculating data according to a predetermined algorithm common to the ECUs 10 using the predetermined public key common to the ECUs 10. The public key is a predetermined code, and is stored in a memory included in the on-vehicle control unit 11.

本ステップでは、車載制御部11は、受信フレームに含まれるデータを公開鍵を用いて前述のアルゴリズムに従って演算した結果と、受信フレームに含まれる認証コードとを比較し、これらが一致するか否かを判断し、判断結果をメモリに記録する。   In this step, the on-vehicle control unit 11 compares the result of calculating the data included in the received frame according to the above-described algorithm using the public key with the authentication code included in the received frame, and determines whether they match And record the determination result in the memory.

S230では、車載制御部11は、認証が成立したか否かを判断する。具体的には、車載制御部11は、S220における判断結果が、一致を表す場合に認証が成立したものと判断する。車載制御部11は、認証が成立した場合に処理をS240へ移行させ、不成立である場合に本ECU受信処理を終了する。   In S230, the in-vehicle control unit 11 determines whether or not the authentication is established. Specifically, the on-vehicle control unit 11 determines that the authentication is established when the determination result in S220 indicates a match. The in-vehicle control unit 11 shifts the process to S240 when the authentication is established, and ends the present ECU reception process when the authentication is not established.

S240では、車載制御部11は、認証テーブルに、受信フレームに含まれる送信元MACアドレスを追加して記録する。
S250では、車載制御部11は、受信フレームに含まれるデータを取得し、データに対する応答を実行する。
In S240, the in-vehicle control unit 11 adds the transmission source MAC address included in the received frame to the authentication table and records the same.
In S250, the in-vehicle control unit 11 acquires data included in the received frame, and executes a response to the data.

このようにして、車載制御部11は、ECU受信処理によって、認証されたECU以外のECUからの受信フレームを受信しないようにすることができる。
[3.作動例]
このように構成された通信システム1の動作例を、図12〜図14を用いて説明する。
In this manner, the on-vehicle control unit 11 can prevent the reception frame from the ECUs other than the authenticated ECUs from being received by the ECU reception process.
[3. Operation example]
An operation example of the communication system 1 configured as described above will be described with reference to FIGS. 12 to 14.

(3a)図12は、ECU10bが、通信線L2を介して、車両を制御するためのデータを含む車両制御用のフレームを、ECU10a、10cに、複数回送信する例を説明する図である。車両制御用のフレームでは、ポート番号は50000に設定される。   (3a) FIG. 12 is a diagram for explaining an example in which the ECU 10b transmits a frame for vehicle control including data for controlling the vehicle to the ECUs 10a and 10c multiple times via the communication line L2. In the frame for vehicle control, the port number is set to 50000.

ここで、始めは、ルーティングテーブル521には、通信線L1にMACアドレスがXで表されるECU10aが接続され、通信線L3にMACアドレスがZで表されるECU10cが接続されている、という対応関係が既に記録され、通信線L2及び通信線L4についての対応関係、すなわち対応装置は、未だ記録されていないものとする(図6参照)。また、ECU10a、10cにおいて、ECU10bについての認証は未だ成立していないものとする。   Here, first, in the routing table 521, the ECU 10a whose MAC address is represented by X is connected to the communication line L1, and the ECU 10c whose MAC address is represented by Z is connected to the communication line L3. It is assumed that the relationship has already been recorded, and the correspondences for the communication line L2 and the communication line L4, that is, the corresponding devices have not been recorded yet (see FIG. 6). Further, in the ECUs 10a and 10c, it is assumed that the authentication of the ECU 10b has not been established yet.

図12において、ECU10b(車載制御部11b)は、1回目の送信では、ECU10a、10cを宛先として、認証コードを含む車両制御用のフレームを送信する(S310)。   12, in the first transmission, the ECU 10b (vehicle-mounted control unit 11b) transmits a vehicle control frame including an authentication code to the ECUs 10a and 10c as a destination (S310).

スイッチングハブ30(中継制御部31)は、端子P2を介して通信線L2からフレームを受信し、ルーティングテーブル521を参照して、送信元装置についての一致条件が成立しているか否か(S125)及び取得順位が一致順位未満であるか否か(S140)に基づいて、フレームを中継するか否かを判断する。   The switching hub 30 (relay control unit 31) receives a frame from the communication line L2 via the terminal P2 and refers to the routing table 521 to determine whether the matching condition for the transmission source device is satisfied (S125) And based on whether or not the acquisition order is less than the coincidence order (S140), it is determined whether to relay the frame.

スイッチングハブ30は、中継して良いと判断した場合(S125;NO、またはS125;YES且つS140;NO)、フレームに含まれる宛先MACアドレスが表す送信先装置であるECU10a、10cが接続されている通信線L1、L3をルーティングテーブル521を参照して特定し、特定した通信線L1、L3に受信フレームを中継する(S320)。   When it is determined that the switching hub 30 may relay (S125: NO, or S125; YES and S140; NO), the ECUs 10a and 10c, which are transmission destination devices represented by the destination MAC address included in the frame, are connected. The communication lines L1 and L3 are identified with reference to the routing table 521, and the reception frame is relayed to the identified communication lines L1 and L3 (S320).

ECU10a(車載制御部11a)及びECU10c(車載制御部11c)は、認証処理を実行し、送信元装置であるECU10bのMACアドレスを認証テーブルに記録し、受信フレームに対応した処理を実行する(S330、S340)。   The ECU 10a (in-vehicle control unit 11a) and the ECU 10c (in-vehicle control unit 11c) execute the authentication process, record the MAC address of the ECU 10b as the transmission source device in the authentication table, and execute the process corresponding to the received frame (S330) , S340).

ECU10bは、認証が成立した後の2回目以降の送信では、認証コードを含まないフレームを送信する(S310)。
ECU10a、ECU10cは、認証テーブルに既にECU10bを表すMACアドレスが記録されているため、認証処理を実行することなく、受信フレームに応じた処理を実行する(S370、S380)。
The ECU 10b transmits a frame not including the authentication code in the second and subsequent transmissions after the authentication is established (S310).
Since the MAC address representing the ECU 10b is already recorded in the authentication table, the ECU 10a and the ECU 10c execute the process according to the received frame without executing the authentication process (S370, S380).

このように、本実施形態のECU10間における車両制御用のフレームの送受信においては、一度認証処理が実行された以降は、送信元装置は認証コードを含めること無くフレームを送信することができ、送信先装置は改めて認証処理を実行すること無くフレームを受信することができる。   As described above, in transmission and reception of a frame for vehicle control between the ECUs 10 of the present embodiment, after the authentication process is performed once, the transmission source device can transmit the frame without including the authentication code. The destination device can receive the frame without performing the authentication process again.

(3b)図13は、正規外部装置20が、通信線L4を介して、診断用のフレームを、ECU10aに送信する例を説明する図である。診断用のフレームでは、ポート番号は13400に設定される。ここで、始めは、ルーティングテーブル521には、図8に示すように、通信線L1〜L3とECU10a〜10cとの対応関係が既に記録され、通信線L4についての対応関係は未だ記録されていないものとする。   (3b) FIG. 13 is a diagram for explaining an example in which the normal external device 20 transmits a diagnostic frame to the ECU 10a via the communication line L4. In the diagnostic frame, the port number is set to 13400. Here, initially, as shown in FIG. 8, the correspondence between the communication lines L1 to L3 and the ECUs 10a to 10c is already recorded in the routing table 521, and the correspondence for the communication line L4 is not yet recorded. It shall be.

図13において、正規外部装置20(正規制御部21)は、ECU10aを宛先とし、診断用のフレームを送信する(410)。
スイッチングハブ30(中継制御部31)は、受信フレームを中継して良いと判断した場合に、図4に示すように受信フレームに含まれる送信元MACアドレス「Q」で表される装置を通信線L4の対応装置としてルーティングテーブル521に記録し、ルーティングテーブル521に従って宛先MACアドレスが表す送信先装置であるECU10aが接続されている通信線L1を特定し、特定した通信線L1に受信フレームを中継する(S420)。
In FIG. 13, the normal external device 20 (the normal control unit 21) transmits a diagnostic frame with the ECU 10a as a destination (410).
When the switching hub 30 (relay control unit 31) determines that the received frame may be relayed, the device represented by the source MAC address "Q" included in the received frame as shown in FIG. It records in the routing table 521 as a corresponding device of L4, identifies the communication line L1 to which the ECU 10a which is the transmission destination device represented by the destination MAC address is connected according to the routing table 521, and relays the received frame to the identified communication line L1. (S420).

ECU10a(車載制御部11a)は、ポート番号に基づいて受信したフレームを診断用フレームであると判断し(S430)、応答用のデータを含めた、正規外部装置20を送信先装置とする診断用のフレームを生成し、該フレームを送信する(S440)。   The ECU 10a (in-vehicle control unit 11a) determines that the received frame is a diagnostic frame based on the port number (S430), and uses the response data as a destination device for diagnosis. Frame is generated, and the frame is transmitted (S440).

スイッチングハブ30は、通信線L1から受信したフレームを、送信元MACアドレスとルーティングテーブル521とに従って、送信すべき通信線が通信線L4であることを特定し、通信線L4に中継する(S450)。   The switching hub 30 identifies that the communication line to be transmitted is the communication line L4 according to the transmission source MAC address and the routing table 521, and relays the frame received from the communication line L1 to the communication line L4 (S450) .

これにより、正規外部装置20は、ECU10aからの診断用データを取得することができる(S460)。また、ECU10aは、正規外部装置20との認証を行うこと無く、応答用のデータを送信することができる。   Thereby, the regular external device 20 can acquire diagnostic data from the ECU 10a (S460). Further, the ECU 10a can transmit response data without performing authentication with the normal external device 20.

(3c)図14は、ECU10bとECU10a、10cとの認証が成立した後に、端子P4にECU10bになりすました非正規外部装置40が接続され、該非正規外部装置40がECU10bになりすましてフレームを送信する例を説明する図である。   (3c) In FIG. 14, after the authentication between the ECU 10b and the ECUs 10a and 10c is established, the unauthorized external device 40 spoofing the ECU 10b is connected to the terminal P4, and the unauthorized external device 40 spoofs the ECU 10b to transmit a frame. It is a figure explaining an example.

図14におけるS510〜S540は、図12におけるS310〜S340と同様であるため説明を省略する。
図14において、非正規外部装置40は、ECU10bについての認証が成立した後、端子P4に接続され、ECU10bになりすまして、ECU10a、10bを送信先装置とする不正な車両制御用のフレームを送信する(S550)。このとき、非正規外部装置40は、フレームのポート番号を50000に設定する。
S510 to S540 in FIG. 14 are the same as S310 to S340 in FIG.
In FIG. 14, after authentication of the ECU 10 b is established, the unauthorized external device 40 is connected to the terminal P 4, and spoofs the ECU 10 b to transmit an illegal vehicle control frame with the ECUs 10 a and 10 b as transmission destination devices. (S550). At this time, the non-regular external device 40 sets the port number of the frame to 50000.

スイッチングハブ30は、送信元装置を表すMACアドレス「Y」が通信線L2に接続される装置と一致していること、及び、通信線L4を取得通信線とし通信線L2を一致通信線として、取得順位が一致順位未満であることに基づいて、フレームを中継しないと判断し(S125;YES、S140;YES)、受信フレームの中継を行わない(S560)。   In the switching hub 30, the MAC address "Y" representing the transmission source device is identical to the device connected to the communication line L2, and the communication line L4 is an acquisition communication line and the communication line L2 is a coincidence communication line, Based on the fact that the acquisition order is less than the coincidence order, it is determined that the frame is not to be relayed (S125; YES, S140; YES), and the reception frame is not relayed (S560).

これにより、スイッチングハブ30は、車内ネットワークにおけるECU10a〜10cのうちのいずれかに成りすました非正規外部装置40が通信線L4に接続されたとしも、該非正規外部装置40からのフレームを中継しないようにすることができる。   As a result, even if the non-regular external device 40, which has become the switching hub 30 in one of the ECUs 10a to 10c in the in-vehicle network, is connected to the communication line L4, the frame from the non-regular external device 40 is not relayed. Can be

[4.効果]
以上詳述した実施形態によれば、以下の効果が得られる。
(4a)スイッチングハブ30(中継制御部31)は、複数の通信線L1〜L4が接続され、複数の通信線L1〜L4間でフレームの中継を行う中継装置である。
[4. effect]
According to the embodiment described above, the following effects can be obtained.
(4a) The switching hub 30 (relay control unit 31) is a relay device connected to the plurality of communication lines L1 to L4 and relaying a frame between the plurality of communication lines L1 to L4.

中継制御部31は、通信線L1〜L4と通信線L1〜L4に接続された装置との対応関係を、通信線L1〜L4毎に表した情報であるルーティングテーブル521を取得する(S120)。中継制御部31は、複数の通信線L1〜L4のいずれか一つから、フレームの送信元を識別するための情報である送信元MACアドレスを含むフレームを、受信フレームとして取得する(S100)。中継制御部31は、受信フレームが取得された通信線L1〜L4を取得通信線L1〜L4として特定する(S110)。   The relay control unit 31 acquires the routing table 521, which is information representing the correspondence between the communication lines L1 to L4 and the devices connected to the communication lines L1 to L4 for each of the communication lines L1 to L4 (S120). The relay control unit 31 acquires a frame including a transmission source MAC address, which is information for identifying a transmission source of a frame, from any one of the plurality of communication lines L1 to L4 as a reception frame (S100). The relay control unit 31 specifies the communication lines L1 to L4 from which the received frame is acquired as the acquired communication lines L1 to L4 (S110).

中継制御部31は、受信フレームに含まれる送信元MACアドレスが示す送信元装置、及びルーティングテーブル521において通信線L1〜L4に接続された装置として対応付けられた装置である対応装置のうち取得通信線L1〜L4に接続された装置を除く装置、が一致しているか否かを判断する(S125)。   The relay control unit 31 acquires communication among the corresponding devices that are devices associated with the transmission source device indicated by the transmission source MAC address included in the reception frame and the devices connected to the communication lines L1 to L4 in the routing table 521. It is determined whether the devices excluding the devices connected to the lines L1 to L4 match (S125).

中継制御部31は、S125により一致していないと判断された場合に、複数の通信線L1〜L4間で受信フレームを中継し、S125により一致していると判断された場合に、受信フレームを中継しない。(S150、S155)。   The relay control unit 31 relays the received frame between the plurality of communication lines L1 to L4 when it is determined that they do not match in S125, and when it is determined that they match in S125, the relay frame is received. Do not relay. (S150, S155).

つまり、スイッチングハブは、仮に対応装置のうちの1つになりすました非正規の通信装置が通信線に接続された場合、この通信線(取得通信線)から取得されたデータに含まれる送信元MACアドレス(送信元情報)が示す送信元装置が、対応装置のうちの取得通信線に接続された装置を除く装置のいずれかに一致するため、取得データを中継しない。これによれば、通信線に接続された複数の装置間で相互に通信を行う際に、新たな装置を必要とすることなく、簡易な構成で非正規の通信装置との通信を抑制することができる。   In other words, if a non-regular communication device, which has become a one of the corresponding devices, is connected to a communication line, the switching hub is a source MAC included in data acquired from this communication line (acquisition communication line). Since the transmission source device indicated by the address (transmission source information) matches one of the devices excluding the device connected to the acquired communication line among the supported devices, the acquired data is not relayed. According to this, when mutually communicating between a plurality of devices connected to the communication line, the communication with the unauthorized communication device is suppressed with a simple configuration without requiring a new device. Can.

(4b)ルーティングテーブル521には、通信線L1〜L4毎に予め定められた順位を含む。中継制御部31は、S125により一致していると判断された場合(S125;YES)に、対応装置のうち送信元装置と一致した装置を一致装置として、該一致装置が接続された通信線L1〜L4である一致通信線L1〜L4の順位を表す一致順位と、取得通信線L1〜L4の順位を表す取得順位とを、ルーティングテーブル521を参照することによって特定し、取得順位と一致順位とを比較する(S140)。   (4b) The routing table 521 includes a predetermined order for each of the communication lines L1 to L4. If the relay control unit 31 determines in step S125 that there is a match (S125; YES), the communication line L1 to which the matching device is connected, with the device matching the transmission source device among the corresponding devices as the matching device. The identification order representing the order of the matching communication lines L1 to L4 and the acquisition order representing the order of the acquisition communication lines L1 to L4, which are ~ L4, is specified by referring to the routing table 521, and the acquisition order and the coincidence order Are compared (S140).

中継制御部31は、S150では、S140により取得順位が一致順位以上であると判断されたときに、受信フレームを中継する。
これによれば、順位の低い通信線に、非正規外部装置40のような、車載装置になりすますおそれのある装置を接続するようにすれば、仮に順位の低い通信線に予め非正規外部装置40が接続されており非正規外部装置40が車載装置(対応装置)のうちの一つになりすましていたとしても、なりすましをされた正規の装置からのデータを中継することができる。
The relay control unit 31 relays the received frame when it is determined in S150 that the acquisition order is equal to or higher than the coincidence order in S150.
According to this, if a device having a possibility of impersonating an on-vehicle device such as the non-regular external device 40 is connected to the low-order communication line, the non-regular external device 40 is preliminarily transmitted to the low-order communication line. Even if the unauthorized external device 40 is spoofed as one of the on-vehicle devices (corresponding devices), data from the spoofed legitimate device can be relayed.

(4c)中継制御部31は、S140により取得順位が一致順位以上であると判断された場合に、ルーティングテーブル521における取得通信線L1〜L4に対応する装置として送信元装置を記録させる(S145)。   (4c) The relay control unit 31 records the transmission source device as a device corresponding to the acquired communication lines L1 to L4 in the routing table 521 when it is determined that the acquisition order is equal to or higher than the coincidence order in S140 (S145) .

これによれば、ルーティングテーブル521が正しい対応関係に更新されるので、更新された以降は、正しいルーティングテーブル521に基づいてフレームの中継を行うことができるようになる。   According to this, since the routing table 521 is updated to the correct correspondence relationship, after updating, it is possible to relay the frame based on the correct routing table 521.

(4d)中継制御部31は、S140により取得順位が一致順位よりも低いと判断された場合に、ルーティングテーブル521における取得通信線L1〜L4に対応する装置と、この取得通信線L1〜L4との対応関係を、ルーティングテーブル521から削除する(S160)。   (4d) If the relay control unit 31 determines that the acquisition order is lower than the coincidence order in S140, the relay control unit 31 corresponds to the apparatus corresponding to the acquired communication lines L1 to L4 in the routing table 521, and the acquired communication lines L1 to L4. Is deleted from the routing table 521 (S160).

これによれば、誤った対応関係がルーティングテーブル521から削除されるので、削除された以降は、正しいルーティングテーブル521に基づいてデータの中継を行うことができるようになる。   According to this, since the incorrect correspondence relationship is deleted from the routing table 521, it is possible to relay data based on the correct routing table 521 after the deletion.

(4e)通信線L1〜L4毎に予め定められた順位を、低順位と該低順位よりも順位が高い高順位の2つの順位のいずれかで表す。
これによれば、低順位に分類された通信線に、なりすましのおそれのある外部装置を接続するようにすれば良いため、簡易に通信システム1を構成することができる。
(4e) The order determined in advance for each of the communication lines L1 to L4 is represented by one of the low order and the high order of two higher than the low order.
According to this, since it is sufficient to connect an external device which may be spoofed to the communication line classified into the low order, the communication system 1 can be configured easily.

(4f)中継制御部31は、S100では、複数の通信線L1〜L4のいずれか一つから、フレームの送信先を識別するための情報である宛先MACアドレスを更に含むフレームを受信フレームとして取得する。中継制御部31は、S150では、受信フレームを中継するときに、ルーティングテーブル521を参照することにより、宛先MACアドレスが表す装置と一致する装置が接続された通信線L1〜L4を特定し、特定した通信線L1〜L4に受信フレームを出力する。   (4f) In S100, the relay control unit 31 acquires a frame further including a destination MAC address, which is information for identifying the transmission destination of the frame, from any one of the plurality of communication lines L1 to L4 as a reception frame. Do. In S150, when relaying a received frame, the relay control unit 31 identifies the communication lines L1 to L4 to which the device matching the device represented by the destination MAC address is connected by referring to the routing table 521, and identifies The received frame is output to the communication lines L1 to L4.

これによれば、ルーティングテーブル521を参照することにより、宛先を指定された装置にフレームを中継することができる。
なお、上記実施形態では、中継制御部31が、データ取得部、通信線特定部、対応取得部、順位判断部、更新部、中継実行部、削除部としての一例に相当する。また、S100がデータ取得部としての処理の一例に相当し、S110が通信線特定部としての処理の一例に相当し、S120が対応取得部としての処理の一例に相当し、S140が順位判断部としての処理の一例に相当する。
According to this, by referring to the routing table 521, it is possible to relay a frame to a device whose destination is specified.
In the above embodiment, the relay control unit 31 corresponds to an example as a data acquisition unit, a communication line identification unit, a correspondence acquisition unit, a rank determination unit, an update unit, a relay execution unit, and a deletion unit. Also, S100 corresponds to an example of processing as a data acquisition unit, S110 corresponds to an example of processing as a communication line identification unit, S120 corresponds to an example of processing as a correspondence acquisition unit, and S140 is a rank determination unit. It corresponds to an example of processing as.

また、S145が更新部としての処理の一例に相当し、S150、S155が中継実行部としての処理の一例に相当し、S160が削除部としての処理の一例に相当する。また、受信フレームが取得データの一例に相当し、送信元MACアドレスが送信元情報の一例に相当し、宛先MACアドレスが送信先情報の一例に相当する。ルーティングテーブル521が対応情報の一例に相当する。   Further, S145 corresponds to an example of processing as an update unit, S150 and S155 correspond to an example of processing as a relay execution unit, and S160 corresponds to an example of processing as a deletion unit. Also, the reception frame corresponds to an example of acquired data, the transmission source MAC address corresponds to an example of transmission source information, and the destination MAC address corresponds to an example of transmission destination information. The routing table 521 corresponds to an example of the correspondence information.

[5.他の実施形態]
以上、本発明を実施するための形態について説明したが、本発明は上述の実施形態に限定されることなく、種々変形して実施することができる。
[5. Other embodiments]
As mentioned above, although the form for implementing this invention was demonstrated, this invention can be variously deformed and implemented, without being limited to the above-mentioned embodiment.

(5a)上記実施形態では、中継制御部31は、スイッチングハブ処理において、送信元装置についての一致条件が成立していない場合に、または、一致条件が成立していても、取得順位が一致順位以上であると判断された場合に、受信フレームを中継していたが、これに限定されるものではない。   (5a) In the above embodiment, in the switching hub process, in the switching hub process, when the matching condition for the transmission source device is not satisfied, or even if the matching condition is satisfied, the acquisition order is the same. When it is determined that the above is true, the received frame is relayed, but it is not limited to this.

例えば、中継制御部31は、一致条件が成立していない場合にフレームを中継し、一致条件が成立している場合にフレームを中継しないように構成されてもよい。この場合、図3に示すスイッチングハブ処理からS140〜S145を削除するようにすれば良い。これによれば、少なくとも、通信線L4に接続され、通信線L4以外の他の通信線に接続された車載装置であるECU10a〜10cになりすました非正規外部装置40からのフレームを中継しないようにすることができる。   For example, the relay control unit 31 may be configured to relay the frame when the coincidence condition is not satisfied, and not to relay the frame when the coincidence condition is satisfied. In this case, S140 to S145 may be deleted from the switching hub process shown in FIG. According to this, at least the ECUs 10a to 10c, which are in-vehicle devices connected to the communication line L4 and connected to other communication lines other than the communication line L4, do not relay the frame from the non-regular external device 40 can do.

(5b)上記実施形態では、通信線の順位を高順位と低順位との2種類に分けたが、これに限定されるものではない。通信線の順位は3種類以上に分けられていてもよい。この場合、最も順位の低い通信線を、なりすましを行うおそれのある外部装置が接続される通信線として用いることにより、上記実施形態と同様の効果が奏される。   (5b) In the above embodiment, the order of the communication lines is divided into two types, high and low, but the invention is not limited to this. The order of the communication lines may be divided into three or more types. In this case, by using the communication line with the lowest rank as a communication line to which an external device that may perform impersonation is connected, the same effect as that of the above embodiment can be obtained.

(5c)上記実施形態では、通信システム1は、イーサネットにおけるプロトコルのうち、例えばUDPを用いた通信システムであったが、これに限定されるものではない。例えば、通信システム1は、イーサネットにおけるプロトコルのうち、TCPを用いた通信システムであってもよい。   (5c) In the above embodiment, the communication system 1 is a communication system using, for example, UDP among protocols in Ethernet, but the present invention is not limited to this. For example, the communication system 1 may be a communication system using TCP among protocols in Ethernet.

(5d)上記実施形態では、対応情報の一例としてルーティングテーブル521を挙げたが、これに限定されるものではない。対応情報とは、通信線と通信線に接続された装置との対応関係を通信線毎に表した情報をいう。対応情報には、例えば、ルーティングテーブル521から通信線毎の順位を削除した残りの部分、すなわち、通信線と通信線に接続された装置との対応関係が含まれていればよい。   (5d) In the above embodiment, the routing table 521 is mentioned as an example of the correspondence information, but the present invention is not limited to this. Correspondence information refers to information representing, for each communication line, the correspondence between the communication line and the devices connected to the communication line. The correspondence information may include, for example, the remaining part of the routing table 521 from which the order for each communication line has been deleted, that is, the correspondence between the communication line and the device connected to the communication line.

(5e)上記実施形態における1つの構成要素が有する複数の機能を、複数の構成要素によって実現したり、1つの構成要素が有する1つの機能を、複数の構成要素によって実現したりしてもよい。また、複数の構成要素が有する複数の機能を、1つの構成要素によって実現したり、複数の構成要素によって実現される1つの機能を、1つの構成要素によって実現したりしてもよい。また、上記実施形態の構成の一部を省略してもよい。また、上記実施形態の構成の少なくとも一部を、他の上記実施形態の構成に対して付加又は置換してもよい。なお、特許請求の範囲に記載した文言のみによって特定される技術思想に含まれるあらゆる態様が本発明の実施形態である。   (5e) The multiple functions of one component in the above embodiment may be realized by multiple components, or one function of one component may be realized by multiple components. . Also, a plurality of functions possessed by a plurality of components may be realized by one component, or one function realized by a plurality of components may be realized by one component. In addition, part of the configuration of the above embodiment may be omitted. In addition, at least a part of the configuration of the above-described embodiment may be added to or replaced with the configuration of the other above-described embodiment. In addition, all the aspects contained in the technical thought specified only by the words described in the claim are an embodiment of the present invention.

(5f)上述した中継制御部31、スイッチングハブ30、通信システム1の他、当該中継制御部31を機能させるためのプログラム、このプログラムを記録した半導体メモリ等の非遷移的実態的記録媒体、中継方法など、種々の形態で本発明を実現することもできる。   (5f) In addition to the relay control unit 31, the switching hub 30, and the communication system 1, a program for causing the relay control unit 31 to function, a non-transitional real recording medium such as a semiconductor memory having the program recorded, relay The invention can also be realized in various forms, such as a method.

1 通信システム、30 スイッチングハブ、31 中継制御部、51 CPU51。   1 communication system, 30 switching hub, 31 relay control unit, 51 CPU 51.

Claims (5)

複数の通信線が接続され、前記複数の通信線間でデータの中継を行う中継装置であって、
前記通信線と前記通信線に接続された装置との対応関係を、前記通信線毎に表した情報である対応情報を取得する対応取得部(S120)と、
前記複数の通信線のいずれか一つから、データの送信元を識別するための情報である送信元情報を含むデータを、取得データとして取得するデータ取得部(S100)と、
前記取得データが取得された通信線を取得通信線として特定する通信線特定部(S110)と、
前記取得データに含まれる送信元情報が示す送信元装置、及び前記対応情報において通信線に接続された装置として対応付けられた装置である対応装置のうち前記取得通信線に接続された装置を除く装置、が一致しているか否かを判断する一致判断部(S125)と、
前記一致判断部により一致していないと判断された場合に、前記複数の通信線間で前記取得データを中継し、前記一致判断部により一致していると判断された場合に、前記取得データを中継しない中継実行部(S150、S155)と、
を備え
前記対応情報には前記通信線毎に予め定められた順位を含み、
前記一致判断部により一致していると判断された場合(S125;YES)に、前記対応装置のうち前記送信元装置と一致した装置を一致装置として、該一致装置が接続された通信線である一致通信線の順位を表す一致順位と、前記取得通信線の順位を表す取得順位とを、前記対応情報を参照することによって特定し、前記取得順位と前記一致順位とを比較する順位判断部(S140)
を更に備え、
前記中継実行部(S150)は、前記順位判断部により前記取得順位が前記一致順位以上であると判断されたときに、前記取得データを中継する、
中継装置。
A relay apparatus to which a plurality of communication lines are connected and which relays data between the plurality of communication lines,
Corresponding acquisition unit that acquires the correspondence information corresponding relationship is information representing for each of the communication line between the connected communication line and to said communication line device and (S120),
A data acquisition unit (S100) for acquiring, as acquisition data, data including transmission source information that is information for identifying a transmission source of data from any one of the plurality of communication lines;
A communication line identification unit (S110) for specifying the communication line from which the acquired data is acquired as the acquired communication line;
The transmission source apparatus indicated by the transmission source information included in the acquired data, and the apparatus connected to the acquired communication line among the corresponding apparatuses corresponding to the apparatus connected to the communication line in the correspondence information are excluded. A match determination unit (S125) that determines whether or not the devices match;
The acquisition data is relayed between the plurality of communication lines when it is judged by the coincidence judgment unit that they do not coincide, and when the coincidence judgment unit judges that they coincide, the acquired data is turned A relay execution unit (S150, S155) not relaying,
Equipped with
The correspondence information includes a predetermined order for each communication line,
When it is determined by the match determination unit that the match is determined (S125; YES), the communication device is a communication line to which the match device is connected with a device matching the transmission source device among the corresponding devices as the match device. A rank determination unit that identifies a match rank representing the rank of the matching communication line and an acquisition rank representing the rank of the acquired communication line by referring to the correspondence information, and comparing the acquisition rank with the match rank S140)
And further
The relay execution unit (S150) relays the acquired data when the order determination unit determines that the acquisition order is equal to or higher than the coincidence order.
Relay device.
請求項に記載の中継装置であって、
前記順位判断部により前記取得順位が前記一致順位以上であると判断された場合に、前記対応情報における取得通信線に対応する装置として前記送信元装置を記録させる更新部(S145)
を更に備える中継装置。
The relay apparatus according to claim 1 , wherein
The updating unit (S145), which causes the transmission source device to be recorded as a device corresponding to the acquired communication line in the correspondence information, when it is determined by the rank determination unit that the acquisition rank is equal to or higher than the match rank.
The relay apparatus further comprising
請求項または請求項に記載の中継装置であって、
前記順位判断部により前記取得順位が前記一致順位よりも低いと判断された場合に、前記対応情報における取得通信線に対応する装置と、この取得通信線との対応関係を、前記対応情報から削除する削除部(S160)
を更に備える中継装置。
The relay apparatus according to claim 1 or 2 ,
When the order determining unit determines that the acquisition order is lower than the matching order, the correspondence between the device corresponding to the acquired communication line in the correspondence information and the acquired communication line is deleted from the correspondence information. Delete part (S160)
The relay apparatus further comprising
請求項から請求項のいずれか一項に記載の中継装置であって、
前記通信線毎に予め定められた順位を、低順位と該低順位よりも順位が高い高順位の2つの順位のいずれかで表す、
中継装置。
A repeater apparatus according to any one of claims 1 to 3,
The predetermined order for each communication line is represented by one of two levels, a low order and a high order higher than the low order.
Relay device.
請求項1から請求項のいずれか一項に記載の中継装置であって、
前記データ取得部は、前記複数の通信線のいずれか一つから、前記データの送信先を識
別するための情報である送信先情報を更に含むデータを前記取得データとして取得し、
前記中継実行部は、前記取得データを中継するときに、前記対応情報を参照することにより、前記送信先情報が表す装置と一致する装置が接続された通信線を特定し、特定した通信線に前記取得データを出力する、
中継装置。
The relay apparatus according to any one of claims 1 to 4 , wherein
The data acquisition unit acquires, as the acquired data, data further including transmission destination information, which is information for identifying a transmission destination of the data, from any one of the plurality of communication lines.
When relaying the acquired data, the relay execution unit refers to the correspondence information to identify a communication line to which a device matching the device represented by the transmission destination information is connected, to the identified communication line. Output the acquired data,
Relay device.
JP2016008118A 2016-01-19 2016-01-19 Relay device Active JP6544250B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016008118A JP6544250B2 (en) 2016-01-19 2016-01-19 Relay device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016008118A JP6544250B2 (en) 2016-01-19 2016-01-19 Relay device

Publications (2)

Publication Number Publication Date
JP2017130756A JP2017130756A (en) 2017-07-27
JP6544250B2 true JP6544250B2 (en) 2019-07-17

Family

ID=59396401

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016008118A Active JP6544250B2 (en) 2016-01-19 2016-01-19 Relay device

Country Status (1)

Country Link
JP (1) JP6544250B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2019151164A1 (en) * 2018-01-30 2021-01-28 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Communication device and control method of communication device
JP6950591B2 (en) * 2018-03-08 2021-10-13 トヨタ自動車株式会社 In-vehicle communication device
JP2023134960A (en) 2022-03-15 2023-09-28 オムロン株式会社 control system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003143209A (en) * 2001-10-30 2003-05-16 Kddi Corp Packet transfer apparatus and its method
WO2005036831A1 (en) * 2003-10-07 2005-04-21 Fujitsu Limited Frame relay device

Also Published As

Publication number Publication date
JP2017130756A (en) 2017-07-27

Similar Documents

Publication Publication Date Title
JP6485429B2 (en) In-vehicle network system
JP6477281B2 (en) In-vehicle relay device, in-vehicle communication system, and relay program
US20160173505A1 (en) On-vehicle communication system
CN112805968B (en) In-vehicle communication device, communication control method, and communication control program
US11930021B2 (en) Unauthorized frame detection device and unauthorized frame detection method
US11444939B2 (en) Authentication control device, authentication control method, and authentication control program
JP6544250B2 (en) Relay device
CN110741604B (en) In-vehicle communication device, communication control method, and recording medium
US11811553B2 (en) Vehicle relay device
CN111788796B (en) Vehicle-mounted communication system, exchange device, authentication method, and computer-readable storage medium
US10965644B2 (en) Network switch
JP5522154B2 (en) Relay system, relay device and communication device constituting the relay system
JP6981755B2 (en) In-vehicle network system
US20170187567A1 (en) Electronic control apparatus
JP7067508B2 (en) Network system
WO2020145086A1 (en) Onboard communication system, onboard communication control device, onboard communication device, communication control method, and communication method
JP6798349B2 (en) Communication system and relay device
JP2022024630A (en) On-vehicle hub and on-vehicle system
JP2013121071A (en) Relay system, and relay device and external device forming the same
WO2018056054A1 (en) Communication system, relay device, communication device and communication method
KR102472413B1 (en) Method for providing security on in vehicle network
JP2009010851A (en) On-vehicle gateway device
US20220231997A1 (en) Setting device, communication system, and vehicle communication management method
JP2015207937A (en) Communication apparatus
WO2017065100A1 (en) Vehicle-mounted communication system and monitoring device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180409

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190402

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190507

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: 20190521

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190603

R151 Written notification of patent or utility model registration

Ref document number: 6544250

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250