WO2010028545A1 - Static route generation method, terminal route realization method and apparatus - Google Patents

Static route generation method, terminal route realization method and apparatus Download PDF

Info

Publication number
WO2010028545A1
WO2010028545A1 PCT/CN2009/001018 CN2009001018W WO2010028545A1 WO 2010028545 A1 WO2010028545 A1 WO 2010028545A1 CN 2009001018 W CN2009001018 W CN 2009001018W WO 2010028545 A1 WO2010028545 A1 WO 2010028545A1
Authority
WO
WIPO (PCT)
Prior art keywords
route
static route
terminal
routing policy
address
Prior art date
Application number
PCT/CN2009/001018
Other languages
French (fr)
Chinese (zh)
Inventor
惠敏
邓辉
刘大鹏
陈刚
胡雪南
Original Assignee
中国移动通信集团公司
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 中国移动通信集团公司 filed Critical 中国移动通信集团公司
Publication of WO2010028545A1 publication Critical patent/WO2010028545A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/42Centralised routing

Definitions

  • the present invention relates to the field of communications, and in particular, to a static route generation method when a terminal is connected to multiple networks, a corresponding terminal route implementation method, and a terminal and a network side device.
  • Ethernet With the rapid development of the Internet, the types of networks are constantly enriched, including Ethernet, GPRS networks, LTE networks, VPNs, WiFi, and so on.
  • Each network has its own characteristics, such as Ethernet with high speed, while GPRS network covers a wide area, and VPN has high security.
  • Users access the corresponding network in order to obtain certain network characteristics.
  • a terminal can access multiple networks at the same time, and can find the most suitable network for different application data packets, and keep the terminal working in multiple networks at the same time.
  • the notebook on the market basically has a wireless network card and an Ethernet card at the same time, and at the same time, a 3G data card slot is left, and these network interfaces can work at the same time.
  • Smartphones can connect to a variety of mobile networks and support WiFi connections.
  • the terminal routing mechanism in the prior art ultimately limits the terminal multi-connection. Since the terminal routing uses the default gateway mechanism, in the case of multiple connections, the operating system selects a default network interface according to certain rules, so that all network traffic enters and exits through this default interface, which actually causes The failure of multiple connections of the terminal cannot achieve the purpose of multi-connection of the terminal, and the simultaneous use of multiple network connections by the terminal cannot be realized.
  • a method for ensuring that multiple network interfaces of a terminal have traffic at the same time is to configure a static route in a host routing table.
  • the specific implementation manner is that the user manually configures the command line.
  • the routing of other traffic is still completed through the default network interface.
  • this method is basically not operative to the user because it is difficult for the user to obtain various routing configuration parameters.
  • the Windows Vista operating system can maintain multiple connections in a specific situation. That is, when the application performs network communication, if the default interface is replaced, the already started application will continue to communicate using the old interface, and the newly launched application uses the latest replacement default. The interface communicates. In this case, the old interface and the new default interface have traffic at the same time, achieving multiple connections to the terminal. However, this is a multi-connection in a passive situation, and this approach does not work when users need to proactively specify different networks for different applications.
  • the terminal routing complies with the default gateway mechanism, that is, no matter how many different networks are accessed by several physical ports on the physical terminal, the packet routing of the terminal is only sent and received from a default interface. This results in the fact that even if the terminal accesses multiple networks, virtually all network traffic is sent or received from one interface, which does not achieve the effect of multiple connections to the terminal.
  • the embodiment of the present invention provides a method for generating a static route, a corresponding terminal, and a network element device, and the terminal generates a corresponding static route according to the routing policy sent by the network element device, and solves the problem that the static route manually configured by the user does not have The problem of operability.
  • the embodiment of the present invention further provides a method for generating a static route, a corresponding terminal, and a DHCP server, so that the terminal sends a routing policy by using a DHCP server to generate a corresponding static route, which solves the problem that the user manually configures the static route.
  • the problem of operability is a method for generating a static route, a corresponding terminal, and a DHCP server, so that the terminal sends a routing policy by using a DHCP server to generate a corresponding static route, which solves the problem that the user manually configures the static route.
  • the embodiment of the invention further provides a method for implementing terminal routing, and the terminal is matched with a static route to send a data packet to implement multiple connection of the terminal.
  • the routing policy acquisition request is initiated to the network side;
  • Receiving a routing policy sent by the network side Generate a corresponding static route and store it according to the received routing policy.
  • the embodiment of the invention provides a method for implementing terminal routing, which includes:
  • the terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route.
  • the static route is generated by using the static route generation method.
  • the embodiment of the invention further provides a terminal, including:
  • a routing policy obtaining unit configured to initiate a routing policy acquisition request to the network side, and receive a routing policy sent by the network side;
  • the static route generation storage unit is configured to generate and store a corresponding static route according to the received routing policy.
  • the embodiment of the invention further provides a network element device, including:
  • a storage unit configured to store a routing policy
  • a receiving unit configured to receive a routing policy acquisition request initiated by the terminal
  • a sending unit configured to send, to the terminal, a routing policy stored in the storage unit.
  • the embodiment of the invention further provides a static route generation method, including:
  • the dynamic host configuration protocol is configured on the network side, and the DHCP server requests the IP configuration; receiving the DHCP message sent by the DHCP server, where the DHCP message includes a routing policy;
  • an embodiment of the present invention provides a method for implementing a terminal route, including:
  • the terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route.
  • the packet is sent using the determined matching route.
  • an embodiment of the present invention provides a terminal, including:
  • the IP configuration requesting unit is configured to request the network side DHCP server to obtain an IP configuration, and receive the DHCP message sent by the DHCP server, where the DHCP message includes a routing policy;
  • the static route generation storage unit is configured to obtain a routing policy included in the DHCP packet, generate a corresponding static route, and store the static route.
  • the embodiment of the present invention provides a DHCP server, including:
  • a storage unit configured to store a routing policy
  • a receiving unit configured to receive an IP configuration request sent by the terminal
  • a generating unit configured to generate a DHCP message, where the DHCP message includes a routing policy stored in the storage unit;
  • a sending unit configured to send, to the terminal, the DHCP message generated by the generating unit.
  • the present invention sends a routing policy to the terminal by the network side network element device or the DHCP server, and the terminal only needs to generate a corresponding static route according to the routing policy delivered by the network element device or the DHCP server, and does not need to obtain various routing configuration parameters by the user.
  • To manually configure a static route For the terminal, the routing algorithm is not required to be maintained in the terminal, which saves computing resources.
  • the entire routing policy does not require human participation, and is simple and easy.
  • the terminal can match the static route according to the attribute information of the data packet to be sent (such as the destination address of the data packet, the service type identifier, and so on), so that multiple network connections can pass the data packet at the same time to achieve the purpose of multiple connections.
  • the attribute information of the data packet to be sent such as the destination address of the data packet, the service type identifier, and so on
  • FIG. 1 is a flowchart of a method for generating a static route according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for implementing terminal routing according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a terminal according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a network element device according to Embodiment 4 of the present invention.
  • FIG. 5 is a flowchart of a method for generating a static route according to Embodiment 5 of the present invention.
  • FIG. 6 is a specific signaling interaction process between a terminal and a DHCP server according to Embodiment 5 of the present invention.
  • FIG. 7 is a schematic structural diagram of a terminal according to Embodiment 7 of the present invention.
  • FIG. 8 is a schematic structural diagram of a DHCP server according to Embodiment 8 of the present invention. detailed description
  • the embodiment of the present invention provides a static route generation method, a corresponding terminal route implementation method, and a corresponding terminal and network element device or a DHCP server, so that the terminal generates a corresponding static route according to the routing policy sent by the network side, and the manual is solved manually.
  • Configuring static routes is not an issue of operability.
  • the terminal needs to send a data packet, the attribute information of the data packet to be sent can be matched with the generated static route, and the data packet is sent through a static route matching the attribute information of the data packet to be sent, so that the terminal is connected multiple times.
  • Embodiment 1
  • the first embodiment provides a method for generating a static route.
  • the network sends a routing policy to the terminal, and the terminal generates a static route according to the routing policy sent by the network.
  • FIG. 1 is a flowchart of a static route generation method according to Embodiment 1 of the present invention, which specifically includes:
  • Step S101 After the terminal accesses the network, the terminal initiates a routing policy acquisition request to the network side.
  • Step S102 The terminal receives a routing policy sent by the network side.
  • Step S103 The terminal generates a corresponding static route according to the received routing policy and stores the static route.
  • the routing policy may specifically include, for example:
  • Destination address/subnet mask and gateway address Destination address/subnet mask and gateway address; or service type identifier and gateway address; or destination address/subnet mask, service type identifier, and gateway address.
  • the subnet address can be obtained from 220.10.0.125/24. .0.0.
  • the destination address is generated according to the received destination address/subnet mask and the gateway address. a static route of the subnet mask and the gateway address, and added to the terminal routing table; when the routing policy delivered by the network side includes the service type identifier and the gateway address,
  • a static route including the service type identifier and the gateway address is generated according to the received service type identifier and the gateway address, and is added to the terminal routing table.
  • the destination address/subnet mask, service type identifier, and gateway address are generated according to the received destination address/subnet mask, service type identifier, and gateway address.
  • the terminal After the terminal leaves a certain network, the terminal automatically deletes the static route generated by the locally stored routing policy according to the corresponding network side.
  • the terminal only needs to generate a corresponding static route according to the routing policy sent by the network side, and does not need to obtain various routing configuration parameters to manually configure the static route, and solves the problem that the user manually configures the static route. Operational problems.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the second embodiment provides a terminal routing implementation method, where the terminal selects a locally stored static route to send a data packet.
  • Embodiment 2 is a flowchart of a method for implementing terminal routing according to Embodiment 2 of the present invention, which specifically includes:
  • Step S201 The terminal matches the attribute information of the to-be-sent data packet with the stored static route to determine a matching route.
  • Step S202 The terminal sends the data packet by using the determined matching route.
  • the static route is generated by the method in the first embodiment.
  • the data packet is sent by using a default route.
  • step S201 it is determined whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route, and if , determining the corresponding static route as a matching route; As described above, if the static route includes the service type identifier and the gateway address, the identification is the same in step S201, and if so, the corresponding static route is determined as the matching route;
  • step S201 it is determined whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route.
  • the code if yes, determines the corresponding static route as the first matching route; and determines whether the service type identifier of the data packet to be sent is the same as the service type identifier included in the static route, and if yes, determines the corresponding static route as the second matching route.
  • the static route is determined as the final matching route; otherwise, the first matching route is determined as the final matching route.
  • the generated static route can be matched according to the attribute information of the data packet to be sent (such as the destination address of the data packet, the service type identifier, etc.), and the matching is performed.
  • the static route sends data packets. Because the data packets of different applications may have different destination addresses or service types, the matching routes may be different. Therefore, the terminal can use multiple routes to send data packets to implement multiple connections.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • the third embodiment provides a terminal, which can obtain a routing policy from the network side to generate a static route and store, and select a stored static route to send a data packet.
  • FIG. 3 is a schematic structural diagram of a terminal according to Embodiment 3 of the present invention, which specifically includes: a routing policy obtaining unit 301, configured to initiate a routing policy acquisition request to a network side, and receive a routing policy sent by a network side;
  • a routing policy obtaining unit 301 configured to initiate a routing policy acquisition request to a network side, and receive a routing policy sent by a network side;
  • the static route generation storage unit 302 is configured to generate and store a corresponding static route according to the received routing policy.
  • the terminal provided in Embodiment 3 of the present invention further includes:
  • the routing determining unit 303 is configured to match the attribute information of the data packet to be sent with the stored static route to determine a matching route.
  • the data sending unit 304 is configured to send the data packet by using the determined matching route.
  • the terminal provided in Embodiment 3 of the present invention may further include:
  • the static route deleting unit is configured to delete the static route generated by the routing policy sent by the corresponding network side stored in the static route generating storage unit after the terminal leaves the network.
  • the terminal provided by the third embodiment of the present invention only needs to generate a corresponding static route according to the routing policy delivered by the network side, and does not need to obtain various routing configuration parameters by the user to manually configure the static route, thereby solving the problem that the user manually configures the static route.
  • the problem is operability; and when the terminal needs to send a data packet, the attribute information of the data packet to be sent can be matched with the generated static route, and the data packet is sent through the matched static route to implement multiple connection of the terminal.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the fourth embodiment provides a network element device, and implements a routing policy to the terminal.
  • FIG. 4 is a schematic structural diagram of a network element device according to Embodiment 4 of the present invention, which specifically includes: a storage unit 401, configured to store a routing policy;
  • the receiving unit 402 is configured to receive a routing policy acquisition request initiated by the terminal.
  • the sending unit 403 is configured to send, to the terminal, a routing policy stored in the storage unit 401.
  • the network element device may further include:
  • the configuration unit 404 is configured to configure or modify a routing policy stored in the storage unit 401.
  • the network element device provided by the fourth embodiment of the present invention pre-sets the routing policy through the network side and stores the routing policy in the network element device. After receiving the request from the terminal, the device sends the set routing policy to the terminal.
  • the algorithm saves the computing resources of the terminal, and the operator can conveniently configure or update the routing policy stored in the network element device, and flexibly implement multiple connections of the terminal.
  • the present invention further provides a static route generation method, a terminal route implementation method, and a corresponding terminal and a DHCP server, which are implemented by extending a dynamic host configuration protocol (DHCP).
  • DHCP dynamic host configuration protocol
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • the fifth embodiment provides a method for generating a static route.
  • the DHCP server includes the routing policy in the DHCP response message returned to the terminal, and the terminal according to the received routing policy. Generate a static route and store it.
  • 5 is a flowchart of a method for generating a static route according to Embodiment 5 of the present invention, which specifically includes: Step S501: After a terminal accesses a network, requesting an IP configuration from a DHCP server on a network side; Step S502: The terminal receives a DHCP message sent by a DHCP server. The routing policy is included in the returned DHCP message.
  • Step S503 The terminal acquires a routing policy included in the DHCP packet, and generates a corresponding static route and stores the corresponding route.
  • the local static route generated according to the routing policy sent by the DHCP server in the network is deleted.
  • the specific signaling interaction process between the terminal and the DHCP server is as shown in FIG. 6, and includes:
  • the terminal After the terminal accesses the network, it sends a Discovery broadcast message to the DHCP server on the network side to determine a locally available DHCP server.
  • the DHCP server on the network side sends a request message in the form of a DHCP message to the terminal, carrying the IP configuration information of the terminal and the set routing policy.
  • the IP configuration information of the terminal includes the IP address, the gateway address, and the domain name server (DNS). ), etc., routing policies are carried through extended DHCP options.
  • the terminal After receiving the Offer message sent by multiple DHCP servers on the network side, the terminal selects a DHCP server and sends a Request broadcast message to all DHCP servers to confirm the selection.
  • the selected DHCP server returns an Acknowledge message of the DHCP message format to the terminal, carrying the IP configuration information of the terminal and the set routing policy; wherein the IP configuration information includes an IP address, a gateway address, and a domain name server ( DNS), etc., routing policies are carried through extended DHCP options.
  • IP configuration information includes an IP address, a gateway address, and a domain name server ( DNS), etc.
  • Table 1 below shows the packet format of DHCP in the prior art:
  • Htype(1) indicates the hardware address type, which is 1 byte in length
  • Hlen(1) indicates the length of the hardware address, and the length is 1 byte.
  • Hops(1) Set to zero, can be used by the forwarding agent when starting through the forwarding agent, and has a length of 1 byte;
  • the operation ID is a random number used for the response of the synchronization message and message between the terminal and the server, and has a length of 4 bytes.
  • Seconds(2) The time specified by the user, after the start of the address acquisition and update, the length is 2 bytes
  • Flags(2) The flag bit, which is 2 bytes in length
  • Ciaddr (4) User IP address, this field is used only when the user is in the BOUND, RENEW or REBINDING state and can respond to ARP requests, and is 4 bytes in length;
  • Siaddr (4) The IP address used in the bootstrap process, which is 4 bytes in length; Giaddr ( 4 ): Forward proxy IP address, length 4 bytes;
  • Options (variable) is an optional parameter field whose length is not fixed.
  • the embodiment of the present invention extends this optional field to carry a routing policy set in the DHCP server.
  • the extension field is: Option N;
  • the Option N field carries the routing policy.
  • a specific routing policy can include:
  • Destination address/subnet mask and gateway address or include service type identifier and gateway address; or destination address/subnet mask, service type identifier, and gateway address.
  • the routing policy includes the destination address/subnet mask, service type identifier, and gateway address.
  • the specific field structure of the extended field Option N is as follows:
  • the above field structure is merely an example.
  • the specific structure of the field structure and the specific length of each field are not limited.
  • step S503 the specific implementation process of the terminal acquiring the routing policy included in the DHCP message to generate the corresponding static route and storing the same is the same as that in the first embodiment, and is no longer spectacular.
  • the terminal only needs to generate a corresponding static route according to the routing policy delivered by the DHCP server on the network side, and does not need to obtain various routing configuration parameters by the user to manually configure the static route, which also solves the problem that the user manually configures the static route. Routing does not have the problem of operability.
  • the sixth embodiment is similar to the second embodiment. When the terminal has a data packet to be sent, the terminal matches the attribute information of the data packet to be sent with the static route stored in the local routing table to determine a matching route. Determine the matching route to send the packet.
  • the static route in the sixth embodiment is generated by the method described in the fifth embodiment.
  • the terminal does not determine a matching route in the static route stored locally, the default route is used to send the data packet.
  • the present invention further provides a terminal having a corresponding function, and a schematic structural diagram thereof is shown in FIG. 7, which includes:
  • the IP configuration requesting unit 701 is configured to request the network side DHCP server to obtain an IP configuration, and receive the DHCP message sent by the DHCP server, where the DHCP message includes the IP configuration information and the routing policy.
  • the static route generation storage unit 702 is configured to obtain a routing policy included in the DHCP message, generate a corresponding static route, and store the corresponding static route.
  • the routing determining unit 703 is configured to match the attribute information of the data packet to be sent with the stored static route to determine a matching route.
  • the data sending unit 704 is configured to send the data packet by using the determined matching route.
  • the terminal in this embodiment may further include: a static route deleting unit, configured to delete a static route generated by the routing policy sent by the DHCP server in the corresponding network stored in the static route generating storage unit after the terminal leaves the network.
  • a static route deleting unit configured to delete a static route generated by the routing policy sent by the DHCP server in the corresponding network stored in the static route generating storage unit after the terminal leaves the network.
  • the terminal provided by the seventh embodiment of the present invention only needs to generate a static route according to the routing policy sent by the DHCP server on the network side, and does not need to obtain various routing configuration parameters to manually configure a static route, thereby solving the problem that the user manually configures the static route. There is no problem of operability; and when the terminal needs to send a data packet, the attribute information of the data packet to be sent can be matched with the generated static route, and the data packet is sent through the matched static route to implement terminal multi-connection.
  • Example 8 Example 8:
  • the eighth embodiment provides a DHCP server, which is used to send a routing policy to the terminal.
  • the storage unit 801 is configured to store a routing policy.
  • the receiving unit 802 is configured to receive an IP configuration request sent by the terminal.
  • the generating unit 803 is configured to generate a DHCP message, where the generated DHCP message includes a routing policy stored in the storage unit 801.
  • the sending unit 804 is configured to send, to the terminal, the DHCP message generated by the generating unit 803.
  • the DHCP server further includes:
  • the configuration unit 805 is configured to configure or modify a routing policy stored in the storage unit 801.
  • the DHCP server provided in Embodiment 8 of the present invention stores a preset routing policy, and after receiving the IP configuration request of the terminal, sends a set routing policy to the terminal by using a response message returned to the terminal;
  • the algorithm saves the computing resources of the terminal, and the operator can conveniently configure or update the routing policy stored in the DHCP server, and flexibly implement multiple connections of the terminal.

