Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE INCLUDE SCREENSHOTS AND AN EXPLANATION. I have provided the sample codes below Python UDPServer from socket import * serverPort = 12000 serverSocket = socket(AF_INET,

PLEASE INCLUDE SCREENSHOTS AND AN EXPLANATION. I have provided the sample codes below image text in transcribed
Python UDPServer
from socket import *
serverPort = 12000
serverSocket = socket(AF_INET, SOCK_DGRAM) serverSocket.bind(('', serverPort))
print(The server is ready to receive)
while True:
message, clientAddress = serverSocket.recvfrom(2048) modifiedMessage = message.upper() serverSocket.sendto(modifiedMessage, clientAddress)
Python TCPClient
from socket import *
serverName = servername
serverPort = 12000
clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket.connect((serverName, serverPort)) sentence = input(Input lowercase sentence:) clientSocket.send(sentence.encode()) modifiedSentence = clientSocket.recv(1024) print(From Server:, modifiedSentence.decode()) clientSocket.close()
In this project, you need to replicate the echo client and server program that we discussed in Chapter 2, and then you are required to enhance the ECHO client/server program that we discussed in the class (25%) A set of sample Python code for echo client/server using both TCP and UDP has been introduced in the class, please refer to the slides of Chapter 2. You need copy the code and test them on your computer. This will be the foundation of next step. (45%) Choose either TCP or UDP version ofthe echo server/client, modify it to acomplish the following function: . Server side program should accept a parameter as the port number that it will listen on for . User(e.g. me) runs the client program to connect to server. Client program should accept two The client program reads a sentence typed in by user via keyboard, and user can select a . Upon receipt of the sentence and command, server converts all the letters in the sentence into incoming request, if no parameter is provided, then 9999 is used by default. parameters that allow user to specify the server address and port number. command, then it sends both the command and the sentence to the server uppercase letters or lower letters or other format based on the received command, and sends the result back to the client. Client program displays the replied sentence on the screen. . Your server should support at least three commands: all uppercase, all lowercase, and another commands that you designed(something like initial caps, reverse each word, reverse the entire sentence, etc.). Make sure test your program before submission, you'll receive o if your programs contains syntax errors! Include a README document for instructions on how to run your program. (20%) You also need to provide a document describing your protocol, ie, underlying transport layer service, port numbers, the order and format of message sent and received by client/server, action associated with each message, etc. The document should provide enough information for others to implement client and server program to interact with yours. Read a RFC document for reference (10%) You should also need to discuss the following issues: . How TCP or UDP would affect your application? Why you pick TCP over UDP(Or vice versa) . Is your protocol stateful or stateless? How does the other type of design would affect your application? (Hint: this has nothing to do with whether you use TCP or UDP) Is your server program able to communicate with multiple clients at the same time

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

Step: 3

blur-text-image

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions