Channelizing E1/T1 terminal emulation equipment and method
Technical field
The present invention relates to data communication technology, comprise interface conversion and protocol conversion technology in the remote data communication.Specifically, relate to conversion and the data of each time slot inside of channelizing E1/T1 and the conversion of ICP/IP protocol of channelizing E1/T1 Interface and Ethernet interface in the E1/T1 transmission network.
Background technology
In existing remote data communication system, the E1/T1 transmission network is method in common and the means that connect a plurality of remote ethernets that are distributed in each geographic range.Being connected of E1/T1 transmission network and Ethernet generally has two methods: first method is to utilize interface convertor, interface convertor can become the data transaction in the several slots in the channelizing E1/T1 Interface protocol data of Ethernet interface, and the data in the E1/T1 transmission network can and be shared in the Ethernet circulation.Second method is to utilize router that E1/T1 transmission network and Ethernet are coupled together, with the data in each time slot in the method ICP/IP protocol access path E1/T1 Interface of access ethernet network device.First method is integrated the data in the several slots in the channelizing E1/T1 Interface, convert the protocol data of Ethernet interface together to, defective is the data in certain time slot in the access path E1/T1 Interface separately, and the data access method of terminal emulation more can not be provided on the channelizing E1/T1 Interface.Though second method provides the access method of the data in certain time slot in the E1/T1 Interface of independent access path, but the method for access is to utilize the ICP/IP protocol access, the data access method of terminal emulation can not be provided on the channelizing E1/T1 Interface, this causes existing application program of carrying out terminal access in a large number to need to revise, brought the modification amount big, the defective that the complicated network structure, especially networking cost are high.
Summary of the invention
The equipment and the method that the purpose of this invention is to provide a kind of channelizing E1/T1 terminal emulation, effectively solve being connected of E1/T1 transmission network and Ethernet, and can provide the data in certain time slot in the data access method access path E1/T1 Interface of terminal emulation, and need not revise existing application program of carrying out the terminal access data in a large number.Application program on the Ethernet can be as remote terminal or other serial communication device of the local serial data access of access by the connection of E1/T1 transmission network.Simplify networking mode, saved cost.Utilizing the E1/T1 transmission network to carry out the field that data access is carried out in equipment control and monitoring and main frame and terminal, purposes is very widely arranged.
To achieve these goals, the equipment of channelizing E1/T1 provided by the invention terminal emulation and method adopt the technical scheme that hardware circuit and relevant software combine.It is characterized in that it comprises channelizing E1/T1 Interface drive circuit, Ethernet interface drive circuit and is connected CPU and four parts of ICP/IP protocol treatment system between described channelizing E1/T1 Interface and the Ethernet interface.Described channelizing E1/T1 Interface drive circuit sends and receives the line code in the E1/T1 transmission network, and changes mutually according to G.703/G.704 standard and HDLC protocol data by HDLC protocol processes chip.Described Ethernet interface drive circuit is responsible for the driving of Ethernet interface, sends and receive the data of Ethernet interface, and it comprises medium accesses control section and two parts of logical connection control.The medium accesses control section has defined the method that packet transmits according to the standard of IEEE 802.3 on the ethernet network medium.The logical connection control section encapsulates and handles data according to the standard of IEEE 802.2, and the control of data traffic is provided.The HDLC protocol data of described CPU access path E1/T1 Interface and IEEE 802.2 protocol datas of Ethernet interface, and HDLC protocol data and IEEE 802.2 protocol datas changed mutually, data are exchanged between channelizing E1/T1 Interface and Ethernet interface.Described ICP/IP protocol treatment system is meant ICP/IP protocol bunch in specific implementation of the present invention, and it comprises basic IP agreement, ICMP agreement, BootP agreement, ARP agreement, RARP agreement, Transmission Control Protocol and udp protocol and the Telnet agreement that can select, TFTP agreement, File Transfer Protocol, snmp protocol and smtp protocol etc.The terminal emulation protocol that the present invention relates to just bunch is developed realization once more in ICP/IP protocol.
Schematic diagram as shown in Figure 1.
Data flowchart as shown in Figure 2.
Description of drawings
As shown in Figure 2, it is as follows that application program sends data to the data flow of virtual serial port:
Application program sends data as the mode according to terminal emulation of the local serial ports of access and 1. arrives certain virtual serial port, because virtual serial port is by channelizing E1/T1 terminal emulation device driver management, so 1. channelizing E1/T1 terminal emulation device driver receives these data, encapsulate according to terminal emulation protocol, 2. the virtual serial port of visiting obtains data number with the destination interface message identification in the terminal emulation protocol; 2. ICP/IP protocol treatment system in the computer will carry out IP protocol encapsulation and IEEE 802.2 protocol encapsulation again according to the packaged data of terminal emulation protocol, obtain data 3.; Packaged data send to channelizing E1/T1 terminal emulation equipment 3. according to IEEE 802.3 standards by Ethernet.3. channelizing E1/T1 terminal emulation equipment receive these data by the Ethernet interface drive circuit; The ICP/IP protocol treatment system unpacks data according to IEEE 802.2 and IP agreement, revert to data 2.; 2. data after the reduction unpack according to terminal emulation protocol by channelizing E1/T1 terminal server, the data after will unpacking again be packaged into again corresponding time slot the HDLC protocol data 4.; 1. 4. the HDLC protocol data revert to data by HDLC protocol processes chip, converts E1/T1 transmission network line code to through channelizing E1/T1 Interface drive circuit, sends to the E1/T1 transmission network through the channelizing E1/T1 Interface.
Like this, application program is sent to channelizing E1/T1 terminal emulation equipment time slot one to one according to the data that the mode of terminal emulation sends to virtual serial port, and sends to the E1/T1 transmission network through the channelizing E1/T1 Interface.
As shown in Figure 2, the transmission flow of the time slot data of E1/T1 transmission network is as follows:
1. pass through channelizing E1/T1 Interface admission passage E1/T1 terminal emulation equipment by the time slot data that the E1/T1 transmission network sends, 1. channelizing E1/T1 Interface drive circuit receives these data, become the HDLC protocol data 4. by HDLC protocol processes chip according to G.703/G.704 normative translation, each channel time slot corresponding one road HDLC protocol data; 4. CPU receives HDLC protocol data bag, unpack according to the HDLC agreement, data after channelizing E1/T1 terminal server will unpack according to terminal emulation protocol again encapsulate again, and 2. gap information obtains data with the destination interface message identification in the terminal emulation protocol; Again 2. the data after the encapsulation carry out IP protocol encapsulation and IEEE 802.2 protocol encapsulation again, finish the conversion of the agreement of HDLC agreement and IEEE 802.2, obtain data 3.; 3. packaged data according to IEEE 802.3 standards, send to computer by Ethernet; 3. the network interface of computer receives these data, by oneself ICP/IP protocol treatment system data is unpacked according to IEEE 802.2 agreements and IP agreement, and according to the data of terminal emulation protocol encapsulation 2. reduction obtains; 2. channelizing E1/T1 terminal emulation service routine receives these data, unpack reduction and obtain data 1., and 1. data are sent to the corresponding virtual serial ports by channelizing E1/T1 terminal emulation device driver according to the destination interface message identification, receive by application program.
Like this, the time slot of set of the virtual serial port of computer and channelizing E1/T1 terminal emulation equipment has been set up transparent one to one data transmission channel.
The present invention carries out channelizing E1/T1 terminal emulate method and comprises following two aspects:
1, channelizing E1/T1 terminal emulation CLIENT PROGRAM
Channelizing E1/T1 terminal emulation CLIENT PROGRAM realizes in the mode of device driver.The equipment that this device driver has been installed has just increased some virtual serial ports, and each virtual serial port is corresponding one by one with the TCP/IP port of channelizing E1/T1 terminal emulation equipment; The data of these virtual serial ports of access are by the Ethernet interface admission passage E1/T1 terminal emulation equipment of channelizing E1/T1 terminal emulation equipment, and are redirected to the corresponding TCP/IP port of channelizing E1/T1 terminal emulation equipment.
2, channelizing E1/T1 terminal emulation service routine
Channelizing E1/T1 terminal emulation service routine is realized in the mode of multithreading TCP/IP port service processes.Each thread is responsible for the agreement of one road Ethernet interface IEEE 802.2 and the conversion of HDLC agreement, and the TCP/IP port of channelizing E1/T1 terminal emulation equipment is corresponding one by one with each channel time slot of channelizing E1/T1 Interface; The data of each channel time slot of access path E1/T1 Interface also newly are directed to the corresponding TCP/IP port of channelizing E1/T1 terminal emulation equipment.
According to said method provided by the invention, the time slot of set of the virtual serial port of computer and channelizing E1/T1 terminal emulation equipment has been set up transparent one to one data transmission channel.Application program can be according to the data access method of terminal emulation as the data in certain time slot in the E1/T1 Interface of the local serial data of access access path.
Embodiment
In implementing channelizing E1/T1 of the present invention terminal emulation, comprise a channelizing E1/T1 Interface, an Ethernet interface and a control port at least.Used main circuit as shown in Figure 3.
Channelizing E1/T1 Interface drive circuit mainly is made of E1/T1 Interface chip DS2154, E1/T1 Interface transformer PE-68825 and HDLC protocol processes chip; Adopt the mode of wire jumper to carry out impedance matching, can make this equipment be applicable to the BNC axis cable unbalanced interface of 75 Ω and the RJ-12 twisted-pair feeder Balanced interface of 120 Ω; The line code of E1/T1 transmission network is HDB3 or AMI; Can finish the mutual conversion of E1/T1 transmission network line code and internal circuit HW signal by this circuit, and, handle by CPU according to HDLC agreement and internal memory RAM swap data.The Ethernet interface drive circuit mainly is made of Ethernet interface chip PE-68025 and MC68160, and this circuit links to each other with CPU by serialization controller SCC; Can finish the ethernet line circuit-switched data according to IEEE 802.2 agreements and internal memory RAM swap data by this circuit, handle by CPU.CPU is made of control circuits such as CPU, RAM, Flash, under the cooperation of software, can finish the realization of ICP/IP protocol bunch on this equipment, finish the mutual conversion of HDLC protocol data and IEEE 802.2 agreements, set up multithreading TCP/IP port service processes, realize channelizing E1/T1 terminal emulation service routine of the present invention.Device driver is finished the driving of channelizing E1/T1 terminal emulation equipment in computer each operating system Windows 2000, Linux, Unix, and realizes channelizing E1/T1 terminal emulation CLIENT PROGRAM of the present invention.
Implement channelizing E1/T1 terminal emulation CLIENT PROGRAM flow chart of the present invention and see Fig. 4.
Implement channelizing E1/T1 terminal emulation service routine flow chart of the present invention and see Fig. 5.
Implement device driver package of the present invention and contain channelizing E1/T1 terminal emulation CLIENT PROGRAM, device driver is each virtual serial port storage allocation, sets up channelizing E1/T1 terminal emulation CLIENT PROGRAM process one to one; The CLIENT PROGRAM process adopts the Socket DLL (dynamic link library), and the Socket port numbers is corresponding one by one with virtual serial port, and internal memory and virtual serial port by appointment carry out exchanges data.The Socket CLIENT PROGRAM is carried out exchanges data by the Socket service routine on Socket and the Ethernet.
Implement channelizing E1/T1 terminal emulation equipment of the present invention, operation Socket service routine carries out exchanges data with the Socket CLIENT PROGRAM on the Ethernet.The Socket service routine adopts the multithreading working method, the corresponding Socket CLIENT PROGRAM of each Socket service processes.The Socket service routine by channelizing E1/T1 terminal emulation equipment internal memory and the channelizing E1/T1 Interface drives and other application programs are carried out exchanges data, set up the one-to-one relationship of Socket port numbers and each time slot of channelizing E1/T1 Interface.The Socket service routine carries out exchanges data by the Socket CLIENT PROGRAM on Socket and the Ethernet.
Application program is according to the method for terminal emulation, the data of access local virtual serial ports, implementing under the device driver control of the present invention, redirect to access Socket client port, being connected by network and Socket again, redirect to access Socket serve port, the Socket serve port is present in to be implemented on the channelizing E1/T1 terminal emulation equipment of the present invention, channelizing E1/T1 terminal emulation equipment has been set up the transparent data passage of Socket port and each time slot of channelizing E1/T1 Interface, so, get the data of Socket serve port, redirect to each time slot of channelizing E1/T1 Interface.Realized that application program is according to the data access method of the terminal emulation purpose as the data in certain time slot in the E1/T1 Interface of the local serial data of access access path.