Question
UDP Bridge In this part, you need to design and implement a client-server file transfer program using User Datagram Protocol (UDP), in the Java programming
UDP Bridge In this part, you need to design and implement a client-server file transfer program using User Datagram Protocol (UDP), in the Java programming language
Review the UDPChat Java program that was used in your lab. Make a new class called Bridge that contains main() method, receives packets on port 4000 from UDPClient, and sends those to the UDPServer listening on port 5000. In the opposite direction it can also receive packets from UDPServer and can send them to the UDPClient. You need to create two DatagramSockets for that purpose; one has to be bound to port 4000 for receiving packets from client and one for sending packet to server which you may (or may not) use a specific binding port. Review the supporting document for more idea on DatagramSocket and DatagramPacket. The Bridge class needs only main() method; and when it runs with UDPClient and UDPServer in one machine, it acts as a bridge between the two applications. Without changing the UDPClient code, the result of the running all classes should not be affected as compared to Lab result and still should show the Capitalized sentence. You need to change the binding port in UDPServer from 4000 to 5000 Step 2 Modify the UDPServer and UDPClient such that the server stores the strings received from the client (via the Bridge) in a file called text.txt until the client aborts the process by sending \q and without requiring to restart client app for every string. Step 3 Further modify the UDPClient and UDPServer so that if the client asks for a text file that exist in the server directory, the server sends the file. The client computer will ask the server to send a copy of a file to the client. The name of the file is to be sent to the server asking if it has a copy. If it has, then the transfer starts; if not, the server responds that it does not have the file and asked for another file name. The file is to be of only ASCII characters (no binary files). This should work for large text files that needs to be transmitted in multiple UDP packets. The server must do the segmentation required for large files. The received file must be saved in the client directory. The server computer will send an "end of file character" to signify the end of file. When the client detects the end-of-file marker, it will close the file and send back an acknowledgement character to the server to acknowledge the receipt of the file which server shows on its screen. The Bridge should show the number of packets that have been transmitted from server to client at any given time, and its buffer size should be 128 bytes. Enhancement (5 marks) In the enhancement part, you will implement an automatic error detection mechanism. The Bridge class will randomly drop one packet during transfer of a large file. You need to detect this in the client and send a message to the server about the missing packet
Step by Step Solution
3.43 Rating (166 Votes )
There are 3 Steps involved in it
Step: 1
To design and implement a clientserver file transfer program using User Datagram Protocol UDP in Java you can follow the steps outlined below Step 1 Create the Bridge Class Create a new class called B...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started