Relay device

A relay device in a communication network includes: a configuration determination unit determining whether a configuration frame is received; a comparison unit; first and second configuration units; and a configuration transfer unit. The comparison unit determines whether the propagation number at reception time is equal to the total number of target devices in a configuration frame. When the propagation number is not equal to the total number, the first configuration unit sets a port in the transfer destination information to the mirror output port. When the propagation number is not equal to the total number, the configuration transfer unit outputs the updated configuration frame from the mirror input port. When the propagation number is equal to the total number, the second configuration unit sets a port in the transfer destination information to the mirror output port.

CROSS REFERENCE TO RELATED APPLICATION

The present application claims the benefit of priority from Japanese Patent Application No. 2018-43033 filed on Mar. 9, 2018. The entire disclosure of the above application is incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to a relay device configuring a communication network.

BACKGROUND

The configuration that any of multiple relay devices performs port mirroring, and a frame mirrored by the port mirroring (that is, replicated) is transferred to a monitoring device of the frame through one or more other relay devices is referred to herein as remote monitoring.

Regarding the remote monitoring, a tunnel for transferring a mirror frame from a switch that has performed port mirroring to a measurement device connected to another switch is configured by distributing a label table to each switch as multiple relay devices from a management server. The mirror frame is a mirrored frame. The tunnel is considered to correspond to a transfer path of the mirror frame.

SUMMARY

According to an aspect of the present disclosure, a relay device as each of a plurality of relay devices in a communication network, includes: a configuration determination unit configured to determine whether a configuration frame is received; a comparison unit; a first configuration unit; a configuration transfer unit; and a second configuration unit. The comparison unit determines whether the propagation number at reception time is equal to the total number of target devices in a configuration frame. When the propagation number is not equal to the total number, the first configuration unit sets a port in the transfer destination information to the mirror output port. When the propagation number is not equal to the total number, the configuration transfer unit outputs the updated configuration frame from the mirror input port. When the propagation number is equal to the total number, the second configuration unit sets a port in the transfer destination information to the mirror output port.

DETAILED DESCRIPTION

Regarding remote monitoring, a tunnel for transferring a mirror frame from a switch that has performed port mirroring to a measurement device connected to another switch is configured by distributing a label table to each switch as multiple relay devices from a management server. The mirror frame is a mirrored frame. The tunnel is considered to correspond to a transfer path of the mirror frame.

In the above feature, it is not clear how the remote monitoring configuration for each switch (that is, each relay device) is performed by information from the management server.

The configuration related to remote monitoring is the configuration of at least the following items (1) to (4).

(1) Item as to which relay device among the multiple relay devices configures the mirror execution device. The mirror execution device is a relay device that implements the port mirroring.

(2) Item as to which port is used as a monitor port and which port is used as a mirror output port in the mirror execution device. The monitor port is a port subject to port mirroring. The mirror output port is a port (that is, mirror port) for outputting the mirror frame.

(3) Item as to which relay device among the multiple relay devices serves as the mirror transfer device. The mirror transfer device is a relay device that transfers the mirror frame from the mirror execution device to a monitoring device.

(4) Item as to which port is the mirror input port and which port is the mirror output port in the mirror transfer device. The mirror input port is a port to which the mirror frame is input from another relay device.

It is an object of the present disclosure to provide a new technique which is capable of facilitating the configuration for remote monitoring.

According to an aspect of the present disclosure, a relay device as each of a plurality of relay devices in a communication network, includes: a configuration determination unit configured to determine whether a configuration frame is received; a comparison unit; a first configuration unit; a configuration transfer unit; and a second configuration unit. The configuration frame provides to transfer a mirror frame from one of the relay devices to a monitor device via another one of the relay devices. The mirror frame is duplicated by executing a port mirroring in the one of the relay devices. The one of the relay devices executing the port mirroring is defined as an execution relay device. The other one of the relay devices disposed in a transfer path between the execution relay device and the monitor device and transferring the mirror frame is defined as a transfer relay device. Each of the execution relay device and the transfer relay device is defined as a target relay device. One of the target relay devices initially connecting to the monitor device is defined as a first-stage relay device. The configuration frame is initially input into the first-stage relay device, and propagates through each target device. The configuration frame includes a configuration information region for storing a propagation number information, a total number of the target devices, a transfer destination information and a transfer source information. The propagation number information indicates a numerical number of propagations as a numerical number of target devices to which the configuration frame has propagated. The configuration frame propagates in a propagation order of the target devices. The first-stage relay device has a first order of the propagation order. The transfer destination information and the transfer source information relates to the target devices in the propagation order in association with each propagation order. The transfer destination information indicates an mirror output port that outputs the mirror frame to be transferred to the monitoring device. The transfer source information recorded in association with a same order of the propagation order as the total number of the target devices indicates a monitor port as an object of the port mirroring. The transfer source information recorded in association with an order of the propagation order smaller than the total number of the target devices indicates a mirror input port to which the mirror frame is input from the other one of the relay devices. The comparison unit determines whether the numerical number of propagations at reception time is equal to the total number of the target devices in a received configuration frame when the configuration determination unit determines that the configuration frame is received. The numerical number of propagations at the reception time is indicated by the propagation number information in the received configuration frame. When the comparison unit determines that the numerical number of propagations at the reception time is not equal to the total number of the target devices, the first configuration unit: sets the relay device to function as the transfer relay device; sets a port indicated in the transfer source information to be the mirror input port when the transfer source information and the transfer destination information in the configuration information region of the configuration frame are associated with the same order of the propagation order as the numerical number of propagations at the reception time; and sets a port indicated in the transfer destination information to be the mirror output port. When the comparison unit determines that the numerical number of propagations at the reception time is not equal to the total number of the target devices, the configuration transfer unit: updates the propagation number information in the configuration frame to be new propagation number information indicating the numerical number of propagations incremented by 1 from the numerical number of propagations at the reception time; and outputs the configuration frame after the propagation number information is updated from the port set as the mirror input port by the first configuration unit. When the comparison unit determines that the numerical number of propagations at the reception time is equal to the total number of the target devices, the second configuration unit: sets the relay device to function as the execution relay device; sets a port indicated in the transfer source information to be the monitor port when the transfer source information and the transfer destination information in the configuration information region of the configuration frame are associated with the same order of the propagation order as the numerical number of propagations at the reception time; and sets a port indicated in the transfer destination information to be the mirror output port.

