subject

For the ping_client python program, you need to write the program to fulfill the following functionalities. (Python program) Send 10 ping request message using UDP protocol to server
Print the response message from server as shown in the example section, the client program will wait up to 0.5 seconds for server response
If server response is received within 0.5 seconds, print the ping echoed message and the calculated round-trip time (RTT) in seconds
If no response is received with 0.5 seconds, print the message ping request message and "Time out"
For the ping_server python program, most of the code have been provided as follows, you need to work on the following
Finish the fill in section so that the ping echoed message is created as shown in the testing section.
The ping echoed message is generated by having the random number attached at the end of the ping request message and capitalize the whole message.
The server program simulates data loss for UDP protocol by using a random number for each ping request. A random number is chosen from the range [0, 9), if the selected number is less than 4, the server does not respond which simulates a time out event, otherwise, the server responds with the ping echoed message as specified.
# ping_server. py
# We will need the following module to generate randomized lost packets import random
from socket import *
# Create a UDP socket
# Notice the use of SOCK_DGRAM for UDP packets
serverSocket = socket(AF_INET, SOCK_DGRAM)
# Assign IP address and port number to socket
serverSocket. bind(('', 12000))
while True:
# Generate random number in the range of 0 to 10
rand = random. randint(0, 10)
# Receive the client packet along with the address it is coming from
message, address = serverSocket. recvfrom(1024)
# Concatenate the random number to the message from the client and capitalize the message
Fill in Start
Fill in End
# If rand is less is than 4, we consider the packet lost and do not respond if rand < 4:
continue
# Otherwise, the server responds
serverSocket. sendto(message, address)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:10
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
question
Computers and Technology, 23.06.2019 01:40
You have a linux system that has a 1000gb hard disk drive, which has a 90gb partition containing an ext4 filesystem mounted to the / directory and a 4gb swap partition. currently, this linux system is only used by a few users for storing small files; however, the department manager wants to upgrade this system and use it to run a database application that will be used by 100 users. the database application and the associated data will take up over 200gb of hard disk space. in addition, these 100 users will store their personal files on the hard disk of the system. each user must have a maximum of 5gb of storage space. the department manager has made it very clear that this system must not exhibit any downtime as a result of hard disk errors. how much hard disk space will you require, and what partitions would you need to ensure that the system will perform as needed? where would these partitions be mounted? what quotas would you implement? what commands would you need to run and what entries to /etc/fstab would you need to create? justify your answers.
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
For the ping_client python program, you need to write the program to fulfill the following functiona...
Questions
question
Mathematics, 25.10.2020 23:30
question
History, 25.10.2020 23:30
question
Mathematics, 25.10.2020 23:30