Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 / 2 In this assignment, you are to implement client-server communication over TCP transport-layer protocol using HTTP application-layer protocol. You are to submit code
1 / 2 In this assignment, you are to implement client-server communication over TCP transport-layer protocol using HTTP application-layer protocol. You are to submit code for two programs: one for client side (e.g. TCP Client.py) and one for server side (eg. TCPServer.py). Compressed folder containing two source files must be submitted Requirements for server-side code: 1. Accepts and parses the HTTP GET request. 2. Get the requested object from the server's file system* 3. Creates an HTTP response message consisting of the requested object preceded by an appropriate response status line. 4. Sends the HTTP response directly to the client. 5. Sends an HTTP "404 Not Found" response back to the client if the requested object is not present. Requirements for client-side code: 1. Connects to the server using a TCP connection. 2. Sends an HTTP GET request to the server. 3. Displays the server response as an output. 4. Takes command line arguments specifying the server IP address, the port at which the server is listening, and the name of the requested object. Sample command to run the client code: python TCP Client.py server_ip server_port filename Sample outputs of client code: at@at: $ python TCPClient.py 192.168.1.12 12000 index.html HTTP request to server: GET /index.html HTTP/1.1 Host: 192.168.1.12 HTTP response from server: HTTP/1.1 200 OK
CSC 450: Computer Networks
Assignment #2
at@at:-$ python TCPclient.py 192.168.1.12 12000 home.html HTTP request to server: GET /home.html HTTP/1.1 Host: 192.168.1.12 HTTP response from server: HTTP/1.1 404 Not Found 2 1 2 at@at:~$ python TCPServer.py The server is ready to receive... HTTP request: GET /index.html HTTP/1.1 Host: 192.168.1.14 Object to be fetched: index.html Object content:CSC 450: Computer Networks
Assignment #2
HTTP response message: HTTP/1.1 200 OKCSC 450: Computer Networks
Assignment #2
HTTP request: GET /home.html HTTP/1.1 Host: 192.168.1.12 Object to be fetched: home.html HTTP response message: HTTP/1.1 404 Not Found *Put an HTML file (e.g. index.html) in the same directory with the server code. When the server code is running, you should be able to access the index.html file (in browser) through server_ip:server_port/filename (e.g. 192.169.25.33:11000/index.html). "Gets the requested object from the server's file system" means opening and reading index.html file in server code (e.g. f = open(filename) ... f.read(), where filename is "index.html"). In this assignment, you are to implement client-server communication over TCP transport-layer protocol using HTTP application-layer protocol. You are to submit code for two programs: one for client side (eg. TCPClient.py) and one for server side (e-g. TCPServer.py). Compressed folder containing two source files must be submitted Requirements for server-side code: 1. Accepts and parses the HTTP GET request. 2. Gets the requested object from the server's file system. 3. Creates an HTTP response message consisting of the requested object preceded by an appropriate response status line. 4. Sends the HTTP response directly to the client. 5. Sends an HTTP 404 Not Found" response back to the client if the requested object is not present. Requirements for client-side code: 1. Connects to the server using a TCP connection. 2. Sends an HTTP GET request to the server. 3. Displays the server response as an output. 4. Takes command line arguments specifying the server IP address, the port at which the server is listening, and the name of the requested object. Sample command to run the client code: python TCPClient.py server_ip server_port filename Sample outputs of client code: at@at: $ python Terclient.py 192.168.1.12 12000 and a HTTP request to server: GET index HTTP/1.1 Host: 1321612 HTTP response from server: HTTP/1.1 200 OKCSC 450: Computer Networks
Assignment #2
at at:-$ python Topclient.py 192.168.1.12 12000 home HETE request to server: GETAH HTTP/1.1 Host: 2.168.1.2 HTEP response from server: HTTP/1.1 404 Not Found ateat:-$ python TCPServer.py The server is ready to receive... HTTP request: GET /index.html HTTP/1.1 Host: 192.168.1.14 Object to be fetched: index.html Object content:CSC 450: Computer Networks
Assignment #2
HTTP response message: HTTP/1.1 200 OK chiosc 450: Computer Networks /h1>Assignment #2
HTTP request: GET /home.html HTTP/1.1 Host: 192.168.1.12 Object to be fetched: home.html HTTP response message: HTTP/1.1 404 Not Found *Put an HTML file (e.g. index.html) in the same directory with the server code. When the server code is running, you should be able to access the index.html file (in browser) through server_ip:server_port/filename (e.g. 192.169.25.33.11000/index.html). "Gets the requested object from the server's file system" means opening and reading index.html file in server code (e.g. f = open(filename).f.read(), where filename is "index.html"). 1 / 2 In this assignment, you are to implement client-server communication over TCP transport-layer protocol using HTTP application-layer protocol. You are to submit code for two programs: one for client side (e.g. TCP Client.py) and one for server side (eg. TCPServer.py). Compressed folder containing two source files must be submitted Requirements for server-side code: 1. Accepts and parses the HTTP GET request. 2. Get the requested object from the server's file system* 3. Creates an HTTP response message consisting of the requested object preceded by an appropriate response status line. 4. Sends the HTTP response directly to the client. 5. Sends an HTTP "404 Not Found" response back to the client if the requested object is not present. Requirements for client-side code: 1. Connects to the server using a TCP connection. 2. Sends an HTTP GET request to the server. 3. Displays the server response as an output. 4. Takes command line arguments specifying the server IP address, the port at which the server is listening, and the name of the requested object. Sample command to run the client code: python TCP Client.py server_ip server_port filename Sample outputs of client code: at@at: $ python TCPClient.py 192.168.1.12 12000 index.html HTTP request to server: GET /index.html HTTP/1.1 Host: 192.168.1.12 HTTP response from server: HTTP/1.1 200 OKCSC 450: Computer Networks
Assignment #2
at@at:-$ python TCPclient.py 192.168.1.12 12000 home.html HTTP request to server: GET /home.html HTTP/1.1 Host: 192.168.1.12 HTTP response from server: HTTP/1.1 404 Not Found 2 1 2 at@at:~$ python TCPServer.py The server is ready to receive... HTTP request: GET /index.html HTTP/1.1 Host: 192.168.1.14 Object to be fetched: index.html Object content:CSC 450: Computer Networks
Assignment #2
HTTP response message: HTTP/1.1 200 OKCSC 450: Computer Networks
Assignment #2
HTTP request: GET /home.html HTTP/1.1 Host: 192.168.1.12 Object to be fetched: home.html HTTP response message: HTTP/1.1 404 Not Found *Put an HTML file (e.g. index.html) in the same directory with the server code. When the server code is running, you should be able to access the index.html file (in browser) through server_ip:server_port/filename (e.g. 192.169.25.33:11000/index.html). "Gets the requested object from the server's file system" means opening and reading index.html file in server code (e.g. f = open(filename) ... f.read(), where filename is "index.html"). In this assignment, you are to implement client-server communication over TCP transport-layer protocol using HTTP application-layer protocol. You are to submit code for two programs: one for client side (eg. TCPClient.py) and one for server side (e-g. TCPServer.py). Compressed folder containing two source files must be submitted Requirements for server-side code: 1. Accepts and parses the HTTP GET request. 2. Gets the requested object from the server's file system. 3. Creates an HTTP response message consisting of the requested object preceded by an appropriate response status line. 4. Sends the HTTP response directly to the client. 5. Sends an HTTP 404 Not Found" response back to the client if the requested object is not present. Requirements for client-side code: 1. Connects to the server using a TCP connection. 2. Sends an HTTP GET request to the server. 3. Displays the server response as an output. 4. Takes command line arguments specifying the server IP address, the port at which the server is listening, and the name of the requested object. Sample command to run the client code: python TCPClient.py server_ip server_port filename Sample outputs of client code: at@at: $ python Terclient.py 192.168.1.12 12000 and a HTTP request to server: GET index HTTP/1.1 Host: 1321612 HTTP response from server: HTTP/1.1 200 OKCSC 450: Computer Networks
Assignment #2
at at:-$ python Topclient.py 192.168.1.12 12000 home HETE request to server: GETAH HTTP/1.1 Host: 2.168.1.2 HTEP response from server: HTTP/1.1 404 Not Found ateat:-$ python TCPServer.py The server is ready to receive... HTTP request: GET /index.html HTTP/1.1 Host: 192.168.1.14 Object to be fetched: index.html Object content:CSC 450: Computer Networks
Assignment #2
HTTP response message: HTTP/1.1 200 OK chiosc 450: Computer Networks /h1>Assignment #2
HTTP request: GET /home.html HTTP/1.1 Host: 192.168.1.12 Object to be fetched: home.html HTTP response message: HTTP/1.1 404 Not Found *Put an HTML file (e.g. index.html) in the same directory with the server code. When the server code is running, you should be able to access the index.html file (in browser) through server_ip:server_port/filename (e.g. 192.169.25.33.11000/index.html). "Gets the requested object from the server's file system" means opening and reading index.html file in server code (e.g. f = open(filename).f.read(), where filename is "index.html")Step by Step Solution
There are 3 Steps involved in it
Step: 1
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