Wireless ad-hoc network is a temporary network set up by wireless nodes usually moving randomly and communicating without a network infrastructure. Due to the massive existing vulnerabilities in mobile ad-hoc networks, they may be insecure against attacks by the malicious nodes. One of these attacks is the black hole attack against network integrity absorbing all data packets in the network. Since the data packets do not reach the destination node on account of this attack, data loss will occur. In this paper, the effect of black hole and gray hole attack on DSR protocol has been considered. Simulation has been performed on the basis of performance parameters and effect has been analyzed using NS2 simulator.