Summary of the invention
The problem to be solved in the present invention is: a kind of user terminal technology that can connect IPv4 agreement and two kinds of network environments of IPv6 agreement simultaneously is provided.
In order to address the above problem, one embodiment of the present of invention provide a kind of message receiving method of user terminal, comprising:
When user terminal receives packet, in the link layer packet header of this packet, search VLAN tag;
Judge the IP protocol type of described packet according to the described VLAN tag that finds;
According to the described IP protocol type of judging, call the IPv4 protocol stack or the IPv6 protocol stack that are loaded in advance in the described user terminal described packet is handled.
In order to address the above problem, an alternative embodiment of the invention provides a kind of method for sending information of user terminal, comprising:
User terminal adds corresponding VLAN tag, and sends to access network equipment according to the IP protocol type of the packet that will send in the link layer packet header of this packet;
Described access network equipment sends to IPv4 business network or IPv6 business network according to the VLAN tag of described packet with described packet.
In order to address the above problem, another embodiment of the present invention provides a kind of user terminal, comprising:
First module is used to load IPv4 protocol stack and IPv6 protocol stack;
Second module is used for searching VLAN tag in the link layer packet header of the packet that receives;
Three module, be used for according to by second module searches to VLAN tag judge that the IP protocol type of described packet sends to four module;
Four module is used for calling the IPv4 protocol stack or the IPv6 protocol stack that are loaded in first module described packet being handled according to the described IP protocol type that receives.
By the present invention, make user terminal can support the IPv4/IPv6 dual stack, thereby can be simultaneously link to each other with operation system such as interaction multimedia operation system under two kinds of network environments, the operation system that lays respectively at IPv4 network and IPv6 network all can be helped promoting by the smooth transition of IPv4 network environment to the IPv6 network environment for the user provides service.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Embodiment
The message receiving method embodiment of user terminal of the present invention
Present embodiment provides a kind of message receiving method of user terminal of the IPv4/IPv6 of support dual stack, as shown in Figure 1, comprising:
Step 100, when user terminal receives packet, in the link layer packet header of this packet, search VLAN tag (hereinafter to be referred as: the VLAN mark).If search successfully, then execution in step 110, otherwise execution in step 120.
Wherein, VLAN (Virtual Local Area Network, hereinafter to be referred as: be a kind of with the apparatus logic ground in the local area network (LAN) rather than physically be divided into the network segment VLAN), thereby realize a kind of network technology of virtual work group.Its main operation principle is: after the VLAN switch receives packet from work station, the partial content of packet is checked, and compared with content in the VLAN configuration database, then specified data bag whereabouts.If packet will mail to a VLAN equipment, add the VLAN mark then for this packet, particularly, can add the VLAN mark according to existing 802.1Q agreement, in order to distinguish different local area network (LAN)s, be forwarded to corresponding target ground according to the VLAN mark again; If packet mails to non-VLAN equipment, then the VLAN switch sends not the packet with the VLAN mark.Because VLAN normally realizes the division of the network segment on data link layer, therefore, the VLAN mark also appears in the link layer packet header usually.
Step 110, the IP protocol type of the packet that receives according to the VLAN marker for judgment that finds.What wherein, IP protocol type mainly was meant this packet employing is IPv4 agreement or IPv6 agreement.
Particularly, can at first send the IP protocol type of the VLAN of this packet according to the VLAN marker for judgment that finds, what promptly judge this VLAN employing is IPv4 agreement or IPv6 agreement; And then judge the IP protocol type that obtains this packet according to the IP protocol type of the VLAN that judges.This is because data packets for transmission has the IP protocol type identical with this VLAN usually in a VLAN.
In addition, before the protocol type of packet is judged, if destination address is the domain name addresses of representing with domain name, then can (abbreviation: DNS) server obtains corresponding IPv4 or IPv6 address, and then judges by domain name system earlier.
Step 120 if do not comprise the VLAN mark in the link layer packet header of packet, is then carried out link layer to the packet that receives and is resolved, and obtains the link layer data segment of packet.
Wherein, according to existing internet communication protocol technology, packet is carrying out comprising link layer packet header and link layer data segment before the link layer parsing.Comprise IP layer packet header and IP layer data section in the link layer data segment.
Step 121 is unpacked to the above-mentioned link layer data segment that obtains, and obtains the IP layer packet header of packet.
Step 122 is judged the IP protocol type of this packet according to the IP protocol version in the IP layer packet header of packet.Wherein, the IP protocol version is a field in the IP layer packet header, and what show this packet employing is IPv4 agreement or IPv6 agreement.
Step 130 according to the IP protocol type of judging, is called the IPV4 protocol stack or the IPv6 protocol stack that are loaded in advance in the user terminal packet is handled.
Particularly, (Socket Application ProgramInterface is called for short: Socket API) call the general TCP/UDP agreement that is loaded in advance in the user terminal and be used to realize network service can to pass through the socket application programming interfaces.In addition, can also call that (be called for short: DHCP) v4/v6, Internet igmpinternet v2/ multicast communication audience find that agreement v6 (is called for short: IGMPv2/MLDv6), (be called for short: RTSP) (be called for short: NTP) protocol stack such as v4/v6 is to realize the IP service for v4/v6, NTP (Network Time Protocol) for real-time streaming protocol as DHCP by the stack manager.Wherein, by calling of API, can provide the terminal equipment support for the interaction multimedia business of coexistence under IPv4 and the IPv6.Above-mentioned each protocol stack in the structure of user terminal shown in Figure 1A.
By the described method of present embodiment, make user terminal can support the IPv4/IPv6 dual stack, thereby can be simultaneously link to each other with operation system such as interaction multimedia operation system under two kinds of network environments.Operation system lays respectively at IPv4 network and IPv6 network, and simultaneously for the user provides service, when the user used IPv4 or IPv6 business, subscriber terminal equipment can call IPv4 or IPv6 protocol stack automatically, realizes correlation function.In addition, present embodiment can also be applied to provide as operator the subscriber terminal equipment of IPv4 and IPv6 business, to realize its business, as the interaction multimedia business.Thereby help by the smooth transition of IPv4 network environment to the IPv6 network environment.
The method for sending information embodiment of user terminal of the present invention
Present embodiment provides a kind of method for sending information of user terminal of the IPv4/IPv6 of support dual stack, as shown in Figure 2, comprising:
Step 201, user terminal are added corresponding VLAN mark, and are sent to access network equipment according to the IP protocol type of the packet that will send in the link layer packet header of this packet.Particularly, send to Access Network access device in the access network equipment.Wherein, user terminal can be set-top box.
Step 202, the Access Network access device in the access network equipment is mapped as corresponding permanent virtual circuit with the VLAN mark in the packet, and (Permanent Virtual Circuit is called for short: PVC).Wherein, the Access Network access device can (be called for short: ADSLMODEM) wait equipment for the ADSL (Asymmetric Digital Subscriber Line) modulator-demodulator.
Step 203, the Access Network outlet device in the access network equipment sends to IPv4 business network or IPv6 business network according to the permanent virtual circuit after shining upon with above-mentioned packet.Wherein, the Access Network outlet device can (be called for short: DSLAM) wait equipment for digital subscriber line access multiplex.
By the described method of present embodiment, user terminal can and support the network environment of IPv6 protocol stack to send data message to the network environment of supporting the IPv4 protocol stack, thereby realization information is interconnected, helps by the smooth transition of IPv4 network environment to the IPv6 network environment.
The embodiment 1 of user terminal of the present invention
Present embodiment provides a kind of user terminal, and as shown in Figure 3, this user terminal 1 comprises receiving element 10 and transmitting element 20.
Wherein, transmitting element 20 is used for the IP protocol type according to the packet that will send, and adds corresponding VLAN tag in the link layer packet header of this packet, and sends to access network equipment.By the VLAN tag in the access network equipment basis packet that receives, this packet is sent to IPv4 business network or IPv6 business network again.Access network equipment wherein can comprise Access Network access device and Access Network outlet device.Access network equipment can repeat no more referring to the method for sending information embodiment of user terminal of the present invention the concrete processing procedure of packet herein.
Receiving element 10 comprises first module, 11, the second modules, 12, the three module 13 and four modules 14, and its operation principle is as follows:
Be mounted with IPv4 protocol stack and IPv6 protocol stack in first module 11 in advance.When user terminal 1 received packet, second module 12 was searched the VLAN mark in the link layer packet header of the packet that receives; The IP protocol type of the packet that the VLAN marker for judgment that three module 13 bases are found by second module 12 receives, what promptly judge this packet employing is IPv4 agreement or IPv6 agreement, and this IP protocol type is sent to four module 14; Four module 14 calls the IPv4 protocol stack or the IPv6 protocol stack that are loaded in first module 11 above-mentioned packet is handled accordingly according to the IP protocol type that receives.
By the described device of present embodiment, obtained the IP protocol type that packet adopted by judgement to the VLAN mark, and then make user terminal can support the IPv4/IPv6 dual stack, it can be simultaneously linked to each other with operation system such as interaction multimedia operation system under two kinds of network environments.The business that has realized operator is by the smooth transition of IPv4 network environment to the IPv6 network environment.
The embodiment 2 of user terminal of the present invention
Receiving element 10 among the embodiment 1 has obtained the IP protocol type that packet adopted by the judgement to the VLAN mark.Yet in some application of reality, if the right and wrong VLAN equipment that packet mails to, the VLAN switch then can not add the VLAN mark in packet.
In order to address this problem, present embodiment improves on the basis of embodiment 1, as shown in Figure 4, the receiving element 10 of user terminal 1 is except comprising first module 11, second module 12, beyond three module 13 and the four module 14, also further comprise: the 5th module 15, the six modules 16 and the 7th module 17.Its operation principle is as follows:
Be mounted with IPv4 protocol stack and IPv6 protocol stack in first module 11 in advance.When user terminal 1 received packet, second module 12 was searched the VLAN mark in the link layer packet header of the packet that receives; And 15 pairs of the 5th modules receive packet and carry out the link layer parsing, obtain the link layer data segment of this packet; The link layer data segment that 16 pairs the 5th modules of the 6th module obtain is unpacked, and obtains the IP layer packet header of described packet.If second module 12 is searched the failure of VLAN mark, when promptly not comprising the VLAN mark in this packet, the information that then will search failure sends to the 7th module 17; When second module 12 does not find the VLAN mark, the IP protocol type of the IP protocol version judgment data bag in the IP layer packet header that the 7th module 17 obtains according to the 6th module 16, and this IP protocol type sent to four module 14; Four module 14 calls the IPv4 protocol stack or the IPv6 protocol stack that are loaded in first module 11 above-mentioned packet is handled accordingly according to the IP protocol type that receives.
In addition, in order to realize network service, the 8th module 18 and the 9th module 19 can also be set in the user terminal 1.Wherein, the 8th module 18 is used to load general TCP/UDP agreement; The 9th module 19 is used for being loaded into by the Socket API Calls the described TCP/UDP agreement of the 8th module 18, to realize network service.As shown in table 1 is the IPv4/IPv6 dual stack structure of loading in the user terminal 1.
Table 1
The IPv4 application program |
The IPv6 application program |
Socket API |
General TCP/UDP |
The IPv4 agreement |
The IPv6 agreement |
Data link layer |
Physical layer |
By the described device of present embodiment, obtained the IP protocol type that packet adopted by detection to the IP protocol version in the IP layer packet header.Thereby when belonging to non-VLAN equipment, user terminal also realized making user terminal can support the purpose of IPv4/IPv6 dual stack.Therefore, enlarged the scope of application of user terminal.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.