Question: using visual studio code develop a Python implementation of a simple protocol using TCP . Protocol Definition The Protocol is a very simple protocol. All

using visual studio code develop a Python implementation of a simple protocol using TCP.
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 TCP stream.
The Client has only one message type it can send to the server, the message is an ASCII
string formatted as:
TNE20003:
In this message:
TNE20003: 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 the TCP stream received on the open port. The
Server MUST check the payload of the TCP 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
TNE20003:A:
In this response:
TNE20003: 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 receive packet is NOT properly formed, then the server must respond with the
message:
TNE20003:E:
TNE20003 Internet and Cybersecurity
for Engineering Applications
Page 3
In this response:
TNE20003: 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:
You will be developing a new set of programs implementing the relevant requirements of the
protocol to function with TCP. It would be strongly advised to use the threaded echo server
code from the tutorial as a base for building your TCP server.
The current implementation of the Protocol does not require delineation of the start and end
of messages. In the Pass task of this lab the Protocol is UDP based, and all messages are
delivered as distinct chunks. When you a message is sent, the remote end (client or server)
is guaranteed to receive the entire message in a single read. They are also guaranteed that
two messages will not be merged in a single read. This means that the program is simple in
that you know you are parsing an entire message for validity and to construct a response.
TCP is more complex as it is a Stream-based Protocol. This means that all messages run
into each other and a read from a remote system can contain multiple messages, part of a
message, or the end part of one message and the start of a second message. Your task will
require modifying the protocol to allow the receiving program to find the start and end of
each message from the TCP stream. This means maintaining some persistence of the
message between reads. There are multiple valid mechanisms for modifying the protocol,
you are free to choose any mechanism you like to do so.
Task:
You will need to develop two Python programs to implement the TCP version of the protocol.
The functionality otherwise needs to be exactly the same in terms of parsing and responding
to packet contents

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!