Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

May I know why my question is closed ?! And Not answered ? I really need your help ? Project Part 3: Background Information Read

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

May I know why my question is closed ?! And Not answered ? I really need your help ?

Project Part 3: Background Information Read each of the sections below before you start your project. You will need this information to complete Part 3 of the project. Consult your Open Learning Faculty Member if you have any questions. SWAP: A Simple Data Link Layer Protocol In Project Part 3, you will design and implement a reliable block transfer protocol, called Stop-and-Wait ARQ Protocol (SWAP), which uses another protocol called Simple Datalink Protocol (SDP). As SDP is a non-reliable block transfer protocol, you will also implement an application, called File Transfer Application (FTA), to send a file to another computer using SWAP, as shown below: Applications SWAP SDP SDP supports the following Application Programming Interfaces (APIs), and SDP is already completely implemented in the file sdp. posted in the Project section of your course. These APIs are used by SWAP. int sdp_send (int sd, char buf, int length): It writes data of length, which is stored in buf, to the session sd.sd is the value returned from swap_open() or swap_wait(). The maximum size that it can send is 256 bytes. It returns the number of bytes written to the session sd if there is no error, otherwise-1. int sdp_receive (int sd, char *buf): It reads data and stores it in buf, from the session sd, which is returned from swap_open() or swap_wait(). The maximum size that it can receive is 256 bytes. And it returns the number of bytes read from the session sd if there is no error,-2 if the session is disconnected, and -1 for other general errors. int sdp_receive_with_timer (int sd, char *buf, unsigned int expiration): It reads data and stores it in buf, from the session sd, which is retumed from swap_open() or swap_wait().expiration is used to set a timer and the unit is a millisecond. The maximum size that it can receive is 256 bytes. It returns the number of bytes read from the session sd if there is no error-3 if the timer expires, -2 if the session is disconnected, and -1 for other general errors. SWAP supports the following APIs, and SWAP is implemented in two files swap_client.c and swap_server.c posted in the Project section of your course. These APIs are used by applications. int swap_wait (unsigned short server_port): It is used by a SWAP server to wait for a reliable session connection request from a SWAP client. The port number server_port is in the network byte order. It returns an identifier, called session descriptor, used for data exchange if there is no error, otherwise -1. int swap_open (unsigned int destination_address, unsigned short server_port): It is used by a SWAP client to open a reliable session to a SWAP server of the destination IP address destination_address in the network byte order with the port number. Project Parts 3 and 4: A Simple Data Link Layer Protocol Overview This is Part 3 and 4 of a project consisting of four parts. Refer to your Suggested Course Schedule to confirm your due dates Part 3 of the project is worth 13% of your final course grade. Part 4 of the project is worth 5% of your final course grade. Refer to your Suggested Course Schedule to confirm your due dates. Read all project directions and questions before you begin preparing your answers, and consult your Open Leaming Faculty Member if you have any questions about the projects. In Project Part 3, you will design and implement a simple protocol, called SWAP. In Project Part 4, you will write a file transfer application, called FTA, that uses SWAP Objectives To apply previously leamed course concepts in order to design and develop a simple data link layer protocol. Project Part 3: Instructions Read the section called Project Part 3: Background Information as you will need this information to complete Part 3 of the project. After you have read and understand the Background Information section, you will design and implement a simple block transfer protocol called Stop-and-Wait ARO Protocol (SWAP). SWAP will use the Stop-and-Wait ARQ protocol to support reliability. This protocol and its implementation (described below) are explained in Project Part 3: Background Information When you implement SWAP, you only need to design and implement SWAP in swap_read and swap_write, using the Simple Data Link Protocol (SDP) and Application Program Interface (APT). All the other functions in SWAP have been already coded in the source files swap_client.c and swap_server.c. SDP is also already completely implemented in sdp.c. (A Project Resource folder can be found on the Homepage of your course management system. It contains your source code files. Locate the following files: swap client.c and swap server.c and sdp.c.) In swap_client.c, there are three functions with some global variables: int swap_open(unsigned int addr, unsigned short port); int swap_write(int sd, char "buf, int length); // you need to design and implement void swap_close(int sd); In swap_server.c, there are three functions with some global variables: int swap_wait(unsigned short port); int swap_readint sd, char "buf); // you need to design and implement void swap_close(int sd); You may use the global variable for the control variable on the SWAP client in swap_client.c, and R for the control variable on the SWAP server in swap_server.c. For error checking, you need to use 1 byte checksum algorithm. Do not forget that you need to use the error checking algorithm for DATA frames as well as ACK frames. For testing your swap_dient.c and swap_server.c after you implement swap_write() and swap_read(), an application to transfer messages, test_swap_client.c and test_swap_server.c. (Go to the Project Resource Folder on your home page to locale the test_swap_client.c and test_swap_server.c files.) Here is an example how to compile the programs. In order to compile the client program, use the following: $ gee test_swap_client.c swap_client.c sdp.c -o test client In order to compile the server program, use: $ gcc test_swap_server.c swap_server.c sdp.c -O test_server After the compilation, assuming 9988 for the port number, you can run the server program first on a terminal: $ ./test_server 9988 And you can run the client program on another terminal: $ ./test_client 127.0.0.1 9988 If there is no error in your swap_client.cand swap_server.c, then test_server will print the message sent from test_client. Requirements for Project Part 3 Submit swap_client.cand swap_server.e with screen shots showing how your programs are compiled and run. Please refer to the general guidelines for preparing and submitting your project found under the Assignments Overview tab of your course. Also note that the resource files necessary for these parts of your project can be found under the Project tab. Marking Criteria Weighting No syntax error. All requirements are fully implemented without syntax errors. Submitted screen shots will be reviewed with source code. Correct implementations All requirements are correctly implemented and produce correct results Submitted screen shots will be reviewed with 15 source code. Total 710 Project Part 3: Background Information Read each of the sections below before you start your project. You will need this information to complete Part 3 of the project. Consult your Open Learning Faculty Member if you have any questions. SWAP: A Simple Data Link Layer Protocol In Project Part 3, you will design and implement a reliable block transfer protocol, called Stop-and-Wait ARQ Protocol (SWAP), which uses another protocol called Simple Datalink Protocol (SDP). As SDP is a non-reliable block transfer protocol, you will also implement an application, called File Transfer Application (FTA), to send a file to another computer using SWAP, as shown below: Applications SWAP SDP SDP supports the following Application Programming Interfaces (APIs), and SDP is already completely implemented in the file sdp. posted in the Project section of your course. These APIs are used by SWAP. int sdp_send (int sd, char buf, int length): It writes data of length, which is stored in buf, to the session sd.sd is the value returned from swap_open() or swap_wait(). The maximum size that it can send is 256 bytes. It returns the number of bytes written to the session sd if there is no error, otherwise-1. int sdp_receive (int sd, char *buf): It reads data and stores it in buf, from the session sd, which is returned from swap_open() or swap_wait(). The maximum size that it can receive is 256 bytes. And it returns the number of bytes read from the session sd if there is no error,-2 if the session is disconnected, and -1 for other general errors. int sdp_receive_with_timer (int sd, char *buf, unsigned int expiration): It reads data and stores it in buf, from the session sd, which is retumed from swap_open() or swap_wait().expiration is used to set a timer and the unit is a millisecond. The maximum size that it can receive is 256 bytes. It returns the number of bytes read from the session sd if there is no error-3 if the timer expires, -2 if the session is disconnected, and -1 for other general errors. SWAP supports the following APIs, and SWAP is implemented in two files swap_client.c and swap_server.c posted in the Project section of your course. These APIs are used by applications. int swap_wait (unsigned short server_port): It is used by a SWAP server to wait for a reliable session connection request from a SWAP client. The port number server_port is in the network byte order. It returns an identifier, called session descriptor, used for data exchange if there is no error, otherwise -1. int swap_open (unsigned int destination_address, unsigned short server_port): It is used by a SWAP client to open a reliable session to a SWAP server of the destination IP address destination_address in the network byte order with the port number. Project Parts 3 and 4: A Simple Data Link Layer Protocol Overview This is Part 3 and 4 of a project consisting of four parts. Refer to your Suggested Course Schedule to confirm your due dates Part 3 of the project is worth 13% of your final course grade. Part 4 of the project is worth 5% of your final course grade. Refer to your Suggested Course Schedule to confirm your due dates. Read all project directions and questions before you begin preparing your answers, and consult your Open Leaming Faculty Member if you have any questions about the projects. In Project Part 3, you will design and implement a simple protocol, called SWAP. In Project Part 4, you will write a file transfer application, called FTA, that uses SWAP Objectives To apply previously leamed course concepts in order to design and develop a simple data link layer protocol. Project Part 3: Instructions Read the section called Project Part 3: Background Information as you will need this information to complete Part 3 of the project. After you have read and understand the Background Information section, you will design and implement a simple block transfer protocol called Stop-and-Wait ARO Protocol (SWAP). SWAP will use the Stop-and-Wait ARQ protocol to support reliability. This protocol and its implementation (described below) are explained in Project Part 3: Background Information When you implement SWAP, you only need to design and implement SWAP in swap_read and swap_write, using the Simple Data Link Protocol (SDP) and Application Program Interface (APT). All the other functions in SWAP have been already coded in the source files swap_client.c and swap_server.c. SDP is also already completely implemented in sdp.c. (A Project Resource folder can be found on the Homepage of your course management system. It contains your source code files. Locate the following files: swap client.c and swap server.c and sdp.c.) In swap_client.c, there are three functions with some global variables: int swap_open(unsigned int addr, unsigned short port); int swap_write(int sd, char "buf, int length); // you need to design and implement void swap_close(int sd); In swap_server.c, there are three functions with some global variables: int swap_wait(unsigned short port); int swap_readint sd, char "buf); // you need to design and implement void swap_close(int sd); You may use the global variable for the control variable on the SWAP client in swap_client.c, and R for the control variable on the SWAP server in swap_server.c. For error checking, you need to use 1 byte checksum algorithm. Do not forget that you need to use the error checking algorithm for DATA frames as well as ACK frames. For testing your swap_dient.c and swap_server.c after you implement swap_write() and swap_read(), an application to transfer messages, test_swap_client.c and test_swap_server.c. (Go to the Project Resource Folder on your home page to locale the test_swap_client.c and test_swap_server.c files.) Here is an example how to compile the programs. In order to compile the client program, use the following: $ gee test_swap_client.c swap_client.c sdp.c -o test client In order to compile the server program, use: $ gcc test_swap_server.c swap_server.c sdp.c -O test_server After the compilation, assuming 9988 for the port number, you can run the server program first on a terminal: $ ./test_server 9988 And you can run the client program on another terminal: $ ./test_client 127.0.0.1 9988 If there is no error in your swap_client.cand swap_server.c, then test_server will print the message sent from test_client. Requirements for Project Part 3 Submit swap_client.cand swap_server.e with screen shots showing how your programs are compiled and run. Please refer to the general guidelines for preparing and submitting your project found under the Assignments Overview tab of your course. Also note that the resource files necessary for these parts of your project can be found under the Project tab. Marking Criteria Weighting No syntax error. All requirements are fully implemented without syntax errors. Submitted screen shots will be reviewed with source code. Correct implementations All requirements are correctly implemented and produce correct results Submitted screen shots will be reviewed with 15 source code. Total 710

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions