In this task, we will be using UDP as the packetized nature of UDP means that...
Fantastic news! We've Found the answer you've been seeking!
Question:
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65c376a783829_71165c376a75f3eb.jpg)
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65c376a7e539f_71165c376a7c6002.jpg)
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65c376a84bdb1_71265c376a82e5c3.jpg)
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65c376a8a5c5b_71265c376a87f85b.jpg)
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65c376a916507_71265c376a8def20.jpg)
Transcribed Image Text:
In this task, we will be using UDP as the packetized nature of UDP means that you do not have to worry about finding the start and end of messages in the protocol, the entire message will be encoded in a single UDP packet. Your UDP server will run a permanent loop accepting packets on an open UDP port. Each packet should contain a message in the allowed format according to the protocol specified below. You will be required to: Parse the message to determine if it meets the protocol definition If the message does not match the protocol definition, reply with the error message as per the protocol If the message does meet the protocol definition, reply with a properly formatted acknowledgment response as per the protocol definition Your UDP client will be required to connect to the UDP server and send at least two messages using the protocol definition as described below. Each message must be sent in a unique datagram. You will be required to: Parse replies from the server Print server replies to the screen and extract packet contents Protocol Definition The Protocol is a very simple protocol. All messages are constructed using ASCII text and each message is self-contained within a single UDP datagram The Client has only one message type it can send to the server, the message is an ASCII string formatted as: NE20001: In this message: NE20001: forms the protocol header and must match this value exactly. is an ASCII string containing the data to send to the server. This string is NOT terminated in any way and JUST contains the actual message. must be at least one character long. The Server is responsible for responding to UDP datagrams received on the open port. The Server MUST check the payload of the UDP packet to ensure it matches the valid Client Message as described above. If the received packet is properly formed (contains a properly formed header and a valid ) then the server must respond with a formatted message containing NE20001:A: In this response: NE20001: forms the protocol header and must match this value exactly A: designates the message type as being an Acknowledgement of receipt of the is an ASCII string and must match exactly the message sent by the client. You will be required to extract from the received packet to place into the reply. If the received packet is NOT properly formed, then the server must respond with the message: NE20001:E: In this response: NE20001: forms the protocol header and must match this value exactly E: designates the message type as being an Error message is an ASCII string. You can choose the exact string but this is an error to report back to the user at the client Methodology: Examine the Python UDP socket commands to get an understanding of how to receive and send messages You may wish to examine the following options for Python programming to make your life easier The struct library to pack and unpack messages. This can allow you to combine multiple variables into a single structure (to create a formatted message) and to unpack a message into multiple variables Look at how you can segment Python strings and/or byte objects using indexing (eg, var[:10], var[10:] and var[10:20]) Task: You will need to develop two Python programs. The server program will need to: Open a UDP port Listen for all incoming UDP packets Parse the packet as per the protocol in this document Construct an appropriate response and send it back to the remote system The client program will need to: Create a UDP socket Send at least two properly formatted messages to the server Listen for responses Parse the reply, extracting protocol parameters and display to the screen In this task, we will be using UDP as the packetized nature of UDP means that you do not have to worry about finding the start and end of messages in the protocol, the entire message will be encoded in a single UDP packet. Your UDP server will run a permanent loop accepting packets on an open UDP port. Each packet should contain a message in the allowed format according to the protocol specified below. You will be required to: Parse the message to determine if it meets the protocol definition If the message does not match the protocol definition, reply with the error message as per the protocol If the message does meet the protocol definition, reply with a properly formatted acknowledgment response as per the protocol definition Your UDP client will be required to connect to the UDP server and send at least two messages using the protocol definition as described below. Each message must be sent in a unique datagram. You will be required to: Parse replies from the server Print server replies to the screen and extract packet contents Protocol Definition The Protocol is a very simple protocol. All messages are constructed using ASCII text and each message is self-contained within a single UDP datagram The Client has only one message type it can send to the server, the message is an ASCII string formatted as: NE20001: In this message: NE20001: forms the protocol header and must match this value exactly. is an ASCII string containing the data to send to the server. This string is NOT terminated in any way and JUST contains the actual message. must be at least one character long. The Server is responsible for responding to UDP datagrams received on the open port. The Server MUST check the payload of the UDP packet to ensure it matches the valid Client Message as described above. If the received packet is properly formed (contains a properly formed header and a valid ) then the server must respond with a formatted message containing NE20001:A: In this response: NE20001: forms the protocol header and must match this value exactly A: designates the message type as being an Acknowledgement of receipt of the is an ASCII string and must match exactly the message sent by the client. You will be required to extract from the received packet to place into the reply. If the received packet is NOT properly formed, then the server must respond with the message: NE20001:E: In this response: NE20001: forms the protocol header and must match this value exactly E: designates the message type as being an Error message is an ASCII string. You can choose the exact string but this is an error to report back to the user at the client Methodology: Examine the Python UDP socket commands to get an understanding of how to receive and send messages You may wish to examine the following options for Python programming to make your life easier The struct library to pack and unpack messages. This can allow you to combine multiple variables into a single structure (to create a formatted message) and to unpack a message into multiple variables Look at how you can segment Python strings and/or byte objects using indexing (eg, var[:10], var[10:] and var[10:20]) Task: You will need to develop two Python programs. The server program will need to: Open a UDP port Listen for all incoming UDP packets Parse the packet as per the protocol in this document Construct an appropriate response and send it back to the remote system The client program will need to: Create a UDP socket Send at least two properly formatted messages to the server Listen for responses Parse the reply, extracting protocol parameters and display to the screen
Expert Answer:
Answer rating: 100% (QA)
Here is an example implementation of a simple UDP clientserver protocol in Python based on the proto... View the full answer
Related Book For
Computer Networking A Top-Down Approach
ISBN: 978-0133594140
7th edition
Authors: James Kurose, Keith Ross
Posted Date:
Students also viewed these programming questions
-
HW1P1 (18 pts total) chedu The shell and tube heat exchanger shown in Figure is the evaporator of an air determ:tioning unit. Air enters the evaporator at a rate of 6 For 2 kg/min of R-134a entering...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
This scenario is based on thefollowing information: Jo King, aged 58 provided the following information for the year ended 30 June 2023. Table2 - Jo's receipts Receipts $ Net salary (PAYG tax...
-
Paul's Medical Equipment Company manufactures hospital beds. Its most popular model, Deluxe, sells for $5,000. It has variable costs totaling $2,800 and fixed costs of $1,000 per unit, based on an...
-
In Exercises, find the straight line that best fits the following data points, where best is meant in the sense of least squares. (1, 1), (2, 3), (3, 6)
-
2. Describe the key reasonswhy divesting a business can create value for shareholders, even when the business is still in the early stages of its life cycle.
-
The operating results in summarized form for a retail computer store for 2010 are: Revenue: Hardware sales ...........$4,800,000 Software sales ........... 2,000,000 Maintenance contracts ...........
-
Dividends Per Share Lightfoot Inc., a software development firm, has stock outstanding as follows: 30,000 shares of cumulative preferred 4% stock, $20 par, and 38,000 shares of $50 par common. During...
-
Carolina Corporation, an S corporation, has no corporate E&P from its years as a C corporation. At the end of the year, it distributes a small parcel of land to its sole shareholder Shadiya. The fair...
-
Prepare the necessary journal entries for the following transactions for Kennedy Co. May 25 Kennedy Co. received a $30,000, 2-month, 6% note from Holt Company in settlement of an account receivable....
-
L II. Liberty Tax Service LIBERT Liberty Tax Service's University City franchise provides tax preparation and tax consulting services. They divide their clients into those with simple SERVICI returns...
-
In July 2013, cnet.com listed the battery life (in hours) and luminous intensity (i. e., screen brightness, in cd/m2) for a sample of tablet computers. We want to know if screen brightness is...
-
In CSMA/CD, after the fifth collision, what is the probability that a node chooses K = 4? The result K = 4 corresponds to a delay of how many seconds on a 10 Mbps Ethernet?
-
How arc different RTP streams in different sessions identified by a receiver? How are different streams from within the same session identified?
-
Host A and 13 are directly connected with a 100 Mbps link. There is one TCF connection between the two hosts, and I-lost A is sending to Host B an enormous file over this connection. Host A can send...
-
Identify two constraints in accounting. AppendixLO1
-
A medium-sized UK-based insurance company underwrites mainly commercial and industrial property and motor and liability insurance. Outline, with reasons, the types of reinsurance it is likely to buy...
-
If the present value of $1.00 received N years from today at an interest rate of int% is 0.270, what is the future value of $1.00 invested today at an interest rate of int% for N years? a. $1.00 b....
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App