[go: up one dir, main page]

CN101184038A - User terminal and its information receiving method and sending method - Google Patents

User terminal and its information receiving method and sending method Download PDF

Info

Publication number
CN101184038A
CN101184038A CNA2007101768422A CN200710176842A CN101184038A CN 101184038 A CN101184038 A CN 101184038A CN A2007101768422 A CNA2007101768422 A CN A2007101768422A CN 200710176842 A CN200710176842 A CN 200710176842A CN 101184038 A CN101184038 A CN 101184038A
Authority
CN
China
Prior art keywords
data packet
module
user terminal
protocol
ipv4
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
CNA2007101768422A
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.)
China United Network Communications Group Co Ltd
Original Assignee
CHINA NETWORK COMMUNICATIONS GROUP Corp
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 CHINA NETWORK COMMUNICATIONS GROUP Corp filed Critical CHINA NETWORK COMMUNICATIONS GROUP Corp
Priority to CNA2007101768422A priority Critical patent/CN101184038A/en
Publication of CN101184038A publication Critical patent/CN101184038A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及一种用户终端及其信息接收方法和发送方法。其中,接收方法包括:在数据包中查找VLAN标记;判断数据包的IP协议类型;调用IPv4协议栈或IPv6协议栈对数据包进行处理。发送方法包括:在该数据包中添加VLAN标记;由接入网设备根据VLAN标记将数据包发送给IPv4或IPv6业务网络。用户终端包括第一模块、第二模块、第三模块和第四模块。通过本发明,使用户终端能够支持IPv4/IPv6双协议栈,从而能够同时和两种网络环境下的业务系统如互动多媒体业务系统相连,使分别位于IPv4网络和IPv6网络的业务系统均能够为用户提供服务,有利于推动由IPv4网络环境向IPv6网络环境的顺利过渡。

Figure 200710176842

The invention relates to a user terminal and its information receiving method and sending method. Wherein, the receiving method includes: searching the VLAN tag in the data packet; judging the IP protocol type of the data packet; calling the IPv4 protocol stack or the IPv6 protocol stack to process the data packet. The sending method includes: adding a VLAN tag to the data packet; sending the data packet to the IPv4 or IPv6 service network by the access network device according to the VLAN tag. The user terminal includes a first module, a second module, a third module and a fourth module. Through the present invention, the user terminal can support the IPv4/IPv6 dual protocol stack, so that it can be connected to the service systems under the two network environments at the same time, such as the interactive multimedia service system, so that the service systems respectively located in the IPv4 network and the IPv6 network can serve the users The provision of services is conducive to promoting the smooth transition from the IPv4 network environment to the IPv6 network environment.

Figure 200710176842

Description

用户终端及其信息接收方法和发送方法 User terminal and its information receiving method and sending method

技术领域technical field

本发明涉及一种用户终端及其信息接收、发送方法,尤其涉及一种能够同时应用于IPv4和IPv6网络环境的用户终端及相应的信息接收、发送方法。The present invention relates to a user terminal and a method for receiving and sending information thereof, in particular to a user terminal and a corresponding method for receiving and sending information that can be applied to both IPv4 and IPv6 network environments.

背景技术Background technique

互动多媒体业务是一种能够使用户端和服务端进行媒体交互,包括视频、音频点播,文本浏览等在内的多媒体业务。现有的互动多媒体业务主要是基于IPv4协议的网络环境。其中,IPv4协议是IP协议的版本号为4的TCP/IP协议族。IPv4协议的地址位数为32位,也就是最多有2的32次方的电脑可以联到互联网上。然而,随着互联网的蓬勃发展,IP位址的需求量愈来愈大,IP地址资源也越发紧张。为了解决IP地址需求量不断上升的问题,出现了以IPv6协议为核心的网络环境。其中,IPv6协议是IP协议的版本号为6的TCP/IP协议族。它对地址空间进行了重新定义,通过采用128位的地址长度极大地增加了IP地址的容量,是下一代网络发展的必然趋势。The interactive multimedia service is a kind of multimedia service that enables the client and the server to perform media interaction, including video, audio on demand, and text browsing. The existing interactive multimedia services are mainly based on the network environment of the IPv4 protocol. Wherein, the IPv4 protocol is a TCP/IP protocol family whose version number is 4 of the IP protocol. The number of addresses in the IPv4 protocol is 32 bits, that is, computers with a maximum of 2 to the power of 32 can be connected to the Internet. However, with the vigorous development of the Internet, the demand for IP addresses is increasing, and the IP address resources are becoming more and more scarce. In order to solve the problem of increasing demand for IP addresses, a network environment with the IPv6 protocol as the core has emerged. Wherein, the IPv6 protocol is a TCP/IP protocol family whose version number is 6 of the IP protocol. It redefines the address space and greatly increases the capacity of the IP address by adopting a 128-bit address length, which is an inevitable trend in the development of the next-generation network.

