{"id":24703414,"url":"https://github.com/youssef-saaed/udpfiletransferproject","last_synced_at":"2025-03-22T04:43:01.658Z","repository":{"id":242264668,"uuid":"796051315","full_name":"youssef-saaed/UDPFileTransferProject","owner":"youssef-saaed","description":"This project implements a file transfer protocol built on UDP with Reliable Data Transfer (RDT) 3.0 and Go-Back-N pipelining. For security, HMAC algorithm is used.","archived":false,"fork":false,"pushed_at":"2024-06-01T17:14:41.000Z","size":976,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T05:55:02.127Z","etag":null,"topics":["file-tr","go-ba","network","rdt-3","socket-programming","udp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youssef-saaed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-04T19:38:53.000Z","updated_at":"2024-06-01T17:14:22.000Z","dependencies_parsed_at":"2024-06-01T20:37:08.842Z","dependency_job_id":"37952c31-7cc6-4903-883d-79397d954d45","html_url":"https://github.com/youssef-saaed/UDPFileTransferProject","commit_stats":null,"previous_names":["youssef-saaed/udpfiletransferproject"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssef-saaed%2FUDPFileTransferProject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssef-saaed%2FUDPFileTransferProject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssef-saaed%2FUDPFileTransferProject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssef-saaed%2FUDPFileTransferProject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youssef-saaed","download_url":"https://codeload.github.com/youssef-saaed/UDPFileTransferProject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907379,"owners_count":20529851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-tr","go-ba","network","rdt-3","socket-programming","udp"],"created_at":"2025-01-27T05:55:14.243Z","updated_at":"2025-03-22T04:43:01.640Z","avatar_url":"https://github.com/youssef-saaed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Network Project: File Transfer Protocol\n\nThis project implements a file transfer protocol built on UDP with Reliable Data Transfer (RDT) 3.0 and Go-Back-N pipelining. For security, HMAC algorithm is used.\n\n## Project Structure\n\nThe project consists of three Python files:\n\n1. `FileTransfer.py`: This script is responsible for sending files.\n2. `Receiver.py`: This script is responsible for receiving files.\n3. `Helpers.py`: This script contains helper functions used by the sender and receiver scripts.\n\n## FileTransfer.py\n\nThis script contains the `FileTransfer` class which is responsible for sending files. The class has the following methods:\n\n- `__init__(self, hostname, port, window_size, timeout, secret_key)`: Initializes the `FileTransfer` object with the given hostname, port, window size, timeout, and secret key.\n- `SendFile(self, filepath)`: Sends the file located at `filepath`. It uses a sliding window protocol with a window size specified during the object's initialization. If a packet is not acknowledged within the specified timeout, it is retransmitted.\n- `plot_packet_log(self)`: Plots the sequence numbers of sent, acknowledged, and retransmitted packets over time.\n\n## Receiver.py\n\nThis script contains the `FileReceiver` class which is responsible for receiving files. The class has the following methods:\n\n- `__init__(self, port, secret_key)`: Initializes the `FileReceiver` object with the given port and secret key.\n- `send_acknowledgement(self, sequence, file_id, address)`: Sends an acknowledgement for the packet with the given sequence number and file ID to the specified address.\n- `receive_file(self, save_path)`: Receives a file and saves it at `save_path`. It sends acknowledgements for each received packet.\n- `plot_packet_log(self)`: Plots the sequence numbers of received packets over time.\n\n## Helpers.py\n\nThis script contains helper functions for packet creation, packet unpacking, and conversion between numbers and byte arrays.\n\n## Usage\n\nTo send a file, run the `FileTransfer.py` script with the file name, window size, and timeout as command-line arguments. For example:\n\n```bash\npython FileTransfer.py [file name] [window size] [timeout]\n```\n\nTo receive a file, run the `Receiver.py` script with the file destination as a command-line argument. For example:\n\n```bash\npython Receiver.py [file destination]\n```\n\n## Security\n\nThe HMAC algorithm is used for security. The secret key is hardcoded in the `FileTransfer.py` and `Receiver.py` scripts. It is used to create a hash-based message authentication code for each packet. This ensures the integrity and authenticity of the packets. The secret key is truncated to 8 bytes before it is used. \n\n## Note\n\nThis project uses a simple form of error control. If a packet is not acknowledged within the specified timeout, it is assumed to be lost and is retransmitted. This may not work well if the network has high latency. In such a case, the timeout may need to be increased. \n\nAlso, the project uses a simple form of flow control. The sender maintains a window of packets that it can send without waiting for acknowledgements. If an acknowledgement is not received for the first packet in the window within the timeout, all packets in the window are retransmitted. This is known as Go-Back-N ARQ. \n\nThe project also includes a plotting feature that plots the sequence numbers of sent, acknowledged, and retransmitted packets over time. This can be useful for visualizing the performance of the protocol. \n\nPlease note that this project is for educational purposes and may not be suitable for use in a production environment.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoussef-saaed%2Fudpfiletransferproject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoussef-saaed%2Fudpfiletransferproject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoussef-saaed%2Fudpfiletransferproject/lists"}