Localization is an important application in wireless sensor network for mobile computing. Range-based and range-free localization technologies are discussed in this paper. As one of most famous range-free location technologies, DV-Hop algorithm is introduced in detail and is simulated in AlgoSenSim. The simulation results show the influence of distribution of sensor nodes on network connectivity in DV-Hop localization. Moreover, mean error, standard deviation and median error generated by DV-Hop localization are compared respectively in the simulation experiment. It suggests that reduce the localization errors by optimizing the layout and the number of beacon nodes in network, and is simulated in AlgoSenSim.