Thứ Hai, Tháng Hai 6, 2023
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
NATuts
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
No Result
View All Result
NATuts
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
No Result
View All Result
NATuts
No Result
View All Result
Home Tech

What is TCP protocol? What is UDP? Compare TCP and UDP

7 Tháng Sáu, 2022
in Tech
0
What is TCP protocol?  What is UDP?  Compare TCP and UDP
585
SHARES
3.2k
VIEWS
Share on FacebookShare on Twitter

In the previous section, I introduced you to the OSI and TCP/IP models, in which the Transport layer is the layer that both models have.

Meanwhile, the transport layer is the layer responsible for logical communication between applications running on different servers, operating through two protocols, TCP and UDP.

The TCP protocol is more reliable, guaranteeing the quality of the transmitted packet, but it takes time to check the data.

As for the UDP protocol, the data transmission speed is faster, but it is not as reliable because there is no verification mechanism like the TCP protocol.

Okay, if you are also interested in this knowledge, let’s learn more about these 2 types of protocols at the Trasnport layer!

#first. What is TCP protocol?

TCP (short for the phrase ) BILLIONmission OLDontrol Protocol) is the transport protocol connection direction (Connection Oriented), that is, before connecting, a remote connection must be established. This process is called the 3-way handshake.

More specifically, the following:

Assuming PC A want to transfer data to PC REMOVE then, PC A will first have to establish a TCP connection to host B through a 3-way handshake:

Step 1: PC A sends PC B a packet with the SYN flag turned on, with the sequence number marked n

Step 2: PC B receives PC A’s SYN packet, it resends a packet with a SYN flag with SEQ sequence number of maccompanied by the ACK flag with SEQ sequence number n+1 To confirm.

Step 3: PC A receives a SYN from B and resends the packet with a SYN with SEQ sequence number . n+1 accompanied by the ACK flag with SEQ sequence number m+1

=> After 3 steps are completed, TCP connection is established between two machines A and B and can transmit data to each other.

tcp-va-udp (1)

Các bài viết liên quan:

How to get travel insurance

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023
5 Best Software to Stream Games

5 Best Software to Stream Games

2 Tháng Một, 2023
IBM Bridge To Cloud For Power

IBM Bridge To Cloud For Power- Everything You Should Know

2 Tháng Một, 2023
Top 10 CRM Software For Construction 

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
What Is IBM Software

What Is IBM Software? 4 Business Segments at IBM You Should Know

26 Tháng Mười Hai, 2022

Thus we can see, TCP has an ACK (Acknowledgment) mechanism used to confirm whether the data has been transmitted to the destination or not, and a packet numbering mechanism (Sequencing) for the purpose of assembling packets. exactly at the time of sending and receiving packets to avoid duplication.

If no response is received, it will resend the packet to ensure the process is not lost. Therefore, data will not be lost on the transmission line, but in return the data transmission speed will be slow.

tcp-va-udp (3)
TCP packet structure (quite complicated)

#2. What is UDP protocol?

UDP (short for the phrase ) User EASYatagram Protocol) is the transport protocol direction not connected (Connectionless).

The UDP protocol does not have a 3-way handshake like the TCP protocol, but instead, it will transmit data immediately, bypassing the authentication mechanism as well as numbering the packets.

Packets are continuously sent to the receiver, the sender does not need to “wait” to see if the receiver has received it, but continues to send.

Therefore, if the receiver loses some packets, it will be lost (the sender will not resend), which is also why applications using UDP protocol will be very fast, because it has Skip the error checking step when transmitting the packet.

tcp-va-udp (4)
UDP protocol packet structure

A simple example for the UDP protocol is Game Online.

Try to imagine when Thach is playing an online game like League of Legends such as.

The server will continuously send a series of UDP packets to Thach’s computer, in a very tense fight, unfortunately Thach lost his life, Thach could not control his champion to continue fighting ᵔᴥᵔ

Yes, and by the time the Internet connection was back, the fighting was over and Thach was on the scoreboard

Thus we can see, the sender is the server that continues to send the packet without knowing whether the receiver received it or not.

The same goes for when you are watching a live video (Live Stream) so if the connection is lost – your video will be paused and then it will go to the next latest broadcast.

Bypassing the error correction mechanism helps UDP increase connection speed and reduce real-time latency, something very important in Online Games and Live Video.

#3. Compare TCP and UDP protocols

tcp-va-udp (2)

TCP UDP
Connection direction Direction not connected
Slow speed High speed
There is an authentication mechanism in case of packet loss No authentication mechanism for packet loss
Packet Marking Do not mark packets
High reliability Low confidence
Header 20 bytes 8 bytes header

#4. Epilogue

Okay, so you got it What is TCP protocol? and What is UDP? then right?!

Through the above analysis, we can see that TCP or UDP protocols have their own advantages and disadvantages.

Depending on the specific case, as well as the needs of use, we will choose accordingly. For applications that need high reliability and do not need to be too fast, we will use TCP, such as websites, emails, or sending data, etc.

As for applications that need to have fast speed, low latency, etc., we will use the UDP protocol. Such as Online Game, Livestream, Online Video, etc.

Hope the information in this article will be useful to you, don’t forget to share the article if you find it useful!\

CTV: Dinh Hoang Thach – Blogchiasekienthuc.com
Edit by Kien Nguyen

The article achieved: 5/5 stars – (There is 1 review)

Note: Was this article helpful to you? Don’t forget to rate the article, like and share it with your friends and family!

Previous Post

Download Ghost Windows 10 Pro Build 21H2 Full Soft Summer 2022

Next Post

The most beautiful wooden stair railing models 2022

Megusta

Megusta

Related Posts

5 Best Software to Stream Games

5 Best Software to Stream Games

2 Tháng Một, 2023
Top 10 CRM Software For Construction 

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
Instruction how to use OBS streaming software

Features, settings and how to use OBS streaming software through 9 simple steps

25 Tháng Mười Hai, 2022
What is Trans woman?  What is Transgender Women?

What is Trans woman? What is Transgender Women?

23 Tháng Mười Hai, 2022
Christmas gift: Genuine Windows 10 Pro for only $6.63 and Office 2021 for $14.22

Christmas gift: Genuine Windows 10 Pro for only $6.63 and Office 2021 for $14.22

22 Tháng Mười Hai, 2022
How to get 50 free coins of SkyJoy App to redeem

How to get 50 free coins of SkyJoy App to redeem

21 Tháng Mười Hai, 2022
Load More
Next Post
The most beautiful wooden stair railing models 2022

The most beautiful wooden stair railing models 2022

Trả lời Hủy

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Bài viết mới

How to get travel insurance
Đời sống

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly
Phần mềm

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023
5 Best Software to Stream Games
Software

5 Best Software to Stream Games

2 Tháng Một, 2023
IBM Bridge To Cloud For Power
Software

IBM Bridge To Cloud For Power- Everything You Should Know

2 Tháng Một, 2023
Top 10 CRM Software For Construction 
Tech

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
What Is IBM Software
Software

What Is IBM Software? 4 Business Segments at IBM You Should Know

26 Tháng Mười Hai, 2022
W3Schools

Ads

Contact: [email protected]

DMCA.com Protection Status

Categories

  • Android
  • Cạm bẫy tâm lí
  • Chưa được phân loại
  • Đồ họa
  • Đời sống
  • Gen Z
  • Health
  • iOS
  • Kĩ năng mềm
  • News
  • Nhà mạng
  • Phần mềm
  • Phần mềm đồ họa
  • Review sách
  • Software
  • Tech
  • Thiết kế ảnh
  • Thiết kế video
  • Thủ thuật
  • Travel
  • Văn hóa Nam Bộ
  • Văn học
  • Window

Browse by Tag

ai là triệu phú android Apple browser Bullet Journal bản thân chai pin Chỉnh ảnh data domain download fshare game game show giả lập màu hosting IKEA ios khuyến mãi kinh doanh kiến thức kiểm tra pin messenger miễn phí mua sắm Máy ảnh mạng network nghệ thuật ngôn ngữ nhà Trần pin laptop quảng cáo tiếng anh trạng thái Trần Thủ Độ tên miền tắt hoạt động từ vựng video viettel window 10 word zalo Đơn giản

Recent News

How to get travel insurance

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023

Trang tin nóng hổi - vừa thổi vừa xem

No Result
View All Result
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z

Trang tin nóng hổi - vừa thổi vừa xem