A relay apparatus for relaying a packet to another apparatus belonging to a predetermined virtual network, the relay apparatus comprising a plurality of reception ports (11a, 11b, 11c), each for receiving a packet from an apparatus of the virtual network and a plurality of queues (151-0, 152-0,..., 151-1, 152-1,...), wherein: each of the plurality of queues is provided in association with a combination of a priority indicative of an order of precedence for packet relaying and at least one VLAN number for identifying a virtual network, at least one of the queues is provided in association with a combination of a priority indicative of an order of precedence for packet relaying and a plurality of VLAN numbers for identifying a plurality of virtual networks, and the relay apparatus comprises: a queue-number storage unit adapted to store, for each priority in association with at least one VLAN number, a queue number for identifying each of the plurality of queues; an accumulated-amount storage unit adapted to store, for each priority, a total packet accumulated amount indicative of a sum of all packets accumulated in each of the plurality of queues associated with the priority; a threshold storage unit adapted to store a threshold of the total packet accumulated amount in association with each queue number; a storage-destination-queue determining unit adapted to determine, when one of the plurality of reception ports (11a, 11b, 11c) receives a packet, the queue in which the packet is to be stored, the queue being indicated by a corresponding queue number, stored in the queue-number storage unit, associated with a VLAN number and the priority set for the packet; and a congestion controlling unit adapted to obtain the total packet accumulated amount and the threshold in association with the corresponding queue number respectively from the accumulated-amount storage unit and the threshold storage unit, to compare the obtained total packet accumulated amount with the threshold, and to determine whether to discard or store the received packet based on the comparison result. each of the plurality of queues is provided in association with a combination of a priority indicative of an order of precedence for packet relaying and at least one VLAN number for identifying a virtual network, at least one of the queues is provided in association with a combination of a priority indicative of an order of precedence for packet relaying and a plurality of VLAN numbers for identifying a plurality of virtual networks, and the relay apparatus comprises: a queue-number storage unit adapted to store, for each priority in association with at least one VLAN number, a queue number for identifying each of the plurality of queues; an accumulated-amount storage unit adapted to store, for each priority, a total packet accumulated amount indicative of a sum of all packets accumulated in each of the plurality of queues associated with the priority; a threshold storage unit adapted to store a threshold of the total packet accumulated amount in association with each queue number; a storage-destination-queue determining unit adapted to determine, when one of the plurality of reception ports (11a, 11b, 11c) receives a packet, the queue in which the packet is to be stored, the queue being indicated by a corresponding queue number, stored in the queue-number storage unit, associated with a VLAN number and the priority set for the packet; and a congestion controlling unit adapted to obtain the total packet accumulated amount and the threshold in association with the corresponding queue number respectively from the accumulated-amount storage unit and the threshold storage unit, to compare the obtained total packet accumulated amount with the threshold, and to determine whether to discard or store the received packet based on the comparison result. a queue-number storage unit adapted to store, for each priority in association with at least one VLAN number, a queue number for identifying each of the plurality of queues; an accumulated-amount storage unit adapted to store, for each priority, a total packet accumulated amount indicative of a sum of all packets accumulated in each of the plurality of queues associated with the priority; a threshold storage unit adapted to store a threshold of the total packet accumulated amount in association with each queue number; a storage-destination-queue determining unit adapted to determine, when one of the plurality of reception ports (11a, 11b, 11c) receives a packet, the queue in which the packet is to be stored, the queue being indicated by a corresponding queue number, stored in the queue-number storage unit, associated with a VLAN number and the priority set for the packet; and a congestion controlling unit adapted to obtain the total packet accumulated amount and the threshold in association with the corresponding queue number respectively from the accumulated-amount storage unit and the threshold storage unit, to compare the obtained total packet accumulated amount with the threshold, and to determine whether to discard or store the received packet based on the comparison result.