Watermarking for attack detection in networked control systems: comparison between a linear and a nonlinear approach