A relay device that is one of a plurality of relay devices in a communication system, the relay device comprising:
- a plurality of ports that include a common port and two ring ports,
- the common port being connected with a terminal,
- each of the two ring ports being connected with one of a plurality of communication lines to connect the plurality of relay devices to each other via the plurality of the communication lines to form a ring-shaped network as a first network;
- a bus interface connected with a communication bus as a second network to connect the plurality of relay devices to each other;
- an abnormality detection module configured to detect a communication line abnormality state that is a state where an abnormal communication line is detected among the plurality of communication lines included in the ring-shaped network;
- a redundant transmission module configured to transmit a first relay target frame in response to that the first relay target frame is received via the common port included in the relay device under the communication line abnormality state,
- the first relay target frame whose destination is a different terminal connected to a different relay device that is different one of the plurality of relay devices via a different common port included in the different relay device,
- the first relay target frame being transmitted via both of the ring-shaped network and the communication bus,
- the ring-shaped network using either (i) both of the two ring ports included in the relay device or (ii) one of the two ring ports included in the relay device via which the first relay target frame is enabled to be transmitted up to the different relay device without passing through the abnormal communication line under the communication line abnormality state;
- and
- an abnormal-time transfer module configured to
- receive via the communication bus a second relay target frame whose destination is the terminal connected via the common port included in the relay device on condition that, under the communication line abnormality state, a subject frame that is a frame whose destination is the terminal connected via the common port included in the relay device has been received via one of the two ring ports included in the relay device,
- execute, upon receiving the second relay target frame, a match determination whether to be affirmative or not affirmative, the match determination being affirmative in response to that the subject frame received via the one of the two ring ports matches the second relay target frame received via the communication bus,
- transmit the subject frame received via the one of the two ring ports to the terminal connected via the common port in response to the match determination being affirmative, and
- discard the subject frame received via the one of the two ring ports and the second relay target frame received via the communication bus without transmitting the subject frame and the second relay target frame via the common port in response to the match determination being not affirmative.