Hi Aleksandar, In order to generate random errors first you have to create the error model in your script and then attach it to the link or node where you want the packets to be dropped. For creating a random uniformly distributed errors you can type:
#Create the error model set em [new ErrorModel] $em unit pkt $em set rate_ 0.03 ;# PER = 3% $em ranvar [new RandomVariable/Uniform] $em drop-target [new Agent/Null] The way you attach error models to the links is different for wired and wireless scenarios. If you are working with wired scenarios you have different places where you can insert the error model, you can check page 127 of the ns2 manual, I use: #attach the model to the link $ns link-lossmodel $em $n0 $n1 If you are working with wireless scenarios you can attach the error model by adding one option in node-config: $ns_ node-config -incomingErrProc $em or $ns_ node-config -outgoingErrProc $em You can find detailed information of the differences between using the first or the second option also in page 127 of the ns2 manual. I must say that I couldn't use the error models in wireless scenarios. There is some problem with the -incomingErrProc and -outgoingErrProc options, they don't insert the error model in the simulation. In other words, the error model is created but it is never used so no packets are dropped. I have this problem when I use 802.11 it may appear in all kind of wireless scenarios. I asked to this list but I got no answer. Currently I am working in error models of wireless, so if you are also working in wireless I can send you more information on the topic. Regards, Guillermo Hi all, I need to setup link between two nodes where I have RANDOM ERRORS with PER (packet error rate) = 10exp-7, 10exp-6,10exp-5.... etc. So, I need to setup Error generator in ns2. Can somebody tell me how to do this? Thanks. A.