Application of VxD Technology

Source: Internet
Author: User

1 Pc V5 protocol test method

1.1 Preface
The development trend of modern telecommunication networks is network centralization, efficiency, and optimization. With the popularization of the Internet, the access capability of communication service networks has been severely tested. It is imperative for telecom networks to develop broadband communication and multimedia services. To achieve digitalization, broadband and intelligence of the access network, the current transmission bottleneck in the telecom network must be solved. The existing access network that uses analog transmission as the main transmission media is difficult to adapt to the network upgrade and new service provision requirements of the access network. So the V5 access network will become a symbol of the modern access network. An important feature of modern access networks is that the service node interface between the network and the vswitch should be an open and standard V5 interface. The V5 interface has unparalleled superiority in providing integrated services and new services, replacing remote modules with V5 access networks is inevitable. Due to the protective response of equipment suppliers, the openness of v5.x interfaces lacks legal protection, and the interoperability, compatibility and completeness between devices of different manufacturers are poor. Therefore, V5 interface protocol testing has become a matter of great concern. Under ideal conditions, devices produced by different manufacturers according to the same protocol standards should be able to communicate normally in the network environment, but this is not the case. Due to the different understanding of the standards, as well as various manufacturers holding different technical policies, some performance of their products will either deviate from the standard or be a subset of the standard. In this way, the local switch (LE) and the access network (an) devices produced by different equipment manufacturers may encounter some problems during Interconnection (for example, the system startup process is inconsistent and cannot be connected ). During the use of the device, some problems may occur due to Protocol cooperation or equipment defects (such as frequent link building or a large number of call losses on the V5 L2 link), which may affect the service quality. When a device connection problem occurs, it is urgent to use a unified scale to measure the device consistency to find out the root cause of the problem. At present, with the commercial launch of V5 interfaces in China, various devices are flocking. In this way, solving the Protocol problems arising from communication equipment interconnection will become an indispensable factor for promoting the application of V5 interfaces, the V5 protocol analyzer is vital for locating and analyzing these problems. Our self-developed V5 protocol tester is advantageous in ease of use, low cost, and easy to upgrade. VxD technology is one of the key technologies.

1.2 V5 protocol tester Principle
The V5 protocol Tester (v5ts) consists of two parts: the ISA bus standard hardware plug-in card and protocol processing software. Each Board can process up to three C channels (ts16, ts15, and ts31) in a 2048 kbit/s data link. You can select one or two boards based on test requirements; the protocol processing software uses Windows95/98 as the operating platform. The hardware plug-in card and its protocol processing software form a complete testing system, which can be used as a V5 protocol testing device or monitoring device on the Le side or an side.
The test principle of v5ts is 1-1. Method A and method B are protocol simulation modes, and method C is Protocol monitoring mode. In method A, v5ts simulates an-side
Test the V5 function on the Le side. In method B, v5ts simulates the V5 function on the Le side to test the V5 function on the an side. In method C, v5ts works as a monitoring device, it can listen on Information frames transmitted between le and.

The test is based on the on-site test specification for access network v5.2 interface issued by the former Ministry of Posts and Telecommunications. There are 7 groups of 84 test terms.
Table 1-1 on-site test specifications for access network v5.2 Interfaces
1.3 tester hardware Principle
The structure of the ISA bus plug-in is shown in 1-2.
Among them, E1 controller adopts the bt8510 of brooktree to complete physical layer functions and the LAPD operation of ts16. hscx (Advanced Serial Communication Controller) selects sab82525 of Siemens, the LAPD operation of ts15 and ts31 was completed; μp used ds80c320 of dallas semiconductor company; DPRAM (dual-port random memory) used idt71342 for μp (microprocessor) communication with MP (master processor); I/O port is used to transmit control signals between μp and MP. DPRAM and I/O port are related to this article.

  1.4 tester Software Framework
The software part of the tester is divided into two major modules based on the different processor implementations: μ P module and MP module.
The μ P module uses the assembly language as the programming language to complete hardware initialization and message sending and receiving. The MP module is divided into four sub-modules:
· Main control module;
· System management module;
· Protocol processing module;
· Data sending and receiving module.
Because the operating platform we use is Windows 95, The VxD program must be called in the MP data receiving and receiving module to exchange data with the ISA plug-in card.

