• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

The method by using user-defined ACL to match the length of packets in the H3C S3610/5510 Switches

  • 0关注
  • 0收藏 505浏览
粉丝: 关注:

The method by using user-defined ACL to match the length of packets in the H3C S3610/5510 Switches

I            Network topology

No

II          Description of the problem

If you want to classify the data flow based on the length of packets, the basic, advanced and ?       ethernet frame header ipv4 ACL could not make this requirement realized. But we could use another type of ACL which is supported in the H3C S3610/5510 switches.

III        Process analysis

The User-defined ACL, based on customized information, you can specify which bytes starting from the Layer 2 header or IP header should match the user-defined string.

User-defined ACLs are numbered in the range 5000 to 5999.The format of creating a rule is as follows.

rule [ rule-id ] { deny | permit } [ { { ipv4 | ipv6 | l2 | l4 | start } rule-string rule-mask offset }&<1-8> ] [ time-range time-name ]

Parameters description:

rule-id: User-defined ACL rule number in the range 0 to 65534.

deny: Defines a deny statement to drop matched packets.

permit: Defines a permit statement to allow matched packets to pass.

ipv4: Sets the offset from the beginning of the IPv4 header.

ipv6: Sets the offset from the beginning of the IPv6 header.

l2: Sets the offset from the beginning of the Layer 2 frame header.

l4: Sets the offset from the beginning of the Layer 4 header.

start: Sets the offset from the beginning of the outmost header.

rule-string: Defines a match pattern in hexadecimal format. Its length must be a multiple of two.

rule-mask: Defines a match pattern mask in hexadecimal format. Its length must be the same as that of the match pattern.

offset: Offset in bytes at which the match operation begins.

&<1-8>: Indicates that up to eight match patterns can be defined in the rule.

time-range time-name: Specifies the time range in which the rule can take effect. The time-name argument is a case-insensitive string of 1 to 32 characters. The name must begin with an English letter and cannot be all to avoid confusion.

IV       Solution

An example for matching accurate length of the packets which is 1200 bytes. The configuration of ACL is as follows.

[H3C] acl number 5000

[H3C-acl-user-5000] rule permit start 04B0 ffff 16

or

[H3C-acl-user-5000] rule permit l3 04B0 ffff 2

Description of the above commands:

From above picture, if you choose "start" or "L2", that means offset of 16 bytes backward from the starting of ethernet frame is the total length of the starting of the packet."04B0" is the hexadecimal express of 1200 and "ffff" expresses an exact match with "04B0" field of the packet.

If you choose "ipv4" or "L3", that means offset of 2 bytes backward from the starting of layer 3.

An example for matching length range of the packets which is 1200<=length<=1280 bytes. The configuration of ACL is as follows.

[H3C] acl number 5000

[H3C-acl-user-5000] rule permit start 04B0 fff0 16

Description: The rule matches the packets whose length ranges from 1200 to 1215,that is,1200<=length<=1215.

Binary express of 1199 is 0000 0100 1010 1111, the hexadecimal  is  04AF.

Binary express of 1200 is 0000 0100 1011 0000, the hexadecimal  is  04B0.

Binary express of 1215 is 0000 0100 1011 1111, the hexadecimal  is  04BF.

The previous 12 bits are the same in the range of 1200 ~ 1215,so by adjusting the mask of "1" number to match the packets of the scope, that is, the pre-12 bits are all the "1" which equals to "fff0" in hex.

[H3C-acl-user-5000] rule permit start 04C0 ffc0 16

Description: The rule matches the packets whose length ranges from 1216 to 1279,that is,1216<=length<=1279.

Binary express of 1216 is 0000 0100 1100 0000, the hexadecimal  is  04C0.

Binary express of 1279 is 0000 0100 1111 1111, the hexadecimal  is  04FF.

Binary express of 1215 is 0000 0100 1011 1111, the hexadecimal  is  04BF.

The previous 10 bits are the same in the range of 1216 ~ 1279,so the pre-10 bits are all the "1" which equals to "ffc0" in hex.

[H3C-acl-user-5000] rule permit start 0500 ffff 16

Description: The rule matches the packets whose length is 1280.

若您有关于案例的建议,请反馈:

作者在2009-02-10对此案例进行了修订
0 个评论

该案例暂时没有网友评论

编辑评论

举报

×

侵犯我的权益 >
对根叔知了社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔知了社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作