Hi,
I guess you may look at chapters 11-12 the following book from Springer: T. Issaraiyakul and E. Hossain, "Introduction to Network Simulator NS2", Springer 2008. Here is the link: http://www.springer.com/engineering/signals/book/978-0-387-71759-3 You might also find the following slide useful: http://www.ece.ubc.ca/~teerawat/NS2.htm<http://www.ece.ubc.ca/%7Eteerawat/NS2.htm> Here is the details: (1) how to apply the errmodel to the incoming link with a random loss probability whose value is r; NS2 provides several built-in error model. If you are looking at a random (non-correlated) loss, you may look at class ErrorModel in file ~ns/queue/errmodel.cc,h (Chapter 12). Here you can simply specify a error probability and insert the error module into NS2. You will need to know the basic of NS2 to configure and insert such the error model. (2) how to implement the arrival process from the source is the Poisson with rate ¦Ë; One of the easiest ways to generate a Poisson traffic is to create arrivals whose inter-arrival time is exponentially distributed. NS2 provides built-in module to create exponentially distributed samples. You may look at class ExponentialRandomVariable in file ~ns/tools/ranvar.h,cc (chapter 12) for this purpose. Alternatively, you may see class Application/Traffic/Exponential in file ~ns/tools/expoo.cc for example implementation. (3) how to add FEC to the model I am a NS-begniner ,can anyone give some help ,thank you very much ! Well, FEC can be integrated into a random error. If you codes can correct at most n out of k bits. Then you can find a probability of having more than n bit error in a packet, and use that as an error probability. BTW, NS2 does have FEC module. You may refer to Chapter 12 on that regard. Best, Teerawat hello,all now,I am modelling random losses in the incoming link (uplink) and congestion losses at node, I consider an M/M/1 queue with a finite buffer of size K,and I assume that losses can caused either by a buffer overflow or randomly with probability r in the incoming link .The arrival process from the source is assumed to be Poisson with rate ¦Ë and the service times of packets is exponentially distributed with rate ¦Ì.My scene for the model is as follows: I use three mobile nodes,node(0),node(1) and node(2). node(1) forwards the packets from node(0) to node(2).and now I have two problems: (1) how to apply the errmodel to the incoming link with a random loss probability whose value is r; (2) how to implement the arrival process from the source is the Poisson with rate ¦Ë; (3) how to add FEC to the model I am a NS-begniner ,can anyone give some help ,thank you very much !