-
Notifications
You must be signed in to change notification settings - Fork 6
Creating an unreliable switch
In so far, as you have been using playground, you have been working in a sterile environment without any errors. This means, that all the packets that your POOP layer sends using the playground wire protocol are being received correctly on the opposite side without errors. However, from now on you will start testing your implementations in a situation where the playground wire protocol will provide no guarantee whether packets are being delivered reliably, and your POOP layer will have to ensure that packets are being sent reliably.
Note: Moving forward, it is essential you are using the updated Playground environment as recent changes to it make it such that it is not backwards compatible. Please ensure that you are running the latest version of Playground.
You can setup a switch that has some errors by creating an "unreliable_switch" in your playground networking.
pnetworking add bad_sw1 unreliable_switch local 8888
pnetworking enable bad_sw1
pnetworking disable p_eth0
pnetworking config eth0 connect bad_sw1
pnetworking enable p_eth0
pnetworking query bad_sw1 get-error-rate
By using the query utility you can see the error rate that has been set. The default error rate is 1 in 10Kb ie. 1 in every 102400
You may wish to test with a higher error rate and can set a new error rate by doing the following:
pnetworking query bad_sw1 set-error-rate 2 102400
You can use raw_echotest to test your implementation of POOP. As discussed in class with the default rate that is set in an unreliable switch is 1 in 102400. You can run your raw_echotest like follows
python raw_echotest server --stack poop
python raw_echotest localhost --count 102400 --stack poop
This will test your implementation by sending an echo packet using the POOP layer and close the client once the echo message has been received. If your implementation is handling errors correctly then there should be no errors.
Keep in mind that this is a utility to check your implementation.