In the current scenario Cognitive Radio (CR) is the best available solution to overcome spectrum shortage problem. Cognitive Radio Ad Hoc Networks (CRAHNs) is the use of CR technology in the wireless ad-hoc network scenario. The field of CRAHNs is still in this nascent stage therefore not much work has been done related to security issues associated with these types of networks. In order to provide secure data transmission over these networks it is mandatory to make these networks robust and less vulnerable against the various types of attacks. Through this report we have presented an implementation and simulation study of Network Layer Attacks primarily Black Hole Attack and Gray Hole Attack in detail with their impacts on the various network parameters. The Black Hole Attack is a type of Denial of Service(DoS) attack where the node that has turned malicious advertises itself as the most optimal path to reach the destination, thus drawing all the traffic towards itself and later either it drops all the received packets or prevent them from reaching their destinations. The Gray Hole Attack is a variation of black hole attack in which selective forwarding principles are used to selectively drop some data and to forward the rest. In this Project using NS2 with the CRAHN extension as the simulator, effect of these attacks on the various network parameters of CRAHNs have been recorded and compared to present an oversight of how performance is affected whenever the network gets injected with these attacks