CN114938347A - Router and router ipv6 self-adaption method and device - Google Patents

Router and router ipv6 self-adaption method and device Download PDF

Info

Publication number
CN114938347A
CN114938347A CN202110153628.5A CN202110153628A CN114938347A CN 114938347 A CN114938347 A CN 114938347A CN 202110153628 A CN202110153628 A CN 202110153628A CN 114938347 A CN114938347 A CN 114938347A
Authority
CN
China
Prior art keywords
router
wan
ipv6
mode
bridge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110153628.5A
Other languages
Chinese (zh)
Inventor
徐清华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN202110153628.5A priority Critical patent/CN114938347A/en
Publication of CN114938347A publication Critical patent/CN114938347A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/741Routing in networks with a plurality of addressing schemes, e.g. with both IPv4 and IPv6
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies

Abstract

The application discloses a router and a router ipv6 self-adaptive method and device, and the router provided by the embodiment of the application can automatically detect ipv6 address allocation capability of a superior device and perform mode switching. And the bridge sub-interface is created to be connected with the WAN sub-interface and added into the bridge BR0 by setting the interfaces of the bridge BR0 and WAN for the router and adding all LANs into the bridge ipv6 self-adaptive method. A routing subinterface is created, which allows the bridge interface BR0 and the routing subinterface to be routed, so that the router automatically supports ipv6 forwarding.

Description

