WO2012088934A1 - 一种报文过滤方法和交换设备 - Google Patents

一种报文过滤方法和交换设备 Download PDF

Info

Publication number
WO2012088934A1
WO2012088934A1 PCT/CN2011/080133 CN2011080133W WO2012088934A1 WO 2012088934 A1 WO2012088934 A1 WO 2012088934A1 CN 2011080133 W CN2011080133 W CN 2011080133W WO 2012088934 A1 WO2012088934 A1 WO 2012088934A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
temporary
address
acl policy
switching device
Prior art date
Application number
PCT/CN2011/080133
Other languages
English (en)
French (fr)
Inventor
刘书岩
丁崇
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012088934A1 publication Critical patent/WO2012088934A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/101Access control lists [ACL]

Definitions

  • IPv6 source protection is a port traffic filtering technology based on IPv6 address and Media Access Control (MAC) address. It can prevent IPv6 address spoofing attacks in the LAN.
  • IPv6 source address binding table inside the switch as the detection standard for the packets received by each port. In only two cases, the switch forwards the data—or the received IPv6 packet satisfies the PORT (port)/IPv6/MAC correspondence in the IPv6 source address binding table, or receives the DHCPv6 packet. The remaining packets will be discarded by the switch.
  • DHCPv6 SNOOPING Dynamic Host Configuration Protocol version 6 Snooping
  • IP Internet Protocol
  • ACL Access Control Lists
  • DHCPv6 SNOOPING is a DHCPv6-based feature.
  • the general solution flow of the IPv6 Source Guard includes three components, a user 102, a switching device 104, and a server 106.
  • the above three components perform the following steps S102.
  • S102 the DHCPv6 SNOOPING function is enabled on the switching device, and the IPv6 source Guard function is enabled on the switching device port of the user.
  • the IPv6 source Guard function is enabled, the ACL policy is downloaded.
  • Step S104 The switching device receives a Solicit message (request message) sent by the DHCPv6 user to the server, and the message is processed by the DHCPv6 SNOOPING module in the device, and then forwarded to the server.
  • Step S106 After receiving the packet, the server encapsulates the response packet Advertise (notification packet), and needs to fill the Layer 2 header when encapsulating the packet. The server first searches for the user's Layer 2 header address in its own cache. If not found, send a neighbor request NS (Neighbor Solicitation) message to the user.
  • Step S108 After receiving the NS message, the user sends an NA (Neighbor Advertisement) message to notify the server of its own Layer 2 address.
  • step S110 the server updates the buffer information according to the NA message, and fills the Layer 2 header of the message Advertise, and then sends it to the switching device, and the DHCPv6 SNOOPING processing on the device forwards the packet to the user.
  • step S112 After processing the Advertise message, the user sends a Request message (Request message) to the server to request an address.
  • Step S114 the server replies to Reply (response message) to confirm the allocation of the address; after the interaction is completed, DHCPv6
  • the SNOOPING module will generate a binding table and forward the ACL policy to the user. It can be seen that when the IPv6 source Guard is enabled, an ACL policy is adopted. In the process of normal DHCPv6 message exchange, the NA message of the response packet expected by the DHCPv6 server can pass. As can be seen from the steps in Figure 1, each port occupies an ACL policy and the user can access the local network without obtaining an IP address through the DHCPv6 server. In the scenario of enabling IPv6 Source Guard, when the user and the server interact to step S106-step S110 and the server does not have the second-level address of the user searched in the cache, the NS is sent to the user to query the second-level address.
  • the ACL policy is generally adopted when the Ipv6 Source Guard is enabled. There are roughly three ways. The first one is to enable Ipv6 Source Guard, the next ACL policy, as long as the IPv6 source address is the beginning of FE80, let it pass (Note: the address starting with FE80 is the link address); The second method is The ACL is not customized.
  • the length of the packets that can be matched by the non-custom mode is limited. Therefore, the next one is to pass the ICMPv6 packet.
  • the third one is to use the customized ACL mode. Long position, the next message for NS and NA to pass. All three methods have defects: In the first method, user protocol packets and data packets using the local link address as the source address can still access the local network, and do not play a filtering role; The data packet whose source address is the link-local address is filtered, but the ping packet can also pass.
  • the third method only allows NS and NA to pass, but uses A valuable custom ACL resource, and the number of ACL resources in the custom mode is very limited compared to the non-custom mode.
  • the present invention provides a packet filtering method and a switching device, which are related to the problem of wasting ACL resources generated when filtering packets in the related art.
  • a packet filtering method including the following steps: The switching device generates a temporary access control list ACL policy according to the request packet sent by the user; the switching device forwards the neighbor request NS packet sent by the server to the user. The switching device determines whether the neighboring NA message sent by the user in response to the neighbor requesting the NS message matches the temporary ACL policy. If the matching, the switching device forwards the packet between the user and the server, and deletes the temporary ACL policy.
  • the step of generating a temporary ACL policy by the switching device according to the request packet sent by the user includes: obtaining the source layer 2 address and the source layer 3 address of the user from the request packet; and obtaining the source layer 2 address and the source layer 3 according to the obtained source layer The address generates a temporary ACL policy.
  • the step of generating a temporary ACL policy according to the obtained source Layer 2 address and the source Layer 3 address includes: acquiring a source Layer 2 MAC address and a source Layer 3 IPv6 address, and combining the MAC address and the IPv6 address into Temporary ACL policy.
  • the step of determining, by the switching device, whether the NA packet matches the temporary ACL policy includes: determining whether the MAC address and the IPv6 address in the NA packet are the same as the MAC address and the IPv6 address in the temporary ACL policy, and if they are the same, determining The NA packet matches the temporary ACL policy. Otherwise, the NA packet does not match the temporary ACL policy.
  • the packet filtering method when the switching device generates a temporary ACL policy according to the request packet sent by the user, the packet filtering method further includes: updating the currently used ACL policy to a temporary ACL policy, and enabling the temporary ACL policy timer.
  • the step of deleting the temporary ACL policy includes: deleting the temporary ACL policy if the temporary ACL policy timer expires.
  • the packet filtering method further includes: the switching device generates a user data binding table, where the user data binding table is used after the user obtains the IPv6 address, Allow users to access the server.
  • a switching device including: a generating unit, configured to generate a temporary ACL policy according to a request packet sent by a user; and a forwarding unit configured to forward the NS packet sent by the server to the user;
  • the unit is configured to determine whether the NA message sent by the user in response to the NS message matches the temporary ACL policy, and the processing unit is configured to determine, in the determining unit, the NA message and the temporary ACL policy sent by the user in response to the NS message.
  • the packet between the user and the server is forwarded, and the temporary ACL policy is deleted.
  • the generating unit includes: an obtaining module, configured to obtain a source layer address and a source layer address of the user from the request packet; and a generating module configured to generate a temporary according to the obtained source layer 2 address and source layer 3 address ACL policy.
  • the obtaining module includes: an obtaining submodule, configured to obtain a source layer MAC address of the user and a source layer 3 IPv6 address; the generating module includes: generating a submodule, configured to combine the MAC address and the IPv6 address into a temporary ACL Strategy.
  • the present invention solves the problem of wasting ACL resources generated when filtering packets in the related art by using a mechanism for generating a temporary ACL policy and deleting an ACL policy, thereby achieving the realization of reducing the waste of ACL resources.
  • the basic functions of IPv6 Source Guard ensure the security of the network.
  • FIG. 1 is a flowchart of a general solution of IPv6 Source Guard according to the related art
  • FIG. 2 is a preferred flowchart of a message filtering method according to an embodiment of the present invention
  • FIG. 3 is a diagram according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a network structure of a packet filtering method according to an embodiment of the present invention
  • FIG. 5 is another preferred flowchart of a packet filtering method according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a packet filtering method according to an embodiment of the present invention, including the following steps: Step S202: A switching device generates a temporary ACL policy according to a request packet sent by a user; Step S204, the switching device sends The user forwards the NS message sent by the server. Step S206: The switching device determines whether the NA message sent by the user in response to the NS message matches the temporary ACL policy. Step S208: If yes, the switching device performs the relationship between the user and the server. The packet is forwarded and the temporary ACL policy is deleted. Preferably, the switching device deletes the temporary ACL policy when the packet forwarding interaction is completed or timed out.
  • a mechanism for generating a temporary ACL policy and deleting an ACL policy is adopted to solve the problem of wasting ACL resources generated when filtering packets in the related art, thereby achieving the requirement of reducing waste of ACL resources. It also implements the basic functions of IPv6 Source Guard to ensure the security of the network.
  • the step of generating a temporary ACL policy by the switching device according to the request packet sent by the user includes: obtaining the source layer 2 address and the source layer 3 address of the user from the request packet; and obtaining the source layer 2 address and the source layer 3 according to the obtained source layer The address generates a temporary ACL policy.
  • how to generate a temporary ACL policy is ensured, thereby reducing waste of ACL resources.
  • the step of generating a temporary ACL policy according to the obtained source Layer 2 address and the source Layer 3 address includes: acquiring a source Layer 2 MAC address and a source Layer 3 IPv6 address, and combining the MAC address and the IPv6 address into Temporary ACL policy.
  • how to generate a temporary ACL policy is further described, thereby ensuring that the waste of ACL resources is reduced.
  • the step of determining, by the switching device, whether the NA packet matches the temporary ACL policy includes: determining whether the MAC address and the IPv6 address in the NA packet are the same as the MAC address and the IPv6 address in the temporary ACL policy, and if they are the same, determining The NA packet matches the temporary ACL policy; otherwise, the NA packet does not match the temporary ACL policy.
  • how to match the temporary ACL policy is ensured, and the basic functions of the IPv6 Source Guard are implemented, and the security of the network is ensured.
  • the packet filtering method of the embodiment further includes: updating the currently used ACL policy to a temporary ACL policy, and enabling the temporary ACL policy timer.
  • the temporary ACL policy is deleted, which further reduces the waste of the ACL policy.
  • the step of deleting the temporary ACL policy includes: deleting the temporary ACL policy if the temporary ACL policy timer expires.
  • the temporary ACL policy is further deleted, which further reduces the waste of the ACL policy.
  • the packet filtering method further includes: the switching device generates a user data binding table, where the user data binding table is used for After the user obtains the IPv6 address, the user is allowed to access the server.
  • the basic functions of the IPv6 Source Guard are further ensured, and the security of the network is ensured.
  • FIG. 3 is a block diagram of a preferred structure of a switching device according to an embodiment of the present invention, including: a generating unit 302, configured to generate a temporary ACL policy according to a request packet sent by a user; and a forwarding unit 304, configured to The user forwards the NS message sent by the server; the determining unit 306 is configured to determine whether the NA message sent by the user in response to the NS message matches the temporary ACL policy; the processing unit 308 is configured to The determining unit 306 determines that the NA message sent by the user in response to the NS message matches the temporary ACL policy, performs packet forwarding between the user and the server, and deletes the temporary ACL policy.
  • a mechanism for generating a temporary ACL policy and deleting an ACL policy is adopted to solve the problem of wasting ACL resources generated when filtering packets in the related art, thereby achieving the requirement of reducing waste of ACL resources. It also implements the basic functions of IPv6 Source Guard to ensure the security of the network.
  • the generating unit 302 includes an obtaining module, configured to obtain a source layer address and a source layer address of the user from the request packet, and a generating module configured to generate a temporary according to the obtained source layer 2 address and the source layer 3 address.
  • the ACL policy describes how to generate a temporary ACL policy, thereby ensuring that the waste of ACL resources is reduced.
  • the obtaining module includes: an obtaining submodule, configured to obtain a source layer MAC address of the user and a source layer 3 IPv6 address; the generating module includes: generating a submodule, configured to combine the MAC address and the IPv6 address into a temporary ACL Strategy. In the preferred embodiment, how to generate a temporary ACL policy is further described, thereby ensuring that the waste of ACL resources is reduced.
  • the determining unit 306 includes: a determining module, configured to determine whether the MAC address and the IPv6 address in the NA message are the same as the MAC address and the IPv6 address in the temporary ACL policy, and if they are the same, the NA message and the temporary ACL are determined.
  • the generating unit 302 further includes: an updating module, configured to: when the switching device generates a temporary ACL policy according to the request packet sent by the user, update the currently used ACL policy to a temporary ACL policy; enable the module, and set the temporary ACL to be enabled. Policy timer. In the preferred embodiment, the temporary ACL policy is deleted, which further reduces the waste of the ACL policy.
  • the processing unit 308 includes: a deleting module, configured to delete the temporary ACL policy if the temporary ACL policy timer expires.
  • the temporary ACL policy is further deleted, which further reduces the waste of the ACL policy.
  • the processing unit 308 further includes a user binding table generating module, configured to generate a user data binding table for obtaining the user data binding table after the switching device performs packet forwarding between the user and the server. After the IPv6 address, the user is allowed to access the server.
  • the basic functions of the IPv6 Source Guard are further ensured, and the security of the network is ensured.
  • FIG. 4 is a schematic diagram of a network structure of a packet filtering method according to an embodiment of the present invention.
  • the network shown in FIG. 4 includes: a DHCPv6 server 401, a switching device 402 supporting DHCPv6 SNOOPING and IPv6 Source Gard, and terminal users 403 and 404.
  • the DHCPv6 server 401 and the switching device 402 are directly connected, and the terminal users 403 and 404 are also directly connected to the switch.
  • FIG. 5 is another preferred flowchart of the network structure message filtering method based on FIG. 4, including the following three components: a user 403, a switching device 402, and a server 401, and the following steps S502 to S514 are performed between the above three components.
  • Step S502 Enable the DHCPv6 SNOOPING function on the switching device 402, and enable the IPv6 Source Guard function on the port of the switching device 402 directly connected to the user 403.
  • IPv6 Source Guard function When the IPv6 Source Guard function is enabled, the following items are not required, and only one Deny Any is required. Strategy.
  • Step S504 when the switching device 402 receives the first request message of the DHCPv6 user 403, the DHCPv6
  • the SNOOPING module parses the source tier 2 address and the source tier 3 address of the user 403 from the request packet.
  • the DHCPv6 SNOOPING module generates a temporary ACL policy based on the source tier 2 address and the source tier 3 address of the user 403.
  • the temporary ACL policy timer is enabled.
  • the DHCPv6 SNOOPING module forwards this request packet. Step S506, the switching device 402 receives the neighbor request of the server 401 requesting the user 403 layer 2 address.
  • Step S508 the switching device 402 receives the message NA neighbor notification message from the server 401NS, and finds that a temporary ACL policy matches the NA message in the filter table, and then the message NA is transparently transmitted.
  • the DHCPv6 server 401 updates the local cache according to the NA message, encapsulates the Layer 2 header of the Alertise packet, and sends it to the user 403.
  • the DHCPv6 SNOOPING module receives the DHCPv6 response packet Advertise and processes it and forwards it to the DHCPv6 user 403.
  • Step S512 After receiving the request message request of the DHCPv6 user 403, the DHCPv6 SNOOPING module forwards the request message to the server 401.
  • Step S514 After receiving the DHCPv6 response packet Reply, the DHCPv6 SNOOPING module parses the information in the Reply packet, generates a user data binding table, deletes the temporary ACL policy, and filters the user filtering policy to the ACL. If the policy timer expires, the temporary ACL policy is deleted. From the above description, it can be seen that the following technical effects are achieved by the present invention: By adopting a mechanism for generating a temporary ACL policy and updating an ACL policy and deleting an ACL policy in advance, the network security of the prior art is low and The problem of wasting ACL resources has achieved the basic functions of IPv6 Source Guard, the security of the network, and the reduction of resource occupation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种报文过滤方法和交换设备,其中该方法包括:交换设备根据用户发送的请求报文生成临时访问控制列表ACL策略;交换设备向用户转发服务器发送的NS报文;交换设备判断用户发送的响应于NS报文的NA报文是否与临时ACL策略匹配;若匹配,则交换设备进行用户和服务器之间的报文转发,并删除临时ACL策略。本发明解决了相关技术中过滤报文时产生的浪费ACL资源的问题。

