The switch performs priority mapping based on the priority of packets or priority of an interface. Then the switch determines the queues and output priorities of the received packets based on packet priorities or the priority of the interface. By doing this, the switch provides differentiated services.