随着计算机性能的提高及通信量的聚增,传统局域网已经越来越超出了自身负荷,交换式以太网技术应运而生,大大提高了局域网的性能。网络交换机能显著的增加带宽,可以建立地理位置相对分散的网络。局域网交换机的每个端口可并行、安全、实时传输信息,而且性能稳定、结构灵活、易于安装、便于管理,能很好地满足企业网和电信运营商宽带接入的需求。
1 Hardware Design of Network Switch
As people demand more security and high bandwidth in network applications, network switches are becoming more and more widely used. This switch uses the ROX bus of the AL101 chip, connecting three 8-port switch chips to form a 24-port switch, meeting the user's demand for multiple switch ports.
1.1 Circuit performance requirements
The high-speed PCB circuit board of the switch has relatively high requirements on EMC and ESD. It uses 75MHz and 50MHz high-speed clocks, and requires the accuracy of the crystal oscillator to be less than 50PPM. At the same time, the clock needs to be sent to different chips through the clock distribution circuit, and the phase difference between the distributed clocks needs to be less than 2ns.
The switch has 24 10/100M adaptive ports, each of which can achieve line-speed switching. According to user needs, the ports can be set to 10/100M rate, full/half duplex, flow control, static MAC address, mirroring, VLAN, etc.
1.2 Switch Block Diagram
The switching technology of this switch adopts the store-and-forward method, and is mainly composed of five parts: interface unit, switching unit, management unit, light display unit and power interface unit. Its block diagram is shown in Figure 1.
After the RJ45 interface receives the data packet with Ethernet frame structure, it is sent to PHY (physical interface chip) after transformer isolation and impedance matching. In this chip, the conversion of analog signal to digital signal of RMII interface is completed, and the link status, conflict, whether the information is too long, rate and other information are obtained.
The data enters the switching chip (composed of three chips, forming a loop through the ROX bus, which can complete the data exchange between the three chips), and the switching chip will obtain the destination address and source address of the data, and perform error checking on the Ethernet frame. The switching chip saves the source address in its own MAC address table, and then matches the destination address with the address in the MAC address table to obtain the corresponding port to which the data will be forwarded. If the destination port is in the same switching chip, the data is taken out of the SGRAM and forwarded to the corresponding port; if the destination port is not in the same switching chip, the data is transmitted to the corresponding switching chip through the ROX bus and then forwarded out; if the corresponding destination address is not found in the MAC address table, the frame is forwarded to all ports other than the source port that belong to the same VLAN or to a certain uplink port (related to the setting of the switching chip register).
The light display is given by PHY, through which you can observe the working speed, connection and data transmission and reception of each port.
During each startup or reset of the switch chip, the contents of the external EEPROM are first read to initialize the switch chip registers. The contents of the switch chip registers can be read and written through the PC management program or the PC's hyperterminal to control or read the switch's working configuration.
2 Network switch software design
The software of the entire network switch system includes the control software of the microcontroller, the EEPROM configuration data and the management program of the PC.
The control software of the microcontroller mainly completes the reading and writing of registers and the communication with the PC. Through this management unit, the switch can be configured into various working modes to meet the needs of different users.
The switch chip is connected to EEPROM (24C02) via I2C bus to save configuration data. When the device is powered on or reset, the device will read this data from EEPROM for system initialization.
The management program of the PC allows the user to connect the serial port of the PC to the system device and configure the system easily through the management program interface of the PC.
2.1 Software Design of MCU Control
The management unit consists of a single-chip microcomputer and a serial port, and the registers of the EEPROM or the switching chip are configured through the PC. The single-chip microcomputer mainly completes the reading and writing of the registers and the communication with the PC. The serial port plays a role in connecting with the PC. There is also a level conversion chip between the microcontroller and the serial port to complete the signal conversion between the microcontroller and the PC. Through the management unit, the switch can be configured into various working modes to meet the needs of different users, such as: 10/100M rate setting, full/half-duplex setting, flow control, static MAC address setting, mirror setting, broadcast storm control, VLAN setting, etc. The software flow of the single-chip microcomputer is shown in Figure 2.
[page]
The modules are described as follows:
main——main program;
init_uart——serial port initialization;
delay——system delay;
helpMenu——help menu;
systemCheck——check system device ID;
whict>:——command prompt (whict is the abbreviation of Wuhan Institute of Chemical Technology);
D——view the entire configuration data of the system;
E——edit the configuration data of the system;
F——configure and manage various functions of the switch;
R——read the configuration data of the system;
W——the system saves the current configuration data to EEPROM;
L——configure the system static MAC address;
M——change the system password;
I——system software reset;
S——the system downloads the default configuration to EEPROM.
2.2 PC management program design
The management program of the PC is programmed in VB language and has an easy-to-understand software interface. Users can easily configure the network switch. The management program of the PC is shown in Figure 3, and the switch management software interface is shown in Figure 4.
Previous article:Design and implementation of network switch based on single chip microcomputer control
Next article:Low-cost LIN bus based on Microchip microcontroller and transceiver
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- EEWORLD University ---- Power Semiconductor Devices
- Check the internal working status and problems of the power supply
- Intel plans to launch 32-core processor in 2010, targeting Sun
- EEWORLD University ---- Introduction to Deep Learning of Neural Networks
- DSP AD current sampling data fitting curve
- FPGA introductory series experimental tutorial - key debounce control LED on and off.pdf
- ADC12 module of MSP430F149
- New Horizons to Pluto: Qorvo Helps Send Images from Pluto to Earth
- [Shanghai Hangxin ACM32F070 development board + touch function evaluation board]——RTC routine
- Summary of the trial of creative application development of RVB2601