Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

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 OK

CSC 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 OK

CSC 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 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 OK

CSC 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 OK

CSC 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

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

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions

Question

=+48-1 Describe how parent-infant attachment bonds form.

Answered: 1 week ago

Question

Introduce and define metals and nonmetals and explain with examples

Answered: 1 week ago

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago

Question

an element of formality in the workplace between different levels;

Answered: 1 week ago