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. About Spring

    “Spring is the most popular application development framework for enterprise Java.”这是Spring官方首页上的第一句 ...

  2. centos6.5 搭建nginx1.6.0 +gridfs +mongodb2.4..10环境

    一) 缘由 因为公司业务需要,需要搭建图片服务器,需求很简单:读取+上传图片,当时第一考虑用nginx来作,但考虑到单纯用nginx来作,无法水平扩展和管理,一旦遇到海量图片,就无办法 扩展.所以考虑 ...

  3. android sqlite使用之模糊查询数据库数据的三种方式

    android应用开发中常常需要记录一下数据,而在查询的时候如何实现模糊查询呢?很少有文章来做这样的介绍,所以这里简单的介绍下三种sqlite的模糊查询方式,直接上代码把: package com.e ...

  4. 用indexOf获取字符窜某个字符的所有位置

    indexOf方法可以传两个参数,第二个参数是传位置的参数,利用这点获取所有的位置.例如: var str = "hello world,welcome!"; var arr = ...

  5. Url以.(点)结尾,在使用httpwebrequest读取的时候,微软会有一个bug……

    解决方法在此,不重复做赘述,传送门:http://stackoverflow.com/questions/856885/httpwebrequest-to-url-with-dot-at-the-en ...

  6. 用vue实现简单实时汇率计算功能

    最近在自己摸索vue的使用,因为相对于只是去看教程和实例,感觉不如自己动手写一个demo入门来的快.刚好看到小程序中有一个简单但是很精致的应用极简汇率,而且它的表现形式和vue的表现形式很像,于是想着 ...

  7. 【Java每日一题】20170110

    20170109问题解析请点击今日问题下方的"[Java每日一题]20170110"查看(问题解析在公众号首发,公众号ID:weknow619) package Jan2017; ...

  8. CodeForces 157C Message

    $dp$. $dp[i][j]$表示$s[i]$到$s[j]$和$t[lent-1+i-j]$到$t[lent-1]$有$dp[i][j]$位相同,然后枚举一遍$dp[i][j]$就可以算出答案了. ...

  9. PRD学习笔记:一些需要注意的说明

    控件说明 1)输入框 若输入框有默认提示,点击输入框,弹出软键盘. 当输入框内不为空(空格除外)时,默认显示消失. 2)软键盘的弹出及退去机制 当输入框内必须输入的为数字时,弹出数字软键盘.其余时候, ...

  10. 安装Java Cer证书

    skldfsdf  Javaawtetwetwetwetwe testse Java estestset