Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

two ( 2 ) server instances. Please see the note at the bottom of this page if you were not able to complete the prior

two (2) server instances.
Please see the note at the bottom of this page if you were not able to complete the prior programming assignment, and need a client/server to complete this assignment.
Details
proxy
Arguments for upstream ports: array/tuple/set/list (whatever your language supports). These will be the dynamic ports for the server instances.
Accept traffic on a given port.
Send any 'PING' messages in a round-robin schedule B between all the given upstream ports.
Any replies it receives from upstream, it will send to the downstream client with ' via $ (SERVER_PORT][$(SERVER_IDX])' appended to the message
${SERVER_PORT} is the upstream server port.
${SERVER_IDX} is the upstream server index in the upstream array.
Example Diagram
In the above example diagram, the proxy is listening on port 8000, and is fronting two servers instances listening on port 8001, and 8002.
Example Output with Client, Proxy, and two Server Instances
Client:1 : sent PING... received b'PONG via 8001[0],
2 : sent PING... Timed out
3 : sent PING... Timed out
4 : sent PING... received b'PONG via 8002[1]'
5 : sent PING... received b'PONG via 8001[0]'
6 : sent PING... Timed Out
7 : sent PING... received b'PONG via 8001[0]'
8 : sent PING... received b'PONG via 8002[1]'
9 : sent PING... received b'PONG via 8001[0]
10 : sent PING... received b'PONG via 8002[1]'
Proxy:
\lambda python
proxy.py --port 8000
[proxy] : ready to proxy data...
Server #0:
please, solve this as per requirements:
and the output should be like this:
Example Output with Client, Proxy, and two Server Instances
Client:
\lambda python client.py --port 8000
1 : sent PING... received b'PONG via 8001[0]'
2 : sent PING... Timed Out
3 : sent PING... Timed Out
4 : sent PING... received b'PONG via 8002[1]'
5 : sent PING... received b'PONG via 8001[0]'
6 : sent PING... Timed Out
7 : sent PING... received b'PONG via 8001[0]'
8 : sent PING... received b'PONG via 8002[1]'
9 : sent PING... received b'PONG via 8001[0]'
10 : sent PING... received b'PONG via 8002[1]'
Proxy:
\lambda python proxy.py --port 8000
[proxy] : ready to proxy data...
Server #0:
\lambda python server.py --port 8001
[server] : ready to accept data...
[client] : PING
[server] : packet dropped
[client] : PING
[client] : PING
[client] : PING
Server #1:
\lambda python server.py --port 8002
[server] : ready to accept data...
[server] : packet dropped
[client] : PING
[server] : packet dropped
[client] : PING
[server] : PING
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions