当前位置:网站首页>Differences and usage scenarios between TCP and UDP
Differences and usage scenarios between TCP and UDP
2022-07-06 02:32:00 【Xiao Wang's shell is quite hard】
difference :
1. Connect
TCP yes ⾯ The transport layer protocol for the connection , Before transmitting data, it is necessary to build ⽴ Connect .
UDP It doesn't need to be connected , Instant transmission of data .
2. service object
TCP yes ⼀ Yes ⼀ Our two services , namely ⼀ A connection has only two endpoints .
UDP ⽀ a ⼀ Yes ⼀、⼀ For more than 、 Many to many interactive communication
3. reliability
TCP Reliable delivery of data , Data can ⽆ A mistake 、 No loss 、 No repetition 、 On demand arrival .
UDP Is the most ⼤ No ⼒ deliver , Reliable delivery of data is not guaranteed .
4. Congestion control 、 flow control
TCP There are congestion control and flow control mechanisms , Ensure the security of data transmission .
UDP There is no , Even if ⽹ Collateral ⾮ It's often congested , It won't affect UDP The transmission rate of .
5. ⾸ Department expenses
TCP ⾸ Ministry ⻓ The degree is ⻓, There will be ⼀ Fixed expenses ,⾸ The Ministry did not make ⽤「 Options 」 Field is 20 Bytes , If so ⽤ 了 「 Options 」 The field will change ⻓ Of .
UDP ⾸ There are only 8 Bytes , And it's fixed , It costs more ⼩.
6. transmission ⽅ type
TCP It's streaming , There is no boundary , But ensure sequence and reliability .
UDP yes ⼀ A package ⼀ Sending packets , There are boundaries , But there may be packet loss and disorder .
7. branch ⽚ Different
TCP The data of ⼤⼩ If ⼤ On MSS ⼤⼩, It will enter... At the transport layer ⾏ branch ⽚,⽬ After the bid host receives it , It is also assembled at the transport layer TCP Data packets , If you lose it halfway ⼀ A minute ⽚, Only need to transmit the lost points ⽚.
UDP The data of ⼤⼩ If ⼤ On MTU ⼤⼩, Will be in IP Step into ⾏ branch ⽚,⽬ After the bid host receives it , stay IP Layer assembled data , Then it is transmitted to the transport layer , But if you lose it halfway ⼀ A minute ⽚, In order to realize reliable transmission UDP Then you need to transmit all data packets , In this way, the transmission efficiency ⾮ Constant difference , So usually UDP The newspaper ⽂ should ⼩ On MTU.
Use scenarios :
TCP
because TCP yes ⾯ Connect to , It can ensure the reliable delivery of data , So often ⽤ On :
FTP ⽂ Piece transmission
HTTP / HTTPS
UDP
because UDP ⾯ towards ⽆ Connect , It can send data at any time , Plus UDP The process itself is simple ⼜⾼ effect , So often ⽤ On :
Less total packets of communication , Such as DNS 、 SNMP etc. 、 video 、⾳ Frequency and other multimedia communication 、⼴ Broadcast communications
边栏推荐
- Six stone management: why should leaders ignore product quality
- 【MySQL 15】Could not increase number of max_ open_ files to more than 10000 (request: 65535)
- 机器学习训练与参数优化的一般过程 (讨论)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
- MySQL winter vacation self-study 2022 11 (7)
- 2020.02.11
- 729. My schedule I / offer II 106 Bipartite graph
- MySQL winter vacation self-study 2022 11 (5)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
- Lecture 4 of Data Engineering Series: sample engineering of data centric AI
猜你喜欢
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
高数_向量代数_单位向量_向量与坐标轴的夹角
Multi function event recorder of the 5th National Games of the Blue Bridge Cup
Easy to use js script
Httprunnermanager installation (III) - configuring myql Database & initialization data under Linux
Shell script updates stored procedure to database
技术管理进阶——什么是管理者之体力、脑力、心力
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
MySQL lethal serial question 1 -- are you familiar with MySQL transactions?
随机推荐
2020.02.11
SQL table name is passed as a parameter
有没有sqlcdc监控多张表 再关联后 sink到另外一张表的案例啊?全部在 mysql中操作
MySQL winter vacation self-study 2022 11 (7)
Paper notes: graph neural network gat
Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
Black high-end responsive website dream weaving template (adaptive mobile terminal)
怎么检查GBase 8c数据库中的锁信息?
Compact lidar global and Chinese markets 2022-2028: technology, participants, trends, market size and share Research Report
I changed the driver to 5.1.35, but it is still the same error. I can succeed even now, but I will report this every time I do an SQL operation
【机器人手眼标定】eye in hand
3D drawing ()
力扣今日題-729. 我的日程安排錶 I
How to check the lock information in gbase 8C database?
【机器人库】 awesome-robotics-libraries
MySQL winter vacation self-study 2022 11 (5)
Template_ Find the reverse pair of permutations_ Sort based on merge
Use image components to slide through photo albums and mobile phone photo album pages
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Bigder:34/100 面试感觉挺好的,没有收到录取