Abstract

A static route generation method, terminal route realization method and apparatus are provided. Through that the network side network element apparatus or the DHCP server transmits a route policy down to a terminal, the terminal generates a static route and stores it according to the route policy transmitted down by the network element apparatus or the DHCP server; the terminal matches the attribute information of the data packet waiting for transmitting with the stored static route, and determines a matching route, sends the data packet using the determined matching route. By applying the scheme of the invention, the user doesn't need to obtain a multiple route configuration parameter to configure the static route manually, that the data packets pass a multiple network connection at the same time can be ensured, and the multi -connection of the terminal can be realized.

Description

静态路由生成方法、 终端路由实现方法及装置 技术领域  Static route generation method, terminal route implementation method and device
本发明涉及通信领域, 尤其涉及终端连接到多个网络时的一种静态路由 生成方法, 相应的终端路由实现方法, 以及终端与网络侧装置。 背景技术  The present invention relates to the field of communications, and in particular, to a static route generation method when a terminal is connected to multiple networks, a corresponding terminal route implementation method, and a terminal and a network side device. Background technique
随着互联网的飞速发展, 网络的种类不断丰富, 包括以太网、 GPRS网络、 LTE网络、 VPN、 WiFi等。 每种网络有自己的特性, 如以太网具有速度高的 特点, 而 GPRS网络则覆盖面积广, VPN具有高安全性等。 用户为了获得某 种网络特性而接入相应的网络, 当用户需要同时获得几种网络特性, 或是单 一网络不能够满足用户的多样需求时, 就催生了终端多连接的需求。 即将一 个终端同时接入多个网络, 可以为不同的应用数据包寻找最合适的网络, 保 持终端同时工作在多个网络中。  With the rapid development of the Internet, the types of networks are constantly enriched, including Ethernet, GPRS networks, LTE networks, VPNs, WiFi, and so on. Each network has its own characteristics, such as Ethernet with high speed, while GPRS network covers a wide area, and VPN has high security. Users access the corresponding network in order to obtain certain network characteristics. When users need to obtain several network characteristics at the same time, or a single network cannot meet the diverse needs of users, it has created the need for multiple connections of terminals. A terminal can access multiple networks at the same time, and can find the most suitable network for different application data packets, and keep the terminal working in multiple networks at the same time.
终端的迅速发展使多连接的需求有了物理硬件保证。 目前市场上的笔记 本电脑基本同时内置有无线网卡和以太网卡, 同时留有 3G数据卡槽, 并且这 些网络接口都可以同时工作。 智能手机能够连接多种制式的移动网络, 并且 支持 WiFi连接。  The rapid development of terminals has made physical hardware assurance for the needs of multiple connections. At present, the notebook on the market basically has a wireless network card and an Ethernet card at the same time, and at the same time, a 3G data card slot is left, and these network interfaces can work at the same time. Smartphones can connect to a variety of mobile networks and support WiFi connections.
但是在具备了用户需求与终端硬件保证的情况下, 现有技术中的终端路 由机制最终限制了终端多连接。 由于终端路由使用默认网关(default gateway ) 机制, 在多连接的情况下, 操作系统会根据一定的规则选择出一个默认的网 络接口, 使所有网络流量都通过这个默认接口进出, 在事实上造成了终端多 连接的失败, 从而不能达到终端多连接的目的, 不能实现终端对多个网络连 接的同时使用。  However, in the case of user requirements and terminal hardware guarantees, the terminal routing mechanism in the prior art ultimately limits the terminal multi-connection. Since the terminal routing uses the default gateway mechanism, in the case of multiple connections, the operating system selects a default network interface according to certain rules, so that all network traffic enters and exits through this default interface, which actually causes The failure of multiple connections of the terminal cannot achieve the purpose of multi-connection of the terminal, and the simultaneous use of multiple network connections by the terminal cannot be realized.
现有技术中 , 一种用来保证终端多个网络接口同时拥有流量的方法是在 主机路由表中配置静态路由。 具体实现方式是用户通过命令行的方式手动配 置静态路由表项, 包括输入目的 IP、 网关、 测量(metric )值等, 这样可以保 证对特定目的 IP地址的流量指定网络接口进行路由, 对其他流量的路由则仍 通过默认网络接口完成, 保证了多个接口同时有流量存在。 但该方法对用户 基本不具有可操作性, 因为用户获取各种路由配置参数很困难。 In the prior art, a method for ensuring that multiple network interfaces of a terminal have traffic at the same time is to configure a static route in a host routing table. The specific implementation manner is that the user manually configures the command line. Set the static routing entry, including the destination IP address, gateway, and metric value. This ensures that the network interface of the specified destination IP address is routed. The routing of other traffic is still completed through the default network interface. There are multiple interfaces with traffic at the same time. However, this method is basically not operative to the user because it is difficult for the user to obtain various routing configuration parameters.
Windows Vista操作系统可以在特定的情形下保持主机多连接, 即在应用 进行网络通信时, 如果默认接口更换, 那么已经启动的应用将继续使用旧接 口进行通信, 新启动的应用使用最新更换的默认接口进行通信。 这种情况下, 旧接口和新的默认接口同时拥有流量, 达到了终端多连接。 但是, 这是一个 被动情况下的多连接, 当用户需要主动为不同应用指定不同网络时, 这种方 式不能发挥作用。  The Windows Vista operating system can maintain multiple connections in a specific situation. That is, when the application performs network communication, if the default interface is replaced, the already started application will continue to communicate using the old interface, and the newly launched application uses the latest replacement default. The interface communicates. In this case, the old interface and the new default interface have traffic at the same time, achieving multiple connections to the terminal. However, this is a multi-connection in a passive situation, and this approach does not work when users need to proactively specify different networks for different applications.
综上所述, 现有技术中, 由于终端路由遵从默认网关机制, 即无论物理上 终端有几个网 口接入多少个不同的网络, 终端的数据包路由只从一个默 认的接口收发。 这样就造成了即使终端接入多个网络, 事实上所有网络流量 都是从一个接口中发送或接收, 达不到终端多连接的效果。 发明内容  In summary, in the prior art, since the terminal routing complies with the default gateway mechanism, that is, no matter how many different networks are accessed by several physical ports on the physical terminal, the packet routing of the terminal is only sent and received from a default interface. This results in the fact that even if the terminal accesses multiple networks, virtually all network traffic is sent or received from one interface, which does not achieve the effect of multiple connections to the terminal. Summary of the invention
本发明实施例提供一种静态路由生成方法、 相应的终端和网元装置, 实 现终端根据网络侧网元装置下发的路由策略, 生成对应的静态路由, 解决了 由用户手动配置静态路由不具有可操作性的问题。  The embodiment of the present invention provides a method for generating a static route, a corresponding terminal, and a network element device, and the terminal generates a corresponding static route according to the routing policy sent by the network element device, and solves the problem that the static route manually configured by the user does not have The problem of operability.
本发明实施例还提供一种静态路由生成方法、 相应的终端和 DHCP服务 器, 实现终端通过 DHCP服务器使用扩展 DHCP报文下发路由策略, 生成对 应的静态路由, 解决了用户手动配置静态路由不具有可操作性的问题。  The embodiment of the present invention further provides a method for generating a static route, a corresponding terminal, and a DHCP server, so that the terminal sends a routing policy by using a DHCP server to generate a corresponding static route, which solves the problem that the user manually configures the static route. The problem of operability.
本发明实施例还提供终端路由实现方法, 通过终端匹配静态路由发送数 据包, 实现终端多连接。  The embodiment of the invention further provides a method for implementing terminal routing, and the terminal is matched with a static route to send a data packet to implement multiple connection of the terminal.
本发明实施例提供的一种静态路由生成方法, 包括:  A static route generation method provided by an embodiment of the present invention includes:
终端接入网络后向网络侧发起路由策略获取请求;  After the terminal accesses the network, the routing policy acquisition request is initiated to the network side;
接收网络侧发送的路由策略; 根据接收的路由策略, 生成对应的静态路由并存储。 Receiving a routing policy sent by the network side; Generate a corresponding static route and store it according to the received routing policy.
本发明实施例提供一种终端路由实现方法, 包括:  The embodiment of the invention provides a method for implementing terminal routing, which includes:
终端将待发送的数据包的属性信息与存储的静态路由进行匹配, 确定出 匹配路由;  The terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route.
使用确定出的匹配路由发送所述数据包;  Sending the data packet using the determined matching route;
其中, 所述静态路由采用上述静态路由生成方法生成。  The static route is generated by using the static route generation method.
本发明实施例还提供一种终端, 包括:  The embodiment of the invention further provides a terminal, including:
路由策略获取单元, 用于向网络侧发起路由策略获取请求, 接收网络侧 发送的路由策略;  a routing policy obtaining unit, configured to initiate a routing policy acquisition request to the network side, and receive a routing policy sent by the network side;
静态路由生成存储单元, 用于根据接收的路由策略, 生成对应的静态路 由并存储。  The static route generation storage unit is configured to generate and store a corresponding static route according to the received routing policy.
本发明实施例还提供一种网元装置, 包括:  The embodiment of the invention further provides a network element device, including:
存储单元, 用于存储路由策略;  a storage unit, configured to store a routing policy;
接收单元, 用于接收终端发起的路由策略获取请求;  a receiving unit, configured to receive a routing policy acquisition request initiated by the terminal;
发送单元, 用于向终端发送所述存储单元中存储的路由策略。  And a sending unit, configured to send, to the terminal, a routing policy stored in the storage unit.
本发明实施例再提供一种静态路由生成方法, 包括:  The embodiment of the invention further provides a static route generation method, including:
终端接入网络后向网络侧动态主机配置协议 DHCP服务器请求 IP配置; 接收所述 DHCP服务器发送的 DHCP报文, 所述 DHCP报文中包含路由 策略;  After the terminal accesses the network, the dynamic host configuration protocol is configured on the network side, and the DHCP server requests the IP configuration; receiving the DHCP message sent by the DHCP server, where the DHCP message includes a routing policy;
获取所述 DHCP报文中包含的路由策略, 生成对应的静态路由并存储。 根据上述使用 DHCP报文的静态路由生成方法, 本发明实施例提供一种 相应的终端路由实现方法, 包括:  Obtain the routing policy contained in the DHCP packet, generate a corresponding static route, and store it. According to the foregoing method for generating a static route using a DHCP message, an embodiment of the present invention provides a method for implementing a terminal route, including:
终端将待发送的数据包的属性信息与存储的静态路由进行匹配, 确定出 匹配路由;  The terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route.
使用确定出的匹配路由发送所述数据包。  The packet is sent using the determined matching route.
根据上述使用 DHCP报文的静态路由生成方法, 本发明实施例提供一种 终端, 包括: IP配置请求单元, 用于向网络侧 DHCP服务器请求获取 IP配置,接收所 述 DHCP服务器发送的 DHCP报文, 所述 DHCP报文中包含路由策略; According to the above method for generating a static route using a DHCP message, an embodiment of the present invention provides a terminal, including: The IP configuration requesting unit is configured to request the network side DHCP server to obtain an IP configuration, and receive the DHCP message sent by the DHCP server, where the DHCP message includes a routing policy;
静态路由生成存储单元, 用于获取所述 DHCP报文中包含的路由策略, 生成对应的静态路由并存储。  The static route generation storage unit is configured to obtain a routing policy included in the DHCP packet, generate a corresponding static route, and store the static route.
根据上述使用 DHCP报文的静态路由生成方法,本发明实施例提供 DHCP 服务器, 包括:  According to the foregoing method for generating a static route using a DHCP message, the embodiment of the present invention provides a DHCP server, including:
存储单元, 用于存储路由策略;  a storage unit, configured to store a routing policy;
接收单元, 用于接收终端发送的获取 IP配置请求;  a receiving unit, configured to receive an IP configuration request sent by the terminal;
生成单元, 用于生成 DHCP报文, 在所述 DHCP报文中包含所述存储单 元中存储的路由策略;  a generating unit, configured to generate a DHCP message, where the DHCP message includes a routing policy stored in the storage unit;
发送单元, 用于向终端发送所述生成单元生成的所述 DHCP报文。  And a sending unit, configured to send, to the terminal, the DHCP message generated by the generating unit.
本发明通过由网络侧网元装置或 DHCP服务器下发路由策略给终端, 终 端只需根据网元装置或 DHCP服务器下发的路由策略生成对应的静态路由, 不需要由用户获取各种路由配置参数来手动配置静态路由。 对于终端来说, 不需要在终端维护路由算法, 节省了计算资源; 对于用户来说, 整个路由策 略不需要人为参与, 简单易行。  The present invention sends a routing policy to the terminal by the network side network element device or the DHCP server, and the terminal only needs to generate a corresponding static route according to the routing policy delivered by the network element device or the DHCP server, and does not need to obtain various routing configuration parameters by the user. To manually configure a static route. For the terminal, the routing algorithm is not required to be maintained in the terminal, which saves computing resources. For the user, the entire routing policy does not require human participation, and is simple and easy.
终端生成静态路由后, 能够根据待发送数据包的属性信息(如数据包的 目标地址、 业务类型标识等) 匹配静态路由, 可以保证多个网络连接同时有 数据包通过, 达到多连接的目的。 附图说明  After the static route is generated, the terminal can match the static route according to the attribute information of the data packet to be sent (such as the destination address of the data packet, the service type identifier, and so on), so that multiple network connections can pass the data packet at the same time to achieve the purpose of multiple connections. DRAWINGS
图 1为本发明实施例一提供的一种静态路由生成方法流程图;  1 is a flowchart of a method for generating a static route according to Embodiment 1 of the present invention;
图 2为本发明实施例二提供的一种终端路由实现方法流程图;  2 is a flowchart of a method for implementing terminal routing according to Embodiment 2 of the present invention;
图 3为本发明实施例三提供的一种终端结构示意图;  3 is a schematic structural diagram of a terminal according to Embodiment 3 of the present invention;
图 4为本发明实施例四提供的网元装置结构示意图;  4 is a schematic structural diagram of a network element device according to Embodiment 4 of the present invention;
图 5为本发明实施例五提供的静态路由生成方法流程图;  FIG. 5 is a flowchart of a method for generating a static route according to Embodiment 5 of the present invention;
图 6为本发明实施例五中终端与 DHCP服务器之间的具体信令交互过程 示意图; FIG. 6 is a specific signaling interaction process between a terminal and a DHCP server according to Embodiment 5 of the present invention; Schematic diagram
图 7为本发明实施例七提供的一种终端结构示意图;  7 is a schematic structural diagram of a terminal according to Embodiment 7 of the present invention;
图 8为本发明实施例八提供的 DHCP服务器结构示意图。 具体实施方式  FIG. 8 is a schematic structural diagram of a DHCP server according to Embodiment 8 of the present invention. detailed description
本发明实施例提供静态路由生成方法、 相应的终端路由实现方法以及相 应的终端和网元装置或 DHCP服务器,实现终端根据网络侧下发的路由策略, 生成对应的静态路由, 解决了由用户手动配置静态路由不具有可操作性的问 题。 且当终端需要发送数据包时, 能够将待发送数据包的属性信息与生成的 静态路由进行匹配, 通过与待发送数据包的属性信息匹配的静态路由发送数 据包, 实现终端多连接。  The embodiment of the present invention provides a static route generation method, a corresponding terminal route implementation method, and a corresponding terminal and network element device or a DHCP server, so that the terminal generates a corresponding static route according to the routing policy sent by the network side, and the manual is solved manually. Configuring static routes is not an issue of operability. When the terminal needs to send a data packet, the attribute information of the data packet to be sent can be matched with the generated static route, and the data packet is sent through a static route matching the attribute information of the data packet to be sent, so that the terminal is connected multiple times.
下面结合附图, 用具体实施例对本发明提供的方法及装置进行详细描述。 实施例一:  The method and apparatus provided by the present invention will be described in detail below with reference to the accompanying drawings. Embodiment 1:
实施例一提供一种静态路由生成方法, 在该方法中, 由网络侧下发路由 策略给终端, 终端根据网络侧下发的路由策略生成静态路由并存储。  The first embodiment provides a method for generating a static route. In this method, the network sends a routing policy to the terminal, and the terminal generates a static route according to the routing policy sent by the network.
参见图 1, 为本发明实施例一提供的一种静态路由生成方法流程图,具体 包括:  FIG. 1 is a flowchart of a static route generation method according to Embodiment 1 of the present invention, which specifically includes:
步骤 S 101、 终端接入网络后向网络侧发起路由策略获取请求;  Step S101: After the terminal accesses the network, the terminal initiates a routing policy acquisition request to the network side.
步骤 S102、 终端接收网络侧发送的路由策略;  Step S102: The terminal receives a routing policy sent by the network side.
步骤 S103、 终端根据接收的路由策略, 生成对应的静态路由并存储。 其中, 路由策略具体可以包含例如:  Step S103: The terminal generates a corresponding static route according to the received routing policy and stores the static route. The routing policy may specifically include, for example:
目的地址 /子网掩码和网关地址; 或者业务类型标识和网关地址; 或者目 的地址 /子网掩码、 业务类型标识和网关地址等。 其中, 目的地址 /子网掩码可 以表示子网地址, 即, 子网地址 =目的地址 /子网掩码中网络标识位的长度,例 如, 由 220.10.0.125/24可以得到子网地址为 200.10.0.0。 骤 S103中,根据接收的目的地址 /子网掩码和网关地址,生成包含该目的地址 /子网掩码和网关地址的静态路由, 并加入到终端路由表中; 当网络侧下发的路由策略中包含业务类型标识和网关地址时, 在步骤Destination address/subnet mask and gateway address; or service type identifier and gateway address; or destination address/subnet mask, service type identifier, and gateway address. The destination address/subnet mask can represent the subnet address, that is, the subnet address = the length of the network identifier bit in the destination address/subnet mask. For example, the subnet address can be obtained from 220.10.0.125/24. .0.0. In step S103, the destination address is generated according to the received destination address/subnet mask and the gateway address. a static route of the subnet mask and the gateway address, and added to the terminal routing table; when the routing policy delivered by the network side includes the service type identifier and the gateway address,
S103中, 根据接收的业务类型标识和网关地址, 生成包含该业务类型标识和 网关地址的静态路由, 并加入到终端路由表中; In S103, a static route including the service type identifier and the gateway address is generated according to the received service type identifier and the gateway address, and is added to the terminal routing table.
当网络侧下发的路由策略中包含目的地址 /子网掩码、 业务类型标识和网 关地址时,在步骤 S103中,根据接收的目的地址 /子网掩码、业务类型标识和 网关地址, 生成包含该目的地址 /子网掩码、 业务类型标识和网关地址的静态 路由, 并加入到终端路由表中。  When the routing policy delivered by the network side includes the destination address/subnet mask, the service type identifier, and the gateway address, in step S103, the destination address/subnet mask, service type identifier, and gateway address are generated according to the received destination address/subnet mask, service type identifier, and gateway address. A static route containing the destination address/subnet mask, service type identifier, and gateway address, and added to the terminal routing table.
当终端离开某一网络后, 终端自动删除本地存储的根据相应网络侧发送 的路由策略生成的静态路由。  After the terminal leaves a certain network, the terminal automatically deletes the static route generated by the locally stored routing policy according to the corresponding network side.
根据本发明上述实施例一, 终端只需根据网络侧下发的路由策略生成对 应的静态路由, 不需要用户获取各种路由配置参数来手动配置静态路由, 解 决了用户手动配置静态路由不具有可操作性的问题。  According to the above-mentioned first embodiment of the present invention, the terminal only needs to generate a corresponding static route according to the routing policy sent by the network side, and does not need to obtain various routing configuration parameters to manually configure the static route, and solves the problem that the user manually configures the static route. Operational problems.
实施例二:  Embodiment 2:
实施例二提供一种终端路由实现方法, 由终端选择本地存储的静态路由 发送数据包。  The second embodiment provides a terminal routing implementation method, where the terminal selects a locally stored static route to send a data packet.
参见图 2, 为本发明实施例二提供的一种终端路由实现方法流程图,具体 包括:  2 is a flowchart of a method for implementing terminal routing according to Embodiment 2 of the present invention, which specifically includes:
步骤 S201、终端将待发送数据包的属性信息与存储的静态路由进行匹配, 确定出匹配路由;  Step S201: The terminal matches the attribute information of the to-be-sent data packet with the stored static route to determine a matching route.
步骤 S202、 终端使用确定出的匹配路由发送数据包;  Step S202: The terminal sends the data packet by using the determined matching route.
其中, 静态路由采用上述实施例一的方法生成。  The static route is generated by the method in the first embodiment.
根据本发明实施例二提供的方法, 当未确定出匹配路由时, 采用默认路 由发送数据包。  According to the method provided by Embodiment 2 of the present invention, when a matching route is not determined, the data packet is sent by using a default route.
如上所述, 若静态路由包含目的地址 /子网掩码和网关地址, 在步骤 S201 中, 需要判断待发送的数据包的目标地址是否属于静态路由包含的目的地址 / 子网掩码中, 若是, 将对应静态路由确定为匹配路由; 如上所述, 若静态路由包含业务类型标识和网关地址, 在步骤 S201中, 识相同, 若是, 将对应静态路由确定为匹配路由; As described above, if the static route includes the destination address/subnet mask and the gateway address, in step S201, it is determined whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route, and if , determining the corresponding static route as a matching route; As described above, if the static route includes the service type identifier and the gateway address, the identification is the same in step S201, and if so, the corresponding static route is determined as the matching route;
如上所述, 若静态路由包含目的地址 /子网掩码、 业务类型标识和网关地 址, 在步骤 S201中, 需要判断待发送的数据包的目标地址是否属于静态路由 包含的目的地址 /子网掩码中, 若是, 将对应静态路由确定为第一匹配路由; 以及判断待发送的数据包的业务类型标识是否与静态路由包含的业务类型标 识相同, 若是, 将对应静态路由确定为第二匹配路由; 当第一匹配路由与第 二匹配路由为同一静态路由时, 将该静态路由确定为最终匹配路由; 否则, 将第一匹配路由确定为最终匹配路由。  As described above, if the static route includes the destination address/subnet mask, the service type identifier, and the gateway address, in step S201, it is determined whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route. The code, if yes, determines the corresponding static route as the first matching route; and determines whether the service type identifier of the data packet to be sent is the same as the service type identifier included in the static route, and if yes, determines the corresponding static route as the second matching route. When the first matching route and the second matching route are the same static route, the static route is determined as the final matching route; otherwise, the first matching route is determined as the final matching route.
根据本发明实施例二的上述方法, 且当终端需要发送数据包时, 能够根 据待发送数据包的属性信息(如数据包的目标地址、 业务类型标识等) 匹配 生成的静态路由, 通过匹配出的静态路由发送数据包; 由于不同应用的数据 包其目标地址或业务类型有可能不同, 则其得到的匹配路由也可能不同, 从 而使得终端可以使用多个路由发送数据包, 实现终端多连接。  According to the foregoing method of the second embodiment of the present invention, when the terminal needs to send a data packet, the generated static route can be matched according to the attribute information of the data packet to be sent (such as the destination address of the data packet, the service type identifier, etc.), and the matching is performed. The static route sends data packets. Because the data packets of different applications may have different destination addresses or service types, the matching routes may be different. Therefore, the terminal can use multiple routes to send data packets to implement multiple connections.
实施例三:  Embodiment 3:
实施例三提供一种终端, 能够从网络侧获取路由策略以生成静态路由并 存储, 并选择存储的静态路由发送数据包。  The third embodiment provides a terminal, which can obtain a routing policy from the network side to generate a static route and store, and select a stored static route to send a data packet.
参见图 3, 为本发明实施例三提供的一种终端结构示意图, 具体包括: 路由策略获取单元 301,用于向网络侧发起路由策略获取请求,接收网络 侧发送的路由策略;  3 is a schematic structural diagram of a terminal according to Embodiment 3 of the present invention, which specifically includes: a routing policy obtaining unit 301, configured to initiate a routing policy acquisition request to a network side, and receive a routing policy sent by a network side;
静态路由生成存储单元 302, 用于根据接收的路由策略,生成对应的静态 路由并存储。  The static route generation storage unit 302 is configured to generate and store a corresponding static route according to the received routing policy.
本发明实施例三提供的终端还包括:  The terminal provided in Embodiment 3 of the present invention further includes:
路由确定单元 303,用于将待发送的数据包的属性信息与存储的静态路由 进行匹配, 确定出匹配路由;  The routing determining unit 303 is configured to match the attribute information of the data packet to be sent with the stored static route to determine a matching route.
数据发送单元 304, 用于使用确定出的匹配路由发送所述数据包。 本发明实施例三提供的终端还可以包括: The data sending unit 304 is configured to send the data packet by using the determined matching route. The terminal provided in Embodiment 3 of the present invention may further include:
静态路由删除单元, 用于终端离开网络后删除所述静态路由生成存储单 元中存储的根据对应网络侧发送的路由策略生成的静态路由。  The static route deleting unit is configured to delete the static route generated by the routing policy sent by the corresponding network side stored in the static route generating storage unit after the terminal leaves the network.
采用本发明实施例三提供的终端, 只需根据网络侧下发的路由策略生成 对应的静态路由, 不需要由用户获取各种路由配置参数来手动配置静态路由, 解决了用户手动配置静态路由不具有可操作性的问题; 且当终端需要发送数 据包时, 能够将待发送数据包的属性信息与生成的静态路由进行匹配, 通过 匹配出的静态路由发送数据包, 实现终端多连接。  The terminal provided by the third embodiment of the present invention only needs to generate a corresponding static route according to the routing policy delivered by the network side, and does not need to obtain various routing configuration parameters by the user to manually configure the static route, thereby solving the problem that the user manually configures the static route. The problem is operability; and when the terminal needs to send a data packet, the attribute information of the data packet to be sent can be matched with the generated static route, and the data packet is sent through the matched static route to implement multiple connection of the terminal.
实施例四:  Embodiment 4:
实施例四提供一种网元装置, 实现向终端下发路由策略。  The fourth embodiment provides a network element device, and implements a routing policy to the terminal.
参见图 4, 为本发明实施例四提供的网元装置结构示意图, 具体包括: 存储单元 401 , 用于存储路由策略;  4 is a schematic structural diagram of a network element device according to Embodiment 4 of the present invention, which specifically includes: a storage unit 401, configured to store a routing policy;
接收单元 402, 用于接收终端发起的路由策略获取请求;  The receiving unit 402 is configured to receive a routing policy acquisition request initiated by the terminal.
发送单元 403, 用于向终端发送存储单元 401中存储的路由策略。  The sending unit 403 is configured to send, to the terminal, a routing policy stored in the storage unit 401.
该网元装置还可以包括:  The network element device may further include:
配置单元 404, 用于配置或修改存储单元 401中存储的路由策略。  The configuration unit 404 is configured to configure or modify a routing policy stored in the storage unit 401.
采用本发明实施例四提供的网元装置, 通过网络侧预先设置路由策略并 存储到网元装置中, 接收到终端的请求后, 向终端发送设置的路由策略; 不 仅避免了在终端需要维护路由算法, 节省了终端的计算资源, 且运营商可以 方便地配置或更新网元装置中存储的路由策略, 灵活实现终端多连接。  The network element device provided by the fourth embodiment of the present invention pre-sets the routing policy through the network side and stores the routing policy in the network element device. After receiving the request from the terminal, the device sends the set routing policy to the terminal. The algorithm saves the computing resources of the terminal, and the operator can conveniently configure or update the routing policy stored in the network element device, and flexibly implement multiple connections of the terminal.
基于同一发明构思, 本发明还提供一种通过扩展动态主机配置协议 ( Dynamic Host Configuration Protocol, DHCP ) 实现的静态路由生成方法、 终端路由实现方法以及相应的终端与 DHCP服务器。  Based on the same inventive concept, the present invention further provides a static route generation method, a terminal route implementation method, and a corresponding terminal and a DHCP server, which are implemented by extending a dynamic host configuration protocol (DHCP).
实施例五:  Embodiment 5:
实施例五提供一种静态路由生成方法, 通过终端接入网络后向 DHCP服 务器请求 IP配置时,由 DHCP服务器在返回给终端的 DHCP应^艮文中包含 路由策略, 终端再根据接收的路由策略, 生成静态路由并存储。 参见图 5,为本发明实施例五提供的静态路由生成方法流程图,具体包括: 步驟 S501、 终端接入网络后向网络侧 DHCP服务器请求 IP配置; 步骤 S502、终端接收 DHCP服务器发送的 DHCP _文,在该返回的 DHCP 报文中包含路由策略; The fifth embodiment provides a method for generating a static route. When the terminal requests access to the network and requests the IP configuration from the DHCP server, the DHCP server includes the routing policy in the DHCP response message returned to the terminal, and the terminal according to the received routing policy. Generate a static route and store it. 5 is a flowchart of a method for generating a static route according to Embodiment 5 of the present invention, which specifically includes: Step S501: After a terminal accesses a network, requesting an IP configuration from a DHCP server on a network side; Step S502: The terminal receives a DHCP message sent by a DHCP server. The routing policy is included in the returned DHCP message.
步骤 S503、 终端获取 DHCP报文中包含的路由策略, 生成对应的静态路 由并存储。  Step S503: The terminal acquires a routing policy included in the DHCP packet, and generates a corresponding static route and stores the corresponding route.
终端离开网络后, 删除本地存储的根据该网络中 DHCP服务器发送的路 由策略生成的静态路由。  After the terminal leaves the network, the local static route generated according to the routing policy sent by the DHCP server in the network is deleted.
实施例五的方法中, 终端与 DHCP服务器之间的具体信令交互过程如图 6所示, 包括:  In the method of the fifth embodiment, the specific signaling interaction process between the terminal and the DHCP server is as shown in FIG. 6, and includes:
1、 终端接入网络后, 向网络侧 DHCP服务器发送发现(Discovery )广播 消息, 以确定本地可用的 DHCP服务器;  After the terminal accesses the network, it sends a Discovery broadcast message to the DHCP server on the network side to determine a locally available DHCP server.
2、 网络侧 DHCP服务器向终端发送 DHCP报文格式的提供 ( Offer )消 息,携带终端的 IP配置信息以及设置的路由策略; 其中, 终端的 IP配置信息 包括 IP地址、 网关地址、域名服务器(DNS )等,路由策略通过扩展的 DHCP 选项携带。  2. The DHCP server on the network side sends a request message in the form of a DHCP message to the terminal, carrying the IP configuration information of the terminal and the set routing policy. The IP configuration information of the terminal includes the IP address, the gateway address, and the domain name server (DNS). ), etc., routing policies are carried through extended DHCP options.
3、 终端接收到网络侧多个 DHCP服务器发送的 Offer消息后, 从中选定 一个 DHCP服务器, 发送选择 ( Request )广播消息给所有的 DHCP服务器确 认选择。  3. After receiving the Offer message sent by multiple DHCP servers on the network side, the terminal selects a DHCP server and sends a Request broadcast message to all DHCP servers to confirm the selection.
4、 选定的 DHCP 服务器向该终端返回 DHCP 报文格式的确认 ( Acknowledge )消息, 携带该终端的 IP配置信息以及设置的路由策略; 其 中, IP配置信息包括 IP地址、 网关地址、 域名服务器(DNS )等, 路由策略 通过扩展的 DHCP选项携带。  4. The selected DHCP server returns an Acknowledge message of the DHCP message format to the terminal, carrying the IP configuration information of the terminal and the set routing policy; wherein the IP configuration information includes an IP address, a gateway address, and a domain name server ( DNS), etc., routing policies are carried through extended DHCP options.
下面对如何扩展 DHCP选项携带路由策略进行具体说明:  The following describes how to extend the DHCP option to carry the routing policy:
下表 1为现有技术中 DHCP的报文格式:  Table 1 below shows the packet format of DHCP in the prior art:
表 1 : OP(1) Htype(1) Hlen(1) Hops(1) Table 1 : OP(1) Htype(1) Hlen(1) Hops(1)
Transaction ID(4)  Transaction ID(4)
Seconds(2) Flags(2)  Seconds(2) Flags(2)
Ciaddr (4)  Ciaddr (4)
Yiaddr ( 4 )  Yiaddr ( 4 )
Siaddr (4)  Siaddr (4)
Giaddr (4)  Giaddr (4)
Chaddr (16)  Chaddr (16)
Sname ( 64 )  Sname ( 64 )
File (128)  File (128)
Options ( variable ) 表 1中各字段的具体含义为:  Options ( variable ) The specific meaning of each field in Table 1 is:
OP(1): 表示消 息 op 代码 I消 息类型 BOOTREQUEST, 2=BOOTREPLY, 长度为 1个字节 (byte);  OP(1): indicates the message op code I message type BOOTREQUEST, 2=BOOTREPLY, length is 1 byte (byte);
Htype(1): 表示硬件地址类型, 长度为 1个字节;  Htype(1): indicates the hardware address type, which is 1 byte in length;
Hlen(1): 表示硬件地址长度, 长度为 1个字节;  Hlen(1): indicates the length of the hardware address, and the length is 1 byte.
Hops(1): 设置为零, 当通过转发代理启动时可以供转发代理使用, 长度 为 1个字节;  Hops(1): Set to zero, can be used by the forwarding agent when starting through the forwarding agent, and has a length of 1 byte;
Transaction ID(4): 操作 ID, 是一个随机数, 用于终端和服务器之间同 步消息和消息的响应, 长度为 4个字节;  Transaction ID (4): The operation ID is a random number used for the response of the synchronization message and message between the terminal and the server, and has a length of 4 bytes.
Seconds(2): 由用户指定的时间, 为开始地址获取和更新进行后的时间, 长度为 2个字节;  Seconds(2): The time specified by the user, after the start of the address acquisition and update, the length is 2 bytes;
Flags(2): 标志位, 长度为 2个字节;  Flags(2): The flag bit, which is 2 bytes in length;
Ciaddr (4): 用户 IP地址, 此字段仅当用户处于 BOUND、 RENEW或 REBINDING状态和能够响应 ARP请求时使用, 长度为 4个字节;  Ciaddr (4): User IP address, this field is used only when the user is in the BOUND, RENEW or REBINDING state and can respond to ARP requests, and is 4 bytes in length;
Yiaddr (4): 用户 IP地址, 长度为 4个字节;  Yiaddr (4): User IP address, length is 4 bytes;
Siaddr (4): 用于 bootstrap过程中的 IP地址, 长度为 4个字节; Giaddr ( 4 ): 转发代理 IP地址, 长度为 4个字节; Siaddr (4): The IP address used in the bootstrap process, which is 4 bytes in length; Giaddr ( 4 ): Forward proxy IP address, length 4 bytes;
Chaddr ( 16 ): 客户硬件地址, 长度为 16个字节;  Chaddr ( 16 ): Customer hardware address, length 16 bytes;
Sname ( 64 ): 可选的服务器主机名, 长度为 64个字节;  Sname ( 64 ): optional server host name, length 64 bytes;
File ( 128 ): 启动文件名, 长度为 128个字节;  File ( 128 ): Start file name, length 128 bytes;
Options ( variable ): 可选的参数字段, 长度不定。  Options ( variable ): An optional parameter field with an indefinite length.
从表 1中的 DHCP报文格式各字段可知, 其中, Options ( variable )是 一个可选的参数字段, 其长度不定。 本发明实施例扩展这一可选字段来携带 设置在 DHCP服务器中的路由策略。 例如, 扩展字段为: Option N; 通过该 Option N字段携带路由策略。  It can be seen from the fields of the DHCP message format in Table 1, where Options (variable) is an optional parameter field whose length is not fixed. The embodiment of the present invention extends this optional field to carry a routing policy set in the DHCP server. For example, the extension field is: Option N; The Option N field carries the routing policy.
具体的路由策略可以包含:  A specific routing policy can include:
目的地址 /子网掩码和网关地址; 或者包含业务类型标识和网关地址; 或 者包含目的地址 /子网掩码、 业务类型标识和网关地址等。  Destination address/subnet mask and gateway address; or include service type identifier and gateway address; or destination address/subnet mask, service type identifier, and gateway address.
以路由策略包含目的地址 /子网掩码、 业务类型标识和网关地址为例, 扩 展字段 Option N的具体字段结构如下:  For example, the routing policy includes the destination address/subnet mask, service type identifier, and gateway address. The specific field structure of the extended field Option N is as follows:
Figure imgf000013_0001
上述字段结构, 仅为举例, 本发明对此字段结构的具体结构形式及各字 段的具体长度不作限定。
Figure imgf000013_0001
The above field structure is merely an example. The specific structure of the field structure and the specific length of each field are not limited.
在上述步骤 S503中,终端获取 DHCP报文中包含的路由策略以生成对应 的静态路由并存储的具体实现过程与实施例一相同, 在此不再勢迷。  In the foregoing step S503, the specific implementation process of the terminal acquiring the routing policy included in the DHCP message to generate the corresponding static route and storing the same is the same as that in the first embodiment, and is no longer fascinating.
根据本发明上述实施例五, 终端只需根据网络侧 DHCP服务器下发的路 由策略生成对应的静态路由, 不需要由用户获取各种路由配置参数来手动配 置静态路由, 同样解决了用户手动配置静态路由不具有可操作性的问题。 实施例六与上述实施例二相类似, 当终端有数据包待发送时, 终端将待 发送的数据包的属性信息与本地路由表中存储的静态.路由进行匹配, 确定出 匹配路由; 并使用确定出的匹配路由发送数据包。 According to the foregoing fifth embodiment of the present invention, the terminal only needs to generate a corresponding static route according to the routing policy delivered by the DHCP server on the network side, and does not need to obtain various routing configuration parameters by the user to manually configure the static route, which also solves the problem that the user manually configures the static route. Routing does not have the problem of operability. The sixth embodiment is similar to the second embodiment. When the terminal has a data packet to be sent, the terminal matches the attribute information of the data packet to be sent with the static route stored in the local routing table to determine a matching route. Determine the matching route to send the packet.
与实施例二所不同的是, 实施例六中的静态路由是采用实施例五所述方 法生成的。  Different from the second embodiment, the static route in the sixth embodiment is generated by the method described in the fifth embodiment.
同样, 当终端在本地存储的静态路由中未确定出匹配路由时, 采用默认 路由发送数据包。  Similarly, when the terminal does not determine a matching route in the static route stored locally, the default route is used to send the data packet.
实施例七:  Example 7:
根据上述实施例五、 实施例六提供的方法, 本发明还提供一种具有相应 功能的终端, 其结构示意图如图 7所示, 包括:  According to the method provided in the foregoing embodiment 5 and the sixth embodiment, the present invention further provides a terminal having a corresponding function, and a schematic structural diagram thereof is shown in FIG. 7, which includes:
IP配置请求单元 701, 用于向网络侧 DHCP服务器请求获取 IP配置, 接 收 DHCP服务器发送的 DHCP报文,在该 DHCP报文中包含 IP配置信息和路 由策略;  The IP configuration requesting unit 701 is configured to request the network side DHCP server to obtain an IP configuration, and receive the DHCP message sent by the DHCP server, where the DHCP message includes the IP configuration information and the routing policy.
静态路由生成存储单元 702, 用于获取 DHCP报文中包含的路由策略, 生成对应的静态路由并存储。  The static route generation storage unit 702 is configured to obtain a routing policy included in the DHCP message, generate a corresponding static route, and store the corresponding static route.
本实施例中的终端还包括:  The terminal in this embodiment further includes:
路由确定单元 703,用于将待发送的数据包的属性信息与存储的静态路由 进行匹配, 确定出匹配路由;  The routing determining unit 703 is configured to match the attribute information of the data packet to be sent with the stored static route to determine a matching route.
数据发送单元 704, 用于使用确定出的匹配路由发送所述数据包。  The data sending unit 704 is configured to send the data packet by using the determined matching route.
本实施例中的终端还可以包括: 静态路由删除单元, 用于终端离开网络 后删除所述静态路由生成存储单元中存储的根据对应网络中 DHCP服务器发 送的路由策略生成的静态路由。  The terminal in this embodiment may further include: a static route deleting unit, configured to delete a static route generated by the routing policy sent by the DHCP server in the corresponding network stored in the static route generating storage unit after the terminal leaves the network.
采用本发明实施例七提供的终端, 只需根据网络侧 DHCP服务器下发的 路由策略生成对应的静态路由, 不需要用户获取各种路由配置参数来手动配 置静态路由, 解决了用户手动配置静态路由不具有可操作性的问题; 且当终 端需要发送数据包时, 能够将待发送数据包的属性信息与生成的静态路由进 行匹配, 通过匹配出的静态路由发送数据包, 实现终端多连接。 实施例八: The terminal provided by the seventh embodiment of the present invention only needs to generate a static route according to the routing policy sent by the DHCP server on the network side, and does not need to obtain various routing configuration parameters to manually configure a static route, thereby solving the problem that the user manually configures the static route. There is no problem of operability; and when the terminal needs to send a data packet, the attribute information of the data packet to be sent can be matched with the generated static route, and the data packet is sent through the matched static route to implement terminal multi-connection. Example 8:
与实施例七提供的终端相对应, 实施例八提供一种 DHCP服务器, 用于 向终端发送路由策略, 其结构示意图如图 8所示, 包括:  Corresponding to the terminal provided in the seventh embodiment, the eighth embodiment provides a DHCP server, which is used to send a routing policy to the terminal.
存储单元 801, 用于存储路由策略;  The storage unit 801 is configured to store a routing policy.
接收单元 802, 用于接收终端发送的获取 IP配置请求;  The receiving unit 802 is configured to receive an IP configuration request sent by the terminal.
生成单元 803, 用于生成 DHCP报文, 在生成的 DHCP报文中包含存储 单元 801中存储的路由策略;  The generating unit 803 is configured to generate a DHCP message, where the generated DHCP message includes a routing policy stored in the storage unit 801.
发送单元 804, 用于向终端发送生成单元 803生成的 DHCP报文。  The sending unit 804 is configured to send, to the terminal, the DHCP message generated by the generating unit 803.
一种较佳方案中, 该 DHCP服务器还包括:  In a preferred solution, the DHCP server further includes:
配置单元 805, 用于配置或修改存储单元 801中存储的路由策略。  The configuration unit 805 is configured to configure or modify a routing policy stored in the storage unit 801.
采用本发明实施例八提供的 DHCP服务器, 存储预先设置的路由策略, 接收到终端的 IP配置请求后, 通过向终端返回的响应消息向终端发送设置的 路由策略; 不仅避免了在终端需要维护路由算法, 节省了终端的计算资源, 且运营商可以方便地配置或更新 DHCP服务器中存储的路由策略, 灵活实现 终端多连接。  The DHCP server provided in Embodiment 8 of the present invention stores a preset routing policy, and after receiving the IP configuration request of the terminal, sends a set routing policy to the terminal by using a response message returned to the terminal; The algorithm saves the computing resources of the terminal, and the operator can conveniently configure or update the routing policy stored in the DHCP server, and flexibly implement multiple connections of the terminal.
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱离本 发明的精神和范围。 这样, 倘若对本发明的这些修改和变型属于本发明权利 要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在内。  It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Therefore, it is intended that the present invention cover the modifications and variations of the invention as claimed.

