In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
In-depth study of Stateless vs. Stateful ways of automatically assigning IPv6 addresses
Small slow brother original article, welcome to reprint
directory
▪ I. Link-Local Address generation
▪ II. Global Address generation
▪ III. Three key flags in RA message
IV. schematic flowchart
▪ V. Test to get IP effect
VI. Application scenarios (choose stateless or stateful)
VII. subsequent content
▪ Attached. reference documentation
I. Link-Local Address generation
Link Local Address is generated in 2 ways
<$Manual configuration
Automatic configuration
Among them,"automatic configuration" is divided into three parts according to algorithm.
<$eui64: converted from mac address
<$stable_secret: changes with network environment, its value will be fixed in fixed network environment
random: generated randomly
II. Global Address generation
There are 2 ways to generate a Global Unicast Address (or Unique Local Address)
<$Manual configuration
Automatic configuration
Among them,"automatic configuration" is divided into three parts according to the acquisition mode.
Stateful: Automatically configure IPv6 addresses according to prefix information contained in Router Advertisement (RA), and the composition method is Prefix + (EUI64 or Random). Stateless can also be called SLAAC (Stateless address autoconfiguration).
<$Stateful: Get IPv6 address via DHCPv6
Among them,"having state" can be divided into two kinds
<$Stateful DHCPv 6: IPv6 address, other parameters (such as DNS) are obtained through DHCPv6
Stateless DHCPv6: IPv6 addresses are still generated via route advertisement RA, other parameters (e.g. DNS) are obtained via DHCPv6
To avoid confusion, what does stateful and stateless mean in this explanation: First, please make it clear that stateful and stateless are only for IPv6 address allocation methods and do not include other parameters.
Status: controllable and manageable. There is an IP address manager in the network, which can identify clients and allocate corresponding IPv6 addresses according to different clients. The lease period and renewal of IP addresses need to be maintained between clients and servers. DHCPv6 is the IP address manager of DHCPv6 Server.
No state: uncontrollable and difficult to manage. There are only gateways in the network, no IP address managers. Therefore, no one identifies the client, and each client configures its own IPv6 address according to the same RA message content sent by the gateway.
III. Three key flags in RA message
There are three key flag bits in RA messages:
<$Autonomous flag (A flag): Indicates whether stateless IP is configured. In an RA message, there may be multiple prefixes, such as 2401::/64, 2402::/64, 2403::/64, and each prefix may be independently configured with A flag.
▪ When on (corresponding bit is 1): indicates that the client should automatically generate IPv6 addresses within the prefix range (the client ensures that the addresses are available through DAD), and configure subnet routing entries and gateways.
▪ When off (corresponding bit is 0): indicates that the client should not automatically generate IPv6 addresses within the prefix range, but can configure subnet routing entries and gateways.
Managed flag (M flag): Indicates whether stateful IP is configured. M flag is the global parameter of RA message, and one RA message has only one M flag.
▪ When on (corresponding bit is 1): indicates that the stateful process starts after the stateful process ends, that is, tells the client that IPv6 addresses and other parameters (such as DNS list) can be obtained through DHCPv6.
▪ When off (corresponding bit is 0): indicates that IPv6 address is not obtained through DHCPv6.
<$Other flag (O flag for short): Indicates whether parameters other than IP (such as DNS list) are obtained through DHCPv6. O flag is also a global parameter in RA messages, and an RA message has only one O flag. Note: This parameter is read only when M flag is off.
▪ When on (corresponding bit is 1): When M flag is on, or M flag is off and at least one A flag is on, other parameters will be obtained through DHCPv6
▪ When M flag is off (corresponding bit is 0): when M flag is on, other parameters will still be obtained through DHCPv6; when M flag is also off, other parameters will not be obtained through DHCPv6
IV. schematic flowchart
Stateless and stateful are not mutually opposite, they can exist at the same time, that is, an IP generated by RA and an IP obtained by DHCPv6 can appear on a NIC at the same time. The mystery can be known through the flow chart drawn by the author below.
As can be seen from the figure, the sequence is:
1$> Stateless autoconfiguration "Link Local Address"
2$> Stateless auto-configures Global Address (or Unique Local Address)
3$> Stateful autoconfigures Global Address (or Unique Local Address) and other parameters where Stateful DHCPv6 or Stateless DHCPv6 exists in the Stateful phase
Note: Some client operating systems or network managers will end when the RA message is not received in the Stateless phase, and will not go to the Stateful phase. For example, CentOS 7 and Ubuntu 17 default logic are like this, while windows server 2012 will continue to go to the Stateful phase.
v. Test to get IP effect
Test environment: Client tests based on CentOS 7+NetworkManager (i.e. the default network management method of the system)
▪ The gateway sends RA messages containing a prefix
DHCPv6 Server assigns IP and DNS
Test content: test M, O, A flag in all permutations and combinations
▪ Whether the client configures stateless IP via RA messages
▪ Whether the client configures prefix subnet routing via RA message
▪ Whether the client configures the gateway via RA messages
▪ Will clients get stateful IP via DHCPv6
▪ Will clients get DNS via DHCPv6
Test results:
vi. Application scenarios (choose stateless or stateful)
When to adopt stateless and when to adopt stateful, the key depends on the application scenario. The core is whether you need to control IP addresses, such as keeping IP unchanged, if you need control, you use stateful; if you don't need control, you use stateless.
Server domain: If you provide services to the outside world, you usually need to use stateful IP. Because sudden changes in service IP can easily lead to service interruption (unless service discovery is done well)
Client domain: such as mobile devices, office PCs, only need to connect to IPv6 Internet, and do not need to provide services to the outside world, you can use stateless IP
VII. subsequent content
Due to space limitations, this article has not yet posted the detailed configuration of the experiment. The complete information of the experiment will be posted in the follow-up article of IPv6 series, including RA, DHCPv6 configuration, and client configuration. Please pay attention.
Annex. Reference document http://www.6deploy.eu/tutorials/080 -6deploy_ipv6_autoconfiguration_mechs_v0_4.pdfhttps://cshihong.github.io/2018/02/01/DHCPv6 basics/
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.