现有技术的缺陷在于:由于IPv4网络向IPv6网络的过渡需要一个较长的时期,在这段时期内,基于IPv4网络的互动多媒体业务和基于IPv6网络的互动多媒体业务必然会同时存在。而现有的互动多媒体业务的用户终端设备都仅能支持单一一种IPv4或IPv6协议,因此不能同时实现基于IPv4协议和Pv6协议的互动多媒体业务。即,当现有的基于IPv4的互动多媒体业务向基于IPv6的互动多媒体业务过渡时,必须重新开发支持IPv6协议栈的用户终端设备,导致过渡所需的时间和成本大大增加,而且用户也不能再享受到原有基于IPv4的互动多媒体业务。从而限制了用户终端设备的使用范围,也阻碍了IPv4网络向IPv6网络过渡的进程。The defect of the prior art is that the transition from the IPv4 network to the IPv6 network requires a long period of time, and during this period, interactive multimedia services based on the IPv4 network and interactive multimedia services based on the IPv6 network will inevitably exist simultaneously. However, existing user terminal equipment for interactive multimedia services can only support a single IPv4 or IPv6 protocol, so interactive multimedia services based on the IPv4 protocol and the IPv6 protocol cannot be simultaneously implemented. That is, when the existing IPv4-based interactive multimedia services transition to IPv6-based interactive multimedia services, user terminal equipment supporting the IPv6 protocol stack must be redeveloped, resulting in a significant increase in time and cost for transition, and users can no longer Enjoy the original IPv4-based interactive multimedia services. Therefore, the scope of use of user terminal equipment is limited, and the process of transition from IPv4 network to IPv6 network is also hindered.

发明内容Contents of the invention

本发明要解决的问题是:提供一种能够同时连接IPv4协议和IPv6协议两种网络环境的用户终端技术。The problem to be solved by the present invention is to provide a user terminal technology capable of connecting to two network environments of the IPv4 protocol and the IPv6 protocol at the same time.

为了解决上述问题,本发明的一个实施例提供了一种用户终端的信息接收方法,包括:In order to solve the above problems, an embodiment of the present invention provides a method for receiving information of a user terminal, including:

当用户终端接收到数据包时,在该数据包的链路层包头中查找虚拟局域网标记;When the user terminal receives the data packet, it searches for the virtual local area network mark in the link layer header of the data packet;

根据查找到的所述虚拟局域网标记判断所述数据包的IP协议类型;Judging the IP protocol type of the data packet according to the found VLAN tag;

根据判断出的所述IP协议类型,调用预先装载于所述用户终端中的IPv4协议栈或IPv6协议栈对所述数据包进行处理。According to the determined IP protocol type, the IPv4 protocol stack or the IPv6 protocol stack preloaded in the user terminal is invoked to process the data packet.

为了解决上述问题,本发明的另一个实施例提供了一种用户终端的信息发送方法,包括:In order to solve the above problems, another embodiment of the present invention provides a user terminal information sending method, including:

用户终端根据要发送的数据包的IP协议类型,在该数据包的链路层包头中添加相应的虚拟局域网标记,并发送给接入网设备;According to the IP protocol type of the data packet to be sent, the user terminal adds a corresponding virtual local area network mark in the link layer header of the data packet, and sends it to the access network device;

所述接入网设备根据所述数据包的虚拟局域网标记,将所述数据包发送给IPv4业务网络或IPv6业务网络。The access network device sends the data packet to an IPv4 service network or an IPv6 service network according to the VLAN tag of the data packet.

为了解决上述问题,本发明的又一个实施例提供了一种用户终端,包括:In order to solve the above problems, another embodiment of the present invention provides a user terminal, including:

第一模块,用于装载IPv4协议栈和IPv6协议栈;The first module is used to load the IPv4 protocol stack and the IPv6 protocol stack;

第二模块,用于在接收到的数据包的链路层包头中查找虚拟局域网标记;The second module is used to search the virtual local area network mark in the link layer header of the received data packet;

第三模块,用于根据由第二模块查找到的虚拟局域网标记判断所述数据包的IP协议类型发送给第四模块;The third module is used to judge the IP protocol type of the data packet according to the virtual local area network mark found by the second module and send it to the fourth module;

第四模块,用于根据接收到的所述IP协议类型,调用装载于第一模块中的IPv4协议栈或IPv6协议栈对所述数据包进行处理。The fourth module is configured to call the IPv4 protocol stack or the IPv6 protocol stack loaded in the first module to process the data packet according to the received IP protocol type.

通过本发明,使用户终端能够支持IPv4/IPv6双协议栈,从而能够同时和两种网络环境下的业务系统如互动多媒体业务系统相连,使分别位于IPv4网络和IPv6网络的业务系统均能够为用户提供服务,有利于推动由IPv4网络环境向IPv6网络环境的顺利过渡。Through the present invention, the user terminal can support the IPv4/IPv6 dual protocol stack, so that it can be connected to the service systems in the two network environments at the same time, such as the interactive multimedia service system, so that the service systems respectively located in the IPv4 network and the IPv6 network can serve the users. The provision of services is conducive to promoting the smooth transition from the IPv4 network environment to the IPv6 network environment.

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

附图说明Description of drawings

图1为本发明所述用户终端的信息接收方法实施例的流程图;FIG. 1 is a flowchart of an embodiment of an information receiving method of a user terminal according to the present invention;

图1A为本发明所述用户终端的信息接收方法实施例所述的各个协议栈在用户终端中的结构示意图;FIG. 1A is a schematic structural diagram of each protocol stack in the user terminal described in the embodiment of the information receiving method of the user terminal according to the present invention;

图2为本发明所述用户终端的信息发送方法实施例的流程图;FIG. 2 is a flowchart of an embodiment of an information sending method of a user terminal according to the present invention;

图3为本发明所述用户终端实施例1的结构示意图;FIG. 3 is a schematic structural diagram of Embodiment 1 of the user terminal according to the present invention;

图4为本发明所述用户终端实施例2的结构示意图。FIG. 4 is a schematic structural diagram of Embodiment 2 of the user terminal of the present invention.

具体实施方式Detailed ways

