美文网首页
2018-10-25

2018-10-25

作者: 家中古词 | 来源:发表于2018-10-25 16:01 被阅读0次

Transmission Control Protocol is a connection-oriented protocol, which means that it requires handshaking to set up end-to-end communications. Once a connection is set up, user data may be sent bi-directionally over the connection.

  • Reliable – Strictly only at transport layer, TCP manages message acknowledgment, retransmission and timeout. Multiple attempts to deliver the message are made. If it gets lost along the way, the server will re-request the lost part. In TCP, there's either no missing data, or, in case of multiple timeouts, the connection is dropped. (This reliability however does not cover application layer, at which a separate acknowledgement flow control is still necessary)

  • Ordered – If two messages are sent over a connection in sequence, the first message will reach the receiving application first. When data segments arrive in the wrong order, TCP buffers delay the out-of-order data until all data can be properly re-ordered and delivered to the application.

  • Heavyweight – TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.

  • Streaming – Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries.

User Datagram Protocol is a simpler message-based connectionless protocol. Connectionless protocols do not set up a dedicated end-to-end connection. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver.

With User Datagram Protocol, computer applications can send messages, in this case referred to as datagrams (transfer unit in packet-switched network, structured in header and payload section), to other hosts on an Internet Protocol (IP) network.

  • Unreliable – When a UDP message is sent, it cannot be known if it will reach its destination; it could get lost along the way. There is no concept of acknowledgment, retransmission, or timeout.

  • Not ordered – If two messages are sent to the same recipient, the order in which they arrive cannot be predicted.

  • Lightweight – There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP.

  • Datagrams – Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent.

  • No congestion control – UDP itself does not avoid congestion. Congestion control measures must be implemented at the application level.

  • Broadcasts — being connectionless, UDP can broadcast - sent packets can be addressed to be receivable by all devices on the subnet.

  • Multicast - a multicast mode of operation is supported whereby a single datagram packet can be automatically routed without duplication to very large numbers of subscribers.

相关文章

网友评论

      本文标题:2018-10-25

      本文链接:https://www.haomeiwen.com/subject/rgqctqtx.html