Network Protocol - UDP collusion

First, what is the UDP protocol?

 

UDP is the User Datagram Protocol short, the Chinese name is the User Datagram Protocol, is the OSI reference model transport layer protocol, which is a non-transport layer protocol connection, providing transaction-oriented messaging service simply unreliable. 

UDP is a formal specification IETF RFC768. UDP protocol number in the IP packet is 17.

 

ISO seven layer model: 

 

1.1 UDP header

 

FIG UDP header structure: 

 

 

UDP header consists of four parts, two of which are optional (pink background part indicated):

 

Source port and destination port used to mark each 16bit application process sent and received. Because UDP does not require a response, so the source port is optional, if not the source port, then set to zero.

 

Destination port behind a fixed length in bytes of the packet length field, used to specify the UDP datagram comprises a length, the minimum length of the data portion is 8byte.

 

The remaining portion of the header is used to 16bit header and data portions do together checksum (Checksum) of this part is optional, but generally use this feature in practical applications.

 

UDP and TCP checksum both to cover their header and data, but before the introduction of the IP header checksum covers only the IP header.

 

1.2 TCP and UDP difference

 

Feature point TCP UDP

Is connected non-connection-oriented connection-oriented

Transmission reliability reliable drop packets, unreliable

Small amount of data transmission scenarios transfer amount

Slow fast

TCP (Transmission Control Protocol) is a connection-oriented, reliable byte stream service. When former clients and servers to exchange data with each other, it must first establish a TCP connection between the two sides, in order to transmit data after. TCP provides a retransmission timeout, discards the duplicate data, test data, and other flow control functions, to ensure that data transmitted from one end to another end. 

UDP (User Datagram Protocol) is a simple-oriented transport layer protocol datagrams. UDP does not provide reliability, it just passed to the application layer IP datagram sent, but does not guarantee that they can reach their destination. Because UDP without establishing a connection between the client and the server before transmitting the data reported, and no timeout retransmission mechanisms, and therefore the transmission speed quickly.

 

Due to the lack UDP congestion control (congestion control), based on the mechanism required to reduce the network congestion collapse due to the effects of uncontrolled and high traffic load caused by UDP. In other words, since the sender UDP congestion can not be detected, the basic equipment such as a network using packet queue and discarded technology router often an effective tool in reducing the large amount of traffic over UDP. Datagram Congestion Control Protocol (the DCCP) designed to be streaming media, such as UDP flow rate of the high speed, the increased host congestion control to reduce this potential problem.

 

1.3 application scenarios

 

Lack of reliability, and are non-connection-oriented protocol, UDP applications must generally allow a certain amount of loss, and copy and paste error. However, some applications, such as TFTP, you need to ensure reliability, it must increase the underlying reliable mechanism at the application layer. But most UDP applications do not need a reliable mechanism, and may even have to introduce a reliable mechanism to reduce performance. Streaming media, instant games and multimedia IP telephony (VoIP) is a typical UDP applications. If an application requires high reliability, it can be a transmission control protocol (i.e., TCP protocol) instead of UDP.

 

Applications using UDP protocol are: Domain Name System (DNS), Simple Network Management Protocol (SNMP), Dynamic Host Configuration Protocol (DHCP), Routing Information Protocol (RIP), and so on. Because UDP does not belong to the connectionless protocol, which has a small consumption of resources, the advantages of fast processing, it is normal for audio, video, and normal data transfer when using UDP more, even if they occasionally lost as several data packets, nor will receive the results have much impact.

 

Second, unicast, multicast, broadcast, multicast

 

Suppose A (abbreviated All) on behalf of all the machines, M (multiple abbreviations) is representative of a plurality of machine A, G (group abbreviation) represents a group of machine represents a machine, then:

 

1 -> 1 is unicast;

1 -> M is multicast;

1 -> A is broadcast;

1 -> G is multicast;

 

When M = A, is the multicast broadcast;

When M = G, multicast to multicast;

1

2

3

4

5

6

7

Multicast include a form of multicast and broadcast, multicast, and broadcast all multicast.

 

2.1 Unicast

 

Unicast is between the host "one to one" communication mode. The sender need to specify the IP port and a recipient, the recipient will only receive datagrams. No impact on other machines within the subnet. 

In the unicast mode, the server must transmit data streams for each client, server × flow rate = number of clients client traffic, a large number of client machines, a large flow rate for each client application (e.g., streaming media) in server will be overwhelmed.

 

2.2 Broadcast

 

Broadcasting is "one for all" between the host communication mode. Subnet as the host sends a broadcast send a message to all hosts on the subnet can receive this information (regardless of whether you need this information). 

In broadcast mode, the server transmits no data to each individual client, the server load is extremely low flow rate. 

Can not be broadcast over the WAN, and broadcast messages can not be forwarded routing, it can only be broadcast in a subnet. Because if the router forwarding broadcast information, it will inevitably cause network paralyzed. This is why designers deliberately did not broadcast IP protocol mechanism for defining the scope of the Internet.

 

The host sends a broadcast message, the destination IP address needs to 255.255.255.255 and port number of the recipient.

 

2.3 Multicast

 

Multicast is between the host "one to many" communication mode. After a host joins a multicast IP, then transmitted to the multicast IP datagrams are sent to the host. 

Set aside specifically for a multicast address range for the Class D address in IPv4, the range 224.0.0.0 ~ 239.255.255.255, and the Class D address into partial link multicast address, multicast address reservation, management authority multicast address is as follows: 

Local link address: 224.0.0.0 ~ 224.0.0.255, a local area network, routers do not forward IP packets belonging to this range.

 

Reserved multicast address: 224.0.1.0 ~ 238.255.255.255, for worldwide or network protocol.

 

Management authority Address: 239.0.0.0 ~ 239.255.255.255, internal organization uses to limit the scope of multicast.

Guess you like

Origin www.cnblogs.com/h3rman/p/10929136.html