A simple TCP and UDP client-server socket program in python for file transfer, with custom protocol configurations.
TCP_UDP_File_Transfer
ββ novels
β ββ Heartsease.txt
β ββ Rogetβs Thesaurus.txt
β ββ The 1991 CIA World Factbook.txt
β ββ The Conquest Of Peru.txt
β ββ War and Peace.txt
ββ README.md
ββ received_files
β ββ tcp
β β ββ War and Peace_TCP_8776.txt
β ββ udp
β ββ War and Peace_UDP_8771.txt
ββ tcp
β ββ tcp_client.py
β ββ tcp_server.py
ββ udp
ββ udp_client.py
ββ udp_server.py
β
Client-Server Architecture
β
File transfer over TCP socket
β
File transfer over UDP Socket
β
Nagle-Algorithm Switch(ON/OFF)
β
Delayed-ACK Algorithm Switch(ON/OFF)
-
To run the TCP server, go to the tcp folder and run the command python3 tcp_server.py
-
To run the TCP client, go to the tcp folder and run the command python3 tcp_client.py. This will give the user options to send specific files. Those files can be selected and send.
-
The same instructions goes for the UDP client and UDP server.
-
To disable nagle's algorithm in TCP server uncomment line 21
-
in tcp_sever.py.
-
To disable nagle's algorithm in TCP client uncomment line 29 in tcp_client.py.
-
To disable delayed ACK in TCP server uncomment line 24 in tcp_server.py
-
To disable delayed ACK in TCP client uncomment line 32 in tcp_client.py
-
Buffersize can be changed in clients and servers of both tcp and udp, by changing the global variable BUFSIZE.
-
To add sleep of 100 us in TCP server uncomment line 48 in tcp_server.py
-
To add sleep of 100 us in UDP server uncomment line 29 in udp_server.py