Claims

权 利 要 求 Rights request
1、 一种静态路由生成方法, 其特征在于, 包括: A static route generation method, comprising:
终端接入网络后向网络侧发起路由策略获取请求;  After the terminal accesses the network, the routing policy acquisition request is initiated to the network side;
接收网络侧发送的路由策略;  Receiving a routing policy sent by the network side;
根据接收的路由策略, 生成对应的静态路由并存储。  Generate a corresponding static route and store it according to the received routing policy.
2、 如权利要求 1所述的方法, 其特征在于,  2. The method of claim 1 wherein:
所述路由策略包括目的地址 /子网掩码和网关地址; 所述根据接收的路由 策略生成对应的静态路由并存储, 具体包括: 根据接收的目的地址 /子网掩码 和网关地址, 生成包含所述目的地址 /子网掩码和网关地址的静态路由, 并加 入到终端路由表中;  The routing policy includes a destination address/subnet mask and a gateway address. The generating a corresponding static route according to the received routing policy and storing the method includes: generating the inclusion according to the received destination address/subnet mask and the gateway address. a static route of the destination address/subnet mask and the gateway address, and added to the terminal routing table;
或者  Or
所述路由策略包括业务类型标识和网关地址; 所述根据接收的路由策略 生成对应的静态路由并存储, 具体包括: 根据接收的业务类型标识和网关地 址, 生成包含所述业务类型标识和网关地址的静态路由, 并加入到终端路由 表中;  The routing policy includes a service type identifier and a gateway address, and the corresponding static route is generated according to the received routing policy, and the method includes: generating, according to the received service type identifier and the gateway address, the service type identifier and the gateway address. Static route, and join to the terminal routing table;
或者  Or
所述路由策略包括目的地址 /子网掩码、 业务类型标识和网关地址; 所述 根据接收的路由策略生成对应的静态路由并存储, 具体包括: 根据接收的目 的地址 /子网掩码、 业务类型标识和网关地址, 生成包含所述目的地址 /子网掩 码、 业务类型标识和网关地址的静态路由, 并加入到终端路由表中。  The routing policy includes a destination address/subnet mask, a service type identifier, and a gateway address. The generating a static route according to the received routing policy and storing the information includes: receiving the destination address/subnet mask, service A type identifier and a gateway address are generated, and a static route including the destination address/subnet mask, service type identifier, and gateway address is generated and added to the terminal routing table.
3、 一种终端路由实现方法, 其特征在于, 包括:  A method for implementing terminal routing, which is characterized in that:
终端将待发送的数据包的属性信息与存储的静态路由进行匹配以确定出 匹配路由;  The terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route.
使用确定出的匹配路由发送所述数据包;  Sending the data packet using the determined matching route;
其中, 所述静态路由采用权利要求 1-2之一所述的方法生成。 The static route is generated by the method of any one of claims 1-2.
4、 如权利要求 3所述的方法, 其特征在于, 若所述静态路由包含目的地 址 /子网掩码和网关地址, 则所述终端将待发送的数据包的属性信息与存储的 静态路由进行匹配以确定出匹配路由具体包括: 判断待发送的数据包的目标 地址是否属于静态路由包含的目的地址 /子网掩码中, 若是, 将相应静态路由 确定为所述匹配路由; The method according to claim 3, wherein if the static route includes a destination address/subnet mask and a gateway address, the terminal sets the attribute information of the data packet to be sent and the stored static route. The matching to determine the matching route specifically includes: determining whether the target address of the data packet to be sent belongs to the destination address/subnet mask included in the static route, and if yes, determining the corresponding static route as the matching route;
若所述静态路由包含业务类型标识和网关地址, 则所述终端将待发送的 数据包的属性信息与存储的静态路由进行匹配以确定出匹配路由具体包括: 识相同, 若是, 将相应静态路由确定为所述匹配路由;  If the static route includes the service type identifier and the gateway address, the terminal matches the attribute information of the data packet to be sent with the stored static route to determine that the matching route specifically includes: the same, if yes, the corresponding static route Determined to be the matching route;
若所述静态路由包含目的地址 /子网掩码、 业务类型标识和网关地址, 则 所述终端将待发送的数据包的属性信息与存储的静态路由进行匹配以确定出 匹配路由具体包括: 判断待发送的数据包的目标地址是否属于静态路由包含 的目的地址 /子网掩码中, 若是, 将对应静态路由确定为第一匹配路由; 以及 判断待发送的数据包的业务类型标识是否与所述静态路由包含的业务类型标 识相同, 若是, 将对应静态路由确定为第二匹配路由; 当所述第一匹配路由 与第二匹配路由为同一静态路由时, 将该静态路由确定为所述匹配路由; 否 则, 将所述第一匹配路由确定为所述匹配路由。  If the static route includes the destination address/subnet mask, the service type identifier, and the gateway address, the terminal matches the attribute information of the data packet to be sent with the stored static route to determine that the matching route specifically includes: Whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route, and if so, the corresponding static route is determined as the first matching route; and whether the service type identifier of the data packet to be sent is determined The static route includes the same service type identifier. If yes, the corresponding static route is determined as the second matching route. When the first matching route and the second matching route are the same static route, the static route is determined as the matching. Routing; otherwise, determining the first matching route as the matching route.
5、 一种终端, 其特征在于, 包括:  5. A terminal, comprising:
路由策略获取单元, 用于向网络侧发起路由策略获取请求, 接收网络侧 发送的路由策略;  a routing policy obtaining unit, configured to initiate a routing policy acquisition request to the network side, and receive a routing policy sent by the network side;
静态路由生成存储单元, 用于根据接收的路由策略, 生成对应的静态路 由并存储。  The static route generation storage unit is configured to generate and store a corresponding static route according to the received routing policy.
6、 如权利要求 5所述的终端, 其特征在于, 还包括:  The terminal according to claim 5, further comprising:
路由确定单元, 用于将待发送的数据包的属性信息与存储的静态路由进 行匹配, 确定出匹配路由;  a route determining unit, configured to match attribute information of the data packet to be sent with the stored static route, and determine a matching route;
数据发送单元, 用于使用确定出的匹配路由发送所述数据包。  And a data sending unit, configured to send the data packet by using the determined matching route.
7、 如权利要求 5所述的终端, 其特征在于, 所述路由策略包括目的地址 /子网掩码和网关地址; 所述根据接收的路由 策略生成对应的静态路由并存储, 具体包括: 根据接收的目的地址 /子网掩码 和网关地址, 生成包含所述目的地址 /子网掩码和网关地址的静态路由, 并加 入到终端路由表中; 7. The terminal of claim 5, wherein: The routing policy includes a destination address/subnet mask and a gateway address. The generating a corresponding static route according to the received routing policy and storing the method includes: generating the inclusion according to the received destination address/subnet mask and the gateway address. a static route of the destination address/subnet mask and the gateway address, and added to the terminal routing table;
或者  Or
所述路由策略包括业务类型标识和网关地址; 所迷根据接收的路由策略 生成对应的静态路由并存储, 具体包括: 根据接收的业务类型标识和网关地 址, 生成包含所述业务类型标识和网关地址的静态路由, 并加入到终端路由 表中;  The routing policy includes a service type identifier and a gateway address, and the generated static route is generated according to the received routing policy, and the method includes: generating, according to the received service type identifier and the gateway address, the service type identifier and the gateway address. Static route, and join to the terminal routing table;
或者  Or
所述路由策略包括目的地址 /子网掩码、 业务类型标识和网关地址; 所述 根据接收的路由策略生成对应的静态路由并存储, 具体包括: 根据接收的目 的地址 /子网掩码、 业务类型标识和网关地址, 生成包含所述目的地址 /子网掩 码、 业务类型标识和网关地址的静态路由, 并加入到终端路由表中-。  The routing policy includes a destination address/subnet mask, a service type identifier, and a gateway address. The generating a static route according to the received routing policy and storing the information includes: receiving the destination address/subnet mask, service The type identifier and the gateway address are generated, and a static route including the destination address/subnet mask, the service type identifier, and the gateway address is generated and added to the terminal routing table.
8、 一种网元装置, 其特征在于, 包括:  8. A network element device, comprising:
存储单元, 用于存储路由策略;  a storage unit, configured to store a routing policy;
接收单元, 用于接收终端发起的路由策略获取请求;  a receiving unit, configured to receive a routing policy acquisition request initiated by the terminal;
发送单元, 用于向终端发送所述存储单元中存储的路由策略。  And a sending unit, configured to send, to the terminal, a routing policy stored in the storage unit.
9、 如权利要求 8所述的网元装置, 其特征在于:  9. The network element device of claim 8, wherein:
所述路由策略包括目的地址 /子网掩码和网关地址, 或者包括业务类型标 识和网关地址, 或者包括目的地址 /子网掩码、 业务类型标识和网关地址。  The routing policy includes a destination address/subnet mask and a gateway address, or includes a service type identifier and a gateway address, or a destination address/subnet mask, a service type identifier, and a gateway address.
10、 一种静态路由生成方法, 其特征在于, 包括:  10. A static route generation method, which is characterized by:
终端接入网络后向网络侧动态主机配置协议 DHCP服务器请求 IP配置; 接收所述 DHCP服务器发送的 DHCP报文, 所述 DHCP报文中包含路由 策略;  After the terminal accesses the network, the dynamic host configuration protocol is configured on the network side, and the DHCP server requests the IP configuration; receiving the DHCP message sent by the DHCP server, where the DHCP message includes a routing policy;
获取所述 DHCP报文中包含的路由策略, 生成对应的静态路由并存储。  Obtain the routing policy contained in the DHCP packet, generate a corresponding static route, and store it.
11、 如权利要求 10所迷的方法, 其特征在于, 所述路由策略通过 DHCP 报文中的可选 Options字段携带。 11. The method of claim 10, wherein the routing policy passes DHCP The optional Options field in the packet is carried.
12、 如权利要求 10或 11所述的方法, 其特征在于:  12. A method as claimed in claim 10 or 11, characterized in that:
所述路由策略包括目的地址 /子网掩码和网关地址, 所述获取所述 DHCP 报文中包含的路由策略生成对应的静态路由并存储, 具体包括: 获取目的地 址 /子网掩码和网关地址, 生成包含所述目的地址 /子网掩码和网关地址的静态 路由, 并加入到终端路由表中;  The routing policy includes a destination address/subnet mask and a gateway address, and the routing policy included in the DHCP packet is generated to generate a static route and is stored, including: acquiring a destination address/subnet mask and a gateway. Address, generating a static route including the destination address/subnet mask and gateway address, and adding to the terminal routing table;
或者  Or
所述路由策略包括业务类型标识和网关地址, 所述获取所述 DHCP报文 中包含的路由策略生成对应的静态路由并存储, 具体包括: 获取业务类型标 识和网关地址, 生成包含所述业务类型标识和网关地址的静态路由, 并加入 到终端路由表中;  The routing policy includes a service type identifier and a gateway address, and the obtaining the routing policy included in the DHCP packet to generate a static route and storing the static route, and the method includes: acquiring a service type identifier and a gateway address, and generating the service type A static route identifying the address of the gateway and adding it to the terminal routing table;
或者  Or
所述路由策略包括目的地址 /子网掩码、 业务类型标识和网关地址, 所述 获取所述 DHCP报文中包含的路由策略生成对应的静态路由并存储, 具体包 括: 获取目的地址 /子网掩码、 业务类型标识和网关地址, 生成包含所迷目的 地址 /子网掩码、 业务类型标识和网关地址的静态路由, 并加入到终端路由表 中。  The routing policy includes a destination address/subnet mask, a service type identifier, and a gateway address, and the routing policy included in the DHCP packet is generated to generate a static route and is stored, including: acquiring a destination address/subnet A mask, a service type identifier, and a gateway address are generated, and a static route including the destination address/subnet mask, the service type identifier, and the gateway address is generated and added to the terminal routing table.
13、 如权利要求 10所述的方法, 其特征在于, 还包括:  13. The method of claim 10, further comprising:
终端离开网络后, 删除本地存储的根据对应网络中 DHCP服务器发送的 路由策略生成的静态路由。  After the terminal leaves the network, the local static route generated by the routing policy sent by the DHCP server in the corresponding network is deleted.
14、 一种终端路由实现方法, 其特征在于, 包括:  A terminal routing implementation method, comprising:
终端将待发送的数据包的属性信息与存储的静态路由进行匹配, 确定出 匹配路由;  The terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route.
使用确定出的匹配路由发送所述数据包;  Sending the data packet using the determined matching route;
其中, 所述静态路由采用权利要求 10-13之一所述的方法生成。  The static route is generated by the method described in any one of claims 10-13.
15、 如权利要求 14所述的方法, 其特征在于, 若所述静态路由包含目的 地址 /子网掩码和网关地址, 则所述终端将待发送的数据包的属性信息与存储 的静态路由进行匹配以确定出匹配路由, 具体包括: 判断待发送的数据包的 目标地址是否属于静态路由包含的目的地址 /子网掩码中, 若是, 将对应静态 路由确定为所述匹配路由; The method according to claim 14, wherein if the static route includes a destination address/subnet mask and a gateway address, the terminal stores attribute information and storage of the data packet to be sent. The matching of the static route to determine the matching route includes: determining whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route, and if so, determining the corresponding static route as the matching route ;
若所述静态路由包含业务类型标识和网关地址, 所述终端将待发送的数 据包的属性信息与存储的静态路由进行匹配以确定出匹配路由, 具体包括: 识相同, 若是, 将对应静态路由确定为所述匹配路由;  If the static route includes the service type identifier and the gateway address, the terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route, which includes: the same knowledge, if yes, the corresponding static route Determined to be the matching route;
若所述静态路由包含目的地址 /子网掩码、 业务类型标识和网关地址, 所 述终端将待发送的数据包的属性信息与存储的静态路由进行匹配以确定出匹 配路由, 具体包括: 判断待发送的数据包的目标地址是否属于静态路由包含 的目的地址 /子网掩码中, 若是, 将对应静态路由确定为第一匹配路由; 以及 识相同, 若是, 将对应静态路由确定为第二匹配路由; 当所迷第一匹配路由 与第二匹配路由为同一静态路由时, 将该静态路由确定为所述匹配路由; 否 则, 将所述第一匹配路由确定为所述匹配路由。  If the static route includes a destination address/subnet mask, a service type identifier, and a gateway address, the terminal matches the attribute information of the data packet to be sent with the stored static route to determine a matching route, which includes: Whether the destination address of the data packet to be sent belongs to the destination address/subnet mask included in the static route, and if so, the corresponding static route is determined as the first matching route; and the same is known; if yes, the corresponding static route is determined to be the second The matching route is determined as the matching route when the first matching route and the second matching route are the same static route; otherwise, the first matching route is determined as the matching route.
16、 一种终端, 其特征在于, 包括:  16. A terminal, comprising:
IP配置请求单元, 用于向网络侧 DHCP服务器请求荻取 IP配置,接收所 述 DHCP服务器发送的 DHCP报文, 所述 DHCP报文中包含路由策略; 静态路由生成存储单元, 用于获取所述 DHCP报文中包含的路由策略, 生成对应的静态路由并存储。  The IP configuration requesting unit is configured to request the network side DHCP server to obtain the IP configuration, and receive the DHCP message sent by the DHCP server, where the DHCP message includes a routing policy, and the static route generating storage unit is configured to acquire the A routing policy contained in a DHCP packet generates a corresponding static route and stores it.
17、 如权利要求 16所述的终端, 其特征在于, 还包括:  The terminal according to claim 16, further comprising:
路由确定单元, 用于根据待发送的数据包的属性信息, 匹配存储的静态 路由, 确定出匹配路由;  a route determining unit, configured to match the stored static route according to the attribute information of the data packet to be sent, and determine a matching route;
数据发送单元, 用于使用确定出的匹配路由发送所述数据包。  And a data sending unit, configured to send the data packet by using the determined matching route.
18、 如权利要求 16所述的终端, 其特征在于:  18. The terminal of claim 16, wherein:
所述路由策略包括目的地址 /子网掩码和网关地址; 所述获取路由策略以 生成对应的静态路由并存储具体包括: 根据接收的目的地址 /子网掩码和网关 地址, 生成包含所述目的地址 /子网掩码和网关地址的静态路由, 并加入到终 端路由表中; The routing policy includes a destination address/subnet mask and a gateway address. The obtaining a routing policy to generate a corresponding static route and storing the specific includes: according to the received destination address/subnet mask and gateway Address, generating a static route including the destination address/subnet mask and gateway address, and adding to the terminal routing table;
或者  Or
所述路由策略包括业务类型标识和网关地址; 所述获取路由策略以生成 对应的静态路由并存储具体包括: 根据接收的业务类型标识和网关地址, 生 成包含所述业务类型标识和网关地址的静态路由, 并加入到终端路由表中; 或者  The routing policy includes a service type identifier and a gateway address. The obtaining the routing policy to generate a corresponding static route and storing the specific information includes: generating a static information including the service type identifier and the gateway address according to the received service type identifier and the gateway address. Routing, and join to the terminal routing table; or
所述路由策略包括目的地址 /子网掩码、 业务类型标识和网关地址; 所述 获取路由策略以生成对应的静态路由并存储具体包括: 根据接收的目的地址 / 子网掩码、 业务类型标识和网关地址, 生成包含所述目的地址 /子网掩码、 业 务类型标识和网关地址的静态路由, 并加入到终端路由表中。  The routing policy includes a destination address/subnet mask, a service type identifier, and a gateway address. The obtaining the routing policy to generate a corresponding static route and storing the content specifically includes: according to the received destination address/subnet mask, service type identifier And the gateway address, generating a static route including the destination address/subnet mask, service type identifier, and gateway address, and adding to the terminal routing table.
19、 一种 DHCP服务器, 其特征在于, 包括:  19. A DHCP server, comprising:
存储单元, 用于存储路由策略;  a storage unit, configured to store a routing policy;
接收单元, 用于接收终端发送的获取 IP配置请求;  a receiving unit, configured to receive an IP configuration request sent by the terminal;
生成单元, 用于生成 DHCP报文, 在所述 DHCP报文中包含所述存储单 元中存储的路由策略;  a generating unit, configured to generate a DHCP message, where the DHCP message includes a routing policy stored in the storage unit;
发送单元, 用于向终端发送所述生成单元生成的所述 DHCP报文。  And a sending unit, configured to send, to the terminal, the DHCP message generated by the generating unit.
20、 如权利要求 19所述的 DHCP服务器, 其特征在于:  20. The DHCP server of claim 19, wherein:
所述路由策略包括目的地址 /子网掩码和网关地址, 或者包括业务类型标 识和网关地址, 或者包括目的地址 /子网掩码、 业务类型标识和网关地址。  The routing policy includes a destination address/subnet mask and a gateway address, or includes a service type identifier and a gateway address, or a destination address/subnet mask, a service type identifier, and a gateway address.
PCT/CN2009/001018 2008-09-09 2009-09-09 Static route generation method, terminal route realization method and apparatus WO2010028545A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810119780.6 2008-09-09
CN200810119780A CN101674221A (en) 2008-09-09 2008-09-09 Static routing generation method, method and device for implementing terminal routing