The configuration determination unit determines whether or not the configuration frame has been received.

The configuration frame is a frame for allowing the mirror frame duplicated by the port mirroring performed by any of the multiple relay devices to be transferred to the monitoring device30through another relay device. The other relay device referred to herein is a relay device that is not a relay device that has performed the port mirroring. The monitoring device is a device for monitoring the mirror frame. In other words, the configuration frame is a frame for configuration related to remote monitoring.

The configuration frame is first input to a first stage device, which is a target device to which the monitoring device is connected, of target devices, which are an execution device as the relay device that performs the port mirroring, and a transfer device as a relay device that exists in a transfer path between the execution device and a monitoring device and transfers the mirror frame from the execution device. The configuration frame is propagated to each target device. The propagation of the configuration frame to each target device is realized by a configuration transfer unit which will be described later. The execution device corresponds to the mirror execution device described above, and the transfer device corresponds to the mirror transfer device described above.

The configuration frame records the propagation number information indicating the number of propagations as the number of target devices to which the configuration frame has propagated and the total number of target devices, and includes the configuration information region.

In the configuration information region, the transfer destination information and the transfer source information about the target devices having the propagation order are recorded in association with each of the propagation orders, which are the order of the target devices to which the configuration frame is propagated, with the first stage device as a first order.

The transfer destination information indicates a port to which the mirror frame is to be output in order to transfer the mirror frame to the monitoring device, that is, the mirror output port.

Among the transfer source information, the transfer source information recorded in association with the same number of propagation orders as the total number indicates a port to be subjected to the port mirroring, that is, the monitor port. Among the transfer source information, the transfer source information recorded in association with the propagation order of a number smaller than the total number indicates a port to which the mirror frame is input from another relay device, that is, the mirror input port.

Then, in the relay device, when an affirmative determination is made by the configuration determination unit, that is, when it is determined that the configuration frame is received, the comparison unit determines whether or not the number of propagation at the time of reception, which is the number of propagations indicated by the propagation number information in the received configuration frame, is equal to the total number in the received configuration frame. Note that “in the configuration frame” means “recorded in the configuration frame”.

The first configuration unit sets the relay device so as to function as the transfer device when a negative determination is made by the comparison unit, that is, when it is determined that the total number is not equal to the number of propagations at the time of reception. Further, the first configuration unit sets a port indicated by the transfer source information as the mirror input port in the relay device, among the transfer destination information and the transfer source information associated with the same number of propagation orders as the number of propagations at the time of reception in the configuration information region of the received configuration frame, and sets a port indicated by the transfer destination information as a mirror output port in the relay device. The first configuration unit performs the configuration of the items (3) and (4). The expression “associated with the propagation order” means “recorded corresponding to the propagation order”.

When the comparison unit makes the negative determination, the configuration transfer unit updates the propagation number information in the received configuration frame to the propagation number information indicating the number of propagations incremented by 1 from the number of propagations at the time of reception, and outputs the configuration frame after the propagation number information is updated from the port set as the mirror input port by the first configuration unit. The configuration transfer unit realizes the propagation of the configuration frame between the target devices.

The second configuration unit sets the relay device so as to function as the execution device when the comparison unit makes the affirmative determination, that is, when the total number and the number of propagations at the time of reception are determined to be equal to each other. Further, the second configuration unit sets a port indicated by the transfer source information as the monitor port in the relay device, and sets a port indicated by the transfer destination information as the mirror output port in the relay device among the transfer destination information and the transfer source information associated with the same number of propagation orders as the number of propagations at the time of reception in the configuration information region of the received configuration frame. The second configuration unit performs the configuration of the above items (1) and (2).

According to the relay device configured as described above, when the configuration frame is input to any port of the relay device which has become the first stage device, the configuration frame is propagated to the relay device which is the execution device, and the configuration of the above items (1) to (4) is completed. Therefore, configuration related to remote monitoring becomes easy. Incidentally, the propagation number information in the configuration frame input to the first stage device may be set to the propagation number information indicating1, which means the first propagation, as the number of propagations.

A communication network1according to an embodiment shown inFIG. 1is, for example, an Ethernet network mounted on a vehicle such as a passenger car, and configures a communication system in the vehicle. Ethernet is a registered trademark.

As shown inFIG. 1, a communication network1includes Ethernet switches11to15(hereinafter referred to as a switch), which are Ethernet network switches, as multiple relay devices. InFIG. 1and other figures to be described later, the switch is referred to as “SW”. The number of switches may be other than five.

Among the switches11to15, the switch11is built in an electronic control device (hereinafter referred to as an ECU)20. The ECU is an abbreviation for “Electronic Control Unit”. The communication network1includes ECUs21to26as devices that communicate through any one or more of the switches11to15.

