tcpexmachina / remy

403 stars 78 forks source link

Added in stochastic loss parameter and object, with new stochastic lo… #46

Closed deeptir18 closed 7 years ago

deeptir18 commented 8 years ago

-Added a new object that simulates stochastic packet loss, dropping packets randomly in the receiver (just has a bernoulli distribution) -Added an input parameter to set the rate at which packets are dropped (the probability of the bernoulli distribution) -Added another input parameter to add a delay penalty in the utility calculation, when a packet loss is seen, of the form:

I had to change a couple of object constructors to make this work, and I modified:

keithw commented 8 years ago

Hi Deepti,

  1. I pushed a fix to the Travis issue to the master branch. Please rebase your commit on top of the latest master. (You can then force-push to loss_pullrequest3 and it will amend this pull request. I think Travis will rerun the tests.)
  2. Please don't change the numbers for any existing field in the protobuf files! That will make the existing protobuf files unreadable by the new code. We have to keep the existing field numbers the same for eternity.
  3. This commit makes StochasticLoss an object that implements a drop_packets() method that cycles through a vector of packets and returns a subset of them. Then the commit makes StochasticLoss a member of SenderGang and applies the loss after the packets are received by the receiver.

I don't think I follow the logic here -- why does the SenderGang have to have knowledge about the loss rate (and location of the loss) in the network? I think StochasticLoss should be a network element just like Delay (https://github.com/tcpexmachina/remy/blob/master/src/delay.hh) or Link (https://github.com/tcpexmachina/remy/blob/master/src/link.hh). It should be a member of the Network (https://github.com/tcpexmachina/remy/blob/master/src/network.hh), receive packets, and then pass (some of) them on to the next network element via a tick method, called in Network::tick() (https://github.com/tcpexmachina/remy/blob/master/src/network.cc#L36) with the other network elements.

That way we can put it anywhere in the network we want (e.g. before or after the bottleneck queue) and the sender doesn't know if it's there or not.