Description
1. You are given a virtual network with three host h1(192.168.1.2), h2(192.168.1.3), and h3(192.168.1.4).
Create four TCP servers on h2. There servers are ADD server (port number 12500), SUB server (port number 12501), MUL server (port number 12502), and IDIV server (port number 12503). If a client supplies two integers to these servers, they should perform the operation specified in their name. Note that IDIV stands for integer division.
Upon successful computation, these servers should send the computed value to a UDP server on host h3. This UDP server on h3 is expected to square the value received from h2 and send the result to h1 over a TCP connection.
Create a program on host h1 which takes three arguments. The first two are integers and the third is the operation that needs to be performed on these integers (ADD, SUB, MUL or IDIV). Then, depending on the operation specified, your program should send the computation request to one of the servers on host h2, and display the result which it gets from h3.
Note: In your implementation, information about h1 such as IP address and server port
numbers should not be hard coded in the programs running on hosts h2 and h3.
Hint: You can find some pointers at inetd deamon
[30]
End of paper
Reviews
There are no reviews yet.