Research on ADSL Gateway Based on ElanSC520 Microcontroller and Linux Operating System

Research on ADSL Gateway Based on ElanSC520 Microcontroller and Linux Operating System

As the content on the Internet becomes more and more colorful, people’s demand for transmission bandwidth has gradually increased, and the 56K bandwidth of traditional Modem has become increasingly overwhelmed. How to make full and effective use of existing telephone line resources to obtain sufficient bandwidth? ADSL (Asymmetric Digital Subscriber Loop) is a good answer.

Authors: Zhong Xiaojian, Pan Guidun, Liang Xiaoyu


As the content on the Internet becomes more and more colorful, people’s demand for transmission bandwidth has gradually increased, and the 56K bandwidth of traditional Modem has become increasingly overwhelmed. How to make full and effective use of existing telephone line resources to obtain sufficient bandwidth? ADSL (Asymmetric Digital Subscriber Loop) is a good answer. ADSL technology utilizes the bandwidth (4K~1.1MHz) of the telephone line higher than the voice band, and uses discrete multi-audio modulation technology to modulate high-speed digital signals (traditional Modem uses voice to modulate digital signals), and the downlink rate can reach 8Mbit/ s, the uplink can reach 1.5Mbit/s. With the continuous advancement of very large-scale integrated circuits (VLSI) and digital signal processing (DSP) technologies, DSL technology has also continued to mature. ADSL completes A/D, D/A conversion, and uses FFT/IFFT for DMT and convolutional coding modulation, which not only achieves high bandwidth utilization, but also ensures low-error transmission characteristics. The ADSL gateway we designed uses Itex’s Apollo 3 ADSL PCI solution as the Internet access part, and the other side uses Ethernet or wireless LAN to connect multiple users. The interface is RJ-45 and wireless access point (AP) antennas. With a flexible and convenient networking method, it can be widely used in home and small office access. In terms of software, we adopt the method of customizing the Linux kernel according to the hardware structure, and integrate the necessary drive modules as the gateway’s operating system, which not only completes the ADSL access module, Ethernet module and wireless local area network (WLAN) wireless access point The driver of the AP module also provides application functions such as DHCP, SNMP, and IP firewall.

One, hardware architecture

1. AMD microcontroller overall architecture

AMD’s ElanSC520 is powerful, suitable for use as a protocol processor and network processor in an embedded environment, compatible with PC/AT, supports 32-bit PCI external bus, and its low transmission delay and low price make it obtainable It has a wide range of applications. ElanSC520 integrates an industrial-grade X86 processor, which provides a good interface and easy portability for software adapted to the X86 structure, supports multiple operating systems including Linux and Windows, and has a built-in high-speed PCI bus interface It conforms to the PCI V2.2 specification, and can expand 1 to 5 PCI bus devices, and decides which PCI device to communicate with each other through its internal PCI bus arbitration mechanism. The maximum transfer rate of the PCI bus can reach 132MB/s. In the design of the ADSL gateway device, we use three PCI bus devices, these three bus devices share the PCI bus to communicate with ElanSC520. The ElanSC520 microcontroller also has high-performance SDRAM and ROM/Flash interfaces, as well as a UART serial interface for configuration and debugging, which can be connected to an analog terminal. The hardware architecture of ATM-based ADSL gateway is shown in Figure 1:

Research on ADSL Gateway Based on ElanSC520 Microcontroller and Linux Operating System
Figure 1: ADSL hardware architecture

2. ADSL access equipment

The ADSL access end uses Itex’s Apollo 3 PCI solution. Its chipset includes line drivers, analog front-ends and digital transceivers to complete the signal transmission and reception filtering, amplification, A/D and D/A conversion on the telephone line , FFT/IFFT and other digital signal processing, and communicate with ElanSC520 through PCI bus. This set of chips integrates the conversion function from PCI to UTOPIA (standard cell interface) into the DMT transceiver and ATM framer, and integrates the line receiver into the analog front end. Since the control is completed by the main processor, Apollo3 does not require additional storage devices and controllers, reducing the control requirements on the board to a minimum, thereby greatly reducing power consumption. The chipset complies with the following protocol standards: G.992.1 (G.DMT), G.992.2 (G.LITE), G.994 (G.HS), T1.413 Issue 2 (1998)

Its structure is shown in Figure 2:

Research on ADSL Gateway Based on ElanSC520 Microcontroller and Linux Operating System
Figure 2: ADSL line access end structure

The signal comes in through the RJ-11 telephone line interface, the receiving end is sent to the receiving part through the receiving filter for filtering, signal amplification, A/D conversion, FFT demodulation, and sent to the processor for processing; and at the sending end, the processor The output digital signal undergoes DMT modulation through IFFT, and then passes through the line driver module, filtered and sent to the telephone line for transmission.

3. Ethernet interface

The Ethernet uses Realtek’s RLT8029AS chip, which is compatible with NE2000 and conforms to the standard 802.3CSMA/CD protocol specification. Its full-duplex feature allows simultaneous transmission and reception, integrated Manchester codec, and can be used in diskless workstations.

4.WLAN_AP interface

In order to make it convenient for notebook computers to share the phone line to surf the Internet, we also provide a WLAN_AP interface on the user side, which can facilitate the networking of wireless local area networks. Here we use TI’s PCI1410A bridge chip to convert PCI signals to PCMCIA signals and connect to wireless The network card encapsulates the data packet into a frame conforming to the IEEE802.11b protocol for transmission.

Second, the software architecture

