& Lt; TCP/IP details volume 1 & gt; Reading Notes (3) -- ip layer sharing (UDP and IGMP)

Source: Internet
Author: User

This time, we will summarize the UDP and IGMP in the IP layer. UDP is a simple datagram-oriented transport layer protocol that provides unreliable services: It adds the application data to the UDP header and then sends it to the IP layer, but they cannot be guaranteed to reach their destination. The application must be concerned with the length of the IP datagram. If it exceeds the MTU of the network, it must partition the IP datagram. If necessary, each network between the source end and the target end needs to be split, not only when the sending end host connects to the first network. IGMP is an Internet group management protocol that supports multicast between hosts and routers. Broadcast and Multicast can only be applied to UDP. Therefore, I have summarized UDP and IGMP here. This is also the order in the book.

 

1. UDP: User Datagram Protocol

Is the UDP Header Format:

The port number indicates the sending and receiving processes. The UDP length field refers to the byte length of the UDP header and UDP data. The value is equal to the length of the IP datagram in the IP datagram headquarters minus the length of the TCP header. The UDP test and (optional) overwrite the UDP header and UDP data. The calculation method is the same as the IP header test and calculation method. If the UDP data is an odd byte, it is filled with a byte of 0. during calculation, the UDP pseudo-header will be added before the UDP header to check whether the data has arrived at the destination correctly twice. It is pseudo-header and byte filling:

We have mentioned the network MTU, the MF and DF bits in the IP datagram header, and the 13-bit offset bits. When the UDP datagram length exceeds the network MTU, you must partition it. If DF bit is set but fragments are required when passing through a network, an ICMP "unreachable (multipart)" error message is generated, I forgot to write it in the ICMP section above. New vrouters are allowed at every 7-7 of the first 8 bytes of ICMP ~ Return your MTU in 8 bytes (which is required to be set to 0. Note the following: (1) data in each of the parts except the last one (except the IP address header) it must be an integer multiple of 8 (why? I still don't know what else to do ...); (2) The first part of the transport layer appears only in the first part. UDP is relatively simple. All packet loss and retransmission problems must be managed by upper-layer applications.

 

2. Internet address, broadcast, Multicast

There are 5 types of Internet addresses, in the following format:

Three types of addresses are available: unicast address, multicast address, and broadcast address. The host number 0 indicates the network number, and the host number 1 indicates the broadcast on the network. There are four broadcast addresses:

First, the restricted broadcast address 255.255.255.255.255. this address is used for the destination address of the IP datagram during host configuration. Under no circumstances will the router forward the datagram whose destination address is a restricted broadcast address, in this way, the datagram only appears in the address network.

The second is the broadcast address pointing to the network. Host numbers are all 1. For example, if the broadcast address of type A is netid.255.255.255.255, A vro must forward the broadcast pointing to the network.

Third, the broadcast pointing to the subnet. The address that points to the subnet's broadcast address. The subnet mask is required for the IP address that is used as the subnet direct broadcast address. For example, if the router receives a datagram sent to 128.1.2.255, when the subnet mask of Class B network 128.1 is 255.255.255.0, this address is the broadcast address pointing to the subnet. However, if the subnet mask is 255.255.254.0, this address is not the broadcast address pointing to the subnet.

4. Broadcast pointing to all subnets. To broadcast to all subnets, you also need to know the subnet mask of the destination network to distinguish it from the broadcast address pointing to the network. The subnet number pointing to the broadcast address of all subnets is 1. for example, if the destination subnet mask is 255.255.255.0, the IP address 128.1.255.255 is a broadcast address pointing to all subnets. However, if the network is not divided into subnets, This is a broadcast pointing to the network.

Broadcast imposes a lot of burden on hosts on the network. Broadcast datagram is discarded only when the UDP layer determines whether it is required by the host (no listening port. Multicast is a method between unicast and broadcast.

A host group is a set of hosts that can receive data sent to a specific multicast group address. A host group can span multiple networks, and members in the host group can join or leave the Host group at any time. There is no limit on the number of hosts in the Host group, and hosts that do not belong to a host group can send information to this group.

Is the conversion from multicast addresses to Ethernet addresses:

The reason for this is 23-bit ing. I heard that the mentor of the person who invented the multicast (who was still A doctor at the time) was willing to buy him half A Class A address for the experiment, therefore, only 23 bits are mapped. This is what I heard in a certain online lesson, hey.

 

3. IGMP Protocol

Multicast routers use IGMP packets to record the changes of group members in the network connected to the vro. The packet format is as follows:



 

The rules are as follows:

(1) When the first process is added to a group, the host sends an IGMP report. If multiple processes are added to the same group, only one report is sent;

(2) When a process leaves a group, no report is required; when the router sends an IGMP query later, no report is sent;

(3) The multicast router regularly sends an IGMP query (to each interface) to check whether there are any multicast group processes contained in the RST packet, in this case, the multicast address in the IGMP query packet is set to 0.

(4) The host sends an IGMP report to respond to an IGMP query. IGMP packets must be sent back to each group that contains at least one process.

I remember I mentioned several algorithms to reduce network traffic, including pruning and suppression. In short, one core idea is that multicast routers do not care about the number of hosts in a multicast group, it only wants to know whether multicast groups on a given interface are interested in this multicast group.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.