Router and router ipv6 self-adaption method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a router and a router ipv6 adaptive method and apparatus.
Background
ipv6(Internet Protocol Version 6, Version 6 of the Internet Protocol) has an integrated security function, the number of addresses is very large, and there are no problems like ipv4(Internet Protocol Version 4, Version 4 of the Internet Protocol) nat (Network Address Translation), so ipv6 does not generally use nat technology in practical application. Compared with ipv4, in the router device routing mode, when ipv4 is used, an operator only needs to allocate one ipv4 segment address to access an external network, and when ipv6 is used, two segments (which shall be called prefixes according to ipv6 specification, and hereinafter, the segment of ipv6 is directly described by prefixes) need to be allocated to be used for local area network routing and external network routing, respectively.
The prior operator generally uses HGU equipment as a gateway equipment of a terminal connected with an external network in an FTTH network, and allocates ipv6 prefixes of two network segments to the HGU equipment, so that when user terminal equipment is directly connected to the HGU equipment, the internet surfing requirement of ipv6 can be met. With the development of WIFI and the improvement of the requirement of people for the wireless capability of the terminal, HGU devices which are arranged currently and in the past for a long time are limited in capability and cannot meet the requirements of users, so that a user generally mounts a router device under the HGU for improving the performance.
However, the HGU device does not support secondary allocation of two ipv6 prefixes, so when the router is directly attached to the HGU device, the ipv6 is supported only when the router device is in the bridge mode and the HGU device is in the routing mode, or when the router device is in the bridge mode and the HGU device is in the routing mode. Due to the fact that the current transition period of ipv4 to ipv6 generally needs to support ipv4 and ipv6 dual stacks at the same time, and ipv6 and ipv4 share a routing/bridge mode configuration, the configuration of ipv6 affects the use scenario of ipv 4.
Disclosure of Invention
The application provides a router and a router ipv6 self-adaption method for realizing router ipv6 self-adaption.
In order to solve the technical problem, the embodiment of the application discloses the following technical scheme:
in a first aspect, an embodiment of the present application discloses a router ipv6 adaptive method, including:
initializing and setting the router state and the router use mode;
sending an RS message in an SLAAC mode to a server to apply for obtaining a WAN address, and recording the WAN state of the router according to the result of obtaining the WAN address;
sending a DHCPv6-PD request to the server to apply for obtaining a LAN prefix, and recording the LAN state of the router according to the result of obtaining the LAN prefix;
configuring a router usage pattern according to the router WAN state and the router LAN state.
Compared with the prior art, the beneficial effect of this application is:
the application provides a router ipv6 self-adaptive method, which is used for initializing and setting a router state and a router use mode, so that the router initially adapts to a common routing mode. The router applies for WAN addresses and LAN prefixes to the server, updates the router state according to the obtained results, and detects the pd support capability of the server. And configuring the use mode of the router according to the current state of the router to adapt to different environments. The router ipv6 self-adaption method provided by the application judges whether the pd support capability of the detection server supports allocation of two prefixes or not, and further selects a proper router forwarding mode, so that router ipv6 self-adaption is realized, and the performance of the router is improved.
In a second aspect, an embodiment of the present application discloses an ipv6 adaptive apparatus, including: the initialization module is used for carrying out initialization setting on the router state and the router use mode;
the WAN address acquisition module is used for sending an RS message in an SLAAC mode to the server to apply for acquiring a WAN address and recording the WAN state of the router according to the result of acquiring the WAN address;
the LAN prefix acquisition module is used for sending a DHCPv6-PD request to the server to apply for acquiring the LAN prefix and recording the LAN state of the router according to the result of acquiring the LAN prefix;
and the mode configuration module is used for configuring the router use mode according to the router WAN state and the router LAN state.
Compared with the prior art, the beneficial effect of this application is:
the present application further provides an ipv6 adaptive apparatus, comprising: and the initialization module is used for carrying out initialization setting on the router state and the router using mode. And the WAN address acquisition module is used for sending the RS message in the SLAAC mode to the server to apply for acquiring a WAN address and recording the WAN state of the router according to the result of acquiring the WAN address. And the LAN prefix acquisition module is used for sending a DHCPv6-PD request to the server to apply for acquiring the LAN prefix and recording the LAN state of the router according to the result of acquiring the LAN prefix. And the mode configuration module is used for configuring the router use mode according to the router WAN state and the router LAN state. The ipv6 adaptive device provided by the application judges whether the pd support capability of the detection server supports allocation of two prefixes, and further selects a suitable router forwarding mode, thereby implementing the ipv6 adaptive router and improving the performance of the router.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a router according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a router state acquisition process according to an embodiment of the present application;
fig. 3 is a schematic flow chart illustrating a router configuring a usage mode according to a router state according to an embodiment of the present application;
fig. 4 is a schematic configuration diagram of a common routing/bridge mode configuration structure of the routers ipv6 and ipv4 according to an embodiment of the present application;
fig. 5 is a schematic diagram of a message uplink forwarding path in a router according to an embodiment of the present application;
fig. 6 is a schematic diagram of a packet downstream forwarding path in a router according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort shall fall within the protection scope of the present application.
Fig. 1 is a router application scenario provided in an embodiment of the present application. As shown in fig. 1, currently, an operator generally uses an HGU (Home Gateway Unit) device as a Gateway device for connecting a terminal to an external network in a network, and allocates ipv6 prefixes of two network segments to the HGU device, so that when a user terminal device is directly connected to the HGU device, the ipv6 internet access requirement can be met. With the development of WIFI and the improvement of the requirement of people for the wireless capability of the terminal, HGU devices which are arranged currently and in the past for a long time are limited in capability and cannot meet the requirements of users, so that users generally mount a router under the HGU for improving the performance.
However, the HGU device does not support secondary allocation of two ipv6 prefixes, so when the router is directly attached to the HGU device, the ipv6 is supported only when the router is in the bridge mode and the HGU device is in the routing mode, or when the router is in the bridge mode and the HGU device is in the routing mode. Due to the fact that the current transition period from ipv4 to ipv6 generally needs to support ipv4 and ipv6 dual stacks at the same time, and ipv6 and ipv4 share a routing/bridge mode configuration, the configuration of the router ipv6 affects the use scenario of ipv 4.
There are two ways for IPv6 to allocate prefixes and addresses, one is stateless prefix Configuration, where an ra (router advertisement) message of icmpv6(Internet Control Protocol Version 6, Internet Control information Protocol Version six) is used to carry prefix information, and the other is stateful prefix Configuration, where dhcpv6(Dynamic Host Configuration Protocol for IPv 6) NA option is used to directly allocate addresses, or dhcpv6 pd is used to allocate prefixes. When the current operator configures the HGU, a stateless configuration or dhcpv6 na is used to allocate an address to the side of the HGU wan (Wide Area Network), and a dhcpv6 PD option is used to allocate a prefix to the side of the LAN (Local Area Network), where the prefix is finally allocated to a user internet device. And when the HGU allocates the prefix to the user internet equipment, only stateless configuration and dhcpv6 na are supported.
Fig. 2 is a schematic diagram of a router state acquisition process provided in an embodiment of the present application, and fig. 3 is a schematic diagram of a process of configuring a usage mode of a router according to a router state provided in an embodiment of the present application. With reference to fig. 2 and fig. 3, an automatic router pattern matching process provided in the embodiment of the present application includes:
s0: and detecting the current use state of the router, and detecting whether the current use mode of the router is a routing mode. If the current usage mode of the router is the routing mode, the next step is performed. If the detection result is no, the router is currently set to the [ ipv4 bridge + ipv6 bridge ] mode.
S1: and performing initial configuration on the router state. The initialization state is [ WAN ipv6 address is acquiring ], [ LAN ipv6 prefix is acquiring ], and the router is set to be in an [ ipv4 routing + ipv6 routing ] mode.
S2: and simultaneously, carrying out WAN address acquisition flow and LAN prefix acquisition flow, and recording the state of the router according to the acquisition result.
S20: and acquiring a WAN address, and recording the WAN state of the router according to the result of acquiring the WAN address.
S201: the router sends a Stateless address autoconfiguration (slaac) message to the server.
S202: if the router fails to receive the response message of the server, the router sends a request in a random delay period, and the router maintains the current state during the request, namely the WAN state is [ WAN ipv6 address is being acquired ]. The period time can be set according to the actual scene needs, and is generally set to be 3-6 s.
S203: and if the router receives the server response message, judging whether the address needs to be acquired in a state mode according to the M-FLAG mark of the response message.
S2031: if the M-FLAG is 0, WAN address prefixes are directly obtained from the response message, legal IPv6 global unicast addresses are automatically generated, and the state of the router WAN is recorded as [ WAN Ipv6 address obtaining success ]. And if the response message does not carry the prefix or carries the prefix illegally, recording the WAN state of the router as WAN ipv6 address acquisition failure.
S2032: if M-FLAG is 1, the router sends a dhcpv6 NA address request to the server.
S20321: if the server does not respond to the dhcpv6 NA request, the 5s + random delay period sends a dhcpv6 NA request during which the current state is maintained, i.e. the router WAN state is recorded as [ WAN ipv6 address is being acquired ].
S20322: if the server responds to the DHCPv6 NA request, the router and the server complete all interaction of DHCPv6-NA, the server sends a response message to the router, and the router acquires an address from the response message.
If the router can successfully acquire the legal ipv6 global unicast address from the response message, the state of the router WAN is recorded as WAN ipv6 address acquisition success.
And if the server response message does not support or the allocated address is illegal, recording the WAN state of the router as WAN ipv6 address acquisition failure.
S21: and acquiring the LAN address, and recording the LAN state of the router according to the result of acquiring the LAN address.
S211: the router sends a DHCPv6-PD request to the server.
S212: if the server does not respond, the 5s + random delay period sends a DHCPv6-PD request, during which the current mode is unchanged, i.e. the router LAN state is recorded as [ LAN ipv6 prefix is being acquired ].
S213: if the server responds, the router proceeds with interacting with the server DHCPv 6-PD.
After the interaction is completed, if the router successfully acquires the legal ipv6 global unicast prefix from the server message, the state of the router is recorded as [ LAN ipv6 prefix acquisition success ].
If the server response message does not support or the prefix distribution is illegal, the state of the router is recorded as LAN ipv6 prefix acquisition failure.
S3: and configuring the router using mode according to the router state.
If the state of the router WAN is [ LAN ipv6 prefix is acquiring ] or the state of the router LAN is [ WAN ipv6 address is acquiring ], the current mode of the router is maintained unchanged, namely the mode of the router is [ ipv4 routing + ipv6 routing ].
If the router WAN state is [ WAN ipv6 address acquisition success ] and the router LAN state is [ LAN ipv6 prefix acquisition success ], the router is configured to use the [ ipv4 route + ipv6 route ] mode.
If the router WAN state is [ WAN ipv6 address acquisition success ] and the router LAN state is [ LAN ipv6 prefix acquisition failure ], the router is configured to use the [ ipv4 route + ipv6 bridge ] mode.
If the router WAN state is [ WAN ipv6 address acquisition failure ], the router mode is maintained unchanged.
According to the router mode configuration method and device, the state of the router is initialized, the WAN address and the LAN prefix of the server are obtained, the current state of the router is recorded according to the obtaining result, and the router mode configuration is carried out according to the current state of the router. By detecting the pd support capability of the server, it is determined whether it supports assigning two prefixes, and then determines which router mode to use. If the router use mode is an [ ipv4 route + ipv6 bridge ] mode, the router is subjected to ipv4/ipv6 route bridge mode isolation configuration.
The application provides a router ipv6 self-adaptive method, which is used for initializing and setting a router state and a router use mode, so that the router initially adapts to a common routing mode. Sending an RS message in an SLAAC mode to a server to apply for obtaining a WAN address, and recording the WAN state of the router according to the result of obtaining the WAN address; and sending a DHCPv6-PD request to the server for acquiring a LAN prefix, and recording the LAN state of the router according to the result of acquiring the LAN prefix, thereby detecting the PD support capability of the server. And configuring the router using mode according to the current state of the router to adapt to different environments. The router ipv6 self-adaption method provided by the application judges whether the pd support capability of the detection server supports allocation of two prefixes or not, and further selects a proper router forwarding mode, so that router ipv6 self-adaption is realized, and the performance of the router is improved.
Further, the application also provides a routing bridge mode isolation configuration method of ipv4/ipv 6. Fig. 4 is a schematic configuration diagram of a common routing/bridge mode of routers ipv6 and ipv4 according to an embodiment of the present application, and as shown in fig. 4, to implement the common routing/bridge mode of routers ipv6 and ipv4, an embodiment of the present application provides a router configured to:
the MAIN WAN interface MAIN-WAN features that the MAIN WAN interface is connected to the interface corresponding to the physical port of outer network (WAN), and the message sent by the interface may be transmitted via the physical port of WAN directly and the message received via the physical port of WAN may use the packet receiving function of MAIN-WAN. The MAIN-WAN does not participate in routing and bridge forwarding.
And the WAN subinterface SUB-WAN is a Virtual Local Area Network (VLAN) Virtual interface of a specified vlan id based on the WAN MAIN interface MAIN-WAN. It is characterized by that firstly VLAN HEADER of designated vlan id is added in the message sent from WAN subinterface SUB-WAN, then the packet-sending function of WAN MAIN interface MAIN-WAN is called to send the message. When the vlan id carried by the message sent by the WAN subinterface SUB-WAN and received by the WAN MAIN interface MAIN-WAN is the vlan id specified by the WAN subinterface SUB-WAN, the vlan in the message is stripped and a packet receiving function of the WAN subinterface SUB-WAN is called. Particularly, if the WAN side message does not need to specify the VLAN id, the message sent by the WAN subinterface SUB-WAN directly calls the WAN MAIN interface MAIN-WAN to send a packet, and if the message received by the WAN MAIN interface MAIN-WAN does not carry the VLAN, the WAN subinterface SUB-WAN is called to receive the packet. And parameters such as MTU of the WAN SUB interface SUB-WAN are limited by MAIN-WAN during setting. The SUB-WAN does not participate in routing and bridge forwarding.
The two sub-interfaces include: the routing WAN subinterface R-SUB-WAN and the bridge WAN subinterface B-SUB-WAN communicate with the WAN subinterface SUB-WAN. The main characteristic is that the message sent to WAN side by WAN subinterface R-SUB-WAN and bridge WAN subinterface B-SUB-WAN is directly converted into WAN subinterface SUB-WAN packet. And the router forwards the message according to the message content and the router mode.
In some embodiments, the messages received by the WAN subinterface SUB-WAN configure the router: if the message received by the WAN subinterface SUB-WAN is an ipv4 message and the router is in an ipv4 routing mode, the message is forwarded to the WAN subinterface R-SUB-WAN for reception; if the message received by the WAN subinterface SUB-WAN is an ipv4 message and the router is in an ipv4 bridge mode currently, the message is received by the WAN subinterface B-SUB-WAN; if the message received by the WAN subinterface SUB-WAN is an ipv6 message and the router is in an ipv6 routing mode, the message is forwarded to the WAN subinterface R-SUB-WAN for reception; and if the message received by the WAN subinterface SUB-WAN is an ipv6 message and the router is in an ipv6 bridge mode currently, the message is switched to be received by the WAN subinterface B-SUB-WAN.
In the embodiment of the application, the routing WAN subinterface R-SUB-WAN can configure the ip and can participate in routing forwarding. The bridge WAN subinterface B-SUB-WAN may participate in bridge forwarding. The parameters of the Maximum Transmission Unit (MTU) of the routing WAN subinterface R-SUB-WAN and the bridge WAN subinterface B-SUB-WAN are limited by the WAN subinterface SUB-WAN during setting.
Each physical LAN port creates a LAN interface, LAN1, LAN 2-LANX, respectively, for connecting the interfaces corresponding to the intranet physical ports. The message sent by the interface can directly use the LAN physical port to send the packet, and the message received by the LAN physical port uses the corresponding packet receiving function of LANX. The LAN interface may participate in route forwarding.
And creating a bridge, wherein the interface mounted under the bridge is forwarded according to MAC, and automatically generating a bridge interface BR0, wherein the BR0 is automatically mounted under the bridge and used as a local area network gateway, ip can be configured, and the bridge interface BR0 can also participate in route forwarding. The following BR0 refers to bridge BR0 and bridge BR0, respectively, as described.
All LAN interfaces LAN1, LAN 2-LANX are mounted under bridge BR0, and bridge WAN subinterface B-SUB-WAN is also mounted under bridge BR 0.
Through the above configuration, an embodiment of the present application provides a router, including: and the WAN subinterface is configured to select a forwarding path according to the type of the received message of the external network and the current mode of the router. And a bridge BR0 having at least one intranet interface mounted thereon. And the bridge interface BR0 is mounted below the bridge BR0 and participates in bridge forwarding. The bridge WAN sub-interface is mounted below the bridge BR0 and can participate in bridge forwarding; the WAN subinterface is routed. Wherein: the bridge interface BR0 and the routing WAN subinterface may be used for route forwarding. The routing WAN subinterface and the bridge WAN subinterface directly convert the messages sent to the WAN side into the WAN subinterface sending packets; and selecting the routing WAN subinterface or the bridge WAN subinterface to forward the message according to the message content and the router mode. The router provided by the embodiment of the application realizes the route and bridge path isolation of ipv4/ipv6 by configuring two virtual interface routing WAN subinterfaces and a bridge WAN subinterface for routing forwarding and bridge forwarding respectively.
One side of the WAN main interface is connected with the physical port of the external network, and the other side of the WAN main interface is connected with the WAN sub-interface; the WAN subinterface is a virtual interface of the WAN main interface, and a message downlink path is configured as follows:
if the message received by the WAN subinterface is an ipv4 message and the router ipv4 mode is an ipv4 routing mode, the message is forwarded to the WAN subinterface for receiving;
if the message received by the WAN subinterface is an ipv4 message and the ipv4 mode of the router is an ipv4 bridge mode, the message is received by the WAN subinterface;
or the like, or, alternatively,
if the message received by the WAN subinterface is an ipv6 message and the router ipv6 mode is an ipv6 routing mode, the message is forwarded to the WAN subinterface for receiving;
if the message received by the WAN subinterface is an ipv6 message and the mode of the router ipv6 is an ipv6 bridge mode, the message is received by the WAN subinterface.
Further, if the WAN side message does not need to specify the vlan id, the message sent by the WAN sub-interface directly calls the WAN main interface to send a packet; and if the message received by the WAN main interface does not carry the VLAN, calling the WAN subinterface to receive the packet.
Further, in the message sent from the WAN subinterface in the embodiment of the present application, VLAN HEADER that specifies vlan id is added in the message, and then a packet sending function of the WAN main interface is called to send the message. When the vlan id carried by the message sent by the WAN subinterface and received by the WAN main interface is the vlan id assigned by the WAN subinterface, the vlan in the message is stripped and a packet receiving function of the WAN subinterface is called.
The router provided by the embodiment of the application realizes the route and bridge path isolation of ipv4/ipv6 by configuring two virtual interface routing WAN subinterfaces and a bridge WAN subinterface for routing forwarding and bridge forwarding respectively.
Fig. 5 is a schematic diagram of an uplink forwarding path of a message in a router according to an embodiment of the present application. As shown in fig. 5, according to the above configuration, the uplink forwarding path of the packet in the router provided in the embodiment of the present application is as follows:
upstream forwarding is a forwarding path for receiving packets on the LAN side. In this embodiment, LANX is taken as an example, and other LAN ports have the same processing logic.
A1: and sending a message to the LANX interface at the intranet physical port X.
A2: the LANX interface receives the message from the corresponding intranet physical port X, firstly, the bridge forwarding process is carried out, the mac table is searched, and the interface to which the target mac belongs is searched.
A2-1: if the searched interface is a bridge WAN subinterface B-SUB-WAN, or the message is an unknown unicast message, or the message is a broadcast message, the forwarding permission judgment is carried out.
Wherein: the forwarding admission determination includes:
(1) and if the message received by the LANX interface is an ipv6 message and the current mode of the router is an ipv6 bridge mode, determining that forwarding is allowed. And if the message received by the LANX interface is an ipv6 message and the current mode of the router is an ipv6 routing mode, determining that forwarding is forbidden.
(2) If the message received by the LANX interface is an ipv4 message and the current mode of the router is an ipv4 bridge mode, the forwarding is determined to be allowed. And if the message received by the LANX interface is an ipv4 message and the current mode of the router is an ipv4 routing mode, determining that forwarding is forbidden.
A2-2: for the message allowed to be forwarded, the destination mac is of a bridge WAN subinterface B-SUB-WAN and is directly converted into a bridge subinterface B-SUB-WAN packet; if the message is an unknown unicast message or the message is a broadcast message, the broadcast or unknown unicast copy message is converted into a bridge subinterface B-SUB-WAN interface packet. And in the bridge WAN subinterface B-SUB-WAN packet sending function, converting the bridge WAN subinterface B-WAN packet sending function into a WAN subinterface SUB-WAN packet sending function, finally converting the bridge WAN subinterface B-WAN packet sending function into a WAN MAIN interface MAIN-WAN packet sending function, and sending the WAN MAIN interface MAIN-WAN packet sending function out from a WAN physical port.
For the message which is forbidden to be forwarded, the target mac is of a bridge subinterface B-SUB-WAN and is directly discarded; and broadcasting or unknown unicast messages, and not copying or forwarding the messages to the bridge WAN subinterface B-SUB-WAN.
A2-3: if the destination mac finds that the interface is the bridge interface BR0, it goes to bridge BR0 to receive packets. If the message is an unknown unicast message or a broadcast message, copying the message, and converting the copied message into a BR0 packet. And searching an ipv4 routing table or an ipv6 routing table according to whether the message is ipv4 or ipv 6. If the search result is the routing WAN subinterface R-SUB-WAN, the routing WAN subinterface R-SUB-WAN packet sending is called, in the routing WAN routing subinterface R-SUB-WAN packet sending function, the routing WAN routing subinterface R-SUB-WAN packet sending is converted into a WAN subinterface SUB-WAN packet sending, finally the routing WAN subinterface SUB-WAN packet sending is converted into a WAN MAIN interface MAIN-WAN packet sending, and the WAN MAIN interface MAIN-WAN packet sending is sent out from a WAN physical port.
A2-4: if the destination mac finds that the interface is another LAN interface, such as LAN2, it turns into the found LAN interface to send a packet. If the message is an unknown unicast message or a broadcast message, after the message is copied, the copied message is converted into a corresponding LAN interface to be sent out from a corresponding LAN physical port.
The router provided by the embodiment of the application mainly branches through ip message types, and non-ipv 6 messages and non-ipv 4 messages are forwarded according to an ipv4 mode. The forwarding restriction is strictly carried out in the bridge path according to the mode + mac corresponding to the message type, when the message enters the routing path, because prefix routing is lacked in the bridge mode, the message can not be successfully forwarded even if the message is not restricted, and therefore the mode judgment and the restriction can not be carried out.
Fig. 6 is a schematic diagram of a packet downstream forwarding path in a router according to an embodiment of the present application. As shown in fig. 6, according to the above configuration, the downstream forwarding path of the packet in the router provided by the embodiment of the present application is as follows:
b1: when the WAN MAIN interface MAIN-WAN receives the message from the WAN physical port, the vlan id of the message is analyzed, and if the vlan id is the designated vlan id of the WAN subinterface SUB-WAN, the WAN subinterface SUB-WAN is converted into a packet.
B2: and then making a forwarding logic decision.
B2-1: if the WAN subinterface SUB-WAN packet receiving message is an ipv6 message, and the current router ipv6 mode is an ipv6 bridge mode; or the WAN subinterface SUB-WAN packet receiving message is an ipv4 message, and the current router ipv4 mode is an ipv4 bridge mode, the bridge subinterface B-SUB-WAN packet receiving is converted, and then the bridge flow is entered.
Since bridge WAN subinterface B-SUB-WAN is under bridge BR0, the bridge forwarding logic forwards as mac. And searching the mac table, if the searching structure is that the result is an LANX port, or the message is a broadcast message, or the message is an unknown unicast message, converting the result into an LANX packet, copying the message, and then transmitting the message from the LANX packet. In the LANX packet transmission function, the LANX packet is transmitted from the physical port corresponding to the LANX. If the mac table lookup result is the bridge interface BR0, the message is directly discarded.
B2-2: if the WAN subinterface SUB-WAN packet receiving message is an ipv6 message, and the current router ipv6 mode is an ipv6 routing mode; or the WAN subinterface message is an ipv4 message, and the current router ipv4 mode is an ipv4 routing mode, and the current router ipv4 mode is converted into a routing WAN subinterface R-SUB-WAN packet receiving mode. Then, the routing table is searched according to the message destination ip.
And when the ip search result is the bridge interface BR0, the ip search result is sent out from the bridge interface BR0, and enters a bridge forwarding flow, and the interface is searched according to the destination mac. And if the mac searching result is the bridge WAN subinterface B-SUB-WAN, the message is directly discarded. If the mac search result is LANX, the packet is converted into an LANX interface packet and is transmitted from a physical port corresponding to the LANX.
When the ip lookup result is not the bridge port BR0, it is discarded directly.
Therefore, an embodiment of the present application provides an adaptive method for a router ipv6, including: if the router configuration state is detected, if the router is configured to be in the bridge mode, the ipv4 bridge + ipv6 bridge mode is used. If the router configuration state is the routing state, the ipv6 mode detection is started, and the router use mode is configured according to the ipv6 mode detection result.
To sum up, the router provided in the embodiment of the present application can automatically detect the ipv6 address assignment capability of the upper device, and perform mode switching. And by interfacing the routers with bridge BR0 and WAN and joining all LANs to the bridge, a bridge WAN subinterface is created to connect with the routing WAN subinterface and a bridge BR0 is added. A routing WAN subinterface is created to allow the bridge interface BR0 and the routing WAN subinterface to be routable to enable the router to automatically support ipv6 forwarding to enable routing isolation of ipv4/ipv6 from the bridge path.
The application provides a router ipv6 self-adaptive method, which is used for initializing and setting a router state and a router use mode, so that the router initially adapts to a common routing mode. Sending an RS message in an SLAAC mode to a server to apply for obtaining a WAN address, and recording the WAN state of the router according to the result of obtaining the WAN address; and sending a DHCPv6-PD request to the server to apply for acquiring the LAN prefix, and recording the LAN state of the router according to the result of acquiring the LAN prefix, thereby detecting the PD support capability of the server. And configuring the use mode of the router according to the current state of the router to adapt to different environments. The router ipv6 self-adaption method provided by the application judges whether the pd support capability of the detection server supports allocation of two prefixes or not, and further selects a proper router forwarding mode, so that router ipv6 self-adaption is realized, and the performance of the router is improved.
The present application further provides an ipv6 adaptive apparatus, comprising: and the mode detection module is used for detecting whether the current use mode of the router is the routing mode.
And the initialization module is used for carrying out initialization setting on the router state and the router use mode. If the mode detection module detects that the current use mode of the router is the routing mode, the initialization module carries out initialization setting on the state of the router and the use mode of the router, initializes the state of the router to be [ WAN ipv6 addresses are acquiring ], [ LAN ipv6 prefixes are acquiring ], and sets the initial use mode of the router to be an [ ipv4 routing + ipv6 routing ] mode.
And the WAN address acquisition module is used for sending the RS message in the SLAAC mode to the server to apply for acquiring a WAN address and recording the WAN state of the router according to the result of acquiring the WAN address.
And the LAN prefix acquisition module is used for sending a DHCPv6-PD request to the server to apply for acquiring the LAN prefix and recording the LAN state of the router according to the result of acquiring the LAN prefix.
And the mode configuration module is used for configuring the router use mode according to the router WAN state and the router LAN state.
Further, in some embodiments, the WAN address acquisition module comprises: and the WAN address application submodule is used for sending the RS message in the SLAAC mode to the server and applying for obtaining a WAN address. And the WAN address receiving submodule is used for receiving a response message of the server to the RS message. And the WAN state recording submodule is used for recording the WAN state of the router according to the response message.
The WAN address receiving submodule is also used for judging whether the address needs to be converted into a stateful mode to obtain the address according to the M-FLAG mark of the response message.
Further, if the M-FLAG in the response message is 0, the WAN state recording submodule directly obtains WAN address prefixes from the response message, automatically generates a legal IPv6 global unicast address and records the WAN state of the router as [ WAN Ipv6 address acquisition success ]. And if the response message does not carry the prefix or the prefix is illegal character, recording the WAN state of the router as WAN ipv6 address acquisition failure.
If the M-FLAG in the response message is 1, the WAN address application submodule sends a dhcpv6 NA address request. If the server does not respond to the dhcpv6 NA request, the WAN address application submodule sends a dhcpv6 NA request to the server in a random delay period, and the current state is maintained unchanged during the request, namely the WAN state recording submodule records the WAN state of the router as [ WAN ipv6 address is being acquired ].
If the server responds to the dhcpv6 NA request, the router and the server complete all interactions of dhcpv6 NA, the server sends a response message to the router, and the router acquires an address from the response message. That is, if the WAN address receiving submodule receives a response message of the dhcpv6 NA request, the WAN address is acquired from the response message.
If the WAN address receiving submodule successfully acquires the legal ipv6 global unicast address from the response message, the WAN state recording submodule records the state of the router WAN as [ WAN ipv6 address acquisition success ].
If the server response message received by the WAN address receiving submodule does not support or the allocated address is illegal, the WAN state recording submodule records the WAN state of the router as WAN ipv6 address acquisition failure.
In some embodiments, the LAN prefix acquisition module comprises: and the LAN prefix application submodule is used for sending the DHCPv6-PD request to the server. And the LAN prefix receiving submodule is used for receiving a response message after the server processes the DHCPv6-PD request. And the LAN state recording submodule is used for recording the LAN state of the router according to the received response message of the DHCPv 6-PD.
In some embodiments, the LAN prefix application submodule is further configured to send the DHCPv6-PD request with a random delay period if the LAN prefix receiving submodule does not receive the server response message.
The LAN state recording submodule records the LAN state of the router according to the received response message of the DHCPv6-PD, and comprises the following steps: if the server responds, the router proceeds with interacting DHCPv6-PD with the server. After the interaction is completed, if the LAN state recording submodule successfully acquires the legal ipv6 global unicast prefix from the server message, the state of the router is recorded as [ LAN ipv6 prefix acquisition success ]. And if the server response message does not support or the allocated prefix is illegal, recording the router state as LAN ipv6 prefix acquisition failure.
In some embodiments, a mode configuration module to configure a router usage mode based on the router WAN state and the router LAN state. Further, if the router WAN state [ LAN ipv6 prefix is being acquired ] or the router LAN state is [ WAN ipv6 address is being acquired ], the current mode of the router is maintained unchanged, i.e. the current router mode is [ ipv4 route + ipv6 route ] mode.
If the router WAN state is [ WAN ipv6 address acquisition success ] and the router LAN state is [ LAN ipv6 prefix acquisition success ], the router is configured to use the [ ipv4 route + ipv6 route ] mode.
If the router WAN state is [ WAN ipv6 address acquisition success ] and the router LAN state is [ LAN ipv6 prefix acquisition failure ], the router is configured to use the [ ipv4 route + ipv6 bridge ] mode.
If the router state is [ WAN ipv6 address acquisition failure ], the current mode of the router is maintained.
In summary, the present application further provides an ipv6 adaptive apparatus, including: and the initialization module is used for carrying out initialization setting on the router state and the router use mode. And the WAN address acquisition module is used for sending the RS message in the SLAAC mode to the server to apply for acquiring a WAN address and recording the WAN state of the router according to the result of acquiring the WAN address. And the LAN prefix acquisition module is used for sending a DHCPv6-PD request to the server to apply for acquiring the LAN prefix and recording the LAN state of the router according to the result of acquiring the LAN prefix. And the mode configuration module is used for configuring the router use mode according to the router WAN state and the router LAN state. And initializing and setting the router state and the router use mode, so that the router initially adapts to the common routing mode. The router applies for WAN address and LAN prefix from the server, updates the state of the router according to the obtained result, and detects the pd support capability of the server. And configuring the router using mode according to the current state of the router to adapt to different environments. The ipv6 self-adaptive device provided by the application judges whether the pd support capability of the probe server supports allocation of two prefixes or not, and further selects a proper router forwarding mode, so that the ipv6 self-adaptation of the router is realized, and the performance of the router is improved.
Since the above embodiments are all described by referring to and combining with other embodiments, the same portions are provided between different embodiments, and the same and similar portions between the various embodiments in this specification may be referred to each other. And will not be described in detail herein.
It is noted that, in this specification, relational terms such as "first" and "second," and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a circuit structure, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such circuit structure, article, or apparatus. Without further limitation, the presence of an element identified by the phrase "comprising an … …" does not exclude the presence of other like elements in a circuit structure, article or device comprising the element. The WLN side is a server side, and can also be a superior device associated with the router, and can be HUG devices or an superior router.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
The above-described embodiments of the present application do not limit the scope of the present application.