2 VxD Technology Overview

  2.1 concept of VxD
An Intel processor has four privileged levels starting from 386, namely, 0 to 3. Level 0 has the highest privilege level, while Level 3 has the lowest privilege level. The four levels can be seen as four concentric circles. For performance considerations, Win95 only uses level 0 and Level 3, and generally runs at level 3, A 0-level program can use all the resources and capabilities of the processor. VxD (Virtual Device Driver) is a program used to extend the functions of Windows operating systems. It is linked to the core layer (RING 0) of the Windows operating system as a DLL ). VxD mainly solves a series of problems that cannot be processed by the ring Layer 3 application.

  2.2 processing in high-level applications
Windows 95 uses the deviceiocontrol function to implement the device input/output control (IOCTL) interface. This function can send commands to the specified VxD and transmit corresponding data. You can use the createfile function to open the VxD, use deviceiocontrol to send commands to the VxD, and use the closehandle function to close the VxD.
The following describes the three functions:
1)Handle Createfile(Lpctstr Lpfilename,DWORD Dwdesiredaccess,
    DWORD Dww.mode,Lpsecurity_attributes Lpsecurityattributes,
    DWORD Dwcreationdisposition,DWORD Dwflagsandattributes,
    Handle Htemplatefile);
If the function is successfully called, a handle to open the specified file is returned. The lpfilename parameter is a pointer to a string that contains the names of the objects to be generated or opened, including files, disk devices, directories, and so on. Here we use the VxD file; dwdesiredaccess is the access object mode, including read, write, read/write, or device query. dw1_mode is the sharing mode of the object. If this parameter is set to zero, the object cannot be shared; lpsecurityattributes is a pointer to the Security Attribute structure. This structure determines whether the returned handle can be inherited by the quilt process. dwcreationdisposition indicates various operations when the file exists or does not exist, if the value create_always is used to generate a new file, if the file already exists, it overwrites the original file and clears the original attributes. dwflagsandattributes indicates the file attributes and symbols. For example, file_attribute_hidden indicates that the file attributes are hidden; htemplatefile is a handle that points to a read-only template file. in Windows95, this parameter must be n Ull.
2)Bool Deviceiocontrol(Handle Hdevice,DWORD Dwiocontrolcode,
    Lpvoid Lpinbuffer,DWORD Ninbuffersize,Lpvoid Lpoutbuffer,
    DWORD Noutbuffersize,Lpdword Lpbytesreturned,
    Lpoverlapped Lpoverlapped);
If the function is successfully called, a non-zero value is returned. The hdevice parameter is the handle of the device for which the operation is to be performed. It is obtained by calling createfile. dwiocontrolcode indicates the control code of the operation. lpinbuffer indicates the pointer to a buffer zone, buffer is the data to be operated; ninbuffersize is the size of the lpinbuffer buffer, in bytes; lpoutbuffer is also a pointer to a buffer, and the buffer is the output data of the operation; noutbuffersize is the size of the lpoutbuffer buffer, in bytes. lpbytesreturned points to a variable to receive the size of the data stored in lpoutbuffer, in bytes. lpoverlapped is the pointer of the overlapped structure.
3)Bool Closehandle(HandleHobject);
If the function is successfully called, a non-zero value is returned. The hobject parameter is a handle to open an object.
When calling the createfile function, you can specify the module name, file name, or the register entry that marks a Vxd to open a static or dynamically installable VxD. If the VxD exists and supports the ioctl interface of the device, createfile returns a device handle, which can be used as a parameter when the deviceiocontrol function is called. Otherwise, createfile fails and the previous error value is set to error_not_supported or error_file_not_found. The error value can be obtained using the getlasterror function.
When you enable VxD, you must specify its name in the following format: //./vxdname. vxdname can be the name of the register item that specifies the module name, file name, or mark a VX.
We specify the extension. VxD, and the function will find this file in the standard search path (generally in Windows System), such:
Handle hdevice;
Hdevice = createfile ("//. // testv5.vxd", 0, 0, null, 0, file_flag_delete_on _ close, null );
The same VxD can be opened multiple times. Each time it is opened, createfile will provide a unique handle for The VxD, but there will never be two VxD copies in the memory. To ensure that the system can clear the last case of VxD from the memory, the value of file_flag_delete_on_close should be specified when the dynamic installable VxD is enabled.
You can use deviceiocontrol to send commands to VxD. In this case, specify the device handle that was previously opened and control the code and input and output parameters. The device handle indicates the Vxd to which the command is to be sent. The control code specifies an operation to be completed by the VxD.
The input and output parameters of deviceiocontrol include the size or address of the buffer used to pass data to or receive data from VxD. Whether these parameters are used depends on how the specified VxD handles the control code.
When you end a VxD, you can use the closehandle function to close the device handle related to it. In the following example, closehandle (hdevice) is disabled ). You do not need to delete the VxD from the memory when you disable it. closehandle will clear the VxD from the memory when there is no valid handle related to the VxD in the system.

  2.3 handling in VxD Program
VxD supports the ioctl interface of devices by processing w32_deviceiocontrol messages during VxD control.
When the application calls the createfile function, the system sends the w32_deviceiocontrol message to the control process of the specified Vxd to determine whether the VxD supports the ioctl interface of the device. If VxD can be dynamically loaded, the system sends sys_dynamic_init control messages to the VxD when it is enabled for the first time.
When an application calls deviceiocontrol, the system calls the VxD control process identified by the given device handle. In this case, the eax register contains the w32_deviceiocontrol message, and the ESI register contains an address in the diocparams structure. This structure contains all the parameters specified by the application in the deviceiocontrol function and other information. VxD should check the dwiocontrolcode Member of the diocparams structure to determine the operation to be executed. The lpvinbuffer member contains some support data required for Vxd to complete the operation. After processing the control code, VxD should copy the information it needs to return to the application to the buffer zone referred to by the lpvoutbuffer member.
If VxD successfully processes the control code, the eax register should be cleared before the return. Otherwise, the eax should be set to a non-zero value.

3. Design of VxD program in V5 protocol Tester

  3.1 VxD programming tool
We use Microsoft's VC ++ and vireo software's VtoolsD for Win95 as the program development language, and numege's softice95 as the debugging tool.
The VtoolsD Development Kit provides full-line C ++ class library support for VxD programming, the most important of which is the quick VxD program. It provides many options to quickly generate the VxD code framework, this is very similar to the Class Wizard in VC ++. In the quick VxD visual programming environment, quick VxD quickly creates a VxD project file based on the programmer's selection. This file includes: C/C ++ header file, C/C ++ code file, and C/C ++ engineering file. The header file contains the class declaration required by Vxd, The VxD control message processing function declaration, and the windows ring3 API call VxD call entry declaration. In the code file, quickvxd pre-generates many class member functions that require further programming to expand its internal functions. Programmers can customize functions by adding code to these class member functions.

  3.2 details
In the V5 protocol tester, the VxD program mainly performs read and write operations on the two-port RAM of the ISA plug-in card. We name the plug-in card device testv5 and the device class testv5device. In our application, we only need to modify the onw32deviceiocontrol function of testv5device.
In the high-level program and VxD program, we define two constants dioc_write and dioc_read as the control code passed to VxD by the high-level program. According to the control code, the onw32deviceiocontrol function in the VxD program reads or writes DPRAM. Based on the hardware jumper on the plug-in card, the starting address of DPRAM is 0x000d0000, And the read/write operations on DPRAM are actually like assigning values to simple arrays. Due to the limited memory size, we should check whether it has reached the end of the memory during read/write operations.

4. Postscript

Our practical ideas make the tester highly scalable and upgradeable. We use the same hardware to monitor the No. 7 signaling. The difference is only protocol analysis software, vxD technology can be applied in a similar way. In the design, we use the ISA bus. With the continuous development of computer technology, we will adopt the PCI bus technology, and The VxD Technology will still have its tenacious vitality on the Windows 95/98 platform, we can use it to Implement DMA to increase the speed of data exchange.

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.