Escolar Documentos
Profissional Documentos
Cultura Documentos
The reason for this is because TCP offers error correction. When the TCP protocol is used there is a "guaranteed delivery." This is due largely in part to a method called "flow control." Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. This works because if a packet of data is sent, a collision may occur. When this happens, the client re-requests the packet from the server until the whole packet is complete and is identical to its original. UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc; UDP is commonly used for streaming audio and video. Streaming media such as Windows Media audio files (.WMA) , Real Player (.RM), and others use UDP because it offers speed! The reason UDP is faster than TCP is because there is no form of flow control or error correction. The data sent over the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality.
On the contrary, UDP has been implemented among some trojan horse viruses. Hackers develop scripts and trojans to run over UDP in order to mask their activities. UDP packets are also used in DoS (Denial of Service) attacks. It is important to know the difference between TCP port 80 and UDP port 80. If you don't know what ports are go here. Frame Structure As data moves along a network, various attributes are added to the file to create a frame. This process is called encapsulation. There are different methods of encapsulation depending on which protocol and topology are being used. As a result, the frame structure of these packets differ as well. The images below show both the TCP and UDP frame structures.
The payload field contains the actually data. Notice that TCP has a more complex frame structure. This is largely due to the fact the TCP is a connection-oriented protocol. The extra fields are need to ensure the "guaranteed delivery" offered by TCP.
There are two types of Internet Protocol (IP) traffic. They are TCP or Transmission Control Protocol and UDP or User Datagram Protocol. TCP is connection oriented once a connection is established, data can be sent bidirectional. UDP is a simpler, connectionless Internet protocol. Multiple messages are sent as packets in chunks using UDP.
Comparison chart
Improve this chart TCP UDP
Reliability:
There is absolute guarantee that the data transferred remains intact and There is no guarantee that the messages or arrives in the same order in which it packets sent would reach at all. was sent. TCP does Flow Control. TCP requires three packets to set up a socket connection, before any user data can UDP does not have an option for flow control be sent. TCP handles reliability and congestion control. Two way Connection reliable one way Connection Reliable
Connection
TCP
UDP
Data is read as a byte stream, no Streaming of distinguishing indications are transmitted to signal message data: (segment) boundaries.
Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent. User Datagram Protocol or Universal Datagram Protocol UDP is also a protocol used in message transport or transfer. This is not connection based which means that one program can send a load of packets to another and that would be the end of the relationship.
Function:
As a message makes its way across the internet from one computer to another. This is connection based.
Usage:
UDP is used for games or applications that require TCP is used in case of non-time critical fast transmission of data. UDP's stateless nature is also useful for servers that answer small queries applications. from huge numbers of clients. UDP Header size is 8 bytes.
Weight:
TCP requires three packets to set up a UDP is lightweight. There is no ordering of socket connection, before any user messages, no tracking connections, etc. It is a small data can be sent. TCP handles transport layer designed on top of IP. reliability and congestion control. TCP does error checking UDP does not have an option for error checking. UDP does not order packets. If ordering is required, it has to be managed by the application layer.
Error Checking:
Ordering:
HTTP, HTTPs, FTP, SMTP Telnet etc... DNS, DHCP, TFTP, SNMP, RIP, VOIP etc... The speed for TCP in comparison with UDP is faster because there is no error-checking
UDP
TCP is more reliable since it manages message acknowledgment and retransmissions in case of lost parts. Thus there is absolutely no missing data. UDP does not ensure that communication has reached receiver since concepts of acknowledgment, time out and retransmission are not present.
edit Ordering
TCP transmissions are sent in a sequence and they are received in the same sequence. In the event of data segments arriving in wrong order, TCP reorders and delivers application. In the case of UDP, sent message sequence may not be maintained when it reaches receiving application. There is absolutely no way of predicting the order in which message will be received.
edit Connection
TCP is a heavy weight connection requiring three packets for a socket connection and handles congestion control and reliability. UDP is a lightweight transport layer designed atop an IP. There are no tracking connections or ordering of messages.
edit Method of transfer
TCP reads data as a byte stream and message is transmitted to segment boundaries. UDP messages are packets which are sent individually and on arrival are checked for their integrity. Packets have defined boundaries while data stream has none.
A TCP connection is established via a three way handshake, which is a process of initiating and acknowledging a connection. Once the connection is established data transfer can begin. After transmission, the connection is terminated by closing of all established virtual circuits. UDP uses a simple transmission model without implicit hand-shaking dialogues for guaranteeing reliability, ordering, or data integrity. Thus, UDP provides an unreliable service and datagrams may arrive out of order, appear duplicated, or go missing without notice. UDP assumes that error checking and correction is either not necessary or performed in the application, avoiding the overhead of such processing at the network interface level. Unlike TCP, UDP is compatible with packet broadcasts (sending to all on local network) and multicasting (send to all subscribers).