Design and Implementation of Network switches controlled by single chip microcomputer

Source: Internet
Author: User

With the improvement of computer performance and the increasing traffic, traditional local area networks are getting more and more out of their load. The exchange Ethernet technology has emerged, greatly improving the performance of local area networks.

A network switch can significantly increase the bandwidth and establish a geographically dispersed network. Each port of a LAN switch can transmit information in parallel, securely, and in real time. It features stable performance, flexible structure, easy installation, and easy management, and can meet the needs of CEN and telecom operators for broadband access.

1. Hardware Design of network switches

With the demand for security and high bandwidth in network applications, network switches are widely used. The vswitch uses the ROX bus of the AL101 chip to connect three eight-port switching chips to form a 24-port switch, meeting users' requirements for multiple switching ports.

1.1 circuit performance requirements

High-Speed PCB boards of switches have high requirements on EMC and ESD. It uses a high-speed clock of 75 MHz and 50 MHz. The accuracy of the crystal oscillator must be smaller than 50 ppm, and the clock must be sent to different chips through the clock distribution circuit, the phase difference between the clock to be allocated is less than 2ns.

The vswitch has 24 10/100 M Adaptive ports, and each port can achieve line rate switching. You can set the port at a rate of 10/100 M, full/half duplex, traffic control, static MAC address, image, and VLAN as needed.

1.2 principle diagram of vswitch

The switching technology of the vswitch adopts the storage-forwarding mode. It consists of the Interface Unit, switching unit, management unit, lamp display unit, and Power Interface Unit. The Block Diagram 1 is shown in.

After receiving an Ethernet frame data packet, the RJ45 interface is sent to the PHY (physical interface chip) after the transformer isolation and impedance matching. In this chip, the analog signal is converted to the digital signal of the RMII interface, obtain information such as the link status, conflict, whether the information is too long, and the speed.

Data enters the switching chip (consisting of three chips, forming a loop through the ROX bus to exchange data between the three chips ), the switching chip obtains the destination address and Source Address of the data and performs error verification on the Ethernet frame. The switch chip saves the source address in its MAC address table, and then matches the destination address with the address in the MAC address table to obtain the corresponding port for data forwarding. If the destination port is in the same swap chip, data is retrieved from SGRAM and forwarded to the corresponding port. If the destination port is not in the same swap chip, data is transmitted to the corresponding switch 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 belonging to the same VLAN except the source port or an uplink port (related to the settings of the SWAp chip register ).

The lamp display is provided by PHY. The lamp display allows you to observe the working rate, connection, and data sending and receiving of each port.

During each boot or reset, the swap chip first reads the content of the external EEPROM to initialize the swap chip register. The content of the switch chip register can be read and written through the PC management program or the PC Super Terminal to control or read the switch configuration.

2 Software Design for network switches

The software of the entire network switch system includes the control software of the single chip microcomputer, the EEPROM configuration data and the Management Program of the PC.

The Control Software of single-chip microcomputer mainly reads and writes registers and communicates with PCs. This management unit can be used to assign switches to various working modes to meet the needs of different users.

The switching chip connects to the EEPROM (24C02) through the I2C bus to save configuration data. When the device is started or reset, the device reads the data from the EEPROM for system initialization.

The Management Program of the PC is used to connect the serial port of the PC to the system device. It is easy to configure the system through the Management Program interface of the PC.

2.1 software design for Single-Chip Microcomputer Control

The Management Unit is composed of a single-chip microcomputer and a serial port. It uses a PC to configure the EEPROM or the register of the switching chip. The single-chip microcomputer mainly reads and writes registers and communicates with the PC. The serial port serves as a connection to the PC. The microcontroller and the serial port also have a level conversion chip, converts the signal between the microcontroller and the PC. The management unit allows the switch to be configured in various working modes to meet the needs of different users, such as 10/100 M speed setting, full/Half Duplex Setting, traffic control, and static MAC address setting, image settings, broadcast storm control, and VLAN settings. The software process of single-chip microcomputer 2 is shown.

The modules are described as follows:

Main -- main program;

Init_uart -- serial port initialization;

Delay-system latency;

HelpMenu -- Help menu;

SystemCheck -- check the 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 system configuration data;

F-configuration and management of various vswitch functions;

R -- read system configuration data;

W -- the system saves the current configuration data to the EEPROM;

L -- Static MAC address configuration;

M -- change the system password;

I -- System Software reset;

S -- the system downloads the default configuration to the EEPROM.

2.2 PC Management Program Design

The Management Program of the PC is programmed in VB and has an easy-to-understand software interface. You can easily configure network switches. As shown in Management Program 3 of PC, switch management software interface 4.

3. Performance Testing of network switches

This switch performs a 12-hour performance test at normal temperature (25 ℃). The test instrument is Smartbits2000. Four items are tested: transparency rate, latency, packet loss rate, and back-to-back. The test results are shown in table 1.

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.