In addition, monitoring duration can also be controlled, i.e., the monitoring can be ended automatically after a preset period of time, or ended by operator. [0023] The method of the invention can be used in network devices, such as routers, bridges or switches.