Thanks to P4, NS4 can define the bahavior of your network element just by inputting a P4 file. When simulatiing there is no need to learn the network simulator libraries and implement device behavior using network simulator's library any more.
Internal modules of traditional network simulators can hardly be ported to real-world networks. But this is no more a problem by introducing P4 to simulation. The P4 in simulation means the P4 in production.
Want a protocol-independent device?
Want to simulate a online configuration of P4 target?
Want to measure the performance of P4 devices?
You need NS4.