Doodling over Protocols
TCP vs UDP

Hello everyone in this blog we are going to understand what is the major difference between TCP and UDP.
Basic understanding
TCP is (Transmission Control Protocol)
UDP is (User Datagram Protocol)
>>Basically its like a medium by which two devices talks over internet (For example :- your browser and a website).
>>Both are Transport Layer Protocols.
>>They both work on the top of the INTERNET PROTOCOL but they behaves differently.
Deep diving into TCP
>>TCP is like the reliable courier service that provide end to end costumer satisfaction and make sure your parcel is safe (Here costumer is client and sender is server).
>>Before transmitting Data it always establish a connection .
>>It must Ensure the ordering of the data because (it is like a telephone line)
>> HTTP or FTP always use TCP to achieve the reliability , but even HTTP is not that much secure.
>>There is so much reliability because it having a checksum at the header of the packet so when user receive it they also check data with that checksum.
>>As compare to UDP transmission is slow , because of established reliable connection.
>>In compare to UDP there is more Overhead (approximately 20 Byte to 60 Byte ) , Because we have to add more secure information in header file .
>>There is Flow control and Congestion control , It ensures the capacity of user to accept the data and the network to manage the load of data.
>> It use algorithm like AIMD to control the congestion.
>> There is retransmission of Data if Packet is lost.
>>There is system of acknowledgement in which user send it when a data packet receive completely, whether it is positive (When data is transmitted successfully) or negative(When data is not transmitted successfully).
TCP ensure that
Data reaches correctly.
It check for Errors.
It resend the missing data.
Keeps data in the correct order.
Real world Example
YouTube >> your browser uses TCP to :--
Connects to the server.
Request the Webpage.
Make Sure that every part loads correctly.
If something is missing , TCP asks for it again.
we use it where we have have to transfer data in order and in reliable way.
Deep Dive into UDP
UDP is like sending a Letter contains Beads , with a small hole (means no confirmation )
>>it will start transmitting Data whenever it get data from application , It does not establish connection first .
>>It does not Follow the ordering of the data packets because data can be transmitted by multiple networks .
>>These protocol mostly use DNS(Domain Name Server) , DHCP (Dynamic Holes Control Protocol), RIP (Routing Information Protocol) , for faster transmission.
>>There is not so much reliability because it does not having a checksum at the header of the packet , but it is optional .
>>As compare to TCP transmission is fast , because of multiple network connection.
>> As compare to TCP there is less Overhead (Approximately 8 byte).
>> There is no use of Algorithm for Flow Control and Congestion Control.
>>There is no re transmission of data if packet is lost.
what does UDP do >>
Sends data quickly.
no initial connection setup .
No safe delivery guarantee.
no use of order listing.
no error correction.
Real world use
>>online gaming.
>>Video calls.
>>live Streaming .
>>it i use were the first priority is to send data quickly .





