ipv4, ipv6 simple explanation

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/xue_yanan/article/details/87977612

A, IPV4

1, ipv4 address is 32 bits long, in dotted decimal notation, four-bit binary number.

(1) A class: for large networks

                   Most significant bit is 0 [far left]

                   0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

                   Address range: 0.0.0.0-127.255.255.255

(2) Category B: used for medium-sized networks

                  The first two are 10

                  10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

                  Address range: 128.0.0.0-191.255.255.255

(3) Class C: for small networks

                  The top three is 110

                  110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

                   Address range is: 192.0.0.0-233.255.255.255

(4) Class D Multicast: 1110

(5) E class reservation: 1111

2. Private IP: use the LAN, there is free:

                    Class A: 10.0.0.0-10.255.255.255

                    Class B: 172.16.0.0-172.31.255.255

                    Class C: 192.168.0.0-192.168.255.255

3, subnet mask, there are two ways of representation:

(1)ip:192.168.1.3

         mask:255.255.255.0

(2)192.168.1.3/24

Remarks: ip is the network's first 24-bit bit after 8 bit is the host. 24 before the same ip address is the same subnet.

4,192.168.1.3 / 24/24 explanations:

24 refers to a 24 binary 1, binary mask is represented: 11111111.11111111.11111111.00000000, namely 255.255.255.0 to decimal

5, abnormal IPV4 format is:

(1)172.168.2.256

(2)172.168.2.2/33

This is the network itself 6,0.0.0.0

7,255.255.255.255 is a broadcast address

Two, IPV6

1, ipv6 128-bit long addresses, in the form of four hexadecimal number expressed in hexadecimal eight groups each, with intermediate ":" separated, each section is 16 bits.

2, the prefix length (subnet mask not call now) represents only one form:

(1)234e:0:4567::3d/64

Remarks: ip is the network former 64 bits, the 64-bit host. 64 before the same ip address is the same subnet. IPV6 default prefix is ​​64.

3, ipv6 notation:

(1) IPV6 run using the hexadecimal notation, the format X: X: X: X: X: X: X: X, where each X represents address 16b, in hexadecimal,

E.g:

     2001:0DB8:0000:0023:0008:0800:200C:417A

→ 2001: DB8: 0: 23: 8: 800: 200C: 417A (the leading 0 each X may be omitted)

(2) IPV6 compressed representation using 0, in some cases, an IPv6 address may contain intermediate long 0, 0 can be compressed to a contiguous stretch "::."

However, in order to ensure the uniqueness of address resolution, address "::" can only appear once,

E.g:

     FF01: 0: 0: 0: 0: 0: 0: 1101 

→ FF01 :: 1101

 

    0:0:0:0:0:0:0:1

→ ::1

 

     0:0:0:0:0:0:0:0

→ ::

(3) IPV6 IPV4 addresses using embedded representation, in order to achieve intercommunication IPv4-IPv6, the IPv4 address is embedded in the IPv6 address, in which case the address is often represented as:

X: X: X: X: X: X: dddd, before taking 96b using its hexadecimal representation, 32b and the last address is an IPv4 dotted decimal notation.

E.g:

   :: 192.168.0.1 and :: FFFF: 192.168.0.1 are two typical examples.

Guess you like

Origin blog.csdn.net/xue_yanan/article/details/87977612