• Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About Us
    • About CSEStack:
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • Campus Ambassador
  • LeaderBoard
CSEstack

What do you want to Learn Today?

  • Programming
    • C/C++
    • Python
    • Java
    • HTML CSS
    • SQL
  • CSE Subject
    • Compiler Design
    • Computer Network
    • COA
    • Data Structure
    • DBMS
    • Operating System
    • Theory of Automata
    • Web Technology
  • Linux
  • Trend
    • Artificial Intelligence (AI)
    • Big Data
    • Cloud Computing
    • Machine Learning (ML)
  • GATE CSE 2020
    • Self Study Plan
    • Complete Syllabus
    • FREE Test Series
    • Topper Interview (AIR 15)
    • Recommended Books by Topper
  • Career
    • Placement Interview
    • Jobs
    • Aptitude
    • Quiz
  • Material
    • Recommended Books
    • Software Installation
  • Contribute to Us
    • Write for Us
    • Submit Source Code or Program
    • Share Interview Experience
  • Tools

14 Difference Between TCP and UDP Protocol

Aniruddha Chaudhari/15 Feb, 17/7257/0
Computer NetworkCSE SubjectDifference Between

TCP and UDP both are the transport layer protocol from 7 layer OSI model architecture. I am not going to describe here all these layers as it is not within the scope of difference between TCP and UDP protocol. You can read 7 Layers of OSI Model in Networking for more detail. I have explained it with layered architecture.

Difference Between TCP and UDP Protocol

The Difference Between TCP and UDP Protocol:

So let’s begin with the topic.

#1 Acronym:

TCP acronym for Transmission Control Protocol. UDP is an acronym for User Datagram Protocol, some either call it as Universal Datagram Protocol.

#2 Connection Type:

TCP is connection oriented protocol. The connection is established by sending handshaking messages before sending actual data.

In the case of UDP, no connection is established. Rather it sends data with no more hustle.

TCP and UDP connection

#3 Reliability:

TCP is considered to be a most reliable connection. Both sender and client check the connection and trust before making data transmission. UDP is not reliable. It does not authorize and check the connection.

UDP provides an unreliable connection. It does not authorize peer and not even check the connection before sending the data.

#4 Speed of data transfer:

As there are initial handshaking and authorization before sending data, TCP is slower than UDP. One of the reasons for faster UDP is, it does not attempt any recovery on failure.

#5 Payload:

UDP carries less payload with messages. It’s obvious as it does not require any authentication and handshaking data. TCP need to send more data to assist reliable communication.

TCP need to send more data to assist reliable communication.

#6 Functionality on Server Side:

Where client sends data to the server, UDP server does not save any client data to identify client for next transmission. It treats every request as new even though getting the same request from the same client. There will be no more relationship between user and server once data transmission is over.

TCP saves client data on the server to identify the customer in case if the client sends data again. It maintains the session for each client request.

Role associated with TCP and UDP Protocol in OSI Layers:

#7 Data Packet ordering:

Before sending data over the network, packets can be fragmented. In TCP every data packet has a sequence number, which identifies the order of each fragmented packet.

In UDP, there is no provision to determine the order of UDP message packet. So after receiving all disordered packets, it is not possible to order them. In any case, if there is need ordering of packets, the only way is to handle by the application layer.

#8 Header for TCP:

TCP header size is 28 bytes. So total size of the packet will be 28 Bytes plus the size of the payload.

TCP header format

TCP header includes following fields.

1. Sequence Number, 2. AcK number, 3. Data offset, 4. Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer 8. Options, 9. Padding, 10. Check Sum, 11. Source port, 12. Destination port

#9 Header for UDP:

UDP has a header of size 8 bytes only.
UDP header format

UDP header includes only four fields which are as follows.

1. Length, 2. Source port, 3. Destination port, 4. Check Sum

#10 Weight:

TCP is heavy weight protocol. It needs three packets for handshaking or to connect before sending data packets.

UDP is lightweight, and it does not require any packet to create a connection as its connectionless protocol.

#11 Acknowledge:

TCP sends an acknowledgment for every request from the receiver (vice-versa).

UDP does not send any acknowledges for any successful or failure data transmission.

#12 Data flow control:

TCP support data flow mechanism. It ensures data reliability and takes action if any glitches occur during congestion.