本发明所述用户终端的信息接收方法实施例Embodiment of the information receiving method of the user terminal according to the present invention

本实施例提供了一种支持IPv4/IPv6双协议栈的用户终端的信息接收方法,如图1所示,包括:This embodiment provides a method for receiving information of a user terminal supporting IPv4/IPv6 dual protocol stack, as shown in FIG. 1 , including:

步骤100,当用户终端接收到数据包时,在该数据包的链路层包头中查找虚拟局域网标记(以下简称:VLAN标记)。若查找成功,则执行步骤110,否则执行步骤120。Step 100, when the user terminal receives a data packet, it searches for a virtual local area network tag (hereinafter referred to as: VLAN tag) in the link layer header of the data packet. If the search is successful, go to step 110, otherwise go to step 120.

其中,虚拟局域网(Virtual Local Area Network,以下简称:VLAN)是一种将局域网内的设备逻辑地而不是物理地划分成网段,从而实现虚拟工作组的一种网络技术。其主要的工作原理是:当VLAN交换机从工作站接收到数据包后,对数据包的部分内容进行检查,并与VLAN配置数据库中的内容进行比较,然后确定数据包去向。如果数据包要发往一个VLAN设备,则给这个数据包加上VLAN标记,具体地,可以依照现有的802.1Q协议添加VLAN标记,用以区分不同的局域网,再根据VLAN标记转发到相应的目的地;如果数据包发往非VLAN设备,则VLAN交换机发送不带VLAN标记的数据包。由于,VLAN通常是在数据链路层上实现网段的划分,因此,VLAN标记也通常出现在链路层包头中。Among them, a virtual local area network (Virtual Local Area Network, hereinafter referred to as: VLAN) is a network technology that divides devices in a local area network into network segments logically rather than physically, thereby realizing a virtual workgroup. Its main working principle is: when the VLAN switch receives a data packet from a workstation, it checks part of the data packet, compares it with the content in the VLAN configuration database, and then determines the destination of the data packet. If the data packet is to be sent to a VLAN device, a VLAN tag is added to the data packet. Specifically, a VLAN tag can be added according to the existing 802.1Q protocol to distinguish different LANs, and then forwarded to the corresponding VLAN tag according to the VLAN tag. Destination; if the packet is destined for a non-VLAN device, the VLAN switch sends the packet without the VLAN tag. Since the VLAN usually realizes the division of the network segment on the data link layer, therefore, the VLAN tag also usually appears in the packet header of the link layer.

步骤110,根据查找到的VLAN标记判断接收到的数据包的IP协议类型。其中,IP协议类型主要是指该数据包采用的是IPv4协议或IPv6协议。Step 110, judge the IP protocol type of the received data packet according to the found VLAN tag. Wherein, the IP protocol type mainly refers to whether the data packet adopts the IPv4 protocol or the IPv6 protocol.

具体地,可以首先根据查找到的VLAN标记判断发送该数据包的VLAN的IP协议类型,即判断该VLAN采用的是IPv4协议还是IPv6协议;然后再根据判断出的VLAN的IP协议类型判断得到该数据包的IP协议类型。这是因为,在一个VLAN中传输的数据包通常具有与该VLAN相同的IP协议类型。Specifically, the IP protocol type of the VLAN that sends the packet can be judged at first according to the VLAN tag found, that is, it is judged whether the VLAN adopts the IPv4 protocol or the IPv6 protocol; The IP protocol type of the packet. This is because data packets transmitted in a VLAN usually have the same IP protocol type as the VLAN.

另外,在对数据包的协议类型进行判断之前,若目标地址是用域名表示的域名地址,则可以先通过域名系统(简称:DNS)服务器得到相应的IPv4或IPv6地址,然后再进行判断。In addition, before judging the protocol type of the data packet, if the target address is a domain name address represented by a domain name, the corresponding IPv4 or IPv6 address can be obtained through a domain name system (DNS for short) server, and then judged.

步骤120,如果在数据包的链路层包头中并不包含VLAN标记,则对接收到的数据包进行链路层解析,得到数据包的链路层数据段。Step 120, if the link layer header of the data packet does not contain the VLAN tag, perform link layer analysis on the received data packet to obtain the link layer data segment of the data packet.

其中,根据现有的互联网通信协议技术,数据包在进行链路层解析之前包括链路层包头和链路层数据段。链路层数据段中包括IP层包头和IP层数据段。Wherein, according to the existing Internet communication protocol technology, the data packet includes a link layer header and a link layer data segment before the link layer analysis is performed. The link layer data segment includes an IP layer header and an IP layer data segment.

步骤121,对上述得到的链路层数据段进行拆包,得到数据包的IP层包头。Step 121, unpack the link layer data segment obtained above to obtain the IP layer header of the data packet.

步骤122,根据数据包的IP层包头中的IP协议版本号判断该数据包的IP协议类型。其中,IP协议版本号是IP层包头中的一个字段,表明该数据包采用的是IPv4协议或是IPv6协议。Step 122, judge the IP protocol type of the data packet according to the IP protocol version number in the IP layer header of the data packet. Wherein, the IP protocol version number is a field in the IP layer header, indicating that the data packet adopts the IPv4 protocol or the IPv6 protocol.

步骤130,根据判断出的IP协议类型,调用预先装载于用户终端中的IPV4协议栈或IPv6协议栈对数据包进行处理。Step 130, according to the determined IP protocol type, call the IPV4 protocol stack or IPv6 protocol stack preloaded in the user terminal to process the data packet.

具体地,可以通过套接字应用程序接口(Socket Application ProgramInterface,简称:Socket API)调用预先装载于用户终端中的通用的TCP/UDP协议用于实现网络通信。另外,还可以通过栈管理器调用如动态主机配置协议(简称:DHCP)v4/v6、Internet组管理协议v2/多点传输听众发现协议v6(简称:IGMPv2/MLDv6)、实时流协议(简称:RTSP)v4/v6、网络时间协议(简称:NTP)v4/v6等协议栈以实现IP服务。其中,通过API的调用,可以为IPv4和IPv6下共存的互动多媒体业务提供终端设备支持。上述各个协议栈在用户终端的结构如图1A所示。Specifically, the general TCP/UDP protocol preloaded in the user terminal may be invoked through a socket application program interface (Socket Application Program Interface, Socket API for short) to realize network communication. In addition, dynamic host configuration protocol (abbreviation: DHCP) v4/v6, Internet Group Management Protocol v2/Multicast Listener Discovery Protocol v6 (abbreviation: IGMPv2/MLDv6), real-time streaming protocol (abbreviation: RTSP) v4/v6, Network Time Protocol (abbreviation: NTP) v4/v6 and other protocol stacks to realize IP services. Among them, by calling the API, terminal equipment support can be provided for interactive multimedia services coexisting under IPv4 and IPv6. The structure of the above-mentioned protocol stacks in the user terminal is shown in FIG. 1A .

通过本实施例所述方法,使用户终端能够支持IPv4/IPv6双协议栈,从而能够同时和两种网络环境下的业务系统如互动多媒体业务系统相连。业务系统分别位于IPv4网络和IPv6网络,同时为用户提供服务,当用户使用IPv4或IPv6业务时,用户终端设备能够自动调用IPv4或IPv6协议栈,实现相关功能。另外,本实施例还可以应用于作为运营商提供IPv4和IPv6业务的用户终端设备,以实现其业务,如互动多媒体业务。从而有利于由IPv4网络环境向IPv6网络环境的顺利过渡。Through the method described in this embodiment, the user terminal can support the IPv4/IPv6 dual protocol stack, so that it can be connected to service systems in two network environments, such as an interactive multimedia service system, at the same time. The service systems are respectively located in the IPv4 network and the IPv6 network, and provide services for users at the same time. When users use IPv4 or IPv6 services, the user terminal equipment can automatically call the IPv4 or IPv6 protocol stack to realize related functions. In addition, this embodiment can also be applied to user terminal equipment that provides IPv4 and IPv6 services as an operator, so as to realize its services, such as interactive multimedia services. This is conducive to the smooth transition from the IPv4 network environment to the IPv6 network environment.

本发明所述用户终端的信息发送方法实施例Embodiment of the information sending method of the user terminal according to the present invention

本实施例提供了一种支持IPv4/IPv6双协议栈的用户终端的信息发送方法,如图2所示,包括:This embodiment provides a method for sending information of a user terminal supporting IPv4/IPv6 dual protocol stack, as shown in FIG. 2 , including:

步骤201,用户终端根据要发送的数据包的IP协议类型,在该数据包的链路层包头中添加相应的VLAN标记,并发送给接入网设备。具体地,发送给接入网设备中的接入网入口设备。其中,用户终端可以为机顶盒。Step 201, the user terminal adds a corresponding VLAN tag to the link layer header of the data packet according to the IP protocol type of the data packet to be sent, and sends it to the access network device. Specifically, it is sent to the access network entry device in the access network device. Wherein, the user terminal may be a set-top box.

步骤202,接入网设备中的接入网入口设备将数据包中的VLAN标记映射为相应的永久虚拟电路(Permanent Virtual Circuit,简称:PVC)。其中,接入网入口设备可以为非对称数字用户环路调制解调器(简称:ADSLMODEM)等设备。Step 202, the access network ingress device in the access network device maps the VLAN tag in the data packet to a corresponding permanent virtual circuit (Permanent Virtual Circuit, PVC for short). Wherein, the access network entrance device may be an asymmetric digital subscriber loop modem (abbreviation: ADSL MODEM) and other devices.

步骤203,接入网设备中的接入网出口设备根据映射后的永久虚拟电路,将上述数据包发送给IPv4业务网络或IPv6业务网络。其中,接入网出口设备可以为数字用户线路接入复用器(简称:DSLAM)等设备。Step 203, the access network egress device among the access network devices sends the above data packet to the IPv4 service network or the IPv6 service network according to the mapped permanent virtual circuit. Wherein, the egress device of the access network may be a device such as a digital subscriber line access multiplexer (DSLAM for short).

通过本实施例所述方法,用户终端可以向支持IPv4协议栈的网络环境及支持IPv6协议栈的网络环境发送数据信息,从而实现信息互联,有利于由IPv4网络环境向IPv6网络环境的顺利过渡。Through the method described in this embodiment, the user terminal can send data information to the network environment supporting the IPv4 protocol stack and the network environment supporting the IPv6 protocol stack, thereby realizing information interconnection, which is conducive to the smooth transition from the IPv4 network environment to the IPv6 network environment.

本发明所述用户终端的实施例1Embodiment 1 of the user terminal of the present invention

本实施例提供了一种用户终端,如图3所示,该用户终端1包括接收单元10和发送单元20。This embodiment provides a user terminal. As shown in FIG. 3 , the user terminal 1 includes a receiving unit 10 and a sending unit 20 .