Due to the stability, openness and scalability of the Linux operating system, it has been widely used in embedded systems. However, since Linux allows non-preemptive operations, it is impossible to become a complete real-time system. It is real-time in a statistical sense. In the design of the ADSL gateway, we can assign real-time signals a high priority to ensure fair process scheduling as a whole.

To build an embedded operating system, we first consider that there is neither much memory nor much external memory available in an embedded application environment. The operating system must be stored in the limited memory Flash, so we must customize us according to the hardware architecture. The required Linux kernel. Since the ADSL access terminal is based on ATM, we need to add a patch for PPP over ATM to the kernel. For supporting the Internet on the basis of ATM, it can actually be attributed to the question of how to support TCP/IP on ATM. That is, the question of how ATM carries IP packets. In the ADSL gateway application, it is necessary to share the ADSL line to access the Internet and follow the point-to-point protocol. Therefore, the driver of the ADSL access terminal is actually a PPP over ATM module, which will be used as a loadable module of the kernel. Process call, and the Ethernet driver and WLAN_AP driver are implemented to transmit IP packets in Ethernet and wireless media, that is, IP packets are encapsulated in 802.3 and 802.11 frame formats, so that the protocol stack of the ADSL gateway is as shown in the figure 3 shown.

Research on ADSL Gateway Based on ElanSC520 Microcontroller and Linux Operating System
Figure 3: Protocol stack of ADSL gateway

In Figure 3, AAL5 is the ATM adaptation layer, and RFC1483 is the fifth type of multi-protocol encapsulation specification for the ATM adaptation layer. It describes how to carry multi-protocol services between hosts, bridge devices, and routing devices in the ATM end system. In the ADSL gateway, according to the ITU protocol specification, the signal is output in the form of ATM cells after a series of transformations. Therefore, we must turn the signal into a packet that can be recognized by the upper layer protocol on the basis of the ATM adaptation layer to determine the packet Whether to forward, discard or receive. According to the RFC1483 protocol, there are two forms of multi-protocol encapsulation. One is LLC encapsulated multi-protocol, that is, LLC-SNAP mode, which carries multiple protocols on the same VC. The protocol type is included in the LLC header, and the other is VC- In MUX mode, different protocols use different VCs, and there is no need to specify the protocol type in the protocol header. The specific VC bears which protocol is determined when the link is initialized. This method reduces link overhead , But when the number of virtual connections is limited, LLC multiplexing is still used. This function is realized by loading the PPPOA module in the Linux kernel.

Three types of information are included in the PPP package:

* Link Control Protocol (LCP) is used to negotiate link parameters, packet size, and authentication type
* Network Control Protocol (NCP) indicates the information of the high-level protocol, which can be IP, IPX and its control protocol.
* Data Frame

The protocol followed by ADSL is based on ATM, that is, at the physical layer, high-speed data signals, RS encoding, scrambling and other physical layer protocols are modulated on the telephone line. Above the physical layer, it is output in ATM cell format. For ADSL gateways, PPP over ATM Adaption Layer 5 (AAL5) RFC2364 uses AAL5 as the framing protocol, supports PVC, SVC, and PPPOA is the basic part of the ADSL protocol stack. It relies on RFC1483 and works in LLC-SNAP or VC -In the MUX mode, the process of encapsulating the PPP packet by the customer premise equipment (CPE) is to use the PPPOA protocol to transmit data on the ADSL loop and DSLAM. The protocol data unit of the common part collection sublayer (CPCS) of AAL5 is shown in Figure 4:

The CPCS-PDU Payload part is the data part of the AAL5 protocol, with a maximum of 216-1 bytes, because it is limited in the two-byte LENGTH field below. There are 48 bytes in the PAD, which is exactly one cell data field, which is generated by the SAR (segment recombination) sublayer. The CPI field is filled in to make the CPCS-PDU TRAILER 64 bits, and the CRC uses 32 bits. Cyclic redundancy check code.

In our ADSL gateway design, taking into account the limited number of virtual connections, we use the LLC-encapsulated multi-protocol mode, namely LLC-SNAP mode, and its CPCS-PDU Payload field is shown in Figure 4. include:

* LLC header: 3 bytes, two of which specify a destination SAP (0xFE) and source SAP (0xFE), followed by the frame type, which is Un-numbered Information=0x03
* Network Layer protocol Identifier (NLPID), PPP is used here, and its type value is 0xCF
* The PPP protocol identification field is one and two bytes
* PPP information domain
* PPP padding field

For users in the local area network to connect to the gateway through the Ethernet port and the antenna of the Wireless LAN. Ethernet and Wireless LAN use different network segments. What the gateway has to do is to look at the user’s IP packet. If it is sent to the local area network, It depends on whether it is on the same network segment, if it is, discard it, if it is not, send it to another network segment, that is to say, it plays a bridging role in the local packet service communication. If it is not sent to the local local area network, but to the wide area network, the packet will be forwarded through the PPP port to realize its routing function. The Ethernet driver and WLAN driver are also loaded into the Linux kernel as a loadable module in Linux.

In order to realize the application gateway function, in the application layer, we also implemented a firewall based on IP address filtering, network address resolution, simple network management, dynamic host address allocation, and WEB server according to actual needs.

3. Further work and prospects

The ADSL gateway integrates the ADSL modem and the application network. It not only completes the analog modulation and demodulation work of ADSL access, but also realizes resource sharing, simple network management and network security functions on this basis. It is a wide range of functions. Application prospective technology.

The Links:   EP4CE6F17I7N LTM121SI-T01