The switches11to15are, for example, layer 2 switches (that is, L2 switches), and perform a communication for relaying in accordance with the Ethernet standard. Each of the switches11to15includes multiple (for example, eight) ports P0to P7. In the communication network1, at least one of the multiple ports P0to P7included in each of the switches11to15is connected to a port of another switch.

The ECU21is connected to the port P2of the switch11through a communication line41. The ECU22is connected to the port P7of the switch12through a communication line42. The ECU23is connected to the port P7of the switch14through a communication line43. The ECU24is connected to the port P5of the switch14through a communication line44. The ECU25is connected to the port P4of the switch15through a communication line45. The ECU26is connected to the port P4of the switch13through a communication line46.

The port P6of the switch11and the port P1of the switch12are connected to each other through a communication line47. The port P6of the switch12and the port P1of the switch14are connected to each other through a communication line48. The port P5of the switch12and the port P1of the switch15are connected to each other through a communication line49. The port P5of the switch11and the port P1of the switch13are connected to each other through a communication line50.

A microcomputer10(hereinafter referred to as a microcomputer) as an arithmetic device provided in the ECU20is connected to the ports P0of the switch11. For that reason, the microcomputer10of the ECU20can communicate with the ECU21through the switch11. The microcomputer10can also communicate with the ECUs22to26through the switch11and any one or more of the other switches12to15. Though not shown, each of the ECUs21to26is also provided with a microcomputer as an arithmetic device. The microcomputer includes semiconductor memories (hereinafter referred to as memory) such as a CPU, a ROM, and a RAM.

A monitoring device30for monitoring a frame flowing through the communication network1is detachably connected to an end of the communication line51connected to the port P1of the switch11.

2. Table Showing Configuration of Remote Monitoring

In the communication network1, a remote monitoring is performed.

A configuration of the remote monitoring, that is, a configuration of a transfer path between the switch11connected with the monitoring device30is connected and the switch for performing the port mirroring (hereinafter referred to as a mirror execution switch) can be regarded as a tree configuration starting from the switch11. For that reason, the configuration of the remote monitoring can be represented by a table shown inFIG. 2(a tabular database). Hereinafter, a switch that relays the mirror frame transmitted by the mirror execution switch to the monitoring device30is referred to as a mirror transfer switch. The mirror execution switch corresponds to an execution device, and the mirror transfer switch corresponds to a transfer device. When the switches11to15, the ports P0to P7, the ECUs20to26, and the like are not particularly distinguished from each other, the reference numerals will be omitted.

A table ofFIG. 2will be described.

A term “hop” means the number of hops. If n is an integer of 1 or more, “hop=n” means that the number of hops is n. Here, the number of hops indicates the order of the switches in which the frame input to the switch11propagates with the switch11connected to the monitoring device30as the first, in other words, indicates the order of connection of each switch with the switch11as the first. The switch11corresponds to a first stage device, and the number of hops corresponds to the propagation order.

In the table ofFIG. 2, the information recorded on a right side of an ECU name in each row numbered 1, 2, 3, . . . at a left end is configuration information indicating the configuration of remote monitoring in the case where each ECU is a target of remote monitoring. A symbol EOF is a mark indicating an end of the content of the configuration information. That is, in each row of the table, the information recorded from the total number of hops to the immediately preceding EOF, that is, the left side, is substantial configuration information.

The total number of hops is the number of switches present between the target ECU and the monitoring device30. In other words, the total number of hops is the number of switches (hereinafter referred to as configuration target switches) to be configured for remote monitoring. To describe the configuration target switch, first, the switch to which the target ECU is connected becomes the mirror execution switch. The switch existing in the transfer path between the mirror execution switch and the monitoring device30serves as a mirror transfer switch. Each of the mirror execution switch and the mirror transfer switch becomes the configuration target switch. The configuration target switch corresponds to the target device, and the total number of hops corresponds to the total number of target devices.

In each row of the table ofFIG. 2, before EOF, a transfer destination port corresponding to the transfer destination information and a transfer source port corresponding to the transfer source information are recorded for each number of hops. Each of the transfer destination port and the transfer source port to be recorded is actually the number of the corresponding port (for example, 0 to 7). Also, inFIG. 2, the port is described as “port”.

The number of hops equal to the total number of hops is the number of hops of the mirror execution switch. For that reason, in each row of the table ofFIG. 2, the transfer destination port and the transfer source port recorded in association with the number of hops equal to the total number of hops are the transfer destination port and the transfer source port for the mirror execution switch.

The number of hops smaller than the total number of hops is the number of hops of the mirror transfer switch. For that reason, in each row of the table ofFIG. 2, the transfer destination port and the transfer source port recorded in association with the number of hops smaller than the total number of hops are the transfer destination port and the transfer source port for the mirror transfer switch.

Among the transfer source ports recorded in the table ofFIG. 2, the transfer source port recorded in association with the number of hops equal to the total number of hops indicates a monitor port, and the transfer source port recorded in association with the number of hops smaller than the total number of hops indicates a mirror input port. As described above, the monitor port is a port to be subjected to port mirroring, and the mirror input port is a port to which the mirror frame is input from another switch. The monitor port is also a port to which the target ECU is connected.

The transfer destination port recorded in the table ofFIG. 2indicates a mirror output port. In other words, in the mirror execution switch, the transfer destination port is a port for outputting a mirror frame duplicated by the switch to be transferred to the monitoring device30, and in the mirror transfer switch, the transfer destination port is a port for outputting a mirror frame from another switch to be transferred to the monitoring device30.

