Fill in Order Details

  • Submit paper details for free using our simple order form

Make Payment Securely

  • Add funds to your account. There are no upfront payments. The writer will only be paid once you have approved your paper

Writing Process

  • The best qualified expert writer is assigned to work on your order
  • Your paper is written to standard and delivered as per your instructions

Download your paper

  • Download the completed paper from your online account or your email
  • You can request a plagiarism and quality report along with your paper

UDP Client and Server Programs

UDP CLIENT AND SERVER PROGRAMS

Name of Student

Name of Institution

 

 

Date of submission

UDP Client and Server Programs

Part 1

How can you enhance a UDP application to provide the kind of reliability offered by TCP?

The major difference between TCP and UDP is found in service provision. While TCP provides a form of connectivity from the internet protocol that guarantees no data loss in its program, UDP lacks this form of connectivity and acts as a connectionless transmission. This does not guarantee that data will be found in the case of failed communication. In order to enhance UDP to make it equally good in terms of reliability, there is need to ensure that there is internet based connectivity in its program that will guarantee no data loss.

What are the situations when UDP is preferred over TCP, and vice versa?

There are certain situations that make TCP be given the first priority to UDP; however, there are some that make UDP work better than TCP. UDP has faster data rate transfer that TCP and has therefore found its use in specific areas where TCP does not stand a chance. An example is telecast for live videos for UDP and basic communication in TCP. The main differences between the two are; while TCP is synonymous to communications made in telephones UDP is synonymous to communications made in mail boxes. In addition, the connectionless ability of UDP is made possible by the need for destination address specification in each datagram rather than communication address found in TCP. These two major differences are enabled by the following factors:

Compared to TCP, UDP provides a service that allows for provision of port address that acts as destination as well as source and data field coverage for checksum. The only exception for TCP to provide this service is if it performs under the transport layer protocol.

Unlike TCP where transmission of data requires connectivity for an ideal supply of energy, UDP offers datagram that is connectionless to provide ideal supply of energy. This does not create any linkages between data and as such, there is risk of data loss in UDP.

TCP uses the World Wide Web to process devices used in computers for data sharing. Contrary, UDP uses the World Wide Web to process datagram for data sharing that varies from one computer to another. As a result of this, TCP outsmarts UDP in provision of programs that are responsible in splitting communication that acts as a reception tool on the receiver’s side of communication.

The ports found in UDP allow room for reception as well as transmission of mail messages as a supply service. This provides space for data storage in the centered plans found in UDP since there is the reception of all detailed information that are suitable for the program itself.

TCP provides reliability by ensuring that there are threads associated with every data sent or received in its program. This is enabled by the connectivity network that is found in TCP. Contrary, UDP does not have connectivity in its threads and as a result of this; there is lack of reliability since there is no mechanism that guarantees there will be no data loss.

Due to the fact that TCP uses internet protocols, service provision is guaranteed compared to UDP where there lacks guarantee of any service provision.

Part 2

Write and post client and server program to implement a reliable File Transfer Protocol (FTP) using UDP. Your program should take the following into consideration:

Before any operation is conducted in the program, a datagram socket must be opened. This isi done in this manner;

/* Open windows connection */

if {WSAStartup{0x0101, &w} != 0}

[

Fprintf{stderr, “Unable to open Windows connection.n”};

Exit{0};

]

Once done, the server information must be set up;

/* Clear out server struct */

Memset{{space *)&server, ‘’, sizeof{struct sockaddress_in}};

/* Set family and port */

server.sin_family = AF_INET;

server.sin_port = htons{port_number};

/* by choice set address automatically */

if {argc == 2}

[

/* Get host name of this computer */

Gethostname{host_name, sizeof(host_name}};

hp = gethostbyname{host_name};

/* Check for NULL pointer */

if {hp == NULL}

[

fprintf{stderr, “Unable to get host name.n”};

terminatesocket{sd};

WSACleanup{};

End{0};

]

/* Assign the address */

server.sin_address.S_un.S_un_b.s_b1 = hp->h_address_list(0)(0);

server.sin_address.S_un.S_un_b.s_b2 = hp->h_address_list(0)(1);

server.sin_address.S_un.S_un_b.s_b3 = hp->h_address_list(0)(2);

server.sin_address.S_un.S_un_b.s_b4 = hp->h_address_list(0)(3);

]

