代做 UDP and TCP sockets

- 首页 >> Algorithm 算法

Introduction
The goal of this programming project is to familiarize you with the low-level operations of the Internet protocol stack as well as reliable data transfer. So far, you have written simple client-server applications in which the server and client implemented some basic functionalities. You have worked with both UDP and TCP sockets. However, in all of the above scenarios, the operating system's networking stack hides all the underlying complexity of constructing and managing IP and TCP headers. Moreover, when writing a TCP socket programming application, you did not care how the reliability is implemented for TCP (although you were familiar with the reliable data transfer mechanisms such as sequence numbers, acknowledgement numbers, checksum, and retransmissions). This programming project has two phases as follows:
Phase 1: UDP Implementation using RAW Socket
Your task is to write a client program called rawUDPClient that takes a file name as input. Then, the client program sends the filename to a UDP web server to request its download. The web server program is called rawUDPServer. Your client and server programs must use SOCK_RAW/IPPROTO_RAW sockets, that is, youare responsible for building the IP and UDP headers in each packet.
Phase 2: Reliable Data Transfer for the UDP Implementation in Phase 1
You may have noticed that in Phase 1, we did not focus on the reliability of file transfer. As you know, UDP does not provide reliable data transfer and you cannot guarantee that the received file is the same as the sent file. This means that the file may have been modified in transit (e.g., some bits may be corrupted, some chunks may be lost, etc.). Therefore, the goal of this phase is to provide reliability for the protocol you

implemented in Phase 1. A text file of any size must be transferred with reliability. You need to implement the following error control mechanisms:
- Checksum
- Sequence Numbers
- Acknowledgement numbers
- Retransmission due to timeout
Implementation and Test Requirements
● You need to implement your programs using Python programming language.
● The file created by your program should be the same as the original file on the web server. You can test whether your file and the original are identical by comparing the file that your client program receives and the original one
using md5sum.
● You should run and test your programs in Mininet and emulate the packet loss
and delay (as you will learn in class).
● Additionally, please be aware that using raw sockets requires administrative
privileges and comes with potential security risks, so use them with caution. This is due to the fact that the security model in OS is usually centered around having hardware and network controlled by the network administrators and then having unprivileged users separate from these administrators on the network. Allowing unprivileged users to use raw sockets would break these security assumptions, since with raw sockets anything could be done in the network, like using privileged ports, spoofing IP addresses etc. For more information, please refer to [1].
● You can use online resources as a reference, but they must be referenced/cited in your Readme file. Do not just copy and paste code from these resources.
● You should not use ChapGPT to write the code for your project. However, you are allowed to use ChapGPT to debug the errors in your code and solve the

issues if you could not solve them as a team after discussion. If you use ChapGPT, you need to explain in your Readme the problems/issues that were solved with it and how they were solved. Include the lessons you learned from ChatGPT as your new code review buddy.
Submission Requirements
1. No late submissions allowed.
2. This is a group assignment. All code must be written by the group members only.
I encourage you to discuss and share ideas with your classmates but remember
to write your own code!
3. OnegroupmembershouldsubmitthedeliverablesonCanvasonbehalfofother
members.
Deliverables and Milestones:
1. Phase 1 should be completed by the week of Nov 6th. You will need to demo your phase 1 to TA during office hours on Nov 8th. This includes running the code, and showing the project logs, readme, and meeting notes.
2. Phase2shouldbecompletedbyDec3rd.
3. Final demo of the project in class (Dec 4th)
● Demo involves presenting your application programs to the instructor, TA, and other students as well as answering questions about your project.
● Note: part of your grade will come from the peer evaluation.
4. Final submission on Canvas: (Dec 4th, 11:59 PM)
● Project documentation (a zip file) that includes the following:
- Readme: Include a Readme file that describes how to run your application, how your application works and if there are any errors or use cases that have limitations or if it doesn't meet any of the requirements. This is also the spot where you want to document any features that you may or may not have implemented. Moreover,

it should summarize the design and key functionalities of your application programs and any features that you have implemented, lessons learned, possible future improvements, etc. This will help me keep an eye out for them as I grade your work.
- Meeting notes: You need to document your meetings (date/time/agenda/conclusions) and put them as a part of the project documentation to ensure every team member has participated. A minimum of two meetings (online/in-person) per week is required among the group members to discuss the project in addition to the time you may spend together working on the code, etc.
- Your project management tool / project log book (such as Trello, Teamwork) to keep record of the tasks and your progress. You must include the weekly tasks assigned to members and which feature(s) has been developed by each member of your team.
- Alternatively, you can use a separate Google Doc for each of the above.
● All of the source files.
NOTE: Phase 1 is worth 10% of your final grade for the project. 30% penalty will be applied if Phase 1 is not completed by Nov 8th.