Publications (1)

Publication Number Publication Date
WO2010028545A1 true WO2010028545A1 (en) 2010-03-18

Family

ID=42004779

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/001018 WO2010028545A1 (en) 2008-09-09 2009-09-09 Static route generation method, terminal route realization method and apparatus

Country Status (2)

Country Link
CN (1) CN101674221A (en)
WO (1) WO2010028545A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102273134A (en) * 2011-05-30 2011-12-07 华为技术有限公司 Method, apparatus and system for network device configuration
USRE49049E1 (en) * 2012-06-18 2022-04-19 Huawei Technologies Co., Ltd. Service processing method, device and system
CN114928590A (en) * 2021-01-30 2022-08-19 华为技术有限公司 IPv6 address configuration method and routing equipment

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102271050B (en) * 2010-06-04 2014-04-30 华为技术有限公司 Method and system for automatically configuring network equipment in Internet protocol version 6 (IPv6) network, and network equipment
CN101917492B (en) * 2010-08-06 2013-06-05 北京乾唐视联网络科技有限公司 Communication method and communication system of novel network
CN102377633B (en) * 2010-08-06 2014-10-08 北京乾唐视联网络科技有限公司 Communication connection method and system of access network device
CN102761441B (en) * 2012-06-29 2016-02-17 深圳市同洲电子股份有限公司 A kind of digital television business method for supervising, Apparatus and system
CN104301225B (en) * 2013-07-17 2017-12-29 华为技术有限公司 A kind of stream forwarding method and communication equipment
WO2015010256A1 (en) 2013-07-23 2015-01-29 华为技术有限公司 Packet forwarding method and device
CN104301233A (en) * 2014-10-31 2015-01-21 易准科技发展(上海)有限公司 Route access method, route access system and user terminal
CN104410572B (en) * 2014-11-25 2017-08-18 青岛海信宽带多媒体技术有限公司 The route table generating method and device of a kind of digital reception device
CN104410576B (en) * 2014-12-12 2018-07-06 上海斐讯数据通信技术有限公司 Hybrid conditional policies route system and method
CN105827440B (en) * 2016-03-11 2019-12-13 北京安云世纪科技有限公司 intelligent terminal and routing configuration method thereof
CN110226307B (en) * 2017-01-26 2021-01-29 华为技术有限公司 Method and device for issuing route
CN110365557B (en) * 2018-03-26 2021-11-02 中兴通讯股份有限公司 Network interconnection method and device
CN109286567B (en) * 2018-11-23 2020-07-28 腾讯科技(深圳)有限公司 Method, device and equipment for acquiring routing strategy
CN110996372B (en) * 2019-11-11 2021-05-18 广州爱浦路网络技术有限公司 Message routing method, device and system and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5884047A (en) * 1993-12-13 1999-03-16 Fujitsu Limited Computer having automatic setting function of static routing information
US6327251B1 (en) * 1995-08-03 2001-12-04 Cisco Technology, Inc. Snapshot routing
CN1543133A (en) * 2003-04-30 2004-11-03 华为技术有限公司 Static route refresh method
CN1909681A (en) * 2005-08-04 2007-02-07 华为技术有限公司 Cross-domain route control method for the third generation mobile communication system
CN1922826A (en) * 2004-02-05 2007-02-28 三星电子株式会社 Tunneling service method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5884047A (en) * 1993-12-13 1999-03-16 Fujitsu Limited Computer having automatic setting function of static routing information
US6327251B1 (en) * 1995-08-03 2001-12-04 Cisco Technology, Inc. Snapshot routing
CN1543133A (en) * 2003-04-30 2004-11-03 华为技术有限公司 Static route refresh method
CN1922826A (en) * 2004-02-05 2007-02-28 三星电子株式会社 Tunneling service method and system
CN1909681A (en) * 2005-08-04 2007-02-07 华为技术有限公司 Cross-domain route control method for the third generation mobile communication system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102273134A (en) * 2011-05-30 2011-12-07 华为技术有限公司 Method, apparatus and system for network device configuration
USRE49049E1 (en) * 2012-06-18 2022-04-19 Huawei Technologies Co., Ltd. Service processing method, device and system
CN114928590A (en) * 2021-01-30 2022-08-19 华为技术有限公司 IPv6 address configuration method and routing equipment
CN114928590B (en) * 2021-01-30 2023-11-10 华为技术有限公司 IPv6 address configuration method and routing equipment

