diff --git a/README.md b/README.md index fc53d75dcb3285de1545563ac3d7aedfba859a8e..1e1c48143be5631ba073f243d0da3984a31ac311 100644 --- a/README.md +++ b/README.md @@ -5,28 +5,25 @@ Implementation in **udp.py** ## What's been completed: **Task 1** – Implemented a function that receives and decodes the welcome message from the UDP server. Data is picked out from the received packet and displayed in a specified format. Pieces of data is picked out using python slicing. Data such as: source port, destination port, data length, checksum, and payload. - + **Task 2** – Implemented a function that calculates the checksum for a UDP packet. The checksum is required to check if a packet is valid. This function starts by constructing a UDP packet to process and pre-processes the data if the length of the packet is uneven. It then loops through every two bytes in the packet and adds them together, which is then added onto the checksum for each loop iteration. Once all the bytes in the packet is processed, the checksum is bit shifted to the right by 16 and the one’s compliment of the checksum is calculated. The checksum is then returned for packet validation. - + **Task 3** – Implemented an infinite loop, which sends and a UDP packet with a payload of ‘1111’ and receives and the time back from the server. There’s a one second delay in each loop so a packet is sent/received every one second. The received packet is decoded and displayed. - - +  ## How to run code: Make sure the python environment is activated (Example command: “source /home/ryan5.morgan/projects/iot_env/bin/activate”). Then just run the python file “udp.py” and it should work on its own (Example command: “python -u "/home/ryan5.morgan/projects/worksheet3/udp.py"”) - + I did not have to make unit tests for my implementation for worksheet 3. This is because the server essentially already tests the implementation. For each loop, the server would send back the correct packet, and send the wrong packet in the loop after. - - - +  ### Functions in udp.py: #### udp()