Description

一种报文过滤方法和交换设备 技术领域 本发明涉及网络安全技术领域, 具体而言, 涉及一种报文过滤方法和交换设备。 背景技术 互联网协议第 6版 (Internet Protocol version 6, 简称为 IPv6) Source Guard (IPv6 源保护)是一种基于 IPv6地址和媒体接入控制 (Media Access Control, 简称为 MAC) 地址的端口流量过滤技术, 它可以防止局域网内的 IPv6地址欺骗攻击。交换机内部有 一个 IPv6 源地址绑定表作为每个端口接收到的数据包的检测标准。 只有在两种情况 下, 交换机会转发数据——或者所接收到的 IPv6包满足 IPv6源地址绑定表中 PORT (端口) /IPv6/MAC的对应关系, 或者是接收到的是 DHCPv6数据包, 其余数据包将 被交换机做丢弃处理。 当动态主机设置协议第 6版窥探 (Dynamic Host Configuration Protocol version 6 Snooping, 简称为 DHCPv6 SNOOPING) 在一个非信任口启用的时 候,启用它上面的 IPv6 source guard,交换机将阻止非信任口上收到的所有互联网协议 ( Internet Protocol, 简称为 IP ) 流量。 用户上线后, 这个端口上将基于 DHCPv6 SNOOPING绑定数据库生成一条端口访问控制列表,这条访问控制列表仅允许在访问 控制列表 (Access Control Lists, 简称为 ACL) 策略中存在的源地址的 IP流量, 并阻 止其他的流量。 当前的 IPv6 源地址绑定表一般都是基于 DHCPv6 SNOOPING绑定表。 DHCPv6 SNOOPING 是一个基于 DHCPv6 的功能。 它通过监听 DHCPv6 用户同 DHCPv6 SERVER (服务器) 的报文交互来生成绑定表, 并使用绑定表对接入用户进行控制。 在一个典型的 DHCPv6交互过程中, 参见图 1, 根据相关技术的 IPv6 Source Guard的 通用解决方案流程, 包括如下三个部件, 用户 102、 交换设备 104以及服务器 106, 以 上三个部件执行如下步骤 S102至 S114。 步骤 S102, 在交换设备上开启 DHCPv6 SNOOPING功能, 在用户直连的交换设 备端口开启 IPv6 Source Guard功能, 在开启 IPv6 Source Guard功能时, 下载 ACL策 略。 步骤 S104, 当交换设备收到 DHCPv6用户会向服务器发送的一个 Solicit报文(请 求报文), 该报文被设备中的 DHCPv6 SNOOPING模块监听到后进行处理, 并转发给 服务器。 步骤 S106, 服务器收到此报文后, 封装响应报文 Advertise (通知报文), 在封装 此报文时需要填充二层头, 此时服务器先在自己的缓存中查找用户的二层头地址, 如 果没有找到, 则向用户发送一个邻居请求 NS (Neighbor Solicitation) 报文。 步骤 S108, 用户收到 NS报文后, 发送一个 NA (Neighbor Advertisement) 报文 通告服务器自己的二层地址。 步骤 S110, 服务器依据此 NA报文更新缓冲信息, 并填充报文 Advertise的二层 头, 然后发给交换设备, 设备上的 DHCPv6 SNOOPING处理后转发给用户。 步骤 S112,用户处理完 Advertise报文后, 向服务器发送 Request报文(请求报文) 以请求地址。 步骤 S114,服务器回复 Reply (响应报文)确认对地址的分配;交互完成后, DHCPv6
SNOOPING模块将生成绑定表, 下 ACL策略, 转发给用户。 可见,在启用 IPv6 Source Guard到时候就下了一条 ACL策略以便在正常 DHCPv6 报文交换的过程中, DHCPv6服务器期待的响应报文 NA报文可以通过。 从图 1中的 步骤可以看出, 每个端口都多占用了一条 ACL策略并且用户在没有通过 DHCPv6服 务器获得 IP地址时也可以访问本地网络。 在开启 IPv6 Source Guard的场景下, 当用户和服务器交互到步骤 S106-步骤 S110 并且服务器没有在缓存中查找的用户的二层头地址时, 会向用户发送 NS 以询问其二 层地址。 由于此时用户没有上线, 在过滤表中不存在用户的信息, 因此任何报文都将 被过滤, 包括用户的响应报文 NA。 服务器收不到 NA报文, 就无法填充二层头, 导 致不能发出 Advertise报文, 正常的 DHCPv6交互过程不能完成。 相关技术中, 一般都是通过在启用 Ipv6 Source Guard的时候下 ACL策略来解决。 大致有三种方法。 第一种是在启用 Ipv6 Source Guard的时候, 下一条 ACL策略, 只 要 IPv6源地址是 FE80开头的报文都让它通过 (注: FE80开头的地址是本地链路地址); 第二种方法是使用 ACL 非自定义模式, 由于非自定义模式能匹配的报文的长度有限 制, 因此只能下一条让 ICMPv6报文通过的策略; 第三种是使用自定义的 ACL模式, 可以匹配到较长的位置, 下一条让 NS和 NA通过的报文。 这三种方法都有缺陷: 第 一种方法下, 使用本地链路地址作为源地址的用户协议报文和数据报文仍然可以访问 本地网络, 并没有起到过滤的作用; 第二种方法, 过滤了源地址是本地链路地址的数 据报文, 但是使得 Ping报文也可以通过; 第三种方法只让 NS和 NA通过, 但是使用 了一条宝贵的自定义模式下的 ACL资源, 而自定义模式下的 ACL资源数量和非自定 义模式相比非常有限。 发明内容 针对相关技术中过滤报文时产生的浪费 ACL资源的问题,本发明提供了一种报文 过滤方法和交换设备。 根据本发明的一个方面, 提供了一种报文过滤方法, 包括如下步骤: 交换设备根 据用户发送的请求报文生成临时访问控制列表 ACL策略;交换设备向用户转发服务器 发送的邻居请求 NS报文;交换设备判断用户发送的响应于邻居请求 NS报文的邻居通 知 NA报文是否与临时 ACL策略匹配; 若匹配, 则交换设备进行用户和服务器之间的 报文转发, 并删除临时 ACL策略。 优选地, 交换设备根据用户发送的请求报文生成临时 ACL策略的步骤包括: 从请 求报文中获取用户的源二层地址和源三层地址; 根据所获取的源二层地址和源三层地 址生成临时 ACL策略。 优选地, 根据所获取的源二层地址和源三层地址生成临时 ACL策略的步骤包括: 获取用户的源二层的 MAC地址和源三层的 IPv6地址,并将 MAC地址和 IPv6地址组 合为临时 ACL策略。 优选地,交换设备判断 NA报文是否与临时 ACL策略匹配的步骤包括: 判断 NA 报文中的 MAC地址和 IPv6地址是否与临时 ACL策略中的 MAC地址和 IPv6地址相 同, 若相同, 则判断出 NA报文与临时 ACL策略匹配; 否则, 判断出 NA报文与临时 ACL策略不匹配。 优选地,在交换设备根据用户发送的请求报文生成临时 ACL策略时,报文过滤方 法还包括: 将当前使用的 ACL策略更新为临时 ACL策略, 并启用临时 ACL策略定时 器。 优选地, 删除临时 ACL策略的步骤包括: 若临时 ACL策略定时器超时, 则删除 临时 ACL策略。 优选地, 在交换设备进行用户和服务器之间的报文转发之后, 报文过滤方法还包 括: 交换设备生成用户数据绑定表, 其中, 用户数据绑定表用于在用户获得 IPv6地址 之后, 允许用户访问服务器。 根据本发明的另一方面, 提供了一种交换设备, 包括: 生成单元, 设置为根据用 户发送的请求报文生成临时 ACL策略; 转发单元, 设置为向用户转发服务器发送的 NS报文; 判断单元, 设置为判断用户发送的响应于 NS报文的 NA报文是否与临时 ACL策略匹配;处理单元,设置为在判断单元判断出用户发送的响应于 NS报文的 NA 报文与临时 ACL策略匹配时, 进行用户和服务器之间的报文转发, 并删除临时 ACL 策略。 优选地, 生成单元包括: 获取模块, 设置为从请求报文中获取用户的源二层地址 和源三层地址; 生成模块, 设置为根据所获取的源二层地址和源三层地址生成临时 ACL策略。 优选地, 获取模块包括: 获取子模块, 设置为获取用户的源二层的 MAC地址和 源三层的 IPv6地址; 生成模块包括: 生成子模块, 设置为将 MAC地址和 IPv6地址组 合为临时 ACL策略。 通过本发明, 采用一个生成临时 ACL策略和删除 ACL策略的机制, 解决了相关 技术中过滤报文时产生的浪费 ACL资源的问题, 进而达到了在减少对 ACL资源浪费 的前提下, 又实现了 IPv6 Source Guard的基本功能, 保障了网络的安全性的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中: 图 1是根据相关技术的 IPv6 Source Guard的通用解决方案流程图; 图 2是根据本发明实施例的报文过滤方法的一种优选流程图; 图 3是根据本发明实施例的交换设备的一种优选结构框图; 图 4是根据本发明实施例的报文过滤方法的网络结构示意图; 图 5是根据本发明实施例的报文过滤方法的另一种优选流程图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突的 情况下, 本申请中的实施例及实施例中的特征可以相互组合。 实施例 1 图 2是根据本发明实施例的报文过滤方法的一种优选流程图, 包括如下步骤: 步骤 S202, 交换设备根据用户发送的请求报文生成临时 ACL策略; 步骤 S204, 交换设备向用户转发服务器发送的 NS报文; 步骤 S206, 交换设备判断用户发送的响应于 NS报文的 NA报文是否与临时 ACL 策略匹配; 步骤 S208, 若匹配, 则交换设备进行用户和服务器之间的报文转发, 并删除临时 ACL策略。 优选的, 交换设备在报文转发的交互完成或超时的情况下删除临时 ACL 策略。 在本优选实施例中, 采用一个生成临时 ACL策略和删除 ACL策略的机制, 解决 了相关技术中过滤报文时产生的浪费 ACL资源的问题, 进而达到了在减少对 ACL资 源浪费的前提下, 又实现了 IPv6 Source Guard的基本功能, 保障了网络的安全性的效 果。 优选地, 交换设备根据用户发送的请求报文生成临时 ACL策略的步骤包括: 从请 求报文中获取用户的源二层地址和源三层地址; 根据所获取的源二层地址和源三层地 址生成临时 ACL策略。 在本优选实施例中, 说明了如何生成临时 ACL策略, 从而保 证了减少对 ACL资源的浪费。 优选地, 根据所获取的源二层地址和源三层地址生成临时 ACL策略的步骤包括: 获取用户的源二层的 MAC地址和源三层的 IPv6地址,并将 MAC地址和 IPv6地址组 合为临时 ACL策略。 在本优选实施例中, 进一步说明了如何生成临时 ACL策略, 从 而保证了减少对 ACL资源的浪费。 优选地,交换设备判断 NA报文是否与临时 ACL策略匹配的步骤包括: 判断 NA 报文中的 MAC地址和 IPv6地址是否与临时 ACL策略中的 MAC地址和 IPv6地址相 同, 若相同, 则判断出所述 NA报文与所述临时 ACL策略匹配; 否则, 判断出所述 NA报文与所述临时 ACL策略不匹配。 在本优选实施例中, 进一步说明了如何匹配临 时 ACL策略, 保证实现了 IPv6 Source Guard的基本功能, 保障了网络的安全性。 优选地,在交换设备根据用户发送的请求报文生成临时 ACL策略时,根据本发明 实施例的报文过滤方法还包括: 将当前使用的 ACL策略更新为临时 ACL策略, 并启 用临时 ACL策略定时器。 在本优选实施例中, 保证临时 ACL策略得以被删除, 进一 步保证了减少对 ACL策略的浪费。 优选地, 删除临时 ACL策略的步骤包括: 若临时 ACL策略定时器超时, 则删除 临时 ACL策略。 在本优选实施例中, 进一步保证临时 ACL策略得以被删除, 进一步 保证了减少对 ACL策略的浪费。 优选地, 在交换设备进行用户和服务器之间的报文转发之后, 根据本发明实施例 的报文过滤方法还包括: 交换设备生成用户数据绑定表, 其中, 该用户数据绑定表用 于在用户获得 IPv6地址之后, 允许用户访问服务器。 在本优选实施例中, 进一步保证 实现了 IPv6 Source Guard的基本功能, 保障了网络的安全性。 实施例 2 图 3是根据本发明实施例的交换设备的一种优选结构框图, 包括: 生成单元 302, 设置为根据用户发送的请求报文生成临时 ACL策略; 转发单元 304, 设置为向所述用 户转发服务器发送的 NS报文;判断单元 306, 设置为判断所述用户发送的响应于所述 NS报文的 NA报文是否与所述临时 ACL策略匹配; 处理单元 308, 设置为在所述判 断单元 306判断出所述用户发送的响应于所述 NS报文的 NA报文与所述临时 ACL策 略匹配时, 进行所述用户和所述服务器之间的报文转发, 并删除所述临时 ACL策略。 在本优选实施例中, 采用一个生成临时 ACL策略和删除 ACL策略的机制, 解决 了相关技术中过滤报文时产生的浪费 ACL资源的问题, 进而达到了在减少对 ACL资 源浪费的前提下, 又实现了 IPv6 Source Guard的基本功能, 保障了网络的安全性的效 果。 优选地, 生成单元 302包括获取模块, 设置为从请求报文中获取用户的源二层地 址和源三层地址; 生成模块, 设置为根据所获取的源二层地址和源三层地址生成临时 ACL策略在本优选实施例中,说明了如何生成临时 ACL策略,从而保证了减少对 ACL 资源的浪费。 优选地, 获取模块包括: 获取子模块, 设置为获取用户的源二层的 MAC地址和 源三层的 IPv6地址; 生成模块包括: 生成子模块, 设置为将 MAC地址和 IPv6地址组 合为临时 ACL策略。 在本优选实施例中, 进一步说明了如何生成临时 ACL策略, 从 而保证了减少对 ACL资源的浪费。 优选地, 判断单元 306包括: 判断模块, 设置为判断 NA报文中的 MAC地址和 IPv6地址是否与临时 ACL策略中的 MAC地址和 IPv6地址相同, 若相同, 则判断出 NA报文与临时 ACL策略匹配; 否则, 判断出 NA报文与临时 ACL策略不匹配。 在 本优选实施例中,进一步说明了如何匹配临时 ACL策略,保证实现了 IPv6 Source Guard 的基本功能, 保障了网络的安全性。 优选地, 生成单元 302还包括: 更新模块, 设置为在交换设备根据用户发送的请 求报文生成临时 ACL策略时,将当前使用的 ACL策略更新为临时 ACL策略; 启用模 块, 设置为启用临时 ACL策略定时器。 在本优选实施例中, 保证临时 ACL策略得以 被删除, 进一步保证了减少对 ACL策略的浪费。 优选的, 处理单元 308包括: 删除模块, 设置为若临时 ACL策略定时器超时, 删 除临时 ACL策略。 在本优选实施例中, 进一步保证临时 ACL策略得以被删除, 进一 步保证了减少对 ACL策略的浪费。 优选地, 处理单元 308还包括用户绑定表生成模块, 设置为在交换设备进行用户 和服务器之间的报文转发之后, 生成用户数据绑定表, 该用户数据绑定表用于在用户 获得 IPv6地址之后,允许用户访问服务器。在本优选实施例中,进一步保证实现了 IPv6 Source Guard的基本功能, 保障了网络的安全性。 实施例 3 本实施例中, 实现 IPv6 Source Guard并且节约 ACL资源的方法采用如下方案:
1 ) 临时 ACL策略。 在 DHCPv6 SNOOPING模块收到 DHCPv6交互报文的第一 个请求报文时, 从报文中解析出二层源地址和三层源 IP地址 (本地链路地址)。 这两 个地址作为临时 ACL策略的基本数据。
2) 提前更新 ACL策略的机制。 在 DHCPv6 SNOOPING模块从 DHCPv6交互报 文的第一个请求报文中提取出临时 ACL策略后就更新 ACL策略, 不必等到用户上线 后更新正式策略。 3 ) 临时 ACL策略状态定时器。 在把临时 ACL策略下到非自定义模式 ACL中后 启动状态定时器。
4) 临时 ACL策略删除机制。 在定时器期限内, 若没有完成正常的交互过程, 则 删除此临时 ACL策略; 在用户成功完成 DHCPv6报文交互, 正常上线后删除此临时 ACL策略。 图 4是根据本发明实施例的报文过滤方法的网络结构示意图,如图 4所示的网络, 包括: DHCPv6服务器 401、 支持 DHCPv6 SNOOPING和 IPv6 Source Gard的交换设 备 402、 终端用户 403和 404。 其中, DHCPv6服务器 401和交换设备 402直连, 终端用户 403和 404也和交换 机直连。交换设备 402开启 DHCPv6 SNOOPING功能, 同时在交换设备 402同终端用 户 403和 404直连的端口开启 IPv6 Source Guard功能。 需要说明的是, 此图仅是一个 DHCPv6 SNOOPING和 IPv6 Source Guard的典型 应用场景, 本发明不局限于此场景。 图 5是基于图 4的网络结构报文过滤方法的另一种优选流程图, 包括如下三个部 件: 用户 403、 交换设备 402和服务器 401, 以上三个部件之间执行如下步骤 S502至 S514。 步骤 S502, 在交换设备 402上开启 DHCPv6 SNOOPING功能, 在用户 403直连 的交换设备 402端口开启 IPv6 Source Guard功能, 在开启 IPv6 Source Guard功能时, 不需要多下表项, 只需下一条 Deny Any的策略。 步骤 S504,当交换设备 402收到 DHCPv6用户 403的第一个请求报文时, DHCPv6
SNOOPING 模块从该请求报文中解析出用户 403 的源二层地址和源三层地址, DHCPv6 SNOOPING模块依据解析出的用户 403的源二层地址和源三层地址生成临时 ACL策略, 下 ACL, 启用临时 ACL策略定时器, DHCPv6 SNOOPING模块转发此请 求报文。 步骤 S506, 交换设备 402收到服务器 401的请求用户 403二层地址的邻居请求
NS报文, 并转发此报文。 步骤 S508,交换设备 402收到用户 403响应服务器 401NS的报文 NA邻居通知报 文后, 发现在过滤表中已经存在一条临时 ACL策略和此 NA报文匹配, 那么透传此报 文 NA。 步骤 S510, DHCPv6服务器 401依据 NA报文更新本地缓存, 封装 Adertise报文 的二层头, 发给用户 403, DHCPv6 SNOOPING模块收到 DHCPv6响应报文 Advertise 后进行处理并转发给 DHCPv6用户 403。 步骤 S512, DHCPv6 SNOOPING模块收到 DHCPv6用户 403的请求报文 Request 后, 转发给服务器 401。 步骤 S514,DHCPv6 SNOOPING模块收到 DHCPv6响应报文 Reply后,解析 Reply 报文中的信息, 生成用户数据绑定表, 删除临时 ACL策略, 下用户过滤策略到 ACL, 若在交互过程中, 临时 ACL策略定时器超时, 则删除临时 ACL策略。 从以上的描述中, 可以看出, 本发明实现了如下技术效果: 通过本发明,采用一个生成临时 ACL策略以及提前更新 ACL策略和删除 ACL策 略的机制,解决了现有技术网络安全性低和浪费 ACL资源的问题,进而达到了既实现 了 IPv6 Source Guard的基本功能, 又保障了网络的安全性, 并且减少了对资源的占用 的效果。 具体体现在: ( 1 )用户在没通过 DHCPv6获得 IP地址之前不能访问网络, 包 括本地网络和全球网络。从而保证了网络的安全性。(2)能够减少对 ACL资源的占用, 降低设备的硬件成本, 节约了极其有限的 ACL资源。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 并且在某些情况下, 可以以不同于此处 的顺序执行所示出或描述的步骤, 或者将它们分别制作成各个集成电路模块, 或者将 它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任 何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1. 一种报文过滤方法, 包括如下步骤:
交换设备根据用户发送的请求报文生成临时访问控制列表 ACL策略; 所述交换设备向所述用户转发服务器发送的邻居请求 NS报文; 所述交换设备判断所述用户发送的响应于所述邻居请求 NS报文的邻居通 知 NA报文是否与所述临时 ACL策略匹配;
若匹配, 则所述交换设备进行所述用户和所述服务器之间的报文转发, 并 删除所述临时 ACL策略。
2. 根据权利要求 1所述的方法, 其中, 所述交换设备根据用户发送的请求报文生 成临时 ACL策略的步骤包括:
从所述请求报文中获取所述用户的源二层地址和源三层地址; 根据所获取的源二层地址和源三层地址生成所述临时 ACL策略。
3. 根据权利要求 2所述的方法, 其中, 根据所获取的源二层地址和源三层地址生 成所述临时 ACL策略的步骤包括:
获取所述用户的源二层的媒体访问控制 MAC地址和源三层的互联网协议 第 6版 IPv6地址, 并将所述 MAC地址和所述 IPv6地址组合为所述临时 ACL 策略。
4. 根据权利要求 1至 3中任一项所述的方法, 其中, 所述交换设备判断所述 NA 报文是否与所述临时 ACL策略匹配的步骤包括:
判断所述 NA报文中的 MAC地址和 IPv6地址是否与所述临时 ACL策略 中的 MAC地址和 IPv6地址相同, 若相同, 则判断出所述 NA报文与所述临时 ACL策略匹配; 否则, 判断出所述 NA报文与所述临时 ACL策略不匹配。
5. 根据权利要求 1所述的方法, 其中, 在交换设备根据用户发送的请求报文生成 临时 ACL策略时, 所述方法还包括:
将当前使用的 ACL策略更新为所述临时 ACL策略,并启用临时 ACL策略 定时器。
6. 根据权利要求 5所述的方法, 其中, 删除所述临时 ACL策略的步骤包括: 若所述临时 ACL策略定时器超时, 则删除所述临时 ACL策略。
7. 根据权利要求 1所述的方法, 其中, 在所述交换设备进行所述用户和所述服务 器之间的报文转发之后, 所述方法还包括:
所述交换设备生成用户数据绑定表, 其中, 所述用户数据绑定表用于在所 述用户获得 IPv6地址之后, 允许所述用户访问所述服务器。
8. 一种交换设备, 包括:
生成单元, 设置为根据用户发送的请求报文生成临时访问控制列表 ACL 策略;
转发单元, 设置为向所述用户转发服务器发送的邻居请求 NS报文; 判断单元,设置为判断所述用户发送的响应于所述 NS报文的邻居通知 NA 报文是否与所述临时 ACL策略匹配;
处理单元, 设置为在所述判断单元判断出所述用户发送的响应于所述 NS 报文的 NA报文与所述临时 ACL策略匹配时,进行所述用户和所述服务器之间 的报文转发, 并删除所述临时 ACL策略。
9. 根据权利要求 8所述的交换设备, 其中, 所述生成单元包括: 获取模块, 设置为从所述请求报文中获取所述用户的源二层地址和源三层 地址;
生成模块, 设置为根据所获取的源二层地址和源三层地址生成所述临时 ACL策略。
10. 根据权利要求 9所述的交换设备, 其中, 所述获取模块包括: 获取子模块, 设 置为获取所述用户的源二层的媒体访问控制 MAC地址和源三层的互联网协议 第 6版 IPv6地址; 所述生成模块包括: 生成子模块, 设置为将所述 MAC地址 和所述 IPv6地址组合为所述临时 ACL策略。
PCT/CN2011/080133 2010-12-27 2011-09-23 一种报文过滤方法和交换设备 WO2012088934A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010609120.3A CN102025641B (zh) 2010-12-27 2010-12-27 一种报文过滤方法和交换设备
CN201010609120.3 2010-12-27