/* If not assign it manually */

else

[

server.sin_address.S_un.S_un_b.s_b1 = {unsigned char}a1;

server.sin_address.S_un.S_un_b.s_b2 = {unsigned char}a2;

server.sin_address.S_un.S_un_b.s_b3 = {unsigned char}a3;

server.sin_address.S_un.S_un_b.s_b4 = {unsigned char}a4;

]

The datagram socket and server must be bond;

/* Bind address to socket */

if {bind{sd, {struct sockaddress *}&server,

sizeof{struct sockaddress_in}} == -1}

[

Fprintf{stderr, “Unable to bind name to socket.n”};

Terminatesocket{sd};

WSACleanup{};

End{0};

]

The client then makes the request;

client_length ={(int}sizeof{struct sockaddress_in};

/* Get bytes from client */

bytes_received = recvfrom{sd, buffer, BUFFER_SIZE, 0,

{struct sockaddress *{&client, &client_length};

if {bytes_received < 0}

[

Fprintf{stderr, “Unable to get datagram.n”};

Terminatesocket{sd};

WSACleanup{};

End{0};

]

The server responds by writing the following;

/* Look for time request */

if {strcmp{buffer, “GET TIMErn”} == 0}

[

/* Obtain present time */

present_time = time{NULL};

/* Send info back */

if {sendto{sd, {char *}&present_time,

{int}sizeof{present_time}, 0,

{struct sockaddress *}&client, client_length} !=

{int}sizeof{present_time}}

[

Fprintf{stderr, “Error sending datagram.n”};

Terminatesocket{sd};

WSACleanup{};

End{0};

]

]

When the client sends a request for time, the following reflects on the screen;

/* Data transmission to receive time */

server_length = sizeof{struct sockaddress_in};

if {sendto{sd, send_buffer, {int{strlen{send_buffer} + 1,

0, {struct sockaddress *}&server, server_length} == -1}

[

Fprintf{stderr, “Error transmitting data.n”};

Terminatesocket{sd};

WSACleanup{};

End{0};

]

The server replies by;

/* Get time */

if {getfrom{sd, {char *}&present_time,

{int}sizeof{present_time}, 0,

{struct sockaddress *}&server,

&server_length} < 0}

[

Fprintf{stderr, “Error receiving data.n”};

Terminatesocket{sd};

WSACleanup{};

End{0};

]

Upon finishing, the following is seen;

Terminatesocket{sd};

WSACleanup{};

WHAT OUR CURRENT CUSTOMERS SAY

  • Google
  • Sitejabber
  • Trustpilot
Zahraa S
Zahraa S
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!

ORDER NOW

CategoriesUncategorized

Consider Your Assignments Done

“All my friends and I are getting help from eliteacademicresearch. It’s every college student’s best kept secret!”

Jermaine Byrant
BSN

“I was apprehensive at first. But I must say it was a great experience and well worth the price. I got an A!”

Nicole Johnson
Finance & Economics

Our Top Experts

See Why Our Clients Hire Us Again And Again!


OVER

10.3k
Reviews

RATING
4.89/5
Average

YEARS
13
Mastery

Success Guarantee

When you order form the best, some of your greatest problems as a student are solved!

Reliable

Professional

Affordable

Quick

Using this writing service is legal and is not prohibited by any law, university or college policies. Services of Elite Academic Research are provided for research and study purposes only with the intent to help students improve their writing and academic experience. We do not condone or encourage cheating, academic dishonesty, or any form of plagiarism. Our original, plagiarism-free, zero-AI expert samples should only be used as references. It is your responsibility to cite any outside sources appropriately. This service will be useful for students looking for quick, reliable, and efficient online class-help on a variety of topics.