CN1311666C - Method for realizing route mechanism based on UPNP protocal radio network - Google Patents
Method for realizing route mechanism based on UPNP protocal radio network Download PDFInfo
- Publication number
- CN1311666C CN1311666C CNB2003101057831A CN200310105783A CN1311666C CN 1311666 C CN1311666 C CN 1311666C CN B2003101057831 A CNB2003101057831 A CN B2003101057831A CN 200310105783 A CN200310105783 A CN 200310105783A CN 1311666 C CN1311666 C CN 1311666C
- Authority
- CN
- China
- Prior art keywords
- routing
- information table
- target
- target device
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 230000007246 mechanism Effects 0.000 title claims abstract description 40
- 230000005540 biological transmission Effects 0.000 claims abstract description 21
- 238000004891 communication Methods 0.000 claims abstract description 15
- 238000012546 transfer Methods 0.000 claims description 35
- 230000008569 process Effects 0.000 claims description 21
- 230000000737 periodic effect Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 11
- 230000007704 transition Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本发明所述的实现基于UPNP协议无线网络路由机制的方法,要求每个无线网络设备具有路由功能,从而可以实现路由信息订阅、新设备上线、旧设备下线、UPNP控制指令和对外信息路由传输和路由表生成机制。应用本发明所述的实现基于UPNP协议无线网络路由机制方法的网络设备,具有设备路由信息表、目标设备参数信息表。本发明所述的方法可以解决多个远距离无线设备间的通讯而无需设置无线中转和路由设备,因而设备成本相应较低。而且可以充分实现无线设备间的资源共享,提高无线网络的实用性和信息交互的实效性。
The method for implementing a wireless network routing mechanism based on the UPNP protocol in the present invention requires each wireless network device to have a routing function, so that routing information subscription, new device online, old device offline, UPNP control instructions and external information routing transmission can be realized and routing table generation mechanism. The network device applying the method for implementing the wireless network routing mechanism based on the UPNP protocol of the present invention has a device routing information table and a target device parameter information table. The method of the invention can solve the communication between multiple long-distance wireless devices without setting up wireless relay and routing devices, so the device cost is correspondingly low. Moreover, resource sharing between wireless devices can be fully realized, and the practicality of the wireless network and the effectiveness of information exchange can be improved.
Description
技术领域technical field
本发明涉及一种实现基于UPNP协议无线网络路由机制的方法,具体地是实现无线网络系统内部所有设备相互间的信息传输而无需专用路由设备。The invention relates to a method for realizing a wireless network routing mechanism based on the UPNP protocol, in particular to realize information transmission between all devices in the wireless network system without special routing devices.
背景技术Background technique
现有网络建设大多还是传统的线缆连网方式,复杂的连线限制了设备移动办公使用。线缆将各种信息设备限制在某个固定场所,对于新型移动办公装置难以发挥其自身移动方便、功能快捷的优点,无线网络也成为现有网络技术发展的主导方向。Most of the existing network construction is still the traditional cable connection method, and the complicated connection limits the mobile office use of equipment. Cables restrict various information devices to a fixed place, and it is difficult for new mobile office devices to take advantage of their own advantages of convenient movement and fast functions. Wireless networks have also become the dominant direction of the development of existing network technologies.
随着各种无线网络技术的发展,特别是802.11协议的使用,已有的无线网络体现出安装便捷、使用灵活、易于扩展等特点,但是现有的无线网络也具有以下缺点,即应用802.11协议的无线网络传输距离有限,只能在一个无线局域网络中进行通讯,解决多个远距离无线设备间的通讯通常需要在网络中设置多个无线中转和路由设备,因而系统设备成本相应提高。With the development of various wireless network technologies, especially the use of the 802.11 protocol, the existing wireless network has the characteristics of convenient installation, flexible use, and easy expansion, but the existing wireless network also has the following disadvantages, that is, the application of the 802.11 protocol The transmission distance of the wireless network is limited, and it can only communicate in one wireless local area network. To solve the communication between multiple long-distance wireless devices, it usually needs to set up multiple wireless transfer and routing devices in the network, so the cost of system equipment is correspondingly increased.
目前为实现无线设备的相互连通和资源共享,也有采用UpnP协议技术来实现自动发现其他基于UpnP协议设备的,但是主要性能都是实现基本的设备发现和通讯,并且前提条件是需要网络设备间直接通讯、或是需要配置硬件路由设备才能实现。At present, in order to realize the interconnection and resource sharing of wireless devices, UPnP protocol technology is also used to realize automatic discovery of other UPnP protocol-based devices, but the main performance is to realize basic device discovery and communication, and the prerequisite is the need for direct connection between network devices. Communication, or need to configure hardware routing equipment to achieve.
发明内容Contents of the invention
本发明所述的实现基于UPNP协议无线网络路由机制的方法,可解决上述问题和不足而实现每个无线设备间的路由选择,做到即使没有路由设备参与、或是不能实现直接通讯的设备间也可通过本发明所述的路由方法,实现网络设备相互间的智能互联和资源共享。The method for realizing the wireless network routing mechanism based on the UPNP protocol described in the present invention can solve the above-mentioned problems and deficiencies and realize the routing selection between each wireless device, so that even if there is no routing device to participate in, or between devices that cannot realize direct communication The intelligent interconnection and resource sharing among network devices can also be realized through the routing method described in the present invention.
本发明所述的实现基于UPNP协议无线网络路由机制的方法,针对目前基于UPNP协议的网络设备间相互联通必须实现物理层连接、且并不支持网路路由功能的现状。本发明所述的方法适应于临时搭建的网络系统,无需网络路由器和服务器,但是需要每个基于UPNP协议的设备具有路由功能,从而实现设备自身有效无线距离之外的设备联通和通讯。The method for realizing the wireless network routing mechanism based on the UPNP protocol of the present invention aims at the current situation that the interconnection between network devices based on the UPNP protocol must realize physical layer connection and does not support the network routing function. The method described in the present invention is suitable for a temporary network system without network routers and servers, but requires each device based on the UPNP protocol to have a routing function, so as to realize the connection and communication of devices beyond the effective wireless distance of the device itself.
本发明所述的实现基于UPNP协议无线网络路由机制的方法,要求每个无线网络设备具有路由功能,从而可以实现路由信息订阅、新设备上线、旧设备下线、UPNP控制指令和对外信息路由传输和路由表生成机制。The method for implementing a wireless network routing mechanism based on the UPNP protocol in the present invention requires each wireless network device to have a routing function, so that routing information subscription, new device online, old device offline, UPNP control instructions and external information routing transmission can be realized and routing table generation mechanism.
应用本发明所述的实现基于UPNP协议无线网络路由机制方法的网络设备,具有设备路由信息表、目标设备参数信息表。The network device applying the method for implementing the wireless network routing mechanism based on the UPNP protocol of the present invention has a device routing information table and a target device parameter information table.
源设备是发起数据通讯的设备,在本发明所述无线网络中的每个设备均是源设备,每个具有路由功能的源设备均具有一设备路由信息表,其格式是:目标设备+转接设备+路由路径+路由次数。A source device is a device that initiates data communication. Each device in the wireless network of the present invention is a source device. Each source device with a routing function has a device routing information table, and its format is: target device+transfer Connected device + routing path + routing times.
每台路由设备中也包含有目标设备参数信息表,在设备进入网络后获取所有的目标设备信息,将信息添加到该目标设备参数信息表中,其格式是:目标设备代号+目标设备IP地址+目标设备属性+目标设备说明。Each routing device also contains a target device parameter information table. After the device enters the network, all target device information is obtained, and the information is added to the target device parameter information table. The format is: target device code + target device IP address +Target Device Properties+Target Device Description.
本发明所述的实现基于UPNP协议无线网络路由机制的方法,是在一个源设备进入网络后,根据按如下流程生成或是更新设备路由信息表、目标设备参数信息表文件:Realization of the present invention is based on the method of UPNP agreement wireless network routing mechanism, is after a source device enters the network, generates or updates device routing information table, target device parameter information table file according to following process:
第一步,无线设备的IP地址分配;The first step, the IP address assignment of the wireless device;
第二步,新设备的路由信息表的确定;The second step is to determine the routing information table of the new device;
第三步,已存在设备的路由信息表更新;The third step is to update the routing information table of the existing equipment;
第四步,无线设备的下线通知;The fourth step is the offline notification of the wireless device;
若某设备发生突然掉电的情况,则不能按第四步步骤内容将下线信息通知给其他设备,上述第四步内容所述的退出机制失效,所述网络系统初始化后即采用下述步骤运行;If a device suddenly loses power, it cannot notify other devices of the offline information according to the content of the fourth step. The exit mechanism described in the fourth step above is invalid. After the network system is initialized, the following steps will be adopted run;
第五步,定期查询机制;The fifth step is the regular query mechanism;
本发明所述的实现基于UPNP协议无线网络路由机制的方法,在上述生成或更新完成设备路由信息表和目标设备参数信息表的基础上,源设备和目标设备间可以进行数据传输和信息反馈。In the method for implementing a wireless network routing mechanism based on the UPNP protocol described in the present invention, on the basis of the above-mentioned generated or updated device routing information table and target device parameter information table, data transmission and information feedback can be performed between the source device and the target device.
1、源设备向目标设备进行数据发送的流程是:1. The process of sending data from the source device to the target device is:
源设备通过设备路由信息表,确定最佳路径和转接设备,将数据包发送给转接设备;The source device determines the best path and the transfer device through the device routing information table, and sends the data packet to the transfer device;
转接设备解析数据包,获取转发次数和目标设备地址,转发次数位加1后,重新构造数据包;The transfer device parses the data packet, obtains the number of forwarding times and the address of the target device, adds 1 to the number of forwarding times, and reconstructs the data packet;
查询本设备的设备路由信息表,获取到达目标设备的最佳路径和下一个转接设备,并重新发送该数据包;Query the device routing information table of this device, obtain the best path to the target device and the next transfer device, and resend the data packet;
以此类推,直到到达目标设备为止;And so on until reaching the target device;
若转发次数位数据>54时,证明该数据包在网路中处于死循环状态,此时路由设备丢弃该数据包,并向源设备发送错误信息。If the number of forwarding times is greater than 54, it proves that the data packet is in an endless loop state in the network. At this time, the routing device discards the data packet and sends an error message to the source device.
2、目标设备接收数据的流程是:2. The process of receiving data by the target device is:
设备接收数据后,判断路由数据包中的IP地址是否为本设备的IP地址;After the device receives the data, it judges whether the IP address in the routing data packet is the IP address of the device;
若是,则停止转发并处理数据;If so, stop forwarding and process the data;
若不是,则继续转发。If not, continue forwarding.
其中,所接收数据包的格式是:包头+源设备IP地址+目标设备IP地址+数据正文+转发次数+校验和+包尾。Wherein, the format of the received data packet is: packet header + source device IP address + target device IP address + data body + forwarding times + checksum + packet tail.
如上所述,本发明所述的实现基于UPNP协议无线网络路由机制的方法,可以解决多个远距离无线设备间的通讯而无需设置无线中转和路由设备,因而设备成本相应较低。而且可以充分实现无线设备间的资源共享,提高无线网络的实用性和信息交互的实效性。As mentioned above, the method for realizing the wireless network routing mechanism based on the UPNP protocol of the present invention can solve the communication between multiple long-distance wireless devices without setting up wireless relay and routing devices, so the device cost is correspondingly low. Moreover, resource sharing between wireless devices can be fully realized, and the practicality of the wireless network and the effectiveness of information exchange can be improved.
附图说明Description of drawings
图1是路由数据包的格式示意图;Fig. 1 is a schematic diagram of the format of a routing data packet;
图2是以A为源设备的网络传输示意图;Figure 2 is a schematic diagram of network transmission with A as the source device;
图3是以B为源设备的网络传输示意图;Fig. 3 is a schematic diagram of network transmission with B as the source device;
图4是以C为源设备的网络传输示意图;Figure 4 is a schematic diagram of network transmission with C as the source device;
图5是以D为源设备的网络传输示意图;Fig. 5 is a schematic diagram of network transmission with D as the source device;
图6是以E为源设备的网络传输示意图;Figure 6 is a schematic diagram of network transmission with E as the source device;
图7是设备下线工作流程;Figure 7 is the equipment off-line workflow;
图8是系统启动过程流程图;Fig. 8 is a flow chart of the system startup process;
图9是路由表的生成和更新流程图。Fig. 9 is a flow chart of generating and updating the routing table.
具体实施方式Detailed ways
本发明所述的实现基于UPNP协议无线网络路由机制的方法,要求每个无线网络设备具有路由功能。The method for realizing the wireless network routing mechanism based on the UPNP protocol in the present invention requires each wireless network device to have a routing function.
应用本发明所述的实现基于UPNP协议无线网络路由机制方法的网络设备,均具有设备路由信息表、目标设备参数信息表。The network equipment applying the method for implementing the wireless network routing mechanism based on the UPNP protocol of the present invention has a equipment routing information table and a target equipment parameter information table.
源设备是发起数据通讯的设备,在本发明所述无线网络中的每个设备均是源设备,每个具有路由功能的源设备均具有一设备路由信息表,其格式是:目标设备+转接设备+路由路径+路由次数。A source device is a device that initiates data communication. Each device in the wireless network of the present invention is a source device. Each source device with a routing function has a device routing information table, and its format is: target device+transfer Connected device + routing path + routing times.
目标设备,表示出网络中所有通过路由功能可以到达的设备代号。源设备通过路由路经与目标设备建立连接,并实现信息通讯;Target device, which indicates all the device codes that can be reached through the routing function in the network. The source device establishes a connection with the target device through the routing path, and realizes information communication;
转接设备,表示出源设备向目标设备发送信息通过多个路由设备转接实现,在路由路径中与源设备第一个通讯的设备定义为转接设备。Transition device means that the source device sends information to the target device through multiple routing devices. The device that first communicates with the source device in the routing path is defined as the transfer device.
路由路径,定义了源设备到目标设备的所有路径,通过路由路径源设备可以选择最优的路径进行网络通讯。但是,源设备向目标设备发送信息,并非一定要求按照源设备的最优路径传输,而是通过选择最优路径,确定转接设备。The routing path defines all the paths from the source device to the target device. Through the routing path, the source device can choose the optimal path for network communication. However, when the source device sends information to the target device, it is not necessarily required to transmit information according to the optimal path of the source device, but to determine the transfer device by selecting the optimal path.
路由次数,表示源设备到目标设备需要转接的路由次数。其中,1次表示可以直接到达,多次表示必须通过路由设备到达。The number of routes indicates the number of routes that need to be transferred from the source device to the target device. Among them, 1 time indicates that it can be reached directly, and multiple times indicates that it must be reached through a routing device.
每台路由设备中包含有目标设备参数信息表,在设备进入网络后获取所有的目标设备信息,将信息添加到该目标设备参数信息表中,其格式是:目标设备代号+目标设备IP地址+目标设备属性+目标设备说明,其中Each routing device contains a target device parameter information table. After the device enters the network, all target device information is obtained, and the information is added to the target device parameter information table. The format is: target device code + target device IP address + Target device attribute + target device description, where
目标设备代号,利用序号表示;Target device code, represented by serial number;
目标设备IP地址,是设备实际网络IP地址;The IP address of the target device is the actual network IP address of the device;
目标设备属性,标识的是固定设备还是移动设备;The target device attribute, identifying whether it is a fixed device or a mobile device;
目标设备说明,基于UPNP协议的设备必要描述说明。Description of the target device, the necessary description of the device based on the UPNP protocol.
如图1所示,路由数据包的格式是:包头+源设备IP地址+目标设备IP地址+数据正文+转发次数+校验和+包尾,其中:As shown in Figure 1, the format of the routing data packet is: packet header + source device IP address + target device IP address + data body + forwarding times + checksum + packet tail, where:
包头,是路由数据包的标志,路由设备得到数据包后,通过判断包头即可知道为路由数据包,其标志是FB、FE;The packet header is the symbol of the routing data packet. After the routing device obtains the data packet, it can be known as the routing data packet by judging the packet header, and its symbols are FB and FE;
源设备IP地址,是发送数据的设备IP地址;The IP address of the source device is the IP address of the device sending the data;
目标设备IP地址,是最终接收数据的设备IP地址;The IP address of the target device is the IP address of the device that finally receives the data;
数据正文,可以是UPNP协议命令或是对外传输的数据流;Data text, which can be a UPNP protocol command or an externally transmitted data stream;
转发次数,是路由数据包的转发次数;The number of forwarding times is the number of forwarding times of routing data packets;
校验和,采用十六进制,占用2个字节,是将计算方法是源设备IP地址+目标设备IP地址+数据正文+转发次数,加满溢出;The checksum, in hexadecimal, occupies 2 bytes, and the calculation method is the IP address of the source device + the IP address of the target device + the data body + the number of forwarding times, and the overflow is filled;
包尾,是数据包的结束标志,其标志是FC。The end of the packet is the end mark of the data packet, and its mark is FC.
本发明所述的实现基于UPNP协议无线网络路由机制的方法,在所述无线网络启动后即由各设备确定其自身的“设备路由信息表”,包括:The method for realizing the wireless network routing mechanism based on the UPNP protocol described in the present invention determines its own "device routing information table" by each device after the wireless network is started, including:
1、目标设备的确定1. Determination of the target device
源设备进入无线网络中,将根据路有机制获取网络中所有的设备,并确定为目标设备。When the source device enters the wireless network, it will obtain all the devices in the network according to the road mechanism, and determine it as the target device.
2、路由路径的确定2. Determination of routing path
两个无线设备如果能直接通讯,则不需要路由设备支持,路由路径从源设备直接到目标设备;不能直接到达,则需要确定路由路径,设备的路由路径可以有多种,但是必须满足,If two wireless devices can communicate directly, there is no need for routing device support, and the routing path is directly from the source device to the target device; if it cannot be reached directly, the routing path needs to be determined. There can be multiple routing paths for devices, but they must be satisfied.
每条路由路径中不可以有重复设备;There cannot be duplicate devices in each routing path;
每两个转接路由设备可以直接通讯,则不需要第三方设备转接。Every two transfer routing devices can communicate directly, so there is no need for third-party device transfer.
3、转接设备的确定3. Determination of transfer equipment
每条路径的第一路由设备为转接设备The first routing device of each path is the transfer device
4、路由次数的确定4. Determination of routing times
根据路由路径可以计算出路由次数。The routing times can be calculated according to the routing path.
如图2-图6所示,设定在无线局域网络中共有A、B、C、D、E五个具有UPNP路由协议的设备,由于无线传输距离有限,如下设备间可以实现直接通讯:As shown in Figure 2-6, it is set that there are five devices with UPNP routing protocol A, B, C, D, and E in the wireless local area network. Due to the limited wireless transmission distance, direct communication can be realized between the following devices:
A-B、B-C、C-D、E-A、E-B、E-CA-B, B-C, C-D, E-A, E-B, E-C
其他设备间的通讯则需要借助于路由功能。5个设备连入网络后,根据其他设备更新自己的路由列表。The communication between other devices requires the help of the routing function. After 5 devices are connected to the network, they update their routing lists according to other devices.
如图2所示,是以A为源设备的网络传输示意图,则A设备的设备路由信息表如下表所示:As shown in Figure 2, it is a schematic diagram of network transmission with A as the source device, and the device routing information table of A device is shown in the following table:
如图3所示,是以B为源设备的网络传输示意图,则B设备的设备路由信息表如下表所示:
如图4所示,是以C为源设备的网络传输示意图,则C设备的设备路由信息表如下表所示:
如图5所示,是以D为源设备的网络传输示意图,则D设备的设备路由信息表如下表所示:
如图6所示,是以E为源设备的网络传输示意图,则E设备的设备路由信息表如下表所示:
本发明所述的实现基于UPNP协议无线网络路由机制的方法,是在一个源设备进入网络后,根据按如下流程生成或是更新设备路由信息表、目标设备参数信息表文件。The method for realizing the wireless network routing mechanism based on the UPNP protocol of the present invention is to generate or update the device routing information table and target device parameter information table files according to the following process after a source device enters the network.
第一步,无线设备的IP地址分配;The first step, the IP address assignment of the wireless device;
用户可以事先设定好自己的IP地址;若未进行设定,则如图8所示自动生成IP地址;Users can set their own IP address in advance; if not set, the IP address will be automatically generated as shown in Figure 8;
无线网络设备开机并进入网络后,进行上电硬件检测是采用有线、还是采用无线连接并进行配置(701);After the wireless network device is turned on and enters the network, the power-on hardware detects whether to use wired or wireless connection and configure it (701);
进行系统初始化(702);Perform system initialization (702);
UPNP协议栈的初始化(703),协议栈的根设备注册;Initialization (703) of the UPNP protocol stack, the root device registration of the protocol stack;
判断是否有DHCP服务器(704);Judging whether there is a DHCP server (704);
根据DHCP协议,向DHCP服务器申请IP地址(705),服务器分配并发送IP地址,无线设备获得IP地址(407);According to the DHCP protocol, apply for an IP address (705) to the DHCP server, the server distributes and sends the IP address, and the wireless device obtains the IP address (407);
若无DHCP服务器,则根据UPNP协议进行自动入网注册和信息订阅(706)。If there is no DHCP server, automatic network registration and information subscription are performed according to the UPNP protocol (706).
第二步,新设备的路由信息表的确定,如图9所示;The second step, the determination of the routing information table of the new equipment, as shown in Figure 9;
设备进入网络前,设备路由信息表和目标设备参数信息表为空;Before the device enters the network, the device routing information table and the target device parameter information table are empty;
进入网络后根据UPNP协议,以广播的形式向网络发布自己的信息,信息包括:本设备的IP地址、本设备的属性(是无线还是有线设备)、本设备的说明内容。After entering the network, according to the UPNP protocol, it publishes its own information to the network in the form of broadcast. The information includes: the IP address of the device, the attributes of the device (whether it is a wireless or wired device), and the description of the device.
其他设备得到广播信息后,更新自己的设备路由信息表、记录该设备的IP地址、将该设备设置为转接设备、路由途径为直接到达(路由次数为1)等;同时为广播设备反馈信息,信息包括:接收设备的属性和说明。After other devices get the broadcast information, update their own device routing information table, record the IP address of the device, set the device as a transfer device, and the routing path is direct arrival (routing number is 1), etc.; at the same time, it feeds back information to the broadcasting device , the information includes: properties and description of the receiving device.
发布广播信息的设备,根据返回信息更新自身的设备路由信息表和目标设备参数信息表。The device that publishes the broadcast information updates its own device routing information table and target device parameter information table according to the returned information.
前述发布广播信息的设备发出命令,订阅回馈信息设备的设备路由信息表、以及目标设备的属性;这些目标设备的设备路由信息表中包含着源设备不能直接通讯的设备;The aforementioned device that publishes the broadcast information issues a command, subscribes to the device routing information table of the feedback information device, and the attributes of the target device; the device routing information table of these target devices includes devices that the source device cannot directly communicate with;
被订阅的设备返回设备路由信息表、以及其设备的属性,反馈内容包括:目标设备的IP地址、路由过程、路由次数、目标设备的属性和目标设备的说明;The subscribed device returns the device routing information table and its device attributes. The feedback content includes: the IP address of the target device, the routing process, the number of routes, the attributes of the target device, and the description of the target device;
源设备再次更新其自身的设备路由信息表和目标设备参数信息表,将已建立直接通讯的路由设备确定为转接设备,以此确定路由路径;The source device updates its own device routing information table and target device parameter information table again, and determines the routing device that has established direct communication as the transfer device to determine the routing path;
第三步,已存在设备的路由信息表更新;The third step is to update the routing information table of the existing equipment;
在已存在的局域网络中,如果一个新的设备加入,局域网络中的所有已存在的设备必将更新其设备路由信息表,以添加新设备的路由信息,即In the existing local area network, if a new device joins, all existing devices in the local area network must update their device routing information table to add the routing information of the new device, that is
新设备直接通知已存在的、可以直接通讯的设备,已存在设备添加目标设备并将该设备设置为转接设备,路由途径为直接到达,路由次数为1;The new device directly notifies the existing device that can communicate directly, the existing device adds the target device and sets the device as a transfer device, the routing path is direct arrival, and the routing number is 1;
路由设备通知新设备上线,设备接收到新设备上线通知并更新其自身设备路由信息表后,同时根据自身的路由信息表向相关的所有目标设备(不包括新设备)发送新设备信息,包括:新设备信息、以及路由设备到目标设备之间的路由路径和路由次数;The routing device notifies that the new device is online. After the device receives the new device online notification and updates its own device routing information table, it sends new device information to all related target devices (excluding new devices) according to its own routing information table, including: New device information, as well as the routing path and routing times between the routing device and the target device;
例如:如上所述的例子,新设备D上线,首先设备D首先与可以直接通讯的设备C通知并发布信息→C设备将D设备确定为目标设备,并更新设备路由信息表,同时立即变为路由设备→C向目标设备A、B、E发送D设备信息,信息包括:D设备信息、以及路由设备C到目标设备A、B、E的路由路径→A、B、E设备收到路由设备C信息后,更新自己的设备路由信息表、添加目标设备D、转换设备为最后一个将数据包发送给目标设备的路由设备。For example: In the example above, when a new device D goes online, first, device D notifies and publishes information with device C that can communicate directly → device C determines device D as the target device, updates the device routing information table, and immediately becomes Routing device→C sends D device information to target devices A, B, E, the information includes: D device information, and the routing path from routing device C to target devices A, B, E→A, B, E devices receive the routing device After C information, update its own device routing information table, add target device D, and convert the device to be the last routing device that sends the data packet to the target device.
再以目标设备A为例,进一步说明设备A的设备路由信息表的更新,路由设备C根据其设备路由信息表,获取C到A的路由路径→计算出路由路径:数据包中的路由路径+A设备→如果路由路径为多种,则确定多种路由表,如:目标设备:D;转接设备:B;路由途径:A->B B->C C->D;路由次数:2+1=3次;Taking the target device A as an example, further explain the update of the device routing information table of device A. Routing device C obtains the routing path from C to A according to its device routing information table → calculates the routing path: the routing path in the data packet + A device → If there are multiple routing paths, determine multiple routing tables, such as: target device: D; transfer device: B; routing path: A->B B->C C->D; routing times: 2 +1=3 times;
第四步,无线设备的下线通知;The fourth step is the offline notification of the wireless device;
如图7所示,无线设备如要下线,则根据其设备路由信息表向所有的目标设备发送设备下线通知,下线通知数据包的格式是:包头+源设备IP地址+目标设备IP地址+下线通知+转发次数+校验和+包尾,As shown in Figure 7, if a wireless device wants to go offline, it will send a device offline notification to all target devices according to its device routing information table. The format of the offline notification packet is: header + source device IP address + target device IP Address+offline notification+forwarding times+checksum+packet tail,
其中,下线通知为一个字节,数值为1;Among them, the offline notification is a byte with a value of 1;
目标设备接到通知后,将更新路由列表,删除该无线设备、且删除所有与该设备有关的路由路径;After the target device receives the notification, it will update the routing list, delete the wireless device, and delete all routing paths related to the device;
源设备等待所有目标设备的返回信息,返回信息数据包的格式是:包头+源设备IP地址+目标设备IP地址+反馈信息+转发次数+校验和+包尾,The source device waits for the return information from all target devices. The format of the return information packet is: header + IP address of the source device + IP address of the target device + feedback information + forwarding times + checksum + tail of the packet,
其中,反馈数据为一个字节,确认为“1”,出现错误为“0”;Among them, the feedback data is one byte, the confirmation is "1", and the error is "0";
若反馈信息的数据为0,说明出现错误,则源设备重新发送下线通知数据包,重发次数最多不超过3次;If the data of the feedback information is 0, indicating an error, the source device resends the offline notification packet, and the number of resends is no more than 3 times;
最后,此设备结束并退出。Finally, the device ends and exits.
第五步,定期查询机制;The fifth step is the regular query mechanism;
若某设备发生突然掉电的情况,则不能按第四步步骤内容将下线信息通知给其他设备,上述第四步内容所述的退出机制失效,因此本发明所述的实现基于UPNP协议无线网络路由机制的方法,自系统初始化后即采用上第五步如下所述的定期查询机制;If a device suddenly loses power, the offline information cannot be notified to other devices according to the content of the fourth step. The exit mechanism described in the fourth step is invalid. The method of the network routing mechanism adopts the regular query mechanism as described in the fifth step above since the system is initialized;
每个设备根据其自身的设备路由信息表,每隔10分钟向所有目标设备发送查询信息;如果有反馈,则证明给目标设备工作正常;状态查询数据包格式是:包头+源设备IP地址+目标设备IP地址+状态查询+转发次数+校验和+包尾,其中,状态查询数据占用一个字节,数值为1或0,正确为“1”,错误为“0”;Each device sends query information to all target devices every 10 minutes according to its own device routing information table; if there is feedback, it proves that the target device is working normally; the status query packet format is: header + source device IP address + Target device IP address + status query + forwarding times + checksum + packet tail, where the status query data occupies one byte, the value is 1 or 0, "1" is correct, and "0" is error;
若发送3次后,查询仍然没有反馈,则证明该设备已经掉电,则在设备路由信息表、目标设备参数信息表中删除该设备、并删除与该设备有关的所有路由路径;If after sending 3 times, the query still has no feedback, it proves that the device has been powered off, then delete the device in the device routing information table and target device parameter information table, and delete all routing paths related to the device;
本发明所述的实现基于UPNP协议无线网络路由机制的方法,在上述生成或更新完成设备路由信息表和目标设备参数信息表的基础上,源设备和目标设备间可以进行数据传输和信息反馈。In the method for implementing a wireless network routing mechanism based on the UPNP protocol described in the present invention, on the basis of the above-mentioned generated or updated device routing information table and target device parameter information table, data transmission and information feedback can be performed between the source device and the target device.
需确定以下传输流程参数:The following transfer process parameters need to be determined:
1、目标设备的选择;1. Selection of the target device;
目标设备代号确定后,根据目标设备参数信息表获取目标设备的IP地址和设备描述,为路由数据报构造提供信息。After the code name of the target device is determined, the IP address and device description of the target device are obtained according to the target device parameter information table to provide information for routing datagram construction.
2、路由数据包的构造;2. The structure of routing data packets;
具体传输的数据保存在路由数据包中发送;路由数据包的生成规则是,当设备利用路由机制发送信息时,无线网络采用TCP/IP协议实现数据的网络传输;路由数据包为TCP/IP包的正文,TCP/IP包中的目标IP地址设置为源设备的转接设备IP地址。The specific transmitted data is stored in the routing data packet and sent; the generation rule of the routing data packet is that when the device uses the routing mechanism to send information, the wireless network uses the TCP/IP protocol to realize the network transmission of data; the routing data packet is a TCP/IP packet , the destination IP address in the TCP/IP packet is set to the IP address of the transfer device of the source device.
3、最佳路径的确定;3. Determination of the best path;
根据目标设备代号,查询源设备的设备路由信息表,最佳路径的选择算法是:According to the code name of the target device, query the device routing information table of the source device. The algorithm for selecting the best path is:
优先选择路由次数最少的一个途径;Prioritize the path with the least number of routes;
对于相同的路由次数,检测路由设备是移动设备还是固定设备,移动设备则减1;固定设备则加1。最后选择数据最大的作为路由路径;For the same number of routes, when detecting whether the routing device is a mobile device or a fixed device, the mobile device will be decremented by 1; the fixed device will be added by 1. Finally, choose the one with the largest data as the routing path;
如果数据还相同,则检测通过的路由设备的无线网络带宽,对比两个路径的路由设备的最低带宽,并优先选取带宽高的一条路经;If the data is still the same, then detect the wireless network bandwidth of the routing device passing through, compare the lowest bandwidth of the routing device of the two paths, and select a path with higher bandwidth first;
如果还相同,则由发送设备随机选取。If they are still the same, they are randomly selected by the sending device.
4、最终转接设备的确定;4. Determination of the final switching equipment;
源设备向目标设备发送信息,如果不能直接到达,则需要路由设备的转发;源设备先将数据包发送到转接设备上,源设备并不规定下一个转接设备,则需要有上一个转接设备根据规则确定;The source device sends information to the target device. If it cannot be reached directly, it needs to be forwarded by the routing device; the source device first sends the data packet to the transfer device. The source device does not specify the next transfer device, so the previous transfer device is required. The connecting device is determined according to the rules;
转接设备的选取规则如下:The selection rules for transfer devices are as follows:
对于直接到达的连接,目标设备就是转接设备;For connections arriving directly, the destination device is the transit device;
如果仅有一个转接设备,则直接采用;If there is only one switching device, use it directly;
如果有多个转接设备,这需要根据规则选择最佳路由过程,最佳路由过程的转接设备为最优转接设备。If there are multiple switching devices, it is necessary to select the best routing process according to the rules, and the switching device of the best routing process is the optimal switching device.
本发明所述的实现基于UPNP协议无线网络路由机制的方法,源设备向目标设备进行数据发送的流程是:In the method for realizing the wireless network routing mechanism based on the UPNP protocol described in the present invention, the flow process for the source device to send data to the target device is:
源设备通过设备路由信息表,确定最佳路径和转接设备,将数据包发送给转接设备;The source device determines the best path and the transfer device through the device routing information table, and sends the data packet to the transfer device;
转接设备解析数据包,获取转发次数和目标设备地址,转发次数位加1后,重新构造数据包;The transfer device parses the data packet, obtains the number of forwarding times and the address of the target device, adds 1 to the number of forwarding times, and reconstructs the data packet;
查询本设备的设备路由信息表,获取到达目标设备的最佳路径和下一个转接设备,并重新发送该数据包;Query the device routing information table of this device, obtain the best path to the target device and the next transfer device, and resend the data packet;
以此类推,直到到达目标设备为止;And so on until reaching the target device;
若转发次数位数据>54时,证明该数据包在网路中处于死循环状态,此时路由设备丢弃该数据包,并向源设备发送错误信息。If the number of forwarding times is greater than 54, it proves that the data packet is in an endless loop state in the network. At this time, the routing device discards the data packet and sends an error message to the source device.
本发明所述的实现基于UPNP协议无线网络路由机制的方法,目标设备接收数据的流程是:路由数据包的格式如图1所示,In the method for realizing the wireless network routing mechanism based on the UPNP protocol of the present invention, the flow process of the target device receiving data is: the format of the routing data packet is as shown in Figure 1,
设备接收数据后,判断路由数据包中的IP地址是否为本设备的IP地址;After the device receives the data, it judges whether the IP address in the routing data packet is the IP address of the device;
若是,则停止转发并处理数据;If so, stop forwarding and process the data;
若不是,则继续转发。If not, continue forwarding.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2003101057831A CN1311666C (en) | 2003-12-01 | 2003-12-01 | Method for realizing route mechanism based on UPNP protocal radio network |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2003101057831A CN1311666C (en) | 2003-12-01 | 2003-12-01 | Method for realizing route mechanism based on UPNP protocal radio network |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1625147A CN1625147A (en) | 2005-06-08 |
| CN1311666C true CN1311666C (en) | 2007-04-18 |
Family
ID=34757415
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2003101057831A Expired - Fee Related CN1311666C (en) | 2003-12-01 | 2003-12-01 | Method for realizing route mechanism based on UPNP protocal radio network |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1311666C (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1841172B1 (en) * | 2006-03-31 | 2018-03-14 | Google Technology Holdings LLC | Re-direction of streaming multimedia in wireless communication devices |
| CN101132364B (en) * | 2007-08-23 | 2012-02-29 | 新动力(北京)建筑科技有限公司 | Data addressing and repeating method and system in control network |
| CN101610487B (en) * | 2009-07-20 | 2012-05-23 | 中兴通讯股份有限公司 | Messaging method and apparatus for telecommunication network |
| CN102957568B (en) * | 2012-11-21 | 2016-06-29 | 浪潮电子信息产业股份有限公司 | A kind of method for managing and monitoring of multi node server |
| CN103281242B (en) * | 2013-06-19 | 2016-04-13 | 迈普通信技术股份有限公司 | protocol stack routing table maintenance method and device |
| CN112104496B (en) * | 2020-09-10 | 2023-06-23 | 中国电力科学研究院有限公司 | Universal substation IED self-discovery and self-configuration method and device based on UPnP |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2003003658A1 (en) * | 2001-06-29 | 2003-01-09 | Koninklijke Philips Electronics N.V. | AUDIO-VIDEO MANAGEMENT IN UPnP |
| WO2003019864A2 (en) * | 2001-08-22 | 2003-03-06 | Thomson Licensing Sa | Method for bridging a upnp network and a havi network |
| US20030140344A1 (en) * | 2002-01-21 | 2003-07-24 | Ghulam Bhatti | Wireless control for universal plug and play networks and devices |
-
2003
- 2003-12-01 CN CNB2003101057831A patent/CN1311666C/en not_active Expired - Fee Related
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2003003658A1 (en) * | 2001-06-29 | 2003-01-09 | Koninklijke Philips Electronics N.V. | AUDIO-VIDEO MANAGEMENT IN UPnP |
| WO2003019864A2 (en) * | 2001-08-22 | 2003-03-06 | Thomson Licensing Sa | Method for bridging a upnp network and a havi network |
| US20030140344A1 (en) * | 2002-01-21 | 2003-07-24 | Ghulam Bhatti | Wireless control for universal plug and play networks and devices |
Non-Patent Citations (1)
| Title |
|---|
| Home Networking with Universal Plug and Play Miller,B TNuxon,C Tai and M.Wood,IEEE Communications Magazine,No.December.2001 2001 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1625147A (en) | 2005-06-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN1819545A (en) | Multicast method in network | |
| CN1315279C (en) | Apparatus and method for retransmitting data packets in mobile ad hoc network environment | |
| CN101068201A (en) | Communication architecture, access point in communication architecture and method for transmitting data packets | |
| CN1242593C (en) | Source address selection system, router device and communication joint and source address selection method | |
| CN1791054A (en) | Virtual special network multicast method by virtual router mode | |
| CN1315314C (en) | Communication system and method thereof | |
| CN1581836A (en) | Domain name service system and method | |
| CN1299541A (en) | Traffic routing in small wireless data net works | |
| CN101053220A (en) | Method and media access control frame format for sending acknowledgments to ingress nodes in a mesh network | |
| CN1496154A (en) | Mobile communication control system, mobile communication control method, router, server, and data structure | |
| CN1713606A (en) | Wireless Communication Network System | |
| CN101047651A (en) | Method, system and equipment for setting IP priority level | |
| CN1770735A (en) | Method and system for transmitting and receiving data using multicasting | |
| CN1968184A (en) | Link layer communication method in LAN and network device thereof | |
| CN1518302A (en) | Communication system, communication method and terminal | |
| CN1956417A (en) | Communication system, communication terminal, route control method and router | |
| CN1311666C (en) | Method for realizing route mechanism based on UPNP protocal radio network | |
| CN1756440A (en) | Communication service control method and system | |
| CN1523840A (en) | Method and apparatus for exchanging routing information in a distributed router system | |
| CN1929638A (en) | Management method for multicast members of wireless LAN IP multicast frame transmission | |
| CN1647454A (en) | Method for changing pmtu on dynamic ip network and apparatus using the method | |
| CN1976343A (en) | Method and system for raising transmission control protocol data handling capacity | |
| CN1146196C (en) | Method and device for establishing routing table in communication network | |
| CN1801957A (en) | Reverse channel building method | |
| CN1771743A (en) | Paging method and device |
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 |
Granted publication date: 20070418 Termination date: 20191201 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |