Speed read the original -TCP / IP (broadcast and multicast)

Chapter 12 Broadcast and Multicast

12.1 Introduction

In Chapter 1, we noted that three IP address: unicast address, broadcast address and multicast address. This chapter will introduce broadcasting and multicasting in more detail.

Broadcast and multicast UDP only applied, they will need to pass messages while the application is very important to multiple recipients. TCP is a connection-oriented protocol, which means that the two were running on the host (determined by IP address) in the two processes (determined by the port number) there is a connection between.

Consider a network shared channel, comprising a plurality of hosts such as Ethernet. Each Ethernet frame contains the source and destination hosts Ethernet address (4 8 bit). Typically, each Ethernet frame is only sent to a single destination host, the destination address specifies a single receiving interface, which is called unicast (unicast). In this manner, the communication two hosts will not interfere with any other hosts within the network (where contention can cause a shared channel is excluded).

Sometimes, however, a host to all other hosts would like to send a frame online, which is broadcast. This process can be seen through ARP and RARP. Multicast (multicast) is between unicast and broadcast: a plurality of frames sent only to the hosts belonging to the multicast group.

In order to clarify broadcast and multicast, the host needs to know the frame transmitted from the filtering process by the channel. FIG 12--1 illustrates this process. First, the frame transmitted from the card to see over a channel, determines whether the frame is received, after receiving it if the device driver to transmit. Typically card to receive only those frames for the destination address or the physical address of the broadcast network card address. Further, most of the interface are set to a mixed mode, this mode can receive a copy of each frame. As an example, tcpdump use this mode.

Currently, most of the network card can be configured to receive the destination address is a multicast frame or a certain subnet address multicast addresses. For Ethernet, when the highest byte address of the least significant bit set to 1 indicates that the address is a multicast address, hexadecimal can be expressed as 01: 00: 00: 00: 00: 0 0 (Ethernet broadcast address ff: ff: ff: ff: ff: ff can be seen as a special case of Ethernet multicast addresses).

If the card receives a frame, the frame will be transmitted to the device driver (if the frame check and wrong, the card will discard the frame). Device driver for additional frame filtering. First, the frame type must be specified protocol (IP, ARP, etc.) to be used. Next, the filtered multicast host to detect whether the multicast group of multicast address described.

The device driver then transmits the data frame to the next layer, for example, when the frame type is specified as an IP datagram, it is passed to the IP layer. More filters for detecting IP source and destination addresses according to the IP address. If the normal, will be transferred to the next layer datagram (e.g. TCP or UDP).
Here Insert Picture Description
Each UDP received by the IP datagram transmitted, according to the destination port number, source port number and sometimes a data packet filtering. If the process is not currently using the destination port number, it discards the data packet and generates an ICMP unreachable packets (TCP port number based on its similar for filtration). If the UDP datagram verifying the presence and wrong, they will be discarded.

Broadcast problem is that it increases the processing load on the host broadcast data is not of interest. Take a broadcast application using UDP as an example. If there are hosts within the network 50, but only the 20 participating application, each time that a UDP broadcast transmission 20 in the host, and the remaining 30 have to deal with these hosts broadcast datagram. Until UDP layer, received UDP broadcast packets will be dropped. This host 30 discards the broadcast datagram UDP is used because the host is not the destination port.

Multicast appeared to reduce the processing load on the host application is not interested. Using multicast host may join one or more multicast groups. In this way, the card will be informed of the hosts belong to which multicast group, and then only where the host receives multicast frames that multicast group.

Released 1489 original articles · won praise 1394 · Views 120,000 +

Guess you like

Origin blog.csdn.net/weixin_42528266/article/details/104710612