Application of Programmable Devices in Ethernet hubs

Source: Internet
Author: User

1 Introduction

With the development and maturity of Ethernet technology, it is widely used. The interconnection technology of Ethernet has also evolved from bus-type networks with dedicated coaxial cables to multi-layer switches. The efficiency and reliability of transmission and exchange are greatly improved. In a common commercial network, due to the high performance and scalability of switches, it has gradually become a mainstream technology for Ethernet Interconnection, and the hub technology is basically no longer used and gradually fades out of the market. However, some special technologies are required in some special application scenarios, such as data monitoring, attack detection, and prevention for network security. Network systems usually need to collect and analyze the data of each network port. If a switch is used to complete the process, the switch must have special port monitoring capabilities, which will inevitably lead to complicated switching and design, high cost. If Hub technology is used, although the efficiency of transmission switching is lower, it is easy to implement monitoring and data collection. In addition, the hub features low transmission latency and fast response speed, which is also an advantage for systems that require real-time performance. Currently, general-purpose hubs have basically been discontinued, and component manufacturers have also stopped developing components. Therefore, it is necessary to use other methods to implement the functions of hubs. This article introduces the principle and method of using FPGA to implement a hub.

2. Working Principle of the hub

The Hub works on the physical layer in the IS0 (International Organization for Standardization) OSI (Open System Interconnection) layer-7 model. Its essence is a multi-port repeater. The main function is to repeat the received signal to expand the transmission distance of the network. Because Ethernet complies with the CSMA/CD protocol, the computer listens to the carrier before sending data. Data is sent only when the network is determined to be idle. The early bus mode was that all computers in the Network were interconnected through a coaxial cable with a T branch. The network interface of the computer used the shared media of the coaxial cable to perform carrier listening and conflict detection, to transfer valid data packets. Currently, commonly used vswitches do not need to detect carriers or share media conflicts. The Hub uses the Ethernet shared media feature to implement the Broadcast Transmission Mode of data packets, so as to achieve monitoring, data collection, and other functions. Although the hub can provide independent network interfaces and channels to connect to the computer, a separate internal BUS is still used as the shared media within the hub. When multiple port data packets occur simultaneously, collision and conflict are inevitable. According to the principle of conflict detection, data packets that conflict with each other will be lost. Therefore, the hub will strengthen the conflict, so that all computer network interfaces connected to the hub can correctly determine the packet conflict, and the network interface can resend the data frame according to certain rules. Because of this, the size of the hub is generally not too large, and the effective transfer rate of packets on the network cannot be too high. Otherwise, the probability of conflict will greatly increase, resulting in multiple data resends, even packet loss affects the transmission reliability of the network. These features must be taken into account during system design.

3. Hub implementation

3.1 Implementation Method

The frame structure of the Ethernet physical layer includes the forward guide code, delimiters, and the net load of the physical layer. The Hub identifies data packets based on the forward guide code and delimiters for processing. Currently, the common Ethernet physical layer Transceiver Technology is very mature. Taking the M Ethernet physical layer interface device as an example, interfaces such as MII and RMII can be provided to connect with the data packet processing circuit. Therefore, this article takes the RMII interface as an example to describe the implementation principle of the hub. The main functions of a hub are data receiving, conflict detection, conflict enhancement, and data broadcast.

The data receiving function extracts valid data packets from CRS_DV and RXD received by each port, as shown in 1, the extraction is based on the fact that the received CRS_DV is valid and RXD has no carrier error, and the data after the forward code and SFD (delimiters) are valid net load data. Because the Hub does not change the received data and forwards the data directly after regeneration, data storage only requires a few clock cycles to facilitate subsequent processing circuit judgment and forwarding.

Conflict Detection is based on whether data packets arrive at the same time on each port. If two or more ports receive data packets at the same time, it is considered that a packet conflict occurs, the Hub reacts to the conflict by enhancing the conflict, that is, sending the enhanced conflict packet to all ports during the detection of the conflict. If the conflict still exists, the reinforcement conflict will continue after the interval is 960ns until the conflict disappears. Integrity should be ensured during the transmission of enhanced conflicting signals. Even if a conflict disappears during the conflict enhancement period, the enhanced conflicting signals should be sent completely.

Data Broadcast is to send data received by a port to all other ports. This is the basic function of the hub and the only way the hub forwards data packets between ports. As shown in 2, TX_EN is the sending enable, and TXD is the sending data. The sent data includes the forward code, delimiters, and net load data.

In addition, if the FPGA scale permits, physical layer functions can also be implemented in the programmable chip, and functions such as signal level conversion, clock extraction, and data encoding/decoding can be processed by FPGA, further improve system integration and reliability.

3.2 simulation waveform

The hub designed in this article is multi-port, and simulation is performed after the programmable device is implemented. Figure 3 shows the simulation waveform without conflict, the Hub forwards the received data from Port 1 to all ports. In the figure, rx_dv_in indicates the valid carrier listening/data of the port. rxd rmii0 indicates the receiving data of port 0, tx en 0ut is the sending enable of the port, and txd_mii0, txd_rmii2, and txd_rmii3 are the sending data of the three ports. At this time, no conflict occurs, and packets are broadcast normally.

Figure 4 The Hub simultaneously receives the simulation waveform of the data from ports 0 and 1, and the data packet is conflicted. Therefore, the collision detection mark collision detect is set to a high level, and then the hub strengthens the conflict collision enhance to a high level. during this period, the server sends enhanced conflict information to all ports and discards all received data so that the port resends the data.

4 Conclusion

The functions and performance of the hub discussed in this article fully meet the system requirements. At the same time, due to the adoption of a new programmable chip, the volume power consumption of the hub is also greatly reduced. Using a programmable chip to implement a hub can also be free from the limitations of traditional dedicated devices. You can increase or decrease the number of ports, configure the port type (cable or optical fiber), and improve system integration, it has certain application value in special scenarios with high requirements.

  1. Describes the concept and basic functions of a hub in detail.
  2. Network Communication fails due to cascade of 3 MB hubs
  3. Differences between low-price switches and hubs

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.