网络协议(三)UDP

1、UDP(User Datagram Protocol):用户数据报协议,属于传输层协议。

  udp是无连接不可靠的数据报协议。其具有以下特性:

(1)无连接,即发送数据前不需要建立连接;

(2)尽最大努力交付,即不保证可靠交付;

(3)面向报文,DUP对应用层交下来的报文,既不合并,也不拆分,而是保留这些报文的边界;

(4)没有拥塞(流量)控制;(congestion control/traffic control)

(5)支持一对一、一对多、多对一、多对多的交互通信。

2、udp头部格式



Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be assumed to be the port to which a reply should be addressed in the absence of any other information. If not used, a value of zero is inserted.
Destination Port has a meaning within the context of a particular internet destination address.
Length is the length in octets of this user datagram including this header and the data. (This means the minimum value of the length is eight.)
Checksum is the 16-bit one’s complement of the one’s complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.
The pseudo header conceptually prefixed to the UDP header contains the source address, the destination address, the protocol, and the UDP length. This information gives protection against misrouted datagrams. This checksum procedure is the same as is used in TCP.


3、UDP基于端口的分用与复用



  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值