Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This project consists of building an S&W (Stop and Wait) reliable protocol. TFv2 is going to be built on top of UDP, and it is

This project consists of building an S&W (Stop and Wait) reliable protocol. TFv2 is going to be built on top of UDP, and it is supposed to provide a reliable transport service to TFv1 (developed in week 3, which needs to change to call your new send and receive functions and use buffers of same size). Messages are sent one at a time, and each message needs to be acknowledged when received, before a new message can be sent. TFv2 implements basically the protocol rdt2.2 presented in the text book. TFv2 consists of a client and a server. Communication is unidirectional, i.e., data flows from the client to the server. The server starts first and waits for messages. The client starts the communication. Messages have seq number 0 or 1. Before sending each message, a 1-byte checksum is calculated and added to the header. After sending each message, the client waits for a corresponding ACK. When it arrives, if it is not the corresponding ACK (or if the checksum does not match), the message is sent again. If it is the corresponding ACK, the client changes state and returns to the application, which can now send one more message. This means that TFv2 blocks on writes until an ACK is received. The server, after receiving a message, checks its checksum. If the message is correct and has the right seq number, the server sends an ACK0 or ACK1 message (according to the seq number) to the client, changes state accordingly, and deliver data to the application. The protocol should deal properly with duplicate data messages and duplicate ACK messages. Follow the FSM in the book! TFv2 message contains the header and the application data. No reordering is necessary, since TFv2 is sending the exact message given by the application, one by one. The checksum must be calculated for messages from the server and client. To calculate the checksum, calculate the XOR off all the bytes (header or header + data) when member cksum (see below) is zero. To verify your protocol, use the result of a random function to decide whether to send the right checksum or just zero. This will fake the error effect.

PROTOCOL

HEADER

seq_ack int (32 bits) // SEQ for data and ACK for Acknowledgement

len int (32 bits) // Length of the data in byes (zero for ACKS)

cksum int (32 bits) // Checksum calculated (by byte)

PACKET

header

data char (10 bytes)

SENDER

Member seq_ack is used as SEQ, and the data is in member data.

Each packet may have 10 or less bytes of data, and the sender only sends the necessary bytes.

After transmitting the file, a packet with no data (len = 0) is sent to notify the receiver that the file is complete. RECEIVER

Member seq_ack is used as ACK, and data is empty (len = 0).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

Students also viewed these Databases questions

Question

2. What do you believe is at the root of the problem?

Answered: 1 week ago