1 IntroductionIn this project, we would implement a simple TCP layer load balancer (in essence similar to HAProxy (haproxy.org). The main objectives of this assignment can be summarized as follows:...

1 answer below »
1 IntroductionIn this project, we would implement a simple TCP layer load balancer (in essence similar to HAProxy (haproxy.org). The main objectives of this assignment can be summarized as follows: (1) hands-on experience with“UNIX” sockets, (2) deep understanding of HTTP protocols, and (3) an introduction to system design, andperformance monitoring.2 Multi-threaded Load Balancer2.1 SpecificationsYour balancer server should accept incoming connection requests, and select one of the backend servers (according to a policy) to forward the request to. The response is forwarded back to the client. A log entry wouldbe added including the following information: (a) client ip, (b) client port (c) Request Type (i.e., GET, Post,..), (d) the chosen server ip, (e) the size of the request, (f) the size of the response, (g) the status code of theresponse, (h) time of the request and the time of the response.The load balancer should implement two policies. Policy I is a simple round robin , where servers are chosenin order. Students should propose another policy. You can use the log entries, or propose new metrics to thelog.The solution should be working and running, you an use any backend http webserver (including Apachehttpd).
3 Bonus3.1 HTTP 1.1Using persistent connections to the backend servers, can significantly improve the performance. This can bedone by using HTTP 1.1 and reuse the connections.3.2 X-Forwarded-ForAdd X-Forwarded-For to the request to the back end server. For more information, please check this https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For.
Answered 7 days AfterOct 28, 2021

Answer To: 1 IntroductionIn this project, we would implement a simple TCP layer load balancer (in essence...

Kshitij answered on Oct 31 2021
123 Votes
Instructions -
Need to create class for Cliebt and TCPload balance/ser
    If IP not works use IP –
127.0.0.1 and 127.0.0.2 is client
    Separate coading for each client and server/Tcpserver
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class cli{
public static void main (String args[])
{

int number,temp;
Scanner sc=new Scanner(System.in);
Socket s= new Socket ("127.0.0.1", "1342");
Scanner sc1=new Scanner (s.getInputStream());
System.out.println ("Enter any number");
number=sc.nextInt();
PrintStream p=new PrintStream (s.getOutputStream());
p.println(number);
temp=sc1.nextInt();
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here