Claims (10)

1. A router ipv6 adaptation method, comprising: initializing and setting the router state and the router use mode;
sending an RS message in an SLAAC mode to a server to apply for obtaining a WAN address, and recording the WAN state of the router according to the result of obtaining the WAN address;
sending a DHCPv6-PD request to the server to apply for obtaining a LAN prefix, and recording the LAN state of the router according to the result of obtaining the LAN prefix;
configuring a router usage pattern according to the router WAN state and the router LAN state.
2. The adaptive method of router ipv6 of claim 1, wherein the initial state of the router is [ WAN ipv6 address is acquiring ], [ LAN ipv6 prefix is acquiring ], and the initial usage mode of the router is [ ipv4 routing + ipv6 routing ] mode.
3. The router ipv6 adaptation method of claim 1, further comprising, before the initializing setting of the router state and the router usage mode: and detecting whether the current use mode of the router is the routing mode, and if the current use mode of the router is the routing mode, carrying out the next step.
4. The self-adaptive method of the router ipv6, according to claim 1, wherein the sending an RS packet in the SLAAC mode to a server applies for acquiring a WAN address, and records a router WAN state according to a result of acquiring the WAN address, including:
sending RS messages in an SLAAC mode to a server;
if the server response message is received, judging whether the address needs to be acquired in a stateful mode according to the M-FLAG mark of the response message;
if the M-FLAG is 0, directly obtaining WAN address prefixes from the response message, automatically generating a legal IPv6 global unicast address, and recording the WAN state of the router as WAN Ipv6 address obtaining success;
if the M-FLAG is 1, the router sends a dhcpv6 NA address request to the server, and if the server sends a response message to the router and the router acquires a legal address from the response message, the WAN state of the router is recorded as WAN ipv6 address acquisition success;
if the router does not receive the server response message, recording the WAN state of the router as [ WAN ipv6 address is being acquired ];
otherwise, the state of the router WAN is recorded as [ WAN ipv6 address acquisition failure ].
5. The adaptive method of router ipv6, according to claim 4, wherein the sending of the DHCPv6-PD request to the server applies for obtaining a LAN prefix, and records router LAN status according to the result of obtaining the LAN prefix; the method comprises the following steps:
sending a DHCPv6-PD request to a server;
if the server does not respond, recording the LAN state of the router as [ LAN ipv6 prefix is acquiring ];
if the server responds, the router and the server continue to interact with each other DHCPv 6-PD;
after interaction is completed, if a legal ipv6 global unicast prefix is successfully acquired from a server message, recording that the router LAN state is [ LAN ipv6 prefix acquisition success ];
and if the server response message does not support or the prefix is illegally distributed, recording the LAN state of the router as LAN ipv6 prefix acquisition failure.
6. The router ipv6 adaptation method of claim 5, wherein router usage patterns are configured according to the router WAN state and the router LAN state; the method comprises the following steps:
configuring a router to use an [ ipv4 route + ipv6 bridge ] mode if the router WAN state is [ WAN ipv6 address acquisition success ] and the router LAN state is [ LAN ipv6 prefix acquisition failure ];
otherwise, the current configuration is maintained.
7. The adaptive method for router ipv6 of claim 6, wherein the configuring router further comprises, after using the [ ipv4 route + ipv6 bridge ] mode: configuring the router:
the WAN subinterface is configured to select a forwarding path according to the type of the received message of the external network and the current mode of the router;
a bridge BR0, having at least one intranet interface mounted thereunder;
the bridge interface BR0 is mounted below the bridge BR0 and participates in bridge forwarding;
the bridge WAN sub-interface is mounted below the bridge BR0 and can participate in bridge forwarding; routing a WAN subinterface;
wherein: the bridge interface BR0 and the routing WAN subinterface can be used for routing forwarding;
the routing WAN subinterface and the bridge WAN subinterface directly convert the messages sent to the WAN side into the WAN subinterface sending packets; and selecting the routing WAN subinterface or the bridge WAN subinterface to forward the message according to the message content and the router mode.
8. An ipv6 adaptive apparatus, comprising: the initialization module is used for carrying out initialization setting on the router state and the router use mode;
the WAN address acquisition module is used for sending an RS message in an SLAAC mode to the server to apply for acquiring a WAN address and recording the WAN state of the router according to the result of acquiring the WAN address;
the LAN prefix acquisition module is used for sending a DHCPv6-PD request to the server to apply for acquiring the LAN prefix and recording the LAN state of the router according to the result of acquiring the LAN prefix;
and the mode configuration module is used for configuring the router use mode according to the router WAN state and the router LAN state.
9. The ipv6 adaptive device according to claim 8, further comprising: and the mode detection module is used for detecting whether the current use mode of the router is a routing mode.
10. A router, comprising: the WAN subinterface is configured to select a forwarding path according to the type of the received message of the external network and the current mode of the router;
a bridge BR0, having at least one intranet interface mounted thereunder;
the bridge interface BR0 is mounted below the bridge BR0 and participates in bridge forwarding;
the bridge WAN sub-interface is mounted below the bridge BR0 and can participate in bridge forwarding; routing a WAN subinterface;
wherein: the bridge interface BR0 and the routing WAN subinterface can be used for routing forwarding;
the routing WAN subinterface and the bridge WAN subinterface directly convert the messages sent to the WAN side into the WAN subinterface sending packets; and selecting the routing WAN subinterface or the bridge WAN subinterface to forward the message according to the message content and the router mode.
CN202110153628.5A 2021-02-04 2021-02-04 Router and router ipv6 self-adaption method and device Pending CN114938347A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110153628.5A CN114938347A (en) 2021-02-04 2021-02-04 Router and router ipv6 self-adaption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110153628.5A CN114938347A (en) 2021-02-04 2021-02-04 Router and router ipv6 self-adaption method and device

