Question: UDP server UDP client TCP server TCP client For Part 1 of this assignment, you will compile and run both TCP and UDP clients/servers given

UDP server
UDP client
TCP server

TCP client

For Part 1 of this assignment, you will compile and run both TCP and UDP clients/servers given during the previous lectures. You may use any IDE/text editor or command line. Once that compiles, for Part 2, you will create a TCP client/server application for vector addition. The details are as follows: - Client sends a vector of integers to the server - Server already contains a vector that does not change - When the server recieves the Client's vector, it creates a new vector with the sum of the client and server's vector, and returns the resulting vector to the Client. - The Client will then display the recieved results Note: TCP protocol can only send bytes strings over the network, so it might take some thought as to how you will transfer the vectors. For verification, make sure to submit captured screens of your running results, along with comments, and also a readme file explaining the steps needed to compile your code. 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) serverSocket.sendto(modifiedMessage.encode(),clientAddress) from socket import serverName = 'localhost' serverPort =12000 clientSocket = socket(AF_INET, SOCK_DGRAM) clientSocket. connect((serverName, serverPort)) message = input('Input lowercase sentence:' ') clientSocket.sendto(message.encode(), (serverName, serverPort)) modifiedMessage, serverAddress = clientSocket.recvfrom(2048) print(modifiedMessage.decode()) clientSocket. close() from socket import serverPort =12000 serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.bind((', serverPort)) serverSocket. listen(1) print("The server is ready to receive") while True: connectionSocket,addr=serverSocket.accept() capitalizedSentence=sentence.upper() connectionSocket. send(capitalizedSentence.encode( )) connectionSocket. close() from socket import server = 'localhost' serverPort =12000 clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket. connect((server,serverPort)) sentence = input('Input lowercase sentence: ') clientSocket. send(sentence.encode()) modifiedSentence = clientSocket.recv(1024) print('From Server: ', modifiedSentence.decode()) clientSocket. close()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