Also Published As

Publication number Publication date
CN101674221A (en) 2010-03-17

Similar Documents

Publication Publication Date Title
WO2010028545A1 (en) Static route generation method, terminal route realization method and apparatus
US20100223655A1 (en) Method, System, and Apparatus for DHCP Authentication
US9485147B2 (en) Method and device thereof for automatically finding and configuring virtual network
JP4071136B2 (en) COMMUNICATION SYSTEM, CONNECTION DEVICE, AND COMMUNICATION METHOD
US9264397B2 (en) Method and system for implementing a user network identity address provisioning server
US11343224B2 (en) Method for renewing IP address and apparatus
US20050175020A1 (en) Tunneling service method and system
EP2346217B1 (en) Method, device and system for identifying an IPv6 session
US8605582B2 (en) IP network system and its access control method, IP address distributing device, and IP address distributing method
JP2006086800A (en) Communication apparatus for selecting source address
US20130111040A1 (en) Auto-Split DNS
US8392613B2 (en) Network address assignment
WO2013123763A1 (en) Dynamic ipv6 configuration method for home gateway
JP3885585B2 (en) Router device and network system using the same
CN110365557B (en) Network interconnection method and device
JP2003298635A (en) Source address selection system, router equipment, communication node and source address selection method
JP2006222929A (en) Network system
EP2765743A1 (en) Layer 2 inter-connecting method, apparatus and system based on ipv6
WO2014101891A1 (en) Method and device for configuring ip address
JP4186733B2 (en) Communication system, terminal, and address generation method
WO2011147343A1 (en) Method, device and system for address assignment in internet protocol (ip) networks
US20060193330A1 (en) Communication apparatus, router apparatus, communication method and computer program product
EP2497324B1 (en) Methods for address translator traversal in 3gpp networks
JP2010062757A (en) Dns proxy apparatus and dns relay method
WO2021052241A1 (en) Address acquisition method and related device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09812612

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09812612

Country of ref document: EP

Kind code of ref document: A1