当前位置:网站首页>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
边栏推荐
- Dachang image library
- Use Scrollview and tabhost to realize vertical scrollbars and tabs
- Global and Chinese markets hitting traffic doors 2022-2028: Research Report on technology, participants, trends, market size and share
- 高数_向量代数_单位向量_向量与坐标轴的夹角
- Paper notes: limit multi label learning galaxc (temporarily stored, not finished)
- High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
- Number conclusion LC skimming review - 1
- SQL table name is passed as a parameter
- Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
- Overview of spark RDD
猜你喜欢
Building the prototype of library functions -- refer to the manual of wildfire
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
高数_向量代数_单位向量_向量与坐标轴的夹角
Zero foundation self-study STM32 - Review 2 - encapsulating GPIO registers with structures
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
Minecraft 1.16.5 biochemical 8 module version 2.0 storybook + more guns
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
Multi function event recorder of the 5th National Games of the Blue Bridge Cup
ReferenceError: primordials is not defined错误解决
数据工程系列精讲(第四讲): Data-centric AI 之样本工程
随机推荐
Paper notes: limit multi label learning galaxc (temporarily stored, not finished)
HDU_p1237_简单计算器_stack
After changing the GCC version, make[1] appears in the compilation: cc: command not found
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
大厂镜像库
有没有sqlcdc监控多张表 再关联后 sink到另外一张表的案例啊?全部在 mysql中操作
Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
高数_向量代数_单位向量_向量与坐标轴的夹角
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
[coppeliasim] 6-DOF path planning
零基础自学STM32-野火——GPIO复习篇——使用绝对地址操作GPIO
Initial understanding of pointer variables
Y a - t - il des cas où sqlcdc surveille plusieurs tables et les associe à une autre? Tout fonctionne dans MySQL
怎么检查GBase 8c数据库中的锁信息?
High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
The intelligent material transmission system of the 6th National Games of the Blue Bridge Cup
2022 eye health exhibition, vision rehabilitation exhibition, optometry equipment exhibition, eye care products exhibition, eye mask Exhibition
SSM assembly
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16