In each row of the table ofFIG. 2, I/O information indicates whether the port mirroring to be executed is the reception mirror or the transmission mirror. The reception mirror is to mirror the frame received from the monitor port, that is, the frame transmitted by the target ECU. The transmission mirror mirrors a frame transmitted from the monitor port, that is, a frame transmitted to the target ECU. As the I/O information, a symbol “I” shown inFIG. 2indicates the reception mirror. If the I/O information is the transmission mirror, the I/O information becomes “O”, for example.

For example, when it is considered that remote monitoring is performed by the reception mirror with the ECU23as a target, the configuration information of the remote monitoring is the configuration information shown in a third row in the table ofFIG. 2, that is, a row having the leftmost number of 3. In the configuration information of the third line, the switches11,12, and14are specified as the configuration target switches based on a connection relationship between the transfer destination port and the transfer source port recorded for each number of hops. It is indicated that the port P7of the third switch14having the first switch11is the monitor port of the reception mirror, and the port P1of the switch14is the mirror output port. Further, it is indicated that the port P6of the second switch12is a mirror input port and the port P1of the switch12is a mirror output port, and that the port P6of the switch11is a mirror input port and the port P1of the switch11is a mirror output port.

The table ofFIG. 2is recorded in a memory (for example, a ROM) of the microcomputer10.

3. Configuration Frame

The microcomputer10transmits a configuration frame in order to perform configuration related to remote monitoring. The configuration frame transmitted from the microcomputer10is input to the port PD of the switch11, and then propagated to each of the configuration target switches including the switch11. The configuration frame will be described with reference toFIG. 3.

First, a normal frame (hereinafter referred to as a normal frame), which is not a configuration frame, will be described. The normal frame is a normal Ethernet frame.

As shown in the first stage ofFIG. 3, the normal frame includes fields of an Ethernet header, a type, an Ethernet payload, and an FCS. The source MAC address (that is, a transmission source MAC address) is stored at an end of the Ethernet header. An Ethernet payload is a body of data that is transferred in a frame. A symbol FCS is an abbreviation for “Frame Check Sequence”.

On the other hand, as shown in the second row ofFIG. 3, in the configuration frame, a field is added at a predetermined position in comparison with the normal frame. A field added to the normal frame is called a unique field. The unique field is added, for example, between the Ethernet header and the type field, that is, between the source MAC address and the type field.

In the unique field of the configuration frame, an identifier (hereinafter referred to as a configuration identifier), which is a code of one or more bits indicating that the frame is the configuration frame, and a security key for authentication are recorded. The security key is a mufti-bit code for verifying that the configuration frame is a frame transmitted from a normal device, that is, the microcomputer10in the present embodiment.

The Ethernet payload of the configuration frame stores the configuration information recorded for the ECU which is the target of remote monitoring among the configuration information recorded for each ECU in the table ofFIG. 2. Incidentally, the configuration frame shown inFIG. 3is a configuration frame when remote monitoring is performed by the reception mirror with the ECU23as a target.

Further, the hop number count value is recorded at a predetermined position in the Ethernet payload of the configuration frame. In the present embodiment, the hop number count value is recorded between the total number of hops and the I/O information.

The hop number count value indicates the number of configuration target switches (that is, the number of propagations) through which the configuration frame has propagated. In the present embodiment, the hop number count value indicates the propagation number as it is, but it is sufficient if there is a one-to-one correspondence between the hop number count value and the number of propagations. The hop number count value in the configuration frame output from the microcomputer10is set to a value indicating a first propagation, that is, 1 in the present embodiment.

The hop number count value corresponds to the propagation number information. In the following description, as shown inFIG. 3, an region in which a transfer destination port corresponding to “the number of hops=1” to a transfer source port corresponding to the same number of hops as the total number of hops are recorded in the Ethernet payload of the configuration frame is referred to as a configuration information region. In the above configuration information region, the transfer destination port and the transfer source port of the configuration target switch corresponding to the number of hops are recorded in association with each hop number from 1 to the same number as the total number of hops.

Next, processing performed by each of the switches11to15in connection with remote monitoring will be described with reference toFIGS. 4 and 5.

First, a configuration process performed by each of the switches11to15for executing a configuration in the switch based on the configuration frame from the microcomputer10will be described with reference toFIG. 4. InFIG. 4, the hop number count value is simply described as a count value.

When a frame is received from any of the ports P0to P7, the switch performs the configuration process ofFIG. 4.

As shown inFIG. 4, in S110, the switch determines whether or not the received frame (hereinafter referred to as a received frame) is a configuration frame, that is, whether or not the configuration frame has been received. Specifically, the switch determines whether or not the unique field is added to the received frame and the configuration identifier is recorded in the unique field. If the configuration identifier is recorded in the unique frame, that is, if the configuration identifier is included in the received frame, the switch determines that the configuration frame has been received.

When it is determined in S110that the configuration frame has not been received, the switch proceeds to S220, and performs a process of relaying the received frame as the normal frame. In other words, a normal relay process is performed on the received frame. Thereafter, the switch ends the configuration process.

When it is determined in S110that the configuration frame has been received, the switch proceeds to S115and performs an authentication process using a security key included in the configuration frame. For example, the switch performs a predetermined calculation on the security key included in the configuration frame, and if the calculation result is a correct value, the switch determines that the authentication has succeeded, and if the calculation result is not a correct value, the switch determines that the authentication has failed.

In a next S117, the switch determines whether or not the authentication has succeeded by the authentication process in S115, and if the authentication has not succeeded, the switch discards the received configuration frame in S119, and then ends the configuration process.

