User Datagram Protocol (Udp)
User Datagram Protocol (Udp)
TCP is a connection-oriented protocol. Connection- UDP is the Datagram oriented protocol. It is connection less,
This is because there is no overhead for opening a
orientation means that the communicating devices should
establish a connection before transmitting data and should connection, maintaining a connection, and terminating a
connection. UDP is efficient for broadcast and multicast type
close the connection after transmitting the data. of network transmission.
TCP is reliable as it guarantees the delivery of data to the The delivery of data to the destination cannot be guaranteed
destination router. in UDP.
TCP provides extensive error checking mechanisms. It is UDP has only the basic error checking mechanism using
because it provides flow control and acknowledgement of
data. checksums.
TCP is comparatively slower than UDP. UDP is faster, simpler, and more efficient than TCP.
Retransmission of lost packets is possible in TCP, but not in There is no retransmission of lost packets in the User
UDP. Datagram Protocol (UDP).
TCP has a (20-60) bytes variable length header. UDP has an 8 bytes fixed-length header.
TCP is used by HTTP, HTTPs, FTP, SMTP and Telnet. UDP is used by DNS, DHCP, TFTP, SNMP, RIP, and VoIP.
Connection-Oriented vs Connectionless Service
2. Definition It is used to create an end to end connection between the senders to the It is used to transfer the data packets between
receiver before transmitting the data over the same or different network. senders to the receiver without creating any
connection.
3. Virtual path It creates a virtual path between the sender and the receiver. It does not create any virtual connection or path
between the sender and the receiver.
4. Authentication It requires authentication before transmitting the data packets to the It does not require authentication before
receiver. transferring data packets.
5. Data Packets Path All data packets are received in the same order as those sent by the Not all data packets are received in the same order
sender. as those sent by the sender.
6. Bandwidth It requires a higher bandwidth to transfer the data packets. It requires low bandwidth to transfer the data
Requirement packets.
7. Data Reliability It is a more reliable connection service because it guarantees data packets It is not a reliable connection service because it
transfer from one end to the other end with a connection. does not guarantee the transfer of data packets
from one end to another for establishing a
connection.
8. Congestion There is no congestion as it provides an end-to-end connection between There may be congestion due to not providing an
sender and receiver during transmission of data. end-to-end connection between the source and
receiver to transmit of data packets.
9. Examples Transmission Control Protocol (TCP) is an example of a connection- User Datagram Protocol (UDP), Internet Protocol
oriented service. (IP), and Internet Control Message Protocol
(ICMP) are examples of connectionless service.
TCP/UDP:SOCKET
WHAT IS SOCKET?
WHAT IS SOCKET?
WHAT IS SOCKET?
SOCKET