Closed

Data link layer protocol

Back ground information:

SWAP: A simple data link 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.c 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 returned 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.

Instructions:

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 (API). 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.

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_read(int sd, char *buf); // you need to design and

implement

• void swap_close(int sd);

You may use the global variable S 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.

If there is no error in your swap_client.c and swap_server.c, then

test_server will print the message sent from test_client.

Skills: C Programming

See more: data access layer vbnet, vbnet user class data access layer, data access layer net, net data access layer different database, visual basic data access layer, data access layer vbnet code, data link layer buet, data access layer implementation code vb net, mac layer protocol implementation ns2, mac layer protocol implementation omnet, mac layer protocol implementation, implementation mac layer protocol using ns2, simulation data link layer, data link layer program, implement data link layer program, data link layer simulation using

About the Employer:
( 0 reviews ) Edmonton, Canada

Project ID: #26832286

4 freelancers are bidding on average $196 for this job

hbxfnzwpf

I am very proficient in c and c++. I have 18 years c++ developing experience now, and have worked for more than 10 years. My work is online game developing, and mainly focus on server side, using c++ under Linux enviro More

$150 CAD in 3 days
(132 Reviews)
6.9
CoherentTech123

Dear Sir, I am a PHD student in Computer Networks. I have checked the details of your work and know the details of ARQ, Stop n Wait and other rdt (data transfer protocols) for reliable and unreliable transfers. More

$250 CAD in 7 days
(35 Reviews)
5.8
manu83tudo

- previous experience in such topics; - eager to discuss a lot in this chat stream; - degree stats / maths;

$224 CAD in 2 days
(4 Reviews)
1.6
ajitsraghav

Hi, I have a total of 4+ years of experience in the field of C/C++/Python programming on Linux platform. I can also create embedded systems project which are based on 32-bit micro-controllers and are programmed in C la More

$160 CAD in 10 days
(0 Reviews)
0.0