If it is determined in S117that the authentication has succeeded in the authentication process, the switch proceeds to S120and acquires information from the received configuration frame. Specifically, the switch acquires the total number of hops, the hop number count value, and the I/O information from the configuration frame. Further, the switch acquires the transfer destination port and the transfer source port recorded corresponding to the number of hops equal to the hop number count value from the configuration information region in the configuration frame. The hop number count value acquired from the configuration frame in S120corresponds to the number of propagations at the time of reception.

In a next S130, the switch determines whether or not the total number of hops and the hop number count value acquired in S120are equal to each other, and if it is determined that the total number of hops and the hop number count value are equal to each other, the switch proceeds to S140.

In S140, the switch is configured so that the switch functions as the mirror execution switch. For example, the switch sets a flag indicating that the switch functions as the mirror execution switch. Further, in S140, the switch sets the transfer source port acquired in S120as the monitor port in the switch, and sets the transfer destination port acquired in S120as the mirror output port in the switch.

In a next S5150, the switch configures the reception mirror or the transmission mirror based on the I/O information acquired in S120. Specifically, if the I/O information acquired from the configuration frame is “I” indicative of the reception mirror, the switch performs the configuration of executing the reception mirror as the port mirroring, and if the I/O information is “O” indicative of the transmission mirror, the switch performs the configuration of executing the transmission mirror as the port mirroring. After performing the processing of S150, the switch proceeds to S170.

When it is determined by the switch in S130that the total number of hops is not equal to the hop number count value, the process proceeds to S160.

In S160, the switch is set so that the switch functions as a mirror transfer switch. For example, the switch sets a flag indicating that the switch functions as the mirror transfer switch. Further, in S160, the switch sets the transfer source port acquired in S120as the mirror input port in the switch, and sets the transfer destination port acquired in S120as the mirror output port in the switch. After performing the processing of S160, the switch proceeds to S170.

In S170, the switch determines whether or not the hop number count value acquired in S120is 1, and if the hop number count value is 1, it is recognized that the switch is a switch (that is, the switch11) connected to the monitoring device30, and the process proceeds to S180.

In S180, the switch performs a configuration in which the mirror identifier is unnecessary. For example, the switch sets a flag indicating that no mirror identifier is required. The switch then proceeds to S190. The mirror identifier is a code of one or more bits inserted into the mirror frame and indicates that the frame is a mirror frame. Whether or not it is configured that the mirror identifier is unnecessary in S180is determined in S350and S410ofFIG. 5, which will be described later.

When it is determined in S170that the hop number count value is not 1, the switch directly proceeds to S190.

In S190, the switch determines whether or not the total number of hops acquired in S120is equal to the hop number count value, similarly to S130. Since the determination result in S130is the same as the determination result in S190, the determination result in S130may be referred to in S190.

When it is determined in S190that the total number of hops and the hop number count value are not equal to each other, the switch proceeds to S200and increments the hop number count value acquired in S120by 1. In a next S210, the switch updates the hop number count value in the received configuration frame to a value incremented by 1, and outputs (that is, transmits) the configuration frame after the hop number count value has been updated from the port set as the mirror input port in S160. Thereafter, the switch ends the configuration process.

If it is determined in S190that the total number of hops is equal to the hop number count value, the switch ends the configuration process as it is.

Next, a transfer control process performed by each of the switches11to15for remote monitoring will be described with reference toFIG. 5.

After receiving the configuration frame and performing the processing of S120and subsequent steps in the configuration processing ofFIG. 4, the switch performs the transfer control process ofFIG. 5when receiving the frame from any of the ports P0to P7.

As shown inFIG. 5, in S310, the switch determines whether or not the switch is set to function as the mirror execution switch by the configuration process ofFIG. 4, and if it is determined that the switch is set to function as the mirror execution switch, the process proceeds to S320.

In S320, the switch performs a process of relaying the received frame as the normal frame. In other words, a normal relay process is performed on the received frame.

After the relay process has been performed in S320, the switch proceeds to S330, and determines whether or not the port mirroring is performed. Specifically, when the configuration in S150ofFIG. 4is the reception mirror and the frame is received from the monitor port set in S140ofFIG. 4, or when the configuration in S150ofFIG. 4is the transmission mirror and the received frame is transmitted from the monitor port set in S140ofFIG. 4, the port mirroring is determined to be performed.

When it is determined in S330that the port mirroring is not to be performed, the switch ends the transfer control process as it is, but when it is determined in S330that the port mirroring is to be performed, the switch proceeds to S340.

In S340, when the configuration in S150ofFIG. 4is the reception mirror, that is, when the reception mirror is implemented as the port mirroring, the switch creates a frame obtained by duplicating the received frame from the monitor port as the mirror frame.

When the configuration in S150ofFIG. 4is a transmission mirror, that is, when the transmission mirror is implemented as the port mirroring, the switch creates a frame obtained by duplicating the frame transmitted from the monitor port as a mirror frame. Since the frame transmitted from the monitor port is the same as the received frame when the transmission mirror is implemented, in S440, the frame obtained by duplicating the received frame may be created as the mirror frame even when the transmission mirror is executed.

In a next S350, the switch determines whether or not the mirror identifier unnecessity has been configured in S180ofFIG. 4. Then, if the mirror identifier unnecessity has not been configured, that is, if the switch is not the switch11, the switch proceeds to S360.

In S360, the switch adds the unique field shown inFIG. 3to the mirror frame created in S340. In addition, the switch records the mirror identifier in the added unique field. That is, the configuration identifier and the security key are not recorded in the unique field added to the mirror frame, but the mirror identifier is recorded. Then, in a next S370, the switch outputs (that is, transmits) the mirror frame to which the unique field including the mirror identifier is added from the mirror output port set in S140ofFIG. 4, and then ends the transfer control process.

For that reason, the mirror frame to which the unique field including the mirror identifier has been added is transferred from the mirror execution switch to another switch (that is, the mirror transfer switch) on the side where the connection order is close to the monitoring device30.

When it is determined in S350that the mirror identifier unnecessity has been configured in S180ofFIG. 4, the switch proceeds to S370without performing the processing of S360. Then, in S370in this case, the switch outputs the mirror frame to which the unique field is not added from the mirror output port set in S140ofFIG. 4, and then ends the transfer control process.

The switch that proceeds from S350to S370is the switch11that is the mirror execution switch. In other words, when the switch11is a mirror execution switch, the process proceeds from S350to S370, and the switch outputs a mirror frame to which a unique field is not added to the monitoring device30.

On the other hand, if the switch determines in S310that the switch is not configured to function as the mirror execution switch, the process advances to S380.

In S380, the switch determines whether or not the switch is configured to function as the mirror transfer switch by the configuration process ofFIG. 4, and if it is determined that the switch is configured to function as the mirror transfer switch, the process proceeds to S390.

In S390, the switch determines whether or not the frame has been received from the mirror input port set in S160ofFIG. 4, and if it is determined that the frame has been received from the mirror input port, the switch proceeds to S400.

In S400, the switch determines whether or not the mirror identifier is included in the received frame from the mirror input port. Specifically, the switch determines whether or not the unique field is inserted in the received frame and whether or not the mirror identifier is included in the unique field.

When it is determined in S400that the received frame includes the mirror identifier, the switch determines that the mirror frame has been received from the mirror input port, and proceeds to S410.

In S410, like S350, the switch determines whether or not the mirror identifier unnecessity has been configured in S180ofFIG. 4. If the mirror identifier unnecessity has been set, that is, if the switch is the switch11, the switch proceeds to S420.

In S420, the switch deletes the unique field from the reception mirror frame, and makes a form of the mirror frame equal to that of the normal frame. With the deletion of the unique field, the mirror identifier is also deleted. Then, in a next S430, the switch outputs (that is, transmits) the mirror frame from which the unique field has been deleted from the mirror output port configured in S140ofFIG. 4, and then ends the transfer control process.

For that reason, the mirror frame transferred from the other switch to the switch11is transferred to the monitoring device30after the unique field has been deleted by the switch11, that is, after the mirror frame has been returned to the normal frame.

When it is determined in S410that the mirror identifier unnecessity is not configured in S180ofFIG. 4, that is, when the switch is the mirror transfer switch but not the switch11, the switch proceeds to S430without performing the processing in S420. Then, in S430in this case, the switch outputs the mirror frame with the unique field added as it is from the mirror output port set in S140ofFIG. 4, and then ends the transfer control process.

For that reason, the mirror frame to which the unique field has been added is transferred from the mirror transfer switch which is not the switch11to another switch on the side where the connection order is close to the monitoring device30.

On the other hand, if the switch determines in S380that the switch is not configured to function as the mirror transfer switch, the process advances to S440. Then, in S440, similarly to S320, the switch performs the normal relay process on the received frame, and then ends the transfer control process.

When it is determined in S390that the frame has not been received from the mirror input port, or when it is determined in the above S400that the mirror identifier is not included in the received frame, the switch also proceeds to S440, and then ends the transfer control process.

The processing ofFIGS. 4 and 5may be performed by one or multiple hardware included in the switch. For example, the hardware that implements the processes ofFIGS. 4 and 5may be implemented by a digital circuit or an analog circuit, or a combination of the digital circuit with the analog circuit. In addition, the switch may include a microcomputer, and a part or all of the processing ofFIGS. 4 and 5may be performed by the microcomputer. In that case, a part or all of the functions of the switch are realized by the CPU of the microcomputer executing a program stored in a non-transitory tangible storage medium. In this example, the memory corresponds to a non-transitory tangible storage medium in which the program is stored. When the execution of the program, a method corresponding to the program is executed.

5. Operation Example

Next, an operation example in which the switches11to15perform the processing ofFIGS. 4 and 5will be described.

In the communication network1shown inFIG. 1, for example, an example in which the remote monitoring is executed by the reception mirror with the ECU23connected to the switch14as a target, that is, the frame transmitted from the ECU23is monitored by the monitoring device30will be described.

In this instance, the microcomputer10in the ECU20transmits the configuration frame illustrated inFIG. 3to the switch11. As described above, the microcomputer10sets the hop number count value in the configuration frame to 1.

The switch11receives the configuration frame from the microcomputer10, and performs the configuration process ofFIG. 4. In the configuration process ofFIG. 4, the switch11makes the determination of “YES” in S110and S117, Then, in S120, the switch11acquires, from the configuration information region of the configuration frame, the transfer destination port and the transfer source port recorded corresponding to the number of hops (that is, “the number of hops=1”) of the same number as the hop number count value in the configuration frame. For that reason, the switch11acquires the port P1as the transfer destination port and acquires the port P6as the transfer source port.

The switch11makes the determination of “NO” in S130, and configures the switch11to function as the mirror transfer switch in S160. Further, in S160, the switch11sets the port P6acquired as the transfer source port as the mirror input port, and sets the port P1acquired as the transfer destination port as the mirror output port.

