[go: up one dir, main page]

CN100366018C - A method for realizing interconnection of communication units - Google Patents

A method for realizing interconnection of communication units Download PDF

Info

Publication number
CN100366018C
CN100366018C CNB2006100030394A CN200610003039A CN100366018C CN 100366018 C CN100366018 C CN 100366018C CN B2006100030394 A CNB2006100030394 A CN B2006100030394A CN 200610003039 A CN200610003039 A CN 200610003039A CN 100366018 C CN100366018 C CN 100366018C
Authority
CN
China
Prior art keywords
address
communication unit
information
communication
mac address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2006100030394A
Other languages
Chinese (zh)
Other versions
CN1859251A (en
Inventor
杨高峰
王志强
陈�光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006100030394A priority Critical patent/CN100366018C/en
Publication of CN1859251A publication Critical patent/CN1859251A/en
Application granted granted Critical
Publication of CN100366018C publication Critical patent/CN100366018C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

本发明提供一种实现通信单元互连的方法,其关键在于通信单元利用第一套媒体接入控制层(MAC)地址和因特网协议(IP)地址通过网线与控制单元进行交互,获得用于通信的第二套MAC地址和IP地址。首先,通信单元根据自身硬件信息获得第一套MAC地址和IP地址,再利用获得的第一套MAC地址和IP地址与事先设置有MAC地址和IP地址的控制单元进行交互,通过网线从控制单元获得基本信息和地址信息;再根据基本信息重新启动,根据地址信息获得用于通信的第二套MAC地址和IP地址,实现通信单元的互连。应用本发明方案,通信可以通过网线进行快速加载应用程序和数据,从而快速地完成通信单元的互连,并且通信单元主动发起获得网络地址的过程,可以大大减少控制单元的负荷。

Figure 200610003039

The present invention provides a method for realizing the interconnection of communication units, the key of which is that the communication unit uses the first set of media access control layer (MAC) address and Internet protocol (IP) address to interact with the control unit through the network cable to obtain the The second set of MAC address and IP address. First, the communication unit obtains the first set of MAC address and IP address according to its own hardware information, and then uses the obtained first set of MAC address and IP address to interact with the control unit with the MAC address and IP address set in advance, and connects the control unit through the network cable. Obtain basic information and address information; then restart according to the basic information, obtain the second set of MAC address and IP address for communication according to the address information, and realize the interconnection of communication units. By applying the solution of the invention, the communication can quickly load application programs and data through the network cable, thereby quickly completing the interconnection of the communication units, and the communication unit actively initiates the process of obtaining the network address, which can greatly reduce the load of the control unit.

Figure 200610003039

Description

一种实现通信单元互连的方法 A method for realizing interconnection of communication units

技术领域technical field

本发明涉及数据通信领域技术,特别是涉及一种实现通信单元互连的方法。The invention relates to the technology in the field of data communication, in particular to a method for realizing the interconnection of communication units.

背景技术Background technique

网络系统一般由多套网络设备互连而成,每一套网络设备都是能够提供特定服务与功能的电信级设备集集合。一般情况下,一套网络设备由大型软件与硬件组成,硬件由大量的计算机、单板、电缆、光纤、网线、机框、机架、路由器、电源、风扇等设备组成,一套网络设备也可以看成是一个系统。其中,有通信功能的计算机和单板等设备通常被称为通信单元。A network system is generally composed of multiple sets of network equipment interconnected, and each set of network equipment is a collection of carrier-grade equipment that can provide specific services and functions. Generally, a set of network equipment is composed of large-scale software and hardware. The hardware is composed of a large number of computers, single boards, cables, optical fibers, network cables, machine frames, racks, routers, power It can be seen as a system. Among them, devices such as computers and single boards with communication functions are generally called communication units.

为了能够实现多套网络设备之间、以及每一套网络设备内部各通信单元之间的通信,就需要对通信单元进行互连。一般来说,通信单元之间实现互连有两个必备的条件:其一是每一个通信单元都对应一套唯一的媒体接入控制(MAC,Media Access Control)层地址和因特网协议(IP,Internet Protocol)地址;其二是每一个通信单元都需要加载维护自身正常运行和保证通信功能正常的基本应用程序和基本数据,然后运行该基本应用程序,运行基本应用程序的过程又称为启动过程。当然,不同的通信单元可能有不同的功能,其基本应用程序和基本数据的内容也可能不同。In order to realize communication between multiple sets of network equipment and among communication units within each set of network equipment, the communication units need to be interconnected. Generally speaking, there are two necessary conditions for the interconnection between communication units: one is that each communication unit corresponds to a unique set of Media Access Control (MAC, Media Access Control) layer address and Internet Protocol (IP , Internet Protocol) address; the second is that each communication unit needs to load the basic application program and basic data to maintain its normal operation and ensure the normal communication function, and then run the basic application program. The process of running the basic application program is also called startup process. Of course, different communication units may have different functions, and the contents of their basic application programs and basic data may also be different.

对于实现通信单元互连的第一个必备条件,一般需要对通信单元配置MAC地址和IP地址。目前,通信单元MAC地址的配置方法一般包括固定配置、人工配置和自动配置三种方式,而通信单元IP地址的配置一般包括人工配置和自动配置。其中,MAC地址的固定配置方式是指网络设备生产过程中就对通信单元的MAC地址进行了配置,其缺点是用户无法对其进行更改,使用不灵活。MAC地址和IP地址的人工配置方式是指用户根据需要对网络设备内的所有通信单元进行人工分配MAC地址和IP地址。由于一套网络设备中的通信单元的数量很大,人工配置的过程不但繁琐,而且容易出错。MAC地址和IP地址的自动配置方法是指网络设备在入网时将自动生成通信单元的MAC地址和IP地址。自动配置方式可以根据用户需求灵活配置,而且大大节约人工,不易出错,将会得到越来越广泛地应用。For the first prerequisite to realize the interconnection of communication units, it is generally necessary to configure MAC addresses and IP addresses for the communication units. At present, the configuration methods of the MAC address of the communication unit generally include fixed configuration, manual configuration and automatic configuration, while the configuration of the IP address of the communication unit generally includes manual configuration and automatic configuration. Among them, the fixed configuration method of the MAC address means that the MAC address of the communication unit is configured during the production process of the network equipment. The disadvantage is that the user cannot change it, and the use is inflexible. The manual configuration method of MAC address and IP address means that the user manually assigns MAC addresses and IP addresses to all communication units in the network device according to needs. Due to the large number of communication units in a set of network equipment, the manual configuration process is not only cumbersome, but also prone to errors. The automatic configuration method of MAC address and IP address means that the network equipment will automatically generate the MAC address and IP address of the communication unit when it is connected to the network. The automatic configuration method can be flexibly configured according to user needs, and greatly saves labor and is less prone to errors, and will be more and more widely used.

对于实现通信单元互连的第二个必备条件,一般是通过串口线或电缆等将物理连接将基本应用程序和基本数据加载给通信单元。For the second necessary condition to realize the interconnection of communication units, it is generally to load the basic application program and basic data to the communication unit through physical connection through serial port lines or cables.

在现有技术中,当采用自动配置通信单元的MAC地址和IP地址时,实现通信单元互连的方法是:先指定一个通信单元作为控制单元,并将配置MAC地址和IP地址的算法存储在控制单元中,负责分配其他通信单元的MAC地址和IP地址。当某个通信单元要接入到通信系统中时,该通信单元先通过串口线或电缆等加载自身的基本应用程序和基本数据,然后进行通信单元的启动过程,并启动接收由控制单元发送给自身数据包的功能;而控制单元则定时、主动地向未接入系统的通信单元所对应的端口发送携带有MAC地址和IP地址的数据包,或者定时扫描端口,当确定有新接入的通信单元后才向该通信单元发送携带有MAC地址和IP地址的数据包;要接入通信系统的通信单元接收到数据包以后,按照数据包中的信息完成自身MAC地址和IP地址配置工作。其中,控制单元可以是负责配置所有通信单元网络地址的中央控制单元,也可以是只给自身下层通信单元配置网络地址的上层控制单元。In the prior art, when the MAC address and IP address of the communication unit are automatically configured, the method for realizing the interconnection of the communication units is: first designate a communication unit as the control unit, and store the algorithm for configuring the MAC address and IP address in the In the control unit, it is responsible for assigning the MAC address and IP address of other communication units. When a communication unit is to be connected to the communication system, the communication unit first loads its own basic application program and basic data through a serial port cable or cable, etc., and then performs the startup process of the communication unit, and starts receiving the data sent by the control unit The function of its own data packets; while the control unit regularly and actively sends data packets carrying MAC addresses and IP addresses to the ports corresponding to the communication units not connected to the system, or regularly scans the ports, when it is determined that there is a new access After the communication unit sends the data packet carrying the MAC address and IP address to the communication unit; after the communication unit to access the communication system receives the data packet, it completes its own MAC address and IP address configuration work according to the information in the data packet. Wherein, the control unit may be a central control unit responsible for configuring the network addresses of all communication units, or an upper-level control unit that only configures network addresses for its own lower-level communication units.

现有技术的缺点是:(1)由于通信单元在配置之前自身还没有MAC地址和IP地址,只能通过串口线或电缆等来进行加载自身的基本应用程序和基本数据,而串口线或电缆等传输速度十分缓慢,导致实现通信单元的互连过程也十分缓慢。(2)控制单元需要定时向所有还未接入系统的通信单元发送携带有MAC地址和IP地址的数据包,或者需要定时扫描与还未接入系统的通信单元相连的端口,当查询到有新的通信单元接入时再向该新接入的通信单元发送MAC地址和IP地址的数据包。而在实际工作中,系统中需要多少个通信单元是根据具体情况决定的,当不需要增加新的通信单元时,控制单元仍然需要执行发送数据包或扫描的工作,增加了控制单元的工作负荷,而且浪费了网络资源。(3)通信单元确定自身MAC地址和IP地址以后,一般很难再修改,而在实际应用中,有时需要灵活修改通信单元的MAC地址和IP地址,现有技术还无法满足这种实际要求。The shortcoming of prior art is: (1) because communication unit self also does not have MAC address and IP address before disposing, can only carry out loading basic application program and basic data by serial port line or cable etc., and serial port line or cable etc. The transmission speed is very slow, resulting in a very slow interconnection process of communication units. (2) The control unit needs to regularly send data packets carrying MAC addresses and IP addresses to all communication units that have not yet connected to the system, or need to regularly scan the ports connected to communication units that have not yet connected to the system. When a new communication unit accesses, the data packet of the MAC address and the IP address is sent to the newly accessed communication unit. In actual work, the number of communication units needed in the system is determined according to the specific situation. When no new communication units need to be added, the control unit still needs to perform the work of sending data packets or scanning, which increases the workload of the control unit. , and a waste of network resources. (3) After the communication unit determines its own MAC address and IP address, it is generally difficult to modify it. In practical applications, it is sometimes necessary to flexibly modify the MAC address and IP address of the communication unit. The prior art cannot meet this practical requirement.

由此可见,在现有技术中,还没有一种可以由通信单元主动获得、并且可以灵活修改自身网络地址的快速的互连方法。It can be seen that, in the prior art, there is no fast interconnection method that can be actively obtained by the communication unit and can flexibly modify its own network address.

发明内容Contents of the invention

有鉴于此,本发明的主要目的在于提供一种实现通信单元互连的方法,可以由通信单元主动获得、可以灵活修改自身网络地址,并且可以实现通信单元快速地进行互连。为了达到上述目的,本发明提出的技术方案为:In view of this, the main purpose of the present invention is to provide a method for realizing interconnection of communication units, which can be actively obtained by communication units, can flexibly modify its own network address, and can realize rapid interconnection of communication units. In order to achieve the above object, the technical scheme proposed by the present invention is:

一种实现通信单元互连的方法,其特征在于,该方法包括以下步骤:A method for realizing the interconnection of communication units, characterized in that the method comprises the following steps:

a、通信单元根据自身硬件信息获得用于加载的第一套媒体接入控制层MAC地址和因特网协议IP地址;a. The communication unit obtains the first set of media access control layer MAC address and Internet Protocol IP address for loading according to its own hardware information;

b、通信单元利用所获得的第一套MAC地址和IP地址,通过网线从控制单元加载基本信息和地址信息,并根据基本信息重新启动,根据地址信息获得用于通信的第二套MAC地址和IP地址,实现通信单元的互连。b. The communication unit uses the obtained first set of MAC address and IP address, loads the basic information and address information from the control unit through the network cable, restarts according to the basic information, and obtains the second set of MAC address and address information for communication according to the address information IP address to realize the interconnection of communication units.

较佳地,步骤b所述通信单元通过网线从控制单元加载基本信息和地址信息的方法为:Preferably, the method for the communication unit in step b to load the basic information and address information from the control unit through a network cable is:

通信单元通过网线向控制单元发送加载请求消息,控制单元通过网线将携带有基本信息和地址信息的加载响应消息返回给通信单元,通信单元将基本信息和地址信息加载给自身。The communication unit sends a loading request message to the control unit through the network cable, and the control unit returns a loading response message carrying basic information and address information to the communication unit through the network cable, and the communication unit loads the basic information and address information to itself.

较佳地,步骤b所述的基本信息为通信单元的基本应用程序和基本数据;Preferably, the basic information described in step b is the basic application program and basic data of the communication unit;

步骤b所述的地址信息为通信地址计算程序和地址计算相关数据。The address information described in step b is the communication address calculation program and address calculation related data.

较佳地,步骤b所述的基本信息为通信单元的基本应用程序和基本数据;Preferably, the basic information described in step b is the basic application program and basic data of the communication unit;

步骤b所述的地址信息为由控制单元事先确定的通信单元的第二套MAC地址和IP地址。The address information in step b is the second set of MAC address and IP address of the communication unit determined in advance by the control unit.

较佳地,所述控制单元事先确定的通信单元的第二套MAC地址和IP地址的确定方法为:Preferably, the method for determining the second set of MAC address and IP address of the communication unit previously determined by the control unit is:

控制单元根据通信地址计算程序和地址计算相关数据确定所述通信单元的第二套MAC地址和IP地址。The control unit determines the second set of MAC address and IP address of the communication unit according to the communication address calculation program and address calculation related data.

较佳地,步骤a所述通信单元根据自身硬件信息获得第一套MAC地址和IP地址的方法为:Preferably, the method for the communication unit in step a to obtain the first set of MAC address and IP address according to its own hardware information is:

a1、通信单元上电后读取自身硬件信息;a1. After the communication unit is powered on, read its own hardware information;

a2、通信单元将自身硬件信息作为计算参数,并根据计算参数和事先保存的加载地址计算程序获得第一套MAC地址和IP地址。a2. The communication unit uses its own hardware information as calculation parameters, and obtains the first set of MAC address and IP address according to the calculation parameters and the loaded address calculation program saved in advance.

较佳地,所述的自身硬件信息为自身设备号、机框号和槽位号。Preferably, the self-hardware information is self-device number, chassis number and slot number.

较佳地,步骤a1所述的读取自身设备号、机框号和槽位号的方法为:Preferably, the method for reading its own device number, chassis number and slot number described in step a1 is:

通信单元读取标识自身设备号、机框号和槽位号的拨码开关信息;或者,The communication unit reads the dial switch information identifying its own device number, chassis number and slot number; or,

通信单元读取标识自身设备号、机框号的拨码开关信息,并通过读取槽位号的功能来读取自身的槽位号。The communication unit reads the dial switch information identifying its own equipment number and chassis number, and reads its own slot number through the function of reading the slot number.

较佳地,当通信单元要修改地址时,所述步骤b之后进一步包括:Preferably, when the communication unit wants to modify the address, the step b further includes:

重新设置通信单元的硬件信息,通信单元根据自身重新修改的硬件信息获得用于加载的新的第一套媒体接入控制层MAC地址和因特网协议IP地址;通信单元利用新的第一套MAC地址和IP地址,通过网线从控制单元加载新的基本信息和地址信息,并根据新的基本信息进行重新启动,根据新的地址信息获得用于通信的新的第二套MAC地址和IP地址,实现通信单元的互连。Reset the hardware information of the communication unit, and the communication unit obtains the new first set of media access control layer MAC address and Internet Protocol IP address for loading according to the hardware information re-modified by itself; the communication unit uses the new first set of MAC address and IP address, load new basic information and address information from the control unit through the network cable, and restart according to the new basic information, obtain a new second set of MAC address and IP address for communication according to the new address information, and realize Interconnection of communication units.

综上所述,本发明提出的一种实现通信单元互连的方法具有以下优点:In summary, a method for interconnecting communication units proposed by the present invention has the following advantages:

(1)由于通信单元在上电之后就可以根据自身的硬件信息自动产生第一套MAC地址和IP地址,而且通信单元与控制单元之间用网线进行连接,所以在生成第一套MAC地址和IP地址之后,就可以利用TCP/IP协议快速地进行加载,从而可以加快通信单元实现互连的速度。(1) Since the communication unit can automatically generate the first set of MAC address and IP address according to its own hardware information after it is powered on, and the communication unit and the control unit are connected with a network cable, so after generating the first set of MAC address and IP address, After the IP address, it can be quickly loaded using the TCP/IP protocol, thereby speeding up the interconnection speed of the communication units.

(2)通信单元利用拨码开关来标识自身硬件信息,可以灵活放置或改变通信单元的位置,而不受实际物理空间的限制,即无需始终将通信单元固定在某个机框的某个槽位上。当通信单元改变自身物理位置时,只需要修改播码开关就可以重新获得标识自身的新的硬件信息,从而获得新的MAC地址和IP地址。(2) The communication unit uses the dial switch to identify its own hardware information, and the position of the communication unit can be flexibly placed or changed without being limited by the actual physical space, that is, it is not necessary to always fix the communication unit in a certain slot of a certain chassis bit. When the communication unit changes its physical location, it only needs to modify the broadcast code switch to re-obtain new hardware information identifying itself, thereby obtaining a new MAC address and IP address.

(3)由于通信单元是主动向控制单元发送加载请求消息,然后才进行地址配置工作,无需控制单元定时向通信单元发送数据包,或定时扫描端口,可以减少控制单元的工作负荷,节约网络资源。(3) Since the communication unit actively sends a loading request message to the control unit, and then performs address configuration work, there is no need for the control unit to send data packets to the communication unit regularly, or to scan ports regularly, which can reduce the workload of the control unit and save network resources. .

附图说明Description of drawings

图1是实现本发明方案的流程图;Fig. 1 is the flowchart of realizing the scheme of the present invention;

图2是应用本发明方案的实施例流程图。Fig. 2 is a flow chart of an embodiment of the solution of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图及具体实施例对本发明作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

本发明的基本思想是:通信单元根据自身硬件信息获得用于加载的第一套媒体接入控制层(MAC)地址和因特网协议(IP)地址;再利用TCP/IP协议的传输方式,通过网线从控制单元获取基本信息和地址信息,然后根据基本信息进行启动过程,根据地址信息获得用于通信的第二套MAC地址和IP地址,完成通信单元的互连。The basic idea of the present invention is: the communication unit obtains the first set of media access control layer (MAC) address and Internet Protocol (IP) address for loading according to its own hardware information; Obtain the basic information and address information from the control unit, then start the process according to the basic information, obtain the second set of MAC address and IP address for communication according to the address information, and complete the interconnection of the communication units.

图1是实现本发明方案的流程图。如图1所示,本发明实现通信单元配置网络地址的方法包括以下步骤:Fig. 1 is the flowchart of realizing the scheme of the present invention. As shown in Figure 1, the present invention realizes that the method for communication unit configuration network address comprises the following steps:

步骤101:通信单元根据自身硬件信息获得第一套MAC地址和IP地址;Step 101: The communication unit obtains the first set of MAC address and IP address according to its own hardware information;

这里,第一套MAC地址和IP地址就是通信单元的网络地址,是用于加载基本信息和地址信息的。Here, the first set of MAC address and IP address is the network address of the communication unit, which is used to load basic information and address information.

步骤102:通信单元利用所获得的第一套MAC地址和IP地址,通过网线从控制单元获得基本信息和地址信息;Step 102: the communication unit obtains the basic information and address information from the control unit through the network cable by using the obtained first set of MAC address and IP address;

这里,基本信息包括基本应用程序和基本数据,而地址信息可以是包括通信地址计算程序和地址计算相关数据的信息,也可以是已经计算出来的通信单元的用于通信的网络地址信息。其中,基本应用程序和基本数据是为了维护通信单元正常运行和正常通信的必须的程序和数据。Here, the basic information includes basic application programs and basic data, and the address information may be information including communication address calculation programs and address calculation-related data, or the calculated network address information of the communication unit used for communication. Among them, the basic application program and basic data are necessary programs and data for maintaining the normal operation and normal communication of the communication unit.

步骤103:通信单元根据获得的基本信息重新启动;Step 103: The communication unit restarts according to the obtained basic information;

步骤104:通信单元根据地址信息获得用于通信的第二套MAC地址和IP地址。Step 104: The communication unit obtains a second set of MAC address and IP address for communication according to the address information.

本发明中,为了区分加载和通信这两个过程,需要给通信单元分配两套网络地址:第一套网络地址用于加载,而第二套网络地址才真正用于通信。当获得第一套网络地址之后,就可以通过网线快速进行加载,并获得第二套网络地址;之后,通信单元舍弃第一套网络地址,直接用第二套网络地址进行通信。其中,第一套网络地址与第二套网络地址之间不冲突,所有用于加载的通信单元的第一套网络地址内相互不冲突,所有用于通信的通信单元的第二套网络地址内相互不冲突。In the present invention, in order to distinguish the two processes of loading and communication, two sets of network addresses need to be assigned to the communication unit: the first set of network addresses is used for loading, and the second set of network addresses is actually used for communication. After obtaining the first set of network addresses, it can be quickly loaded through the network cable and obtain the second set of network addresses; after that, the communication unit discards the first set of network addresses and directly uses the second set of network addresses for communication. Among them, the first set of network addresses does not conflict with the second set of network addresses, the first set of network addresses of all communication units used for loading do not conflict with each other, and the second set of network addresses of all communication units used for communication do not conflict with each other.

本发明中,通信单元获取自身硬件信息的方法有两种:一种是读取事先设置的拨码开关的方式,另外一种是数据配置的方式。其中,读取事先设置的拨码开关的方式为:将拨码开关设置到预先规定的位置上,每一个拨码开关的“开”可以代表“1”,“关”可以代表“0”,若干个拨码开关就可以标识通信单元自身的设备号、机框号和槽位号等硬件信息;通信单元直接读取与拨码开关相连的信号线上的信息,就可以获得自身的硬件信息。数据配置方式为:系统先将通信单元的硬件信息以某种文件的方式存储在控制单元内,然后通过串口线或电缆等传输给通信单元,通信单元再从该文件中获得自身的硬件信息。In the present invention, there are two methods for the communication unit to obtain its own hardware information: one is to read the pre-set DIP switch, and the other is to configure data. Among them, the way to read the pre-set DIP switch is: set the DIP switch to a predetermined position, the "on" of each DIP switch can represent "1", and "OFF" can represent "0", Several DIP switches can identify hardware information such as the equipment number, frame number and slot number of the communication unit itself; the communication unit can directly read the information on the signal line connected to the DIP switch to obtain its own hardware information . The data configuration method is as follows: the system first stores the hardware information of the communication unit in the control unit in the form of a certain file, and then transmits it to the communication unit through a serial line or cable, and the communication unit obtains its own hardware information from the file.

在本发明中,每一个通信单元都存储有加载地址计算程序,当通信单元上电后,就可以根据自身的硬件信息和加载地址计算程序获得第一套MAC地址和IP地址。In the present invention, each communication unit stores a loading address calculation program, and when the communication unit is powered on, it can obtain the first set of MAC address and IP address according to its own hardware information and the loading address calculation program.

图2是应用本发明方案的实施例流程图。在本实施例中,有8套需要互连的设备,每套设备中有100个通信单元,每一个通信单元有24个拨码开关,其中8个拨码开关标识通信单元自身的所属的设备号,8个拨码开关标识通信单元自身所属的机框号,另外8个拨码开关标识通信单元自身所属的槽位号。本实施例中,所有的通信单元都直接通过网线与控制单元相连,每套设备之间也用网线进行连接。Fig. 2 is a flow chart of an embodiment of the solution of the present invention. In this embodiment, there are 8 sets of equipment that need to be interconnected, each set of equipment has 100 communication units, and each communication unit has 24 DIP switches, of which 8 DIP switches identify the equipment to which the communication unit itself belongs 8 DIP switches identify the chassis number to which the communication unit belongs, and the other 8 DIP switches identify the slot number to which the communication unit itself belongs. In this embodiment, all communication units are directly connected to the control unit through network cables, and each set of equipment is also connected with network cables.

如图2所示,本实施例实现通信单元配置网络地址的方法的步骤为:As shown in Figure 2, the steps in this embodiment to realize the method for the communication unit to configure the network address are:

步骤201:通信单元读取自身的设备号、机框号和槽位号。Step 201: The communication unit reads its own device number, frame number and slot number.

本实施例中,通信单元可以通过读取拨码开关来获得自身设备号、机框号和槽位号。而在实际应用中,通信单元还可以通过读取拨码开关来获得自身设备号、机框号,通过通信单元本身具备的读取槽位号的功能来获得自身槽位号。In this embodiment, the communication unit can obtain its own device number, frame number and slot number by reading the dial switch. In practical applications, the communication unit can also obtain its own equipment number and chassis number by reading the dial switch, and obtain its own slot number through the function of reading the slot number of the communication unit itself.

本实施例中,可以规定拨码开关的第1位至第8位为通信单元的槽位号,第9位至第16位为通信单元的机框号,第17位至24位为通信单元的设备号。而在实际应用中,通信单元拨码开关的数量可以根据用户需求来设置,其数量的多少由互连的设备数和设备内的通信单元数来确定。另外,拨码开关中分别用多少来标识设备号、机框号和槽位号也可以用户根据实际情况自行确定。In this embodiment, it can be stipulated that the first to eighth digits of the DIP switch are the slot numbers of the communication unit, the ninth to 16th digits are the chassis numbers of the communication unit, and the 17th to 24th digits are the communication unit device number. However, in practical applications, the number of communication unit dial switches can be set according to user requirements, and the number is determined by the number of interconnected devices and the number of communication units in the device. In addition, the number of DIP switches used to identify the device number, chassis number, and slot number can also be determined by the user according to the actual situation.

在实际应用中,通信单元还可以通过数据配置的方式来获得通信单元自身硬件信息,即将通信单元的硬件信息用文件的形式存储下来,如:文本文件,通信单元再读取该文件获得自身的硬件信息。In practical applications, the communication unit can also obtain the hardware information of the communication unit itself through data configuration, that is, store the hardware information of the communication unit in the form of a file, such as: a text file, and then the communication unit reads the file to obtain its own hardware information.

步骤202:通信单元将自身的设备号、机框号和槽位号作为计算参数,并根据该计算参数和事先存储的加载地址计算程序获得第一套MAC地址和IP地址。Step 202: The communication unit uses its own device number, frame number and slot number as calculation parameters, and obtains the first set of MAC address and IP address according to the calculation parameters and the pre-stored loading address calculation program.

在本实施例中,加载地址计算程序可以将通信单元的MAC地址设置为:0x00-0xe0-0xfc-设备号-机框号-槽位号,将通信单元的IP地址设置为:172.设备号.机框号.槽位号。在实际应用中,加载地址计算程序还可以采用其它方法来生成MAC地址和IP地址,只要通信单元的地址不冲突即可。In this embodiment, the loading address calculation program can set the MAC address of the communication unit to: 0x00-0xe0-0xfc-device number-frame number-slot number, and set the IP address of the communication unit to: 172.device number .Shelf number.Slot number. In practical applications, other methods may be used to generate the MAC address and the IP address by loading the address calculation program, as long as the addresses of the communication units do not conflict.

步骤203:通信单元利用自身第一套MAC地址和IP地址通过网线与事先已经设置了MAC地址和IP地址的控制单元建立连接。Step 203: The communication unit uses its first set of MAC address and IP address to establish a connection with the control unit whose MAC address and IP address have been set in advance through a network cable.

在本实施例中,控制单元已经事先分配了用于通信的MAC地址和IP地址,并且每一个通信单元中也已经保存有控制单元的MAC地址和IP地址。当通信单元也获得了自身的MAC地址和IP地址,一般需要先与控制建立连接,即:SOCKET连接,才能利用TCP/IP协议通过网线进行通信。In this embodiment, the control unit has been assigned a MAC address and an IP address for communication in advance, and each communication unit has also stored the MAC address and IP address of the control unit. When the communication unit also obtains its own MAC address and IP address, it generally needs to establish a connection with the controller first, that is, a SOCKET connection, in order to use the TCP/IP protocol to communicate through the network cable.

步骤204:通信单元通过网线向控制单元发送TCP/IP协议的加载请求消息。Step 204: the communication unit sends a loading request message of the TCP/IP protocol to the control unit through the network cable.

本实施例中,由于通信单元与控制单元是用网线进行连接的,而且都具有MAC地址和IP地址,所以,通信单元和控制单元之间的交互应当满足TCP/IP协议的要求。In this embodiment, since the communication unit and the control unit are connected by a network cable, and both have MAC addresses and IP addresses, the interaction between the communication unit and the control unit should meet the requirements of the TCP/IP protocol.

步骤205:控制单元将携带有基本应用程序、基本数据、通信地址计算程序和地址计算相关数据的TCP/IP协议的加载响应消息通过网线返回给通信单元。Step 205: The control unit returns the load response message of the TCP/IP protocol carrying the basic application program, basic data, communication address calculation program and address calculation related data to the communication unit through the network cable.

本实施例中,控制单元不但将通信单元必须的基本应用程序和基本数据通过网线传输给通信单元,而且将通信地址计算程序和地址计算相关数据也传输给了通信单元。此后,通信单元就可以利用通信地址计算程序和地址计算相关数据在本地计算用于通信的第二套MAC地址和IP地址。In this embodiment, the control unit not only transmits the basic application program and basic data necessary for the communication unit to the communication unit through the network cable, but also transmits the communication address calculation program and address calculation related data to the communication unit. Afterwards, the communication unit can use the communication address calculation program and address calculation related data to locally calculate the second set of MAC address and IP address for communication.

在实际应用中,控制单元还可以在接收到某通信单元发送的加载请求消息以后,直接在本地计算该通信单元的第二套MAC地址和IP地址,然后将计算出来的第二套MAC地址和IP地址携带于加载响应消息发送给通信单元。In practical applications, the control unit can also directly calculate the second set of MAC address and IP address of the communication unit locally after receiving the loading request message sent by a certain communication unit, and then use the calculated second set of MAC address and IP address The IP address is carried in the loading response message and sent to the communication unit.

步骤206:通信单元根据通信地址计算程序和地址计算相关数据获得第二套MAC地址和IP地址。Step 206: The communication unit obtains a second set of MAC address and IP address according to the communication address calculation program and address calculation related data.

本实施例中,通信地址计算程序可以将通信单元的第二套MAC地址设置为:0x00-0xe0-0xfc-00-设备号-模块号,通信单元的第二套IP地址可以设置为:172.设备号.200.模块号。地址计算相关数据就是模块号与通信单元硬件信息之间的对应关系,该对应关系可以由用户根据实际请求自行设定。例如:当通信单元的机框号为1、槽位号为1时,可以规定其对应的模块号为32。另外,通信地址计算程序也可以由用户根据实际情况自行定义,只要所有的通信单元的地址不冲突即可。In this embodiment, the communication address calculation program can set the second set of MAC addresses of the communication unit to: 0x00-0xe0-0xfc-00-device number-module number, and the second set of IP addresses of the communication unit can be set to: 172. Device number. 200. Module number. The data related to address calculation is the corresponding relationship between the module number and the hardware information of the communication unit, and the corresponding relationship can be set by the user according to actual requirements. For example: when the chassis number of the communication unit is 1 and the slot number is 1, the corresponding module number can be specified as 32. In addition, the communication address calculation program can also be defined by the user according to the actual situation, as long as the addresses of all communication units do not conflict.

步骤207:通信单元利用自身第二套MAC地址和IP地址与控制单元建立连接。Step 207: The communication unit uses its second set of MAC address and IP address to establish a connection with the control unit.

当通信单元再次与控制单元建立连接之后,就可以与已经接入系统中的其它通信单元或控制单元按照TCP/IP协议进行通信,即实现了通信单元之间的互连。After the communication unit establishes a connection with the control unit again, it can communicate with other communication units or control units that have been connected to the system according to the TCP/IP protocol, that is, the interconnection between communication units is realized.

在实际应用中,当确定通信单元的用于通信的MAC地址和IP地址之后,还可以根据需要对其进行修改,修改方法为:重新设置通信单元硬件信息,之后的步骤与本发明所提出的方法一致,此处不再赘述。值得注意的是:重新设置通信单元的硬件信息不应该与其它通信单元冲突。In practical application, after determining the MAC address and IP address used for communication of the communication unit, it can also be modified as required. The modification method is: reset the communication unit hardware information, and the subsequent steps are the same as those proposed by the present invention. The method is the same and will not be repeated here. It is worth noting that resetting the hardware information of the communication unit should not conflict with other communication units.

应用本发明方案,每一套设备中的通信单元都可以在上电时自动生成一套MAC地址和IP地址,利用该地址,各套设备中的通信单元就可以直接利用网线并按照TCP/IP协议发送消息进行加载,然后生成用于通信的第二套MAC地址和IP地址。Applying the solution of the present invention, the communication unit in each set of equipment can automatically generate a set of MAC address and IP address when powered on, and using this address, the communication unit in each set of equipment can directly use the network cable and follow the TCP/IP The protocol sends messages to load and then generates a second set of MAC and IP addresses for communication.

另外,由于设备号也是作为通信单元的硬件信息,可以用拨码开关或数据配置方式将不同的设备中的通信单元用设备号进行区分,因此可以区分不同设备中的通信单元的网络地址,实现多套设备利用网线进行通信。In addition, since the device number is also used as the hardware information of the communication unit, the communication units in different devices can be distinguished by the device number by using the dial switch or data configuration mode, so the network addresses of the communication units in different devices can be distinguished to realize Multiple sets of devices use network cables to communicate.

综上所述,以上仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。To sum up, the above are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1. A method of interconnecting communication units, the method comprising the steps of:
a. the communication unit obtains a first set of MAC address and an Internet Protocol (IP) address for loading according to the hardware information of the communication unit;
b. the communication unit loads basic information and address information from the control unit through the network cable by using the obtained first set of MAC address and IP address, restarts according to the basic information, and obtains a second set of MAC address and IP address for communication according to the address information to realize the interconnection of the communication unit.
2. The method of claim 1, wherein the method for loading the basic information and the address information from the control unit through the network cable by the communication unit in step b is as follows:
the communication unit sends a loading request message to the control unit through the network cable, the control unit returns a loading response message carrying the basic information and the address information to the communication unit through the network cable, and the communication unit loads the basic information and the address information to the communication unit.
3. The method according to claim 1 or 2, wherein the basic information of step b is basic application and basic data of the communication unit;
the address information in the step b is related data of a communication address calculation program and address calculation.
4. The method according to claim 1 or 2, wherein the basic information of step b is basic application and basic data of the communication unit;
the address information in step b is the second set of MAC address and IP address of the communication unit predetermined by the control unit.
5. The method of claim 4, wherein the second set of MAC address and IP address of the communication unit previously determined by the control unit is determined by:
the control unit determines a second set of MAC address and IP address of the communication unit based on the communication address calculation program and the address calculation related data.
6. The method of claim 1, wherein the method for the communication unit to obtain the first set of MAC address and IP address according to its hardware information in step a is:
a1, reading the hardware information of the communication unit after the communication unit is powered on;
a2, the communication unit takes the hardware information as the calculation parameter, and obtains the first set of MAC address and IP address according to the calculation parameter and the loading address calculation program saved in advance.
7. The method of claim 6, wherein the self hardware information is a self device number, a machine frame number, and a slot number.
8. The method of claim 7, wherein the method of reading the device number, the frame number and the slot number of step a1 is as follows:
the communication unit reads dial switch information for identifying the equipment number, the machine frame number and the slot position number of the communication unit; or,
the communication unit reads the dial switch information identifying the equipment number and the machine frame number of the communication unit, and reads the slot number of the communication unit through the function of reading the slot number.
9. The method of claim 1, wherein when the communication unit is to modify the address, said step b is further followed by:
resetting hardware information of the communication unit, wherein the communication unit obtains a new first set of MAC address and IP address for loading according to the revised hardware information; the communication unit loads new basic information and address information from the control unit through the network cable by using the new first set of MAC address and IP address, restarts according to the new basic information, and obtains a new second set of MAC address and IP address for communication according to the new address information to realize the interconnection of the communication unit.
10. The method of claim 9, wherein the hardware information is a device number, a frame number, and a slot number.
CNB2006100030394A 2006-01-26 2006-01-26 A method for realizing interconnection of communication units Expired - Fee Related CN100366018C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100030394A CN100366018C (en) 2006-01-26 2006-01-26 A method for realizing interconnection of communication units

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100030394A CN100366018C (en) 2006-01-26 2006-01-26 A method for realizing interconnection of communication units

Publications (2)

Publication Number Publication Date
CN1859251A CN1859251A (en) 2006-11-08
CN100366018C true CN100366018C (en) 2008-01-30

Family

ID=37298116

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100030394A Expired - Fee Related CN100366018C (en) 2006-01-26 2006-01-26 A method for realizing interconnection of communication units

Country Status (1)

Country Link
CN (1) CN100366018C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102185934B (en) * 2011-04-27 2015-01-07 深圳Tcl新技术有限公司 System and method for writing MAC (media access control) address
CN102521172B (en) * 2011-11-22 2015-07-08 华为技术有限公司 Allocating method of hardware address, back panel and system
CN103795821A (en) * 2014-02-11 2014-05-14 江苏沁恒股份有限公司 Method and device for applying for independent MAC address through Internet for networking product
CN113132501A (en) * 2019-12-31 2021-07-16 上海欣诺通信技术股份有限公司 System, method, device and medium for managing multiple optical transport network devices by single IP address

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4899274A (en) * 1985-11-21 1990-02-06 International Business Machines Corporation Dynamic terminal address allocation by the terminal itself in a data processing system
WO2003047215A2 (en) * 2001-11-26 2003-06-05 Schneider Automation Inc. Method and apparatus for assigning a network node address
CN1567831A (en) * 2003-07-07 2005-01-19 深圳市中兴通讯股份有限公司 Method of automatic network address configuration for communication unit within equipment
CN1662014A (en) * 2004-02-25 2005-08-31 Lg电子有限公司 Method of assigning addresses to a plurality of devices on a network and a network system therefor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4899274A (en) * 1985-11-21 1990-02-06 International Business Machines Corporation Dynamic terminal address allocation by the terminal itself in a data processing system
WO2003047215A2 (en) * 2001-11-26 2003-06-05 Schneider Automation Inc. Method and apparatus for assigning a network node address
CN1567831A (en) * 2003-07-07 2005-01-19 深圳市中兴通讯股份有限公司 Method of automatic network address configuration for communication unit within equipment
CN1662014A (en) * 2004-02-25 2005-08-31 Lg电子有限公司 Method of assigning addresses to a plurality of devices on a network and a network system therefor

Also Published As

Publication number Publication date
CN1859251A (en) 2006-11-08

Similar Documents

Publication Publication Date Title
CN103814554B (en) A kind of communication means of virtual easily extensible local area network (LAN), device and system
US7440415B2 (en) Virtual network addresses
CN103229478B (en) A kind of method and apparatus determining virtual-machine drift
US9525648B2 (en) Method for acquiring physical address of virtual machine
EP3664372A1 (en) Network management method and related device
US10361970B2 (en) Automated instantiation of wireless virtual private networks
CN103534984A (en) Port setting method, apparatus and computer program product for routing
CN109240796A (en) Virtual machine information acquisition methods and device
CN113886153B (en) A container-based network card stress testing method and device
US8887237B2 (en) Multimode authentication
CN102316003A (en) Router and method for remotely starting operating system by router
CN106657444A (en) Method and device for configuring IP address of BMC
CN111294416A (en) Method for obtaining IP address and related products
CN100366018C (en) A method for realizing interconnection of communication units
CN103503413B (en) Method and device for transmitting network information
CN117591294A (en) Service dynamic load access method and device, internet of things platform and medium
CN105472050A (en) Network access method and network access device
CN115695374A (en) IPv6 subnet prefix advertisement implementation method, device, equipment and storage medium
US20200267116A1 (en) Internet protocol version six address management
CN104104749A (en) Method and device for allocating tunnel IP addresses
CN103067476B (en) A kind of dynamic network reconstruction method based on virtual machine
CN106130765B (en) Virtual desktop distribution method and device
EP4083795A1 (en) Method for deploying virtual machine, and related apparatus
US20200162419A1 (en) Address assignment method and related device
CN117082033A (en) Method, device, equipment and medium for establishing network connection between storage equipment and host

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080130

Termination date: 20180126