其中,发送单元20用于根据要发送的数据包的IP协议类型,在该数据包的链路层包头中添加相应的虚拟局域网标记,并发送给接入网设备。再由接入网设备根据接收到的数据包中的虚拟局域网标记,将该数据包发送给IPv4业务网络或IPv6业务网络。其中的接入网设备可以包括接入网入口设备和接入网出口设备。接入网设备对数据包的具体处理过程可参见本发明所述用户终端的信息发送方法实施例,此处不再赘述。Wherein, the sending unit 20 is configured to add a corresponding virtual local area network mark in the link layer header of the data packet according to the IP protocol type of the data packet to be sent, and send it to the access network device. Then, the access network device sends the data packet to the IPv4 service network or the IPv6 service network according to the virtual local area network mark in the received data packet. The access network devices may include access network ingress devices and access network egress devices. For the specific processing process of the data packet by the access network device, reference may be made to the embodiment of the information sending method of the user terminal in the present invention, which will not be repeated here.

接收单元10包括第一模块11,第二模块12,第三模块13及第四模块14,其工作原理如下:The receiving unit 10 includes a first module 11, a second module 12, a third module 13 and a fourth module 14, and its working principle is as follows:

第一模块11中预先装载有IPv4协议栈和IPv6协议栈。当用户终端1接收到数据包时,第二模块12在接收到的数据包的链路层包头中查找VLAN标记;第三模块13根据由第二模块12查找到的VLAN标记判断接收到的数据包的IP协议类型,即判断该数据包采用的是IPv4协议还是IPv6协议,并将该IP协议类型发送给第四模块14;第四模块14根据接收到的IP协议类型,调用装载于第一模块11中的IPv4协议栈或IPv6协议栈对上述数据包进行相应的处理。The first module 11 is pre-loaded with an IPv4 protocol stack and an IPv6 protocol stack. When the user terminal 1 received the data packet, the second module 12 searched for the VLAN tag in the link layer header of the received data packet; the third module 13 judged the received data according to the VLAN tag found by the second module 12 The IP protocol type of the packet, that is to judge whether the data packet adopts the IPv4 protocol or the IPv6 protocol, and send the IP protocol type to the fourth module 14; the fourth module 14 calls the IP protocol type loaded in the first module according to the received IP protocol type The IPv4 protocol stack or IPv6 protocol stack in module 11 performs corresponding processing on the above data packets.

通过本实施例所述装置,通过对VLAN标记的判断获得了数据包所采用的IP协议类型,进而使用户终端能够支持IPv4/IPv6双协议栈,使其能够同时和两种网络环境下的业务系统如互动多媒体业务系统相连。实现了运营商的业务由IPv4网络环境向IPv6网络环境的顺利过渡。Through the device described in this embodiment, the IP protocol type adopted by the data packet is obtained by judging the VLAN tag, so that the user terminal can support the IPv4/IPv6 dual protocol stack, so that it can simultaneously communicate with the services under the two network environments Systems such as interactive multimedia service systems are connected. It realizes the smooth transition of the operator's business from the IPv4 network environment to the IPv6 network environment.

本发明所述用户终端的实施例2Embodiment 2 of the user terminal of the present invention

实施例1中的接收单元10通过对VLAN标记的判断获得了数据包所采用的IP协议类型。然而在实际的某些应用中,如果数据包发往的是非VLAN设备,则VLAN交换机则不会在数据包中添加VLAN标记。The receiving unit 10 in Embodiment 1 obtains the IP protocol type adopted by the data packet by judging the VLAN tag. However, in some actual applications, if the data packet is sent to a non-VLAN device, the VLAN switch will not add a VLAN tag to the data packet.

为了解决这一问题,本实施例在实施例1的基础上进行了改进,如图4所示,用户终端1的接收单元10除了包括第一模块11,第二模块12,第三模块13及第四模块14以外,还进一步包括:第五模块15,第六模块16和第七模块17。其工作原理如下:In order to solve this problem, this embodiment has been improved on the basis of Embodiment 1. As shown in FIG. In addition to the fourth module 14 , it further includes: a fifth module 15 , a sixth module 16 and a seventh module 17 . It works as follows:

第一模块11中预先装载有IPv4协议栈和IPv6协议栈。当用户终端1接收到数据包时,第二模块12在接收到的数据包的链路层包头中查找VLAN标记;并且,第五模块15对接收到数据包进行链路层解析,得到该数据包的链路层数据段;第六模块16对第五模块得到的链路层数据段进行拆包,得到所述数据包的IP层包头。如果第二模块12查找VLAN标记失败,即该数据包中并不包含VLAN标记时,则将查找失败的信息发送给第七模块17;当第二模块12未找到VLAN标记时,第七模块17根据第六模块16得到的IP层包头中的IP协议版本号判断数据包的IP协议类型,并将该IP协议类型发送给第四模块14;第四模块14根据接收到的IP协议类型,调用装载于第一模块11中的IPv4协议栈或IPv6协议栈对上述数据包进行相应的处理。The first module 11 is pre-loaded with an IPv4 protocol stack and an IPv6 protocol stack. When the user terminal 1 receives the data packet, the second module 12 searches for the VLAN tag in the link layer header of the received data packet; and, the fifth module 15 performs link layer analysis on the received data packet to obtain the data The link layer data segment of the packet; the sixth module 16 unpacks the link layer data segment obtained by the fifth module to obtain the IP layer header of the data packet. If the second module 12 fails to find the VLAN tag, that is, when the packet does not contain the VLAN tag, the information of the search failure is sent to the seventh module 17; when the second module 12 does not find the VLAN tag, the seventh module 17 According to the IP protocol version number in the IP layer header obtained by the sixth module 16, the IP protocol type of the data packet is judged, and the IP protocol type is sent to the fourth module 14; the fourth module 14 calls according to the received IP protocol type The IPv4 protocol stack or IPv6 protocol stack loaded in the first module 11 performs corresponding processing on the above data packets.

