Principle and application of NS2 network simulator