In addition, the switch11makes the determination of “YES” in S170, and performs a configuration in which the mirror identifier is unnecessary in S180. Then, the switch11makes the determination of “NO” in S190, and outputs the configuration frame in which the hop number count value is incremented by 1 from the port P6set as the mirror input port by the processing of S200and S210. The configuration frame output from the port P6of the switch11, in which the hop number count value is updated to 2, is received by the switch12.

The switch12receives the configuration frame from the switch11, and performs the configuration process ofFIG. 4.

Similarly to the switch11, the switch12also performs the determination of “YES” in S110and S117in the configuration process ofFIG. 4. Then, in S120, the switch12also acquires, from the configuration information region of the configuration frame, the transfer destination port and the transfer source port recorded corresponding to the number of hops (that is, “the number of hops=2”) of the same number as the hop number count value in the configuration frame. For that reason, the switch12acquires the port P1as the transfer destination port and acquires the port P6as the transfer source port.

Similarly to the switch11, the switch12also makes the determination of “NO” in S130, and configures the switch12to function as the mirror transfer switch in S160. Further, in S160, the switch12configures the port P6acquired as the transfer source port as the mirror input port, and configures the port P1acquired as the transfer destination port as the mirror output port.

On the other hand, the switch12makes the determination of “NO” in S170. For that reason, the switch12does not configure the mirror identifier unnecessity.

Then, the switch12makes the determination of “NO” in S190, and outputs the configuration frame in which the hop number count value is incremented by 1 from the port P6configured as the mirror input port by the processing in S200and S210. The configuration frame output from the port P6of the switch12, in which the hop number count value is updated to 3, is received by the switch14.

The switch14receives the configuration frame from the switch12, and performs the configuration process ofFIG. 4.

Similarly to the switches11and12, the switch14also makes the determination of “YES” in S110and S117in the configuration process ofFIG. 4. Then, in S120, the switch14also acquires, from the configuration information region of the configuration frame, the transfer destination port and the transfer source port recorded in correspondence with the number of hops (that is, “the number of hops=3”) of the same number as the hop number count value in the configuration frame. For that reason, the switch14acquires the port P1as the transfer destination port and acquires the port P7as the transfer source port.

Meanwhile, in order to receive a configuration frame in which the hop number count value is equal to the total number of hops, the switch14makes the determination of “YES” in S130and configures the switch12to function as the mirror execution switch in S140. Further, in S140, the switch14configures the port P7acquired as the transfer source port as the monitor port, and configures the port P1acquired as the transfer destination port as the mirror output port. In the example ofFIG. 3, since the I/O information included in the configuration frame is “I”, the switch14performs the configuration of executing the reception mirror as the port mirroring in S150.

Similarly to the switch12, the switch14makes the determination of “NO” in S170. For that reason, the switch14does not configure the mirror identifier unnecessity.

In order to make the determination of “YES” in S190, the switch14terminates the configuration process ofFIG. 4without transferring the configuration frame to another switch.

Therefore, when the microcomputer10transmits the configuration frame exemplified inFIG. 3, the configuration frame propagates in the stated order of the switch11, the switch12, and the switch14as indicated by an arrow Y1of a dashed line inFIG. 1. The switches11,12, and14are configured as follows.

The switch14is set as the port mirroring and as the mirror execution switch that implements the reception mirror. The switch11and the switch12are set as mirror transfer switches.

In the switch14, the port P7to which the ECU23is connected is set as a monitor port, and the port P1to which the switch12is connected is set as the mirror output port.

In the switch12, the port P6to which the port P1of the switch14is connected is set as the mirror input port, and the port P1to which the switch11is connected is set as the mirror output port.

In the switch11, the port P6to which the port P1of the switch12is connected is set as the mirror input port, and the port P1to which the monitoring device30is connected is set as the mirror output port.

In other words, the mirror frame mirrored by the switch14is set to be transferred to the monitoring device30through the switch12and the switch11.

Among the switches11,12, and14, the switch11to which the monitoring device30is connected is configured so that the mirror identifier is unnecessary.

Next, it is assumed that the ECU23transmits a frame destined for the ECU24, for example, after configured as described above.

The frame transmitted by the ECU23is input to the ports P7of the switch14. Then, the switch14that has received the frame from the ECU23makes the determination of “yes” in S310ofFIG. 5, and transmits the frame (that is, the normal frame) from the ECU23from the port P5in S320ofFIG. 5, thereby transferring the frame to the ECU24. InFIG. 1, a solid arrow Y1indicates that the normal frame is relayed from the ECU23to the ECU24.

Since the switch14is configured to implement the reception mirror as the port mirroring and receives the frame from the port P7configured as the monitor port, the switch14makes the determination of “YES” in S330ofFIG. 5. In other words, the switch14determines the execution of the port mirroring.

Therefore, in S340ofFIG. 5, the switch14creates a frame obtained by duplicating the received frame from the port P7as the mirror frame. Then, the switch14makes the determination of “NO” in S350ofFIG. 5, and adds a unique field including the mirror identifier to the mirror frame in S360ofFIG. 5. Further, in S370ofFIG. 5, the switch14outputs the mirror frame to which the unique field is added from the port P1set as the mirror output port.

The mirror frame output from the port P1of the switch14is input to the port P6of the switch12.

The switch12that has received the mirror frame from the switch14makes the determination of “NO” in S310ofFIG. 3, and makes the determination of “YES” in S380ofFIG. 3. Further, the switch12determines “YES” in both S390and S400ofFIG. 5. That is, the switch12determines that the mirror frame has been received from the port P6set as the mirror input port.

The switch12outputs a mirror frame received from the switch14, that is, a mirror frame with the unique field added, from the port P1configured as the mirror output port in S430ofFIG. 5in order to make the determination of “NO” in S410ofFIG. 5.