Publications (1)

Publication Number Publication Date
WO2012088934A1 true WO2012088934A1 (zh) 2012-07-05

Family

ID=43866514

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080133 WO2012088934A1 (zh) 2010-12-27 2011-09-23 一种报文过滤方法和交换设备

Country Status (2)

Country Link
CN (1) CN102025641B (zh)
WO (1) WO2012088934A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187740A (zh) * 2020-09-14 2021-01-05 锐捷网络股份有限公司 一种网络接入控制方法、装置、电子设备及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025641B (zh) * 2010-12-27 2015-01-28 中兴通讯股份有限公司 一种报文过滤方法和交换设备
CN109862137B (zh) * 2019-03-28 2022-01-28 新华三技术有限公司 报文传输方法及装置
CN111416887B (zh) * 2020-03-31 2021-07-16 清华大学 地址检测的方法、装置、交换机及存储介质
CN114157436A (zh) * 2020-08-17 2022-03-08 迈普通信技术股份有限公司 报文过滤方法、装置、网络设备及计算机可读存储介质
CN113132241B (zh) * 2021-05-07 2022-05-24 杭州迪普信息技术有限公司 Acl模板动态配置方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1753173A1 (fr) * 2005-08-10 2007-02-14 Alcatel Contrôle d'accès d'un équipement mobile à un réseau de communication IP par modification dynamique des politiques d'accès
CN101692674A (zh) * 2009-10-30 2010-04-07 杭州华三通信技术有限公司 双栈接入的方法和设备
CN101827138A (zh) * 2010-05-21 2010-09-08 杭州华三通信技术有限公司 一种优化的ipv6过滤规则处理方法和设备
CN101917458A (zh) * 2010-07-12 2010-12-15 杭州华三通信技术有限公司 一种向客户机发送网络引导程序的方法及装置
CN102025641A (zh) * 2010-12-27 2011-04-20 中兴通讯股份有限公司 一种报文过滤方法和交换设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1753173A1 (fr) * 2005-08-10 2007-02-14 Alcatel Contrôle d'accès d'un équipement mobile à un réseau de communication IP par modification dynamique des politiques d'accès
CN101692674A (zh) * 2009-10-30 2010-04-07 杭州华三通信技术有限公司 双栈接入的方法和设备
CN101827138A (zh) * 2010-05-21 2010-09-08 杭州华三通信技术有限公司 一种优化的ipv6过滤规则处理方法和设备
CN101917458A (zh) * 2010-07-12 2010-12-15 杭州华三通信技术有限公司 一种向客户机发送网络引导程序的方法及装置
CN102025641A (zh) * 2010-12-27 2011-04-20 中兴通讯股份有限公司 一种报文过滤方法和交换设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187740A (zh) * 2020-09-14 2021-01-05 锐捷网络股份有限公司 一种网络接入控制方法、装置、电子设备及存储介质
CN112187740B (zh) * 2020-09-14 2022-09-16 锐捷网络股份有限公司 一种网络接入控制方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN102025641A (zh) 2011-04-20
CN102025641B (zh) 2015-01-28

