The present invention relates to an arrangement and a method for protection switching. According to the invention the arrangement includes at least one primary and at least one secondary egress switch port, a routing table and a selection table. The method includes: Checking which group identity an ingress flow identity of a data flow is associated with. Checking if a primary or a secondary egress switch port routing address is to be used for said group identity. Switching the data flow to the egress switch port corresponding to the egress switch port routing address that is to be used.