Publications (1)

Publication Number Publication Date
CN114938347A true CN114938347A (en) 2022-08-23

Family

ID=82863316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110153628.5A Pending CN114938347A (en) 2021-02-04 2021-02-04 Router and router ipv6 self-adaption method and device

Country Status (1)

Country Link
CN (1) CN114938347A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070192593A1 (en) * 2005-12-29 2007-08-16 Boisjolie Darren R Method and system for transparent bridging and bi-directional management of network data
CN102025797A (en) * 2010-11-30 2011-04-20 北京星网锐捷网络技术有限公司 Address prefix processing method, device, system and network equipment
WO2013123763A1 (en) * 2012-02-20 2013-08-29 烽火通信科技股份有限公司 Dynamic ipv6 configuration method for home gateway
CN103581353A (en) * 2012-08-02 2014-02-12 上海斐讯数据通信技术有限公司 Method and system of automatic configuration of gateway device
CN111541797A (en) * 2020-04-23 2020-08-14 深圳市吉祥腾达科技有限公司 Eco-based IPV6 implementation method
CN111614565A (en) * 2020-05-19 2020-09-01 青岛海信宽带多媒体技术有限公司 Message forwarding method and gateway
CN112272244A (en) * 2020-10-22 2021-01-26 北京自如信息科技有限公司 Router WAN end IPv6 internet mode configuration method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070192593A1 (en) * 2005-12-29 2007-08-16 Boisjolie Darren R Method and system for transparent bridging and bi-directional management of network data
CN102025797A (en) * 2010-11-30 2011-04-20 北京星网锐捷网络技术有限公司 Address prefix processing method, device, system and network equipment
WO2013123763A1 (en) * 2012-02-20 2013-08-29 烽火通信科技股份有限公司 Dynamic ipv6 configuration method for home gateway
CN103581353A (en) * 2012-08-02 2014-02-12 上海斐讯数据通信技术有限公司 Method and system of automatic configuration of gateway device
CN111541797A (en) * 2020-04-23 2020-08-14 深圳市吉祥腾达科技有限公司 Eco-based IPV6 implementation method
CN111614565A (en) * 2020-05-19 2020-09-01 青岛海信宽带多媒体技术有限公司 Message forwarding method and gateway
CN112272244A (en) * 2020-10-22 2021-01-26 北京自如信息科技有限公司 Router WAN end IPv6 internet mode configuration method and device

