Method for assigning a location-based network address to a network device (299,399) in a network comprising a plurality of network devices (299,399) forming a daisy chain, said network devices comprising means for exchanging communication data with an application, first connection means arranged for connecting in a first position a first terminal pair with said means for exchanging communication data, second connection means arranged for connecting in a first position a second terminal pair with said means for exchanging communication data and an electrical circuit providing a connection with at least said first or said second connection means so that a connection can be established between said electrical circuit and at least one port of said first or second terminal pair when said first or second connection means is in a second position, characterized in that said first and second connection means further arranged for being switched to interconnect in a bypass mode while having said electrical circuit in parallel in case of a malfunctioning network device, the method comprising the steps of - generating in a switching device a stimulus signal to a network comprising a plurality of network devices - detecting in said switching device, based on a response signal to said stimulus signal received from said network, a change in topology of said network comprising a plurality of network devices by a change in the number of observed electrical circuits, - sending a command instructing at least one network device of said plurality having no location-based network address to open said second connection means, - receiving a request for assigning a network address from a network device of the at least one network device having no location-based network address yet, - measuring an electrical quantity of said response signal to determine the number of malfunctioning network devices in said daisy chain between said switching device and said network device from which said request was received, - assigning with said switching device a location-based network address to said network device from which said request was received, taking into account the number of said malfunctioning network devices. - generating in a switching device a stimulus signal to a network comprising a plurality of network devices - detecting in said switching device, based on a response signal to said stimulus signal received from said network, a change in topology of said network comprising a plurality of network devices by a change in the number of observed electrical circuits, - sending a command instructing at least one network device of said plurality having no location-based network address to open said second connection means, - receiving a request for assigning a network address from a network device of the at least one network device having no location-based network address yet, - measuring an electrical quantity of said response signal to determine the number of malfunctioning network devices in said daisy chain between said switching device and said network device from which said request was received, - assigning with said switching device a location-based network address to said network device from which said request was received, taking into account the number of said malfunctioning network devices.