Analysis of flow control mechanism

Source: Internet
Author: User
Tags fcoe

Flow control is a basic feature of Ethernet that prevents dropped frames in the event of port congestion. Before delving into the analysis, let's look at a simple application scenario:

Port A and B receive the message, and port C forwards the message out. If the packet rate of ports A and B is greater than the bandwidth of Port C, then some of the messages will be in buffer inside the device. When the buffer occupancy rate reaches a certain level, ports A and B will send pause frames outward, notifying the peer to suspend sending for a period of time. Pause frames can only block the sending of normal data frames to the peer, and cannot prevent the sending of Mac control frames.

The above description has a prerequisite that port A and B work in full duplex mode and enable the flow control function. On the other hand, we also have the wishful thinking that the peer can recognize pause frames and can respond appropriately. In other words, the port on the end should also turn on the flow control function.

It is important to note that some Ethernet devices can only respond to pause frames, but cannot send pause frames.

The basic principle of flow control is not difficult to understand, it is easy to overlook the point is--after the port received pause frames, how long to stop sending messages. In fact, the pause frame carries the time parameter. A device that receives a pause frame can determine how long to stop sending by simply parsing it. Typically, the local port will receive multiple pause frames consecutively in the event of congestion on the end device. As long as the congestion status of the peer device is not lifted, the associated port will always send pause.

The structure of the pause frame

The frame length of the pause frame is 64 bytes and the structure is very simple. As shown below:

The destination MAC address of the pause frame is the reserved MAC address of 01-80-c2-00-00-01 (used by the pause frame of Mac control), and the source Mac is the MAC address of the device that sent the pause frame.

The Length/type field is hexadecimal number 8808.

The value of the mac control opcode field is 0x0001. In fact, the pause frame is one of the Mac control frames, and other types of Mac control frames use different opcode values, which are not explained in detail here. Later, we will talk about a PFC frame similar to pause, where the value of the field in the PFC frame is 0x0101.

The Mac control parameters domain needs to be parsed according to the type of mac control opcode. For pause frames, the field is a 2-byte unsigned number with a range of 0~65535. The time unit for this domain is Pause_quanta, and each pause_quanta is equivalent to 512 bits of time.

Self-negotiation of flow control

In reality, most vendor Ethernet switches have flow control switch commands. Some manufacturers of equipment can be negotiated in the self-negotiation function, this behavior has the IEEE standard as the basis.

In the self-negotiated information, there are two stream-controlled bits, namely pause and asm_dir, that represent symmetric pause and asymmetric pause respectively. Symmetric pause indicates that pause frames can be sent and received, while asymmetric pause indicates that only pause frames are sent or received.

The 28b.3 of the IEEE 802.3 standard describes how these two bits are parsed. In short, if the two parties send a negotiation message that the pause bit is 1, both parties can send and receive pause frames. If one of the pause bits is 0, then the value of the ASM_DIR bit will be combined with the value of the pause bit to be analyzed concretely.

How the half-duplex mode implements flow control.

As I said at the beginning of this article, ports A and B work in full-duplex mode for a reason. If the port is operating in half-duplex mode, then the pause frame is likely to conflict with the message sent to the end, the end can not receive a good pause frame, can not achieve the function of pause.

For half-duplex mode problems, the industry's common solution is "back pressure" or "jamming" mechanism. For these two mechanisms, the author has not found the corresponding standards, perhaps referred to is the same mechanism. In half-duplex mode, the port sends out some signals to occupy the link, and there is no chance to send the message to the end. This way, you can indirectly achieve and flow-control similar effects.

Priority-based flow control (PFC)

Ethernet data forwarding is best-effort, and does not guarantee the transmission process without packet loss. such as FTP, the upper layer protocol, through its own confirmation mechanism to ensure the integrity of the data, once the message is lost, you can request the end multiplicity transmission. Because of this, Ethernet's best-effort forwarding method has not encountered too much problem for a long time.

Although the IEEE 802.3x flow control can prevent packet loss, there is a problem that cannot be ignored. Pause frames cause all messages on a link to stop sending, which is obviously unacceptable in a network with high quality of service requirements. For this reason, there has been an opposition to convection control in the industry. The IEEE 802.1QBB standard solves this problem.

The core idea of IEEE 802.1QBB is to send pasuse frames separately for traffic of different priorities on the same link. When a priority business is congested, only such messages are suspended and other types of business are not affected. The IEEE 802.1Qbb is also known as PFC (priority-based flow control) because it provides flow control for specific priority traffic.

The FCoE technology encapsulates the data frame of the fiber channel in an Ethernet frame for transmission, and one of the basic requirements of FCOE is the inability to drop packets. PFC successfully meets the needs of FCoE without impacting other businesses.

Related Article

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.