refered from http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/

TCP UDP
Reliability: TCP is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message. Reliability: UDP is connectionless protocol. When you a send a data or message, you don't know if it'll get there, it could get lost on the way. There may be corruption while transferring a message.
Ordered: If you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order. Ordered: If you send two messages out, you don't know what order they'll arrive in i.e. no ordered
Heavyweight: - when the low level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together. Lightweight: No ordering of messages, no tracking connections, etc. It's just fire and forget! This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.
Streaming: Data is read as a "stream," with nothing distinguishing where one packet ends and another begins. There may be multiple packets per read call. Datagrams: Packets are sent individually and are guaranteed to be whole if they arrive. One packet per one read call.
Examples: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol (FTP port 21) and Secure Shell (OpenSSH port 22) etc. Examples: Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online multiplayer games etc

Further readings

Difference between TCP and UDP的更多相关文章

  1. TCP和UDP的9个区别是什么

    TCP和UDP是两个传输层协议,广泛应用于网络中不同主机之间传输数据.对任何程序员来说,熟悉TCP和UDP的工作方式都是至关重要的.这就是为什么TCP和UDP是一个流行的Java编程面试问题.我曾经在 ...

  2. TCP与UDP区别

    原文链接:http://blog.sina.com.cn/s/blog_493309600100clrw.html TCP与UDP区别 TCP---传输控制协议,提供的是面向连接.可靠的字节流服务.当 ...

  3. JDK16关于TCP和UDP的优化

    文章转自belaban.blogspot.com Double your performance: virtual threads (fibers) and JDK 15/16!If you use ...

  4. C++网络套接字编程TCP和UDP实例

    原文地址:C++网络套接字编程TCP和UDP实例作者:xiaojiangjiang 1.       创建一个简单的SOCKET编程流程如下 面向有连接的套接字编程 服务器: 1)  创建套接字(so ...

  5. 【校验】TCP和UDP的校验和

    一开始,私以为校验和只是简单的求和得到的结果,后来在TCP和UDP里面看到使用的校验和方式有点奇怪--二进制反码(循环进位)求和. 人类的认知过程必将从简单到复杂,看下这个二进制反码循环求和是啥子意思 ...

  6. 初入网络系列笔记(2)TCP和UDP

    一.借鉴说明,本博文借鉴以下博文 1.BlueTzar,TCP/IP四层模型, http://www.cnblogs.com/BlueTzar/articles/811160.html 2.叶剑峰,漫 ...

  7. 传输层协议TCP和UDP

    本文力图简洁,让读者对TCP和UDP有个初步的认知.闲话少说,现在开始吧.TCP和UDP都是传输层的协议.TCP通过三次握手建立可靠连接,对未送达的消息重新进行发送.UDP不建立连接而直接发送,对未送 ...

  8. 【Python网络编程】利用Python进行TCP、UDP套接字编程

    之前实现了Java版本的TCP和UDP套接字编程的例子,于是决定结合Python的学习做一个Python版本的套接字编程实验. 流程如下: 1.一台客户机从其标准输入(键盘)读入一行字符,并通过其套接 ...

  9. http、tcp、udp、OAUTH2.0网络协议区别

                    一.先来一个讲TCP.UDP和HTTP关系的 1.TCP/IP是个协议组,可分为三个层次:网络层.传输层和应用层. 在网络层有IP协议.ICMP协议.ARP协议.RAR ...

随机推荐

  1. 一点MongoDB的基础及mongodb在mac上的安装

    最近发现维持写博客的习惯还是挺困难的,尤其对我来说,计划好的事过了好长时间才想到要去做. 这段时间一直在熟悉MongoDB,首先我是参考的这一篇:8天学通MongoDB   原博主写得非常好,我这里就 ...

  2. IIS7中 ASP.NET授权功能如何实现对静态文件的控制

    IIS7中 ASP.NET授权功能如何实现对静态文件的控制 前序 .net提供了3种用户认证的方式,分别是Windows,Forms,Passport.这几种形式的定义可以在网站根目录下Web.con ...

  3. [置顶] Android系统移植与调试之------->Amlogic方案编译步骤

    1. 拷贝Amlogic的SourceCode 切换目录到  /home/roco/work/amlogic/SourceCode/mx0831-0525下将mx0831-0525.tgz拷贝到  / ...

  4. hdu 1217

    判断通过货币的兑换能否获利,,最短路,这里是乘法,, #include<stdio.h> #include<string.h> double map[31][31],ans[3 ...

  5. ios-王云鹤 把UIdatePicker 嵌入到 UIActionSheet中

    这里简单的解释一下: -(void) setUpDatePicker方法用于调用UIDatePicker -(void) DatePickerDoneClick:(id) sender方法用于实现隐藏 ...

  6. C# 中判断字符串是不是汉字

    //1.用ASCII码判断 //在 ASCII码表中,英文的范围是0-127,而汉字则是大于127,具体代码如下: string text = "是不是汉字,ABC,柯乐义"; ; ...

  7. 结构-行为-样式-Js排序算法之 快速排序

    快速排序算法,是我的算法系列博客中的第二个Js实现的算法,主要思路:    在一个数组中随机取一个数(一般都取第一个或者最后一个),使这个数与数组中其他数进行比较,如果比它大就放到它的右边,比它小就放 ...

  8. 【.NET-EF】Entity Framework学习笔记1 - VS2013没有EF的解决方法

    解决方法:我本来也没有,百度了一下,在C:\ProgramData\Package Cache\{08AEF86A-1956-4846-B906-B01350E96E30}v12.0.20912.0\ ...

  9. JS 多个参数的传递

    var link = $("<a/>", { href: '/StandardManagement/StandardActivitiesDetail?' + $.par ...

  10. 开子线程下载图片,回到主线程刷新UI步骤

    -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { [NSThread detachN ...