[solved]-Goal Assignment Implement Tcp Client Server Programs C C Write Two Programs Assignment Si Q39079330
The goal of this assignment is to implement a TCP clientand server programs in C or C++. You will have to writetwo programs for this assignment, a simple client and a simple DNSserver . These will translate domain name to IP address or viceversa – make screenshots after compiling the program
The protocol Every request from the client to the server andevery reply from the server to the client will have fixed format.The client can send three commands,
getIP: x1x2—xn.xxx -This command asks theserver to translate the domain name to the corresponding IPaddress. The first part of the domain name has length of ncharacter delaminated by “.”. The last part is three characterslong.
getDN xxx.xxx.xxx.xxx. -This command asks theserver to translate the IP address to corresponding domain name. IPaddresses are usually represented in dot-decimal notation,consisting of four decimal numbers, each ranging from 0 to 255.
quit -This command asks the client toterminate the connection and exit.
The server
When the server is started, it should listen for requests fromthe client and respond appropriately. Off course the server willsearch the database/file to find the translation. Then the serverwill respond to the client requests with one of the following fourmessages:
Unknowing IP address
Unknowing Domain Name
IP address: xxx.xxx.xxx.xxx
Domain Name: xxxxx.xxx
Your server should run as a daemon, not connected to a terminal.Make sure that you kill your server after you are through testingit.
The client
The client has an interface with a human user. The client shoulddisplay a prompt > whenever it is ready for the next commandfrom the user. Here are commands for the user. The meaning shouldbe obvious.
getIP amazon.com
getDN 192.192.12.12
quit
In case of an error, the client should display a suitable errormessage to the user. If input is correct as specified in the aboveprotocol, then the client will pass the server a request. If theserver is down then the client must display the followingmessage:
“Server is down, please try later.”
Then the server should respond with one of the four abovemessages. The server should not output anything on the screen. Uponreceiving the server’s response, the client will display the domainname or the IP address based on the user’s request. Then the clientwill continue running to serve next user’s request.
Expert Answer
Answer to The goal of this assignment is to implement a TCP client and server programs in C or C++. You will have to write two pro… . . .
OR

