Notes on data communication and network-IPv4 VS IPv6
The IPv4 datagram format is as follows:
Version: the version that identifies the current datagram.
Header Length: defines the total length of the datagram header in 4 bytes. If the field value is 5, the length of the header is 20 (5*4), and the maximum value of the field is 15, that is, the maximum length of the header is 60 bytes. Service type:
The service type field contains 8 bits to indicate how the router processes the data packet. The length of this field is composed of four service type (TOS) subdomains and three priority (b7 b6 b5) (precedence) subdomains. The first bit is the Reserved Bit. The structure of this field is shown in:
There are eight priorities. The higher the priority, the more important the data packet is. Lists the meanings of priorities.
In the four-bit service type subdomains, b4 b3 b2 b1 represents D (latency), T (throughput), R (reliability), and (cost), respectively ). Lists the composition of service type subdomains.
Total Length: defines the total length of IPv4 datagram in bytes. This field is 16-bit long, so the IPv4 datagram length is limited to 65536 (2 ^ 16-1) bytes, the header occupies 20 ~ 60 bytes. When talking about Ethernet data frames, the maximum data bit of a frame is 1500 bytes. If an IP packet is larger than 1500 bytes, isn't it not fit in a frame? Indeed, we need to segment IP data packets. We need to describe how to segment IP data packets in the future.
ID: used for segmentation. It will be described later.
Flag: used for segmentation. It will be described later.
Segment offset: used for segmentation. It will be described later.
Survival time: controls the maximum number of hops of a datagram through a vro.
Protocol: defines the high-level protocol for using this IPv4 service. 1: ICMP, 2: IGMP, 6: TCP, 17: UDP, 89: OSPF
Header checksum: only the checksum used for verifying the IP packet header.
Source IP Address: The Logical Address of the source.
Destination IP Address: the destination logical address.
Option: This part is composed of several options. It can be up to 40 bytes in the following types:
IPv6
The format of IPv6 datagram is as follows:
Version: defines the version number of the IP protocol. for IPv6, the value is 6.
Priority: defines the priority of a group when traffic is congested.
Stream label: A stream label can be used to mark packets of a specific stream, so that different packets can be differentiated at the network layer. Vrouters on the forwarding path can distribute traffic and process the traffic according to the flow label. Because the flow label is carried in the IPv6 packet header
The receiver does not need to identify different streams based on the packet content. The destination node can also identify streams based on the stream tag. Because the stream tag is in the packet header, therefore, after using IPSec, you can still perform QoS Processing Based on the stream tag.
Next header: defines the header that follows the basic header in the datagram. The next header or the optional extension header used by the IP address, or the upper-layer protocol (TCP, UDP ). Each extension header also contains this field.
Hop count limit: the TTL field of the field and IPv4 serves the same purpose.
Source Address: The Logical Address of the source.
Destination Address: the destination logical address.
The size of 6 extension headers can be added after the basic header of IPv6. Many of these headers are IPv4 options and six types of extension headers are provided.
IPv4 vs IPv6
Compared with IPv4, IPv6 has the following advantages:
1. A larger address space. The IPv6 address is 128-bit. IPv4 is 32-bit.
2. A better header address. IPv6 uses a new header format. The options are separated from the basic header. If necessary, you can insert the options between the basic header and the upper-layer data. This simplifies and accelerates the routing selection process, because most options do not need to be checked by the router.
3. New options. IPv6 has some new options to implement additional functions.
4. allow extension. IPv6 allows protocol expansion if new technologies or applications require it.
5. Resource allocation is supported. In IPv6, the service type field is canceled, but a mechanism is added to enable the source end to request special processing for the group.
6. More security is supported. In IPv6, encryption and authentication options provide the confidentiality and integrity of groups.
Transition from IPv4 to IPv6
Because there are a lot of systems on the Internet, the transition from IPv4 to IPv6 cannot happen suddenly. It takes a long time for the system on the Internet to transition from IPv4 to IPv6, this transition must be smooth to prevent any problems between IPv4 and IPv6 systems. The IETF shot a medium 3 Strategy to smooth the transition.
Dual-protocol stack
The so-called dual-protocol stack means that a station should run both IPv4 and IPv6. If an IPv4 protocol group is accepted, the IPv4 protocol stack is used for processing. If an IPv6 protocol group is accepted, the IPv6 protocol stack is used for processing.
Tunneling Technology
When two systems that use IPv6 need to communicate, but their groups must pass through the IPv4 region, tunneling must be used to pass through the region, this group must have an IPv4 address. Therefore, when entering this region, the IPv6 group must be encapsulated into an IPv4 group. When the group leaves this region, the encapsulation is removed.
Header Conversion
When an IPv4 address communicates with an IPv6 address, the header must be used for conversion.