代写COMP 4911 Winter 2024 - Assignment 4

- 首页 >> Python编程

COMP 4911 Winter 2024 - Assignment 4


Introduction


For this assignment you will extend the stop-and-wait “ RDT” protocol to implement a pipelined “Go-Back-N” protocol as described in chapter 3. You should use Python 3, and your Mininet environment is well-suited as a test platform. The files below are available on Moodle:


rdt.py


Some useful functions: rdt_send(), rdt_recv(), make_data_pkt(), etc.


rdt-send.py


Sample sender code


rdt-recv.py


Sample receiver code


You can modify any of the files, and you must document all changes that you make. You are also free to start from scratch, use a completely different approach, etc.


Start by becoming familiar with and running the sample code RDT code. You will need to implement a window mechanism with an appropriate range of sequence numbers. You can decide how large you want the window to be. Define variables (e.g. nextseqnum, expectedseqnum, etc.) so that your sender and receiver can maintain any required state information. You will need a timeout mechanism. There are several ways to do this. Use Google and find some examples to work from. The sample code uses the built-in socket timeout mechanism. Consider the Timer object from the standard Python threading library.


You should use a simple Mininet network (“sudo -E mn” will give you a network with hosts h1 and h2) as your development and test environment. You can also test your program on real computers.


You must document your code well. Use lots of comments and provide any additional documentation that you think will be helpful to explain how your code works. Take note of the grading scheme below. Some advice: document your code in such a way that your peers could read and understand your code – i.e. write comments in a way that you would find useful if you were reading someone else’s code.


You must demonstrate that your protocol operates correctly when packets are lost or corrupted. You can use Mininet to simulate adverse network conditions. Specifically, Mininet interfaces can be configured to add delay and drop packets. An example command line would be “sudo -E mn --link tc,loss=5”, which will drop 5% of packets on every interface. See the example in the Mininet walkthrough and the Mininet API documentation for details.


Make sure your code outputs information that shows the operation of your GBN protocol.


Grading


Code


50%


Code comments and other documentation


25%


Documented test cases that demonstrate correct protocol operation


25%


If you use code that you find on the Internet, indicate that you have done so by citing it appropriately. Obviously, you cannot use someone else’s completed GBN protocol that you find on Github. I have looked at dozens of them, so it will be obvious to me if you do so.


站长地图