Question

In: Computer Science

Your company is developing two web apps, one for voice calls over the internet (VoIP), and...

Your company is developing two web apps, one for voice calls over the internet (VoIP), and another for streaming music. Between TCP and UDP, explain which protocol you would use for each app and why.

Solutions

Expert Solution

We'll cover the two major
transport protocols UDP and TCP.Before
we do that, let's talk about
transport protocols in general to
understand why we need them in the first
place. On the Internet every network
packet follows this five layer structure.
We have the application layer, the
transport layer, the network layer, the
link layer and the physical layer.
Remember that UDP and TCP are part of
the transport layer.Have you ever
wondered why it's possible that two
applications can use the same internet
connection at the same time. Well that's
because of what the transport layer
provides. It allows multiple applications
to use one network connection
simultaneously much like street names
have house numbers. The transport layer
creates about 65,000 ports on your
computer per network connection. These
ports can be reserved and used by
applications on your computer and one
application can use multiple boards at
the same time.
We have two
major transport protocols UDP and
TCP and they both have their own
characteristics. Let's look at UDP first
One of the biggest advantages of UDP is
that it's packet sizes are smaller than
TCP about sixty percent. Even UDP headers
are eight bytes and TCP headers are 20
bytes so that's a big difference.
UDP is connectionless. This means that
you don't have to create a connection
first before sending out data and
finally you have more control over when
data is being sent out. Now I do realize
that this may sound a little vague to
you but once we get tcp into the mix
this will become clearer because data
corruption is a common occurrence on the
Internet. UDP has a primitive form of
error detection it's back. It's carry a
16-bit checksum but it is not that
reliable when UDP does detect corruption
it will not try to recover from it. In
most cases the corrupted segment we'll
just be discarded in some cases it will
keep the corrupted segment but turn on a
warning flag for the application. UDP
does not attempt to compensate for lost
packets. Every packet gets sent out once
if it gets dropped on its way to the
receiver top lock it's gone. UDP does not
guarantee in order packet delivery.
Packets won't necessarily arrive in the
application in the order that they were
sent.
There's no congestion control in UDP
even if your networks really busy.
UDP will just try to cram those packets
in there. This is usually a bad strategy
because on a congested network packets
get dropped more often. In conclusion UDP
may be lightweight but it's not that
reliable this is where TCP comes in. The
transmission control protocol has
certain features that make it more
reliable than UDP however it also has a
bigger communication over at than UDP
since TCP is connection based we have to
negotiate a connection first. Before we
can do
this procedure is known as the three-way
handshake. First the initiator will ask
the acceptor if it wants to set up a
connection the acceptor will reply to
this request and when the initiator
receives this reply it will send a
packet to the acceptor that acknowledges
that the connection has now been
established. A similar song-and-dance
takes place when they close down a
connection. Now that we have this
connection we can implement all kinds of
nice features like delivery
acknowledgments when data gets sent from
one host to another the receiver will
acknowledge that it got that data. This
is one of the reasons why TCP segments
carry a number. Another feature that TCP
offers is retransmission. When a sender
doesn't get a delivery acknowledgment
within a certain amount of time it will
assume that the packet got lost on its
way so it will send it again
because segments are numbered in TCP it
can also implement in order delivery
although packets may still arrive out of
order. TCP will rearrange them before
sending them to the application. Other
TCP enhancements include congestion
control. This feature will delay
transmission of data when the network is
congested it eases the strain on the
network and helps minimize packet loss.
TCP enforces a small change to error
detection. Well there is no technical
improvement of the error detection
feature the checksum has now been made
mandatory for ipv4 as well as ipv6. For
UDP segments the checksum is only
mandatory for ipv6 packets. Let's look at
the downsides of fusing TCP. TCP segments
need bigger headers than UDP segments. As
you may remember UDP headers are about
60% smaller than TCP headers, a side
effect of TCPS congestion control
mechanism is that data doesn't always
get sent out immediately. This is of
course done on purpose to ease network
congestion but sometimes that's not what
you want take.

Skype for example when
you're making a voice call you kind of
want it to feel like a real-time
conversation right. Well what TCPS
congestion control does is when the
network is congested it deliberately
introduces latency so your real-time
conversation will not feel as real-time
as you want it to be. As you can see
congestion control can be either a
nuisance or an enhancement, it all
depends on the context really. Finally
TCP has a bigger overhead. All those
retransmissions and packet
acknowledgments and all that jazz. Well
that's overhead sometimes you don't want
every packet to arrive. Sure you want
packets to arrive but if certain packets
drop out you don't care that much for
example to stream HD video you need lots
of bandwidth but if you use TCP for
you need even more because you have to
send around acknowledgments you have to
do retransmissions and besides video
streaming can deal with a certain amount
of packet loss. They have ways to
compensate for that. In this case it
makes more sense to use UDP than TCP.
Both protocols are also different on a
conceptual level. We call UDP
message-oriented which means that
applications send their data and
distinct chunks. Think of it as snail
mail email or text messaging. Now TCP on
the other hand is stream oriented. It is
used as a continuous flow of data. Under
TCP your application does not choose how
data is sliced into packets. Just let it
know whenever anything needs to be sent
and then TCP will slice that into
packets and recompose everything. On the
other end if you'd use lots of small
packets but it could also choose to go
with few big packets it just makes
whatever works best at that time. Rest
assured though you don't have to worry
about how the packets are sliced all you
need to know is that on the receiver end
everything gets recomposed into a stream
that you can read from so which one's
better UDP or TCP it all depends on the
type of application that you're building.
Let's look at text communication
performance wise. This isn't a big
challenge because you don't need a lot
of bandwidth to send some text around.
After all under TCP everything will work
fine with UDP however you could get text
in the wrong order or text you get lost
along the way. There is no guarantee
anything could go wrong there because
UDP doesn't do read transmissions and it
doesn't guarantee in order delivery when
it comes to text communication. TCP
clearly takes the cake now
I don't know about you but when I
download files off the internet
I'd like to have all the parts including
the chunks that didn't make it through
the first time. TCP offers retransmission
UDP does not. We're also going to need in
order to deliver
because seriously what good is a
scrambled JPEG for similar reasons.
Remote access protocols like SSH also
use TCP. If you need delivery
acknowledgments UDP isn't going to do
you any good if you insist on using UDP
you could implement some sort of
acknowledgement system in your
application layer for important packets
but most of the time it's not worth the
hassle. With multimedia streaming things
are a little more ambiguous it could
either be UDP or TCP traditionally
people have chosen UDP because it has
less overhead it doesn't do that
congestion control thing that introduces
latency and we can compensate for a
certain percentage of lost packets. More
recently people have started to use TCP
for multimedia streaming if the
bandwidth is there you might as well
enjoy the benefits that TCP brings. Also
some firewalls blocked UDP altogether
for security reasons and then you're
forced to use TCP. UDP can also be used
for small question-and-answer
transactions such as DNS lookups. The
main benefit here is that you don't have
the overhead of creating and closing a
connection every time you need something
as is the case with multimedia streaming
bandwidth intensive apps that can
tolerate some amount of packet loss.

Thnk you


Related Solutions

You are an entrepreneur developing your first business plan for a business selling over the internet....
You are an entrepreneur developing your first business plan for a business selling over the internet. Right now you are working on the financial plan segment of your business plan and need to estimate the financing needs, both to launch your business and to operate it for the first 12 months during which you estimate you will incur a loss. You intend to apply for a bank loan to cover your first year’s financing needs. You have worked with an...
Define Internet, Web, HTML, Javascript, Web Page, Ecommerce, and Internet Service Provider ISP) in your own...
Define Internet, Web, HTML, Javascript, Web Page, Ecommerce, and Internet Service Provider ISP) in your own words in one essay.
Your company, VZ, is evaluating the proposal of expanding FiOS Internet, Voice and TV service coverage...
Your company, VZ, is evaluating the proposal of expanding FiOS Internet, Voice and TV service coverage to Western New York. The expansion project requires a new system costs $108,000, and it would incur another installation and configuration expense of $12,500. The system falls into the MACRS 3-year class, and it would be sold after 3 years for $65,000. The project would require an increase in net working capital (Labor, Office Leasing) of $5,500. The project is expected to generate additional...
Simple Painting GUI Apps You are just developing the GUI app. Your mission in this exercise...
Simple Painting GUI Apps You are just developing the GUI app. Your mission in this exercise is to implement a very simple Java painting application. Rapid Prototyping The JFrame is an example that can support the following functions: * Draw curves, specified by a mouse drag. * Draw filled rectangles or ovals, specified by a mouse drag (don't worry about dynamically drawing the shape during the drag - just draw the final shape indicated). * Shape selection (line, rectangle or...
Research the Internet about healthcare apps that are available to you. Describe how your choice educates...
Research the Internet about healthcare apps that are available to you. Describe how your choice educates patients, increases awareness, and advances care. Discuss the benefits of healthcare apps and who would benefit from them most. Specifically address how they can help health care professionals.
You select one client device type mentioned in this lesson for delivering VoIP or video-over IP...
You select one client device type mentioned in this lesson for delivering VoIP or video-over IP and research the device type (IP telephone, softphone, videophone, etc.). You should write a report summarizing your findings. The report should include a comparison of three to five devices currently available for general use, including the manufacturer, the model, the seller, the cost, and a summary of the manufacturer specifications.
in the 1990s, Microsoft battled Netscape over market share for their web browsers, called internet Explorer...
in the 1990s, Microsoft battled Netscape over market share for their web browsers, called internet Explorer and Navigator use this example to analyse whether there are multiple equilibria and, if so, why one equilibrium might emerge in preference to the others.
QUESTION ONE: A company has set a goal of developing a rechargeable battery that lasts over...
QUESTION ONE: A company has set a goal of developing a rechargeable battery that lasts over 5 hours (300 minutes) in continuous use, on average. A random sample of 10 of these batteries measured the following lifespans (in minutes): 319, 294, 336, 353, 341, 329, 315, 329, 302, and 289. (a) Display the sample data in a stemplot and describe the distribution. (b) Is there convincing evidence that the company has met its goal? Provide statistical evidence to support your...
1. Write a detailed article on Evolution of attacks on the internet & web [your article...
1. Write a detailed article on Evolution of attacks on the internet & web [your article should cover HTTP, HTTPS, HTML, URL related] 2.What is a Unicode Homograph attack? Present your study with a detailed analysis
Your cousin’s voice sound different over the telephone than it does in person. This is because...
Your cousin’s voice sound different over the telephone than it does in person. This is because telephones      do not transmit frequencies over about 3000 Hz. Since 3000 Hz is well above the normal frequency of      speech, why does eliminating these high frequencies change the sound of your cousin’s voice? Carefully      provide the reasoning behind your answer.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT