TCP
Transmission Control Protocol (TCP) is a standard protocol used in TCP/IP networks. While the IP protocol handles only the packets, TCP defines how two hosts initiate and maintain connectivity with the stream of data. TCP guarantees the delivery of data packets in the same order in which they are sent.
Why TCP use?
TCP is used to ensure that the transmission of data between the server and the client is secure. Regardless of the amount of data, it guarantees the quality of the data sent over the network. It is used to transmit data from other high-level protocols that all the transmitted data reaches.
TCP/IP Layers
- Application Layer – This one is the top layer and its acts as an interface between the application and network service to communicate. The application layer contains all the high-level protocols such as HTTP, DNS, SSH FTP, SMTP, DHCP, etc.
- Transport Layer – It receives data from the application layer, divides them into pieces, transport them, and solves possible issues for proper delivery. TCP operates in this layer.
- Internet Layer – It is also known as the IP or Network layer, which is in charge of sending data packets and ensuring that data is delivered as exactly as possible.
- Network Access Layer – This layer is the combination of OSI model data link layer and the physical layer. This one is the bottom layer of the TCP/IP. It briefs the process through which data is actually transferred over the network.
Advantages:
- TCP is connection-oriented and allows different kinds of devices.
- It supports different routing protocols
- It is independent of the operating system and open protocol
Disadvantage:
- It is not simple to replace protocols
- It doesn’t support broadcast or multicast transmission
- It’s not suitable for LAN network, only work with WAN network
UDP
User datagram Protocol works on top of Internet Protocol (IP) to transfer data over a network. The source and destination is not required for UDP to establish a three-way handshake before transmission takes place.
Why UDP is used?
UDP is an unreliable and connectionless protocol and is a part of Internet protocol referred to as UDP/IP suite. UDP is used for critical time data transmission such as DNS lookup, video streaming, and online gaming. UDP establishes low-latency and loss-tolerating connections establish over the network. Since high performance is needed, UDP allows packets to be dropped instead of processing delayed packets. It also saves bandwidth and there is no error checking for that.
Advantages:
- UDP uses a check on all packets for error correction
- Broadcast and multicast transmissions are available in UDP
- It uses a small packet size with a small header (8 bytes). The fewer bytes in the UDP protocol make it need less time and less memory for processing packets.
Disadvantages:
- No flow control and acknowledgment for data received.
- Error control is not use by UDP. If it detects an error, it simply drops.
In UDP, Routers do not retransmit the data after conflict.