UDP does not have any data flow control mechanism associated with it.

Difference Between TCP and UDP Protocol for its Uses:

TCP and UDP both have their advantages depending on the circumstances it is going to use.

#13 Top Layer Protocol:

What are the Top layer protocols that use TCP?

  • For web browsing, HTTP and HTTPS use TCP protocol.
  • For server file management FTP uses TCP.
  • Messaging protocol SMTP uses TCP.
  • TCP transport layer protocol is also useful for connecting the server using Telnet or ssh.

What are the Top layer protocols that use UDP?

  • DNS is domain name server portal to find the IP associated with the domain name. It used UDP as underline protocol.
  • Dynamic host configuration portal DHCP use UDP.
  • TFTP is trivial FTP protocol which less secure than FTP, uses UDP.
  • Some other top layer protocol includes SNMP, RIP, VOIP.

#14 TCP and UDP Uses:

Where is TCP useful?

TCP is useful where you need reliability and authorisation. It is useful where security is a primary concern. It is useful when reliability is more important than transmission time.

Where to use UDP protocol?

UDP is useful when the network needs fast data transmission over reliability.

Conclusion:

These are all 14 points to put Difference Between TCP and UDP Protocol. All these points revolve around connection oriented and reliable TCP, and connectionless and unreliable UDP protocol.

Other differences you would like to read from Computer Network:

  • Difference between IPv4 and IPv6 IP addresses
  • 12 Advantages and Disadvantages of OSI model Layered Architecture
  • Difference Between Subnetting and Supernetting

I tried to cover every aspect to Difference Between TCP and UDP Protocol. If you have any doubt, write below in the comment section.

Computer NetworkTCPUDP

Related Posts

Computer NetworkCSE Subject

9 Difference between Connection-Oriented and Connectionless Services Protocol

Computer NetworkCSE SubjectDifference Between

16 Advantages and Disadvantages of Ethernet | With Its Characteristics

Computer NetworkCSE SubjectDifference Between

Main Difference Between Physical and Logical Topology [Comparing Definition]

Aniruddha Chaudhari
I am complete Python Nut, love Linux and vim as an editor. I hold Master of Computer Science from NIT Trichy. I dabble in C/C++, Java too. I keep sharing my coding knowledge and my own experience on CSEstack Portal.

Leave a Reply Cancel reply

Interview Experiences

AccentureAgriChain Akamai Amazon Amdocs American Express Attra Infotech BARC Barclays BlockGrain BYJUS Cisco Cognizant Coupon Dunia Credit Suisse DE Shaw Druva Experis IT Eze Software Factset Fiorano General Electric Incture Technologies Infosys Kasmo Cloud Microsoft MindTree Mu Sigma Numerify Opteamix Oracle Persistent Pole to Win Qualcomm Reliance Riverbed Syntel TCS Tech Mahindra Teradata Terralogic Virtusa Wipro

Interview Questions



You can share your interview experience.

Don’t Miss !

Latest Articles

Cisco Online Test Pattern and Interview Questions for Freshers


[7 Best Tips] How to Make Daily Study Timetable and Stick to It?


Persistent Written Test and Technical Coding Questions [Paper Pattern]


10 Top Website Design Tips for Small Business to Boost Up Your Sales


Main Difference Between remove del and pop in Python List


Tech Mahindra Placement (Online Test | Essay Writing | Interview Questions)


Importance of Career Exploration for High-School Students | Why?


Favorite Topic

AI algorithm array bigdata bit manipulation career Code Computer Network cpp data analytics database data scientist Data Structure db DBMS difference between Django education GATE GATE Topper Interview HTML ibm IBM ISDL interview IP address Java JavaScript Jobs Linked List linux linux cmd nit OOPs Concept os Programming Python python list Qualcomm SOAP sorting stack string vim webbrowser web development

Contribution to Community

  • Contribute to CSEstack Portal
  • Submit Your Source Code or Program
  • Share Your Interview Experience
  • CSEStack Leadership Board
  • Campus Ambassador Program by CSEstack

About CSEstack Portal

  • About CSEStack:
  • Contact Us
  • CSEStack Campus Ambassador
  • Recommended Books by Expert

© 2019 – CSEstack.org. All Rights Reserved.

  • Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About Us
    • About CSEStack:
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • Campus Ambassador
  • LeaderBoard