The mirror frame output from the port P1of the switch12is input to the port P6of the switch11.

The switch11that has received the mirror frame from the switch12makes the determination of “NO” in S310ofFIG. 3, and makes the determination of “YES” in S380ofFIG. 3. Further, the switch11makes the determination of “YES” in both of S390and S400ofFIG. 5. In other words, similarly to the switch12, the switch11also determines that the mirror frame has been received from the port P6configured as the mirror input port.

The switch12makes the determination of “NO” in S410ofFIG. 5whereas the switch11makes the determination of “YES” in S410ofFIG. 5. For that reason, in S420ofFIG. 5, the switch11deletes the unique field from the reception mirror frame. Then, in S430ofFIG. 5, the switch11outputs the mirror frame from which the unique field is deleted, that is, the mirror frame in the same form as the normal frame, from the port P1configured as the mirror output port.

The mirror frame output from the port P1of the switch11is input to the monitoring device30. The monitoring device30monitors the mirror frame. InFIG. 1, a dotted arrow Y2indicates that the mirror frame is transferred from the switch14to the monitoring device30through the switch12and the switch11.

According to the switches11to15of the embodiment described in detail above, the following advantages are obtained.

(a) Since the switches11to15perform the configuration process ofFIG. 4, when a configuration frame is input to any port of the switch11to which the monitoring device30is connected, the configuration frame is propagated to the switch serving as the mirror execution switch, and the configuration of the above items (1) to (4) is completed. Therefore, configuration related to remote monitoring becomes easy. Note that S110corresponds to the processing as the configuration determination unit. S130and S190correspond to the processing as the comparison unit. S160corresponds to the processing as the first configuration unit. Steps S200and S210correspond to processing as the configuration transfer unit. S140corresponds to processing as the second configuration unit.

(b) Since the switches11to15perform the transfer control process shown inFIG. 5, remote monitoring based on the configuration content can be performed according to the configuration process shown inFIG. 4. Note that S330to S370correspond to the processing as the mirror execution unit. Steps S390and S400correspond to the processing as the reception determination unit. Steps S410to S430correspond to the processing as the mirror transfer unit.

(c) When the switch functions as the mirror execution switch, the switch adds the unique field to the mirror frame and records the mirror identifier in the unique field in S360ofFIG. 5. When the switch functions as the mirror transfer switch, the switch determines whether or not the mirror frame has been received based on whether or not the mirror identifier is included in the received frame in S400ofFIG. 5. If the hop number count value in the received configuration frame is 1, the switch deletes the unique field from the reception mirror frame in S420ofFIG. 5when the switch functions as the mirror transfer switch. Then, the switch that has performed the processing of S420outputs the mirror frame from which the unique field has been deleted, from the port configured as the mirror output port.

Therefore, the switch functioning as the mirror transfer switch can easily determine whether or not the received frame is the mirror frame based on the mirror identifier, and can transfer the mirror frame of the same format as that of the normal frame to the monitoring device30.

(d) The unique field to be added is a field provided between the source MAC address and the type field in the Ethernet frame. For that reason, the mirror identifier can be included in the mirror frame without affecting the Ethernet protocol.

(e) The configuration frame includes the configuration identifier. Then, in S110ofFIG. 4, the switch determines whether or not the configuration frame has been received based on whether or not the configuration identifier is included in the received frame. For that reason, the switch can easily determine whether or not the frame is a configuration frame.

(f) In the configuration frame, the configuration identifier is placed in the field added between the source MAC address and the type field (that is, the unique field). For that reason, the configuration identifier can be included in the configuration frame without affecting the Ethernet protocol.

The configuration frame includes the security key for authentication. Then, in the configuration processing ofFIG. 4, when it is determined that the configuration frame has been received, the switch performs the authentication process using the security key in the authentication frame in S115, and when it is determined that the authentication is not successful by the authentication process in S117, the switch discards the configuration frame in S119. For that reason, the configuration related to the remote monitoring can be prevented from being performed by the configuration frame from an unauthorized device. Note that S115to S119correspond to processing as the authentication unit.

7. Other Embodiments

Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the embodiments described above, and various modifications can be made to implement the present disclosure.

For example, the communication protocol may be other than Ethernet. If only one of the reception mirror and the transmission mirror is implemented, I/O information may not be included in the configuration frame.

In addition, a plurality of functions including one component in the above embodiment may be realized by a plurality of components, or a function of one component may be realized by a plurality of components. In addition, a plurality of functions including a plurality of components may be realized by one component, or a function realized by a plurality of components may be realized by one component. In addition, a part of the configuration of the above embodiment may be omitted. In addition to the switches described above, the present disclosure can be realized in various forms such as a system including the switch as a component, a program for causing a computer to function as the switch, a non-transitory tangible recording medium such as a semiconductor memory in which the program is recorded, and a setting method of remote monitoring.

The electronic control device as controllers and methods described in the present disclosure may be implemented by a special purpose computer created by configuring a memory and a processor programmed to execute one or more particular functions embodied in computer programs. Alternatively, the electronic control device as controllers and methods described in the present disclosure may be implemented by a special purpose computer created by configuring a processor provided by one or more special purpose hardware logic circuits. Alternatively, the electronic control device as controllers and methods described in the present disclosure may be implemented by one or more special purpose computers created by configuring a combination of a memory and a processor programmed to execute one or more particular functions and a processor provided by one or more hardware logic circuits. The computer programs may be stored, as instructions being executed by a computer, in a tangible non-transitory computer-readable medium.