另外,为了实现网络通信,用户终端1中还可以设置第八模块18和第九模块19。其中,第八模块18用于装载通用的TCP/UDP协议;第九模块19,用于通过Socket API调用装载于第八模块18中的所述TCP/UDP协议,以实现网络通信。如表1所示为用户终端1中装载的IPv4/IPv6双协议栈结构。In addition, in order to realize network communication, an eighth module 18 and a ninth module 19 may also be set in the user terminal 1 . Wherein, the eighth module 18 is used to load the general TCP/UDP protocol; the ninth module 19 is used to call the TCP/UDP protocol loaded in the eighth module 18 through Socket API to realize network communication. Table 1 shows the IPv4/IPv6 dual protocol stack structure loaded in the user terminal 1 .

表1Table 1

    IPv4应用程序IPv4 applications     IPv6应用程序IPv6 applications     Socket  APISocket API     通用的TCP/UDPGeneral TCP/UDP     IPv4协议  IPv4 protocol     IPv6协议  IPv6 protocol     数据链路层 data link layer     物理层Physical layer

通过本实施例所述装置,通过对IP层包头中的IP协议版本号的检测获得了数据包所采用的IP协议类型。从而在用户终端属于非VLAN设备时也实现了使用户终端能够支持IPv4/IPv6双协议栈的目的。因此,扩大了用户终端的适用范围。With the device described in this embodiment, the IP protocol type adopted by the data packet is obtained by detecting the IP protocol version number in the IP layer header. Therefore, when the user terminal is a non-VLAN device, the purpose of enabling the user terminal to support the IPv4/IPv6 dual protocol stack is also achieved. Therefore, the scope of application of the user terminal is expanded.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

1.一种用户终端的信息接收方法,其特征在于包括:1. An information receiving method of a user terminal, characterized in that it comprises: 当用户终端接收到数据包时,在该数据包的链路层包头中查找虚拟局域网标记;When the user terminal receives the data packet, it searches for the virtual local area network mark in the link layer header of the data packet; 根据查找到的所述虚拟局域网标记判断所述数据包的IP协议类型;Judging the IP protocol type of the data packet according to the found VLAN tag; 根据判断出的所述IP协议类型,调用预先装载于所述用户终端中的IPv4协议栈或IPv6协议栈对所述数据包进行处理。According to the determined IP protocol type, the IPv4 protocol stack or the IPv6 protocol stack preloaded in the user terminal is invoked to process the data packet. 2.根据权利要求1所述的用户终端的信息接收方法,其特征在于所述在链路层包头中查找虚拟局域网标记还包括:2. The information receiving method of the user terminal according to claim 1, wherein said searching the virtual local area network mark in the link layer header also includes: 当未找到所述虚拟局域网标记时,根据所述数据包的IP层包头中的IP协议版本号判断所述数据包的IP协议类型。When the virtual local area network mark is not found, judge the IP protocol type of the data packet according to the IP protocol version number in the IP layer header of the data packet. 3.根据权利要求2所述的用户终端的信息接收方法,其特征在于根据所述IP协议版本号判断所述数据包的IP协议类型之前还包括:3. the information receiving method of user terminal according to claim 2, is characterized in that before judging the IP protocol type of described data packet according to described IP protocol version number, also comprises: 对接收到的所述数据包进行链路层解析,得到所述数据包的链路层数据段;Perform link layer analysis on the received data packet to obtain the link layer data segment of the data packet; 对所述链路层数据段进行拆包,得到所述数据包的IP层包头。Unpacking the link layer data segment to obtain the IP layer header of the data packet. 4.根据权利要求1所述的用户终端的信息接收方法,其特征在于调用所述IPv4协议栈或IPv6协议栈对所述数据包进行处理包括:4. The information receiving method of the user terminal according to claim 1, wherein calling the IPv4 protocol stack or the IPv6 protocol stack to process the data packet comprises: 通过套接字应用程序接口调用预先装载于所述用户终端中的通用的TCP/UDP协议用于实现网络通信。The general TCP/UDP protocol preloaded in the user terminal is invoked through the socket API to implement network communication. 5.根据权利要求1所述的用户终端的信息接收方法,其特征在于在所述数据包的链路层包头中查找虚拟局域网标记之前还包括:5. The information receiving method of the user terminal according to claim 1, characterized in that before searching the virtual local area network mark in the link layer header of the data packet, it also includes: 如果接收到的所述数据包的目标地址为域名地址,则通过域名系统服务器将该域名地址转换为相应的IPv4或IPv6地址。If the destination address of the received data packet is a domain name address, the domain name address is converted into a corresponding IPv4 or IPv6 address by the domain name system server. 6.一种用户终端的信息发送方法,其特征在于包括:6. A method for sending information of a user terminal, characterized in that it comprises: 用户终端根据要发送的数据包的IP协议类型,在该数据包的链路层包头中添加相应的虚拟局域网标记,并发送给接入网设备;According to the IP protocol type of the data packet to be sent, the user terminal adds a corresponding virtual local area network mark in the link layer header of the data packet, and sends it to the access network device; 所述接入网设备根据所述数据包的虚拟局域网标记,将所述数据包发送给IPv4业务网络或IPv6业务网络。The access network device sends the data packet to an IPv4 service network or an IPv6 service network according to the VLAN tag of the data packet. 7.根据权利要求6所述的用户终端的信息发送方法,其特征在于所述接入网设备将所述数据包发送给IPv4业务网络或IPv6业务网络包括:7. The information sending method of the user terminal according to claim 6, wherein the sending of the data packet by the access network device to the IPv4 service network or the IPv6 service network comprises: 所述接入网设备中的接入网入口设备将所述数据包中的虚拟局域网标记映射为相应的永久虚拟电路;The access network ingress device in the access network device maps the virtual local area network label in the data packet to a corresponding permanent virtual circuit; 所述接入网设备中的接入网出口设备根据所述永久虚拟电路,将所述数据包发送给IPv4业务网络或IPv6业务网络。The access network egress device among the access network devices sends the data packet to an IPv4 service network or an IPv6 service network according to the permanent virtual circuit. 8.一种用户终端,其特征在于包括:8. A user terminal, characterized in that it comprises: 发送单元,用于根据要发送的数据包的IP协议类型,在该数据包的链路层包头中添加相应的虚拟局域网标记,并发送给接入网设备;The sending unit is used to add a corresponding virtual local area network mark in the link layer header of the data packet according to the IP protocol type of the data packet to be sent, and send it to the access network device; 接收单元,包括:Receiver unit, including: 第一模块,用于装载IPv4协议栈和IPv6协议栈;The first module is used to load the IPv4 protocol stack and the IPv6 protocol stack; 第二模块,用于在接收到的数据包的链路层包头中查找虚拟局域网标记;The second module is used to search the virtual local area network mark in the link layer header of the received data packet; 第三模块,用于根据由第二模块查找到的虚拟局域网标记判断所述数据包的IP协议类型,并发送给第四模块;The third module is used to judge the IP protocol type of the data packet according to the virtual local area network mark found by the second module, and send it to the fourth module; 第四模块,用于根据接收到的所述IP协议类型,调用装载于第一模块中的IPv4协议栈或IPv6协议栈对所述数据包进行处理。The fourth module is configured to call the IPv4 protocol stack or the IPv6 protocol stack loaded in the first module to process the data packet according to the received IP protocol type. 9.根据权利要求8所述的用户终端,其特征在于所述接收单元还包括:9. The user terminal according to claim 8, wherein the receiving unit further comprises: 第五模块,用于对接收到的所述数据包进行链路层解析,得到所述数据包的链路层数据段;The fifth module is used to perform link layer analysis on the received data packet to obtain the link layer data segment of the data packet; 第六模块,用于对第五模块得到的链路层数据段进行拆包,得到所述数据包的IP层包头。The sixth module is configured to unpack the link layer data segment obtained by the fifth module to obtain the IP layer header of the data packet. 第七模块,用于当第二模块未找到所述虚拟局域网标记时,根据第六模块得到的所述IP层包头中的IP协议版本号判断所述数据包的IP协议类型,并发送给第四模块。The seventh module is used to judge the IP protocol type of the data packet according to the IP protocol version number in the IP layer packet header obtained by the sixth module when the second module does not find the virtual local area network mark, and send it to the second module Four modules. 10.根据权利要求8或9所述的用户终端,其特征在于所述接收单元还包括:10. The user terminal according to claim 8 or 9, wherein the receiving unit further comprises: 第八模块,用于装载通用的TCP/UDP协议;The eighth module is used to load the general TCP/UDP protocol; 第九模块,用于通过套接字应用程序接口调用装载于第八模块中的所述TCP/UDP协议,以实现网络通信。The ninth module is used to call the TCP/UDP protocol loaded in the eighth module through the socket API to realize network communication.
CNA2007101768422A 2007-11-05 2007-11-05 User terminal and its information receiving method and sending method Pending CN101184038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101768422A CN101184038A (en) 2007-11-05 2007-11-05 User terminal and its information receiving method and sending method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101768422A CN101184038A (en) 2007-11-05 2007-11-05 User terminal and its information receiving method and sending method

Publications (1)

Publication Number Publication Date
CN101184038A true CN101184038A (en) 2008-05-21

Family

ID=39449127

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101768422A Pending CN101184038A (en) 2007-11-05 2007-11-05 User terminal and its information receiving method and sending method

Country Status (1)

Country Link
CN (1) CN101184038A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594196A (en) * 2008-05-26 2009-12-02 新奥特(北京)视频技术有限公司 A kind of method for packing of network transmission programming
CN102377671A (en) * 2011-11-02 2012-03-14 中国联合网络通信集团有限公司 Load balancing method and system and broadband remote access server equipment
CN102497385A (en) * 2011-12-31 2012-06-13 曙光信息产业股份有限公司 Network traffic auditing method and auditing system
CN102625283A (en) * 2012-03-21 2012-08-01 中兴通讯股份有限公司 Dial-up connection method and system and mobile terminal
CN103150340A (en) * 2013-02-05 2013-06-12 上海达梦数据库有限公司 Fast loading system and method for multimedia data
CN103248574A (en) * 2013-05-07 2013-08-14 汉柏科技有限公司 IPv4 network and IPv6 network mixing method and system
CN106487579A (en) * 2015-08-31 2017-03-08 西门子公司 For providing method and the webserver part of access equipment configuration data
CN107172009A (en) * 2017-04-06 2017-09-15 烽火通信科技股份有限公司 By sending vlan information on socket to the method for application module
CN109117182A (en) * 2018-08-29 2019-01-01 下代互联网重大应用技术(北京)工程研究中心有限公司 Detection method, equipment, system and the medium of IPv6 degree are supported based on source code
CN114945047A (en) * 2022-04-08 2022-08-26 北京智象信息技术有限公司 Intelligent terminal APP Internet protocol selection method, system, equipment and medium

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594196A (en) * 2008-05-26 2009-12-02 新奥特(北京)视频技术有限公司 A kind of method for packing of network transmission programming
CN102377671A (en) * 2011-11-02 2012-03-14 中国联合网络通信集团有限公司 Load balancing method and system and broadband remote access server equipment
CN102377671B (en) * 2011-11-02 2014-10-29 中国联合网络通信集团有限公司 Load balancing method and system and broadband remote access server equipment
CN102497385A (en) * 2011-12-31 2012-06-13 曙光信息产业股份有限公司 Network traffic auditing method and auditing system
CN102497385B (en) * 2011-12-31 2015-09-16 曙光信息产业股份有限公司 A kind of network traffics auditing method and auditing system
CN102625283B (en) * 2012-03-21 2015-08-12 中兴通讯股份有限公司 A kind of dial-up connection method, system and mobile terminal
CN102625283A (en) * 2012-03-21 2012-08-01 中兴通讯股份有限公司 Dial-up connection method and system and mobile terminal
CN103150340A (en) * 2013-02-05 2013-06-12 上海达梦数据库有限公司 Fast loading system and method for multimedia data
CN103150340B (en) * 2013-02-05 2016-06-22 上海达梦数据库有限公司 The quick-loading system of multi-medium data and method
CN103248574A (en) * 2013-05-07 2013-08-14 汉柏科技有限公司 IPv4 network and IPv6 network mixing method and system
CN103248574B (en) * 2013-05-07 2016-08-31 汉柏科技有限公司 A kind of IPv4 network and the mixing network method of IPv6 network and system
CN106487579A (en) * 2015-08-31 2017-03-08 西门子公司 For providing method and the webserver part of access equipment configuration data
CN106487579B (en) * 2015-08-31 2019-10-15 西门子公司 Method and web server component for providing access to device configuration data
CN107172009A (en) * 2017-04-06 2017-09-15 烽火通信科技股份有限公司 By sending vlan information on socket to the method for application module
CN107172009B (en) * 2017-04-06 2020-01-07 烽火通信科技股份有限公司 Method for uploading VLAN information to application module through socket
CN109117182A (en) * 2018-08-29 2019-01-01 下代互联网重大应用技术(北京)工程研究中心有限公司 Detection method, equipment, system and the medium of IPv6 degree are supported based on source code
CN114945047A (en) * 2022-04-08 2022-08-26 北京智象信息技术有限公司 Intelligent terminal APP Internet protocol selection method, system, equipment and medium
CN114945047B (en) * 2022-04-08 2023-09-26 北京智象信息技术有限公司 Intelligent terminal APP Internet protocol selection method, system, equipment and medium

Similar Documents

Publication Publication Date Title
CN101184038A (en) User terminal and its information receiving method and sending method
US9787503B2 (en) Utilizing proxy internet protocol addressing in a gateway for communicating with multiple service provider networks
US8989196B2 (en) Method and apparatus for providing host node awareness for multiple NAT64 environments
US8509243B2 (en) Method and device for sending a packet based on tunneling protocol used in layer 2
CN101409685B (en) Forwarding method and access device based on virtual local area network mapping
JP5368459B2 (en) Support for triple operation services in user equipment
CN113794609B (en) Home gateway and service forwarding method thereof
US20090106394A1 (en) Method of establishing a tunnel between network terminal devices passing through firewall
EP2557817A1 (en) Method and system for transmitting wireless multicast data
WO2013040942A1 (en) Data centre system and apparatus, and method for providing service
US7978694B2 (en) Method for transmitting layer 2 packet and access device thereof
CN101488904A (en) Method for GRE tunnel crossing network address translation apparatus and network address translation apparatus
CN107317752B (en) Method and device for forwarding data message
CN102025792A (en) Router and IP address setting method thereof
CN102710485B (en) Transparent proxy method and proxy server
CN106059994A (en) Data transmission method and network equipment
CN104168338A (en) Network address conversion device and network address conversion method
US20030142672A1 (en) Data packet transmission method and network switch applying same thereto
US11902158B2 (en) System and method for forwarding packets in a hierarchical network architecture using variable length addresses
US7564850B2 (en) Method for transmitting layer 2 packet and access device thereof
JP7348403B2 (en) Method for sending reply packets, method for sending route advertisement messages, network device, and computer program
WO2009076906A1 (en) Method, device and system for a terminal to realize the access to the retail service provider
WO2009039785A1 (en) Method and device for establishing multicasting transmission paths and implementing multicasting transmission
EP2073506A1 (en) Method for resolving a logical user address in an aggregation network
CN102413196A (en) Network address assignment and management method and system thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: CHINA LINKED NETWORK COMMUNICATION GROUP CO.,LTD.

Free format text: FORMER OWNER: CHINA NETWORK COMMUNICATIONS GROUP CORPORATION

Effective date: 20090522

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20090522

Address after: Number 21, Finance Street, Beijing, Xicheng District: 100140

Applicant after: China United Network Telecommunication Group Co., Ltd.

Address before: Number 21, Finance Street, Beijing, Xicheng District: 100032

Applicant before: China Network Communications Group Corporation

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20080521