Similar Documents

Publication Publication Date Title
US11451510B2 (en) Method and apparatus for processing service request
US7996894B1 (en) MAC address modification of otherwise locally bridged client devices to provide security
US20110032939A1 (en) Network system, packet forwarding apparatus, and method of forwarding packets
US9825861B2 (en) Packet forwarding method, apparatus, and system
WO2011140795A1 (zh) 一种防止介质访问控制地址欺骗攻击的方法和交换设备
WO2012088934A1 (zh) 一种报文过滤方法和交换设备
US20120144483A1 (en) Method and apparatus for preventing network attack
EP2686984A1 (en) Method and apparatus for accessing a private surveillance network through l2tp
US8917629B2 (en) Method and apparatus for detecting devices on a local area network
EP2724508A1 (en) Preventing neighbor-discovery based denial of service attacks
WO2012075850A1 (zh) 一种防止mac地址欺骗的方法、系统及交换机
WO2014166073A1 (zh) 报文转发方法和网络设备
WO2017107871A1 (zh) 访问控制方法和网络设备
US20130332586A1 (en) Providing ipv6 connectivity through shared external interfaces on electronic devices
US7826447B1 (en) Preventing denial-of-service attacks employing broadcast packets
WO2013044691A1 (zh) 基于lisp的映射请求响应、信息获取方法及相应设备
JP5034534B2 (ja) 通信システム
WO2012041168A1 (zh) 用于IPv6网络的网络连接处理方法及其装置
US9710513B2 (en) Access management method, device and system
WO2016177185A1 (zh) 媒体访问控制mac地址的处理方法及装置
WO2013023465A1 (zh) 身份位置分离与传统网络互联互通方法、ilr和asr
WO2023035836A1 (zh) 一种报文处理方法及相关装置
JP2008283495A (ja) パケット転送システムおよびパケット転送方法
WO2014107905A1 (zh) 集群以及转发方法
EP3021529B1 (en) Method and device for implementing layer 3 virtual private network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11853252

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11853252

Country of ref document: EP

Kind code of ref document: A1