Last updated
Last updated
This assignment has automated tests! Make sure to read the and to download the framework before starting.
The remote unreliable chat client can be reached at
IP: 212.132.114.68
PORT: 5382
Do not forget to connect using UDP!
You may experience some difficulties when making unreliable chat client and DIY DNS server assignments on campus for a reason is that a majority of UDP communication is blocked on VU's network.
Reminder: You are not allowed to use libraries for computing checksums, CRCs, etc.
You cannot use os.exit() function to terminate your program
In the mandatory assignment, you implemented a simple chat client. Because the interfaces and protocols of computer networking are already well-established, there are many challenges that you do not need to take into account. For example, once a connection is established, TCP provides a stream of bytes in the order they were sent and without error. This assignment asks you to give up such conveniences and instead provide solutions to some of these challenges yourself.
IMPORTANT: tests will expect your client to connect to a server at address 127.0.0.1 and port 5382 (even though you can develop your client using the external server). The address and the port will be, as well, supplied via test script when starting your client script using the arguments --address
and --port
. Thus tests will start your client script as python3 client.py --address "127.0.0.1" --port 5382
.
The Internet Protocol (IP) is an unreliable datagram protocol. Fortunately for many application programmers, the Transport Control Protocol (TCP) runs on the hosts and hides the unreliability of the network and underlying protocols.
Implement a chat client that uses UDP and the protocol shown in This chat client must be able to communicate with similar clients via the Unreliable Chat Server, whose address can be found on Canvas. You can configure the Unreliable Chat Server to simulate an unreliable network by letting it drop a fraction of the received messages, insert errors into messages, or even change their order. Use this to test the correctness of your chat client. The commands used to configure the server are listed below.
Your chat client should meet all the requirements listed in (except for RT1), as well as the requirements below.
Technical Requirements:
RT1: The client must use the UDP transport layer protocol for all network communication.
Error Detection/Correction Requirements:
RE1: The client must implement error detection or error correction mechanisms.
RE2: The client must detect at least 16-bit errors with high probability (e.g., using CRC).
RE3: Messages containing errors (in the header or body) that cannot be corrected must not be displayed.
RE4: The error-detection code rate is larger than 0.5.
Interface Requirements:
RI11: The !set command must follow the format below: !set <name> <value1> <value2>
R12: The !get command must follow the format below: !get <name>
RI13: The message displayed upon receiving a VALUE message from the server must follow the format: The value of <name> is <value> <upper>
RI14: The format of the reset command must be: !reset
Special Command Requirements:
RC2: Typing the !set command must allow the user to set a configuration value for the server.
RC3: Typing the !get command must allow the user to retrieve the value of a server configuration.
RC4: Typing the !reset command must reset all configured values to their defaults.
Delivery Requirements:
RD1: Messages must be displayed to the receiver in the order that they were sent by the sender.
RD2: Successfully received messages must be acknowledged.
RD3: Unacknowledged messages must be retransmitted.
RD4: The sender must maintain separate acknowledgement queues for each conversation.
RD5: No duplicate messages must be printed.
Our server will add artificial transmission inconsistencies when handling your messages. It can be configured using the protocol below:
Show that your chat client hides the unreliability of the network from the user. Configure the Unreliable Chat Server and send messages between two instances of your client.
RI1-RI10: from the .
RC1: from the .
SET DROP <value>\n
Client
Set message drop probability. Value between 0 and 1.
SET FLIP <value> \n
Client
Set bit flip probability. Value between 0 and 1.
SET BURST <value>\n
Client
Set burst error probability. Value between 0 and 1.
SET BURST-LEN <lower> <upper>\n
Client
Set burst error length. Default is 3.
SET DELAY <value>\n
Client
Set message delay probability. Value between 0 and 1.
SET DELAY-LEN <lower> <upper>\n
Client
Set the delay length in seconds. Default is 5.
GET <name>\n
Client
Get the current value of a setting.
VALUE <name> <value> (<upper>)\n
Server
The name and value(s) of a setting requested by the client.
RESET\n
Client
Set all values back to their defaults.
SET-OK\n
Server
Value received and set.