Similar Documents

Publication Publication Date Title
US7941512B2 (en) Use of IPv6 in access networks
EP1410579B1 (en) Method for configuring a computer network
US8917737B2 (en) Automatically identifying an edge-facing router
US7046666B1 (en) Method and apparatus for communicating between divergent networks using media access control communications
EP2919444B1 (en) Method, relay device, and system for acquiring internet protocol address in network
US8451839B2 (en) Method and apparatus for managing route information and forwarding data in access devices
CA2274050A1 (en) System, device, and method for routing dhcp packets in a public data network
WO2009045130A1 (en) Vrrp and learning bridge cpe
Armitage et al. IPv6 over Non-Broadcast Multiple Access (NBMA) networks
AU2005338685B2 (en) Method and arrangement in an access system
CN112654049B (en) Method, system, node and medium for configuring a wireless communication coverage extension system
US20140313933A1 (en) Method, apparatus, and system for layer 2 interworking based on ipv6
JP2014161084A (en) Self-configuration of forwarding table in access node
US20060067350A1 (en) Method of assigning network identifiers by means of interface identifiers
CN114938347A (en) Router and router ipv6 self-adaption method and device
JP5845964B2 (en) Communication apparatus and program
Cisco Configuring IP Addressing
Cisco Configuring IP Addressing
Cisco IP Addressing Commands
Cisco IP Addressing Commands
Cisco Configuring IP Addressing
Cisco IP Addressing Commands
Cisco Configuring IP
Cisco Configuring IP
Cisco Configuring IP

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination