A network element for a packet-switched network comprising: a plurality of network ports (31, 32) for exchanging synchronization messages with further network elements, a local clock (41, 141), a timestamp generation module associated to each network port for triggering generation of a timestamp by the local clock at the time of sending or receiving a synchronization message through the network port, and a synchronization control module (43, 143) selectively configurable in a first operating mode and a second operating mode wherein the synchronization control module configured in the first operating mode is adapted to select a first network port as a slave port and a second network port as a master port, adjust an offset of the local clock as a function of the timestamps of the synchronization messages received through the slave port, and send synchronization messages including timestamps obtained with the adjusted local clock through the master port; and wherein the synchronization control module configured in the second operating mode is adapted to forward a synchronization message received through the first network port to the second network port, send the synchronization message through the second network port, and compute a residence time of the synchronization message in the network element as a function of the timestamps obtained at the times of receiving and sending the synchronization message, characterized in that the synchronization control module (43, 143) is selectively configurable in the first operating mode and the second operating mode as a function of a configuration signal, wherein the network element further comprises a detection module for detecting the configuration signal as a signaling object within a synchronization message and wherein the synchronization control module (43, 143) processes a synchronization message in accordance with the first operating mode or the second operating mode as a function of the signaling object included in the synchronization message. a plurality of network ports (31, 32) for exchanging synchronization messages with further network elements, a local clock (41, 141), a timestamp generation module associated to each network port for triggering generation of a timestamp by the local clock at the time of sending or receiving a synchronization message through the network port, and a synchronization control module (43, 143) selectively configurable in a first operating mode and a second operating mode wherein the synchronization control module configured in the first operating mode is adapted to select a first network port as a slave port and a second network port as a master port, adjust an offset of the local clock as a function of the timestamps of the synchronization messages received through the slave port, and send synchronization messages including timestamps obtained with the adjusted local clock through the master port; and wherein the synchronization control module configured in the second operating mode is adapted to forward a synchronization message received through the first network port to the second network port, send the synchronization message through the second network port, and compute a residence time of the synchronization message in the network element as a function of the timestamps obtained at the times of receiving and sending the synchronization message, characterized in that the synchronization control module (43, 143) is selectively configurable in the first operating mode and the second operating mode as a function of a configuration signal, wherein the network element further comprises a detection module for detecting the configuration signal as a signaling object within a synchronization message and wherein the synchronization control module (43, 143) processes a synchronization message in accordance with the first operating mode or the second operating mode as a function of the signaling object included in the synchronization message.