正则表达式13.docx

上传人:b****7 文档编号:8804707 上传时间:2023-02-01 格式:DOCX 页数:76 大小:61.53KB
下载 相关 举报
正则表达式13.docx_第1页
第1页 / 共76页
正则表达式13.docx_第2页
第2页 / 共76页
正则表达式13.docx_第3页
第3页 / 共76页
正则表达式13.docx_第4页
第4页 / 共76页
正则表达式13.docx_第5页
第5页 / 共76页
点击查看更多>>
下载资源
资源描述

正则表达式13.docx

《正则表达式13.docx》由会员分享,可在线阅读,更多相关《正则表达式13.docx(76页珍藏版)》请在冰豆网上搜索。

正则表达式13.docx

正则表达式13

Page1第1页

Memory-EfficientRegularExpressionSearchUsing内存高效使用正则表达式搜索

StateMerging国家合并

MichelaBecchiMichelaBecchi

DepartmentofComputerScienceandEngineering计算机科学与工程

WashingtonUniversity,StLouis,MO华盛顿大学,圣路易斯,密苏里州

mbecchi@cse.wustl.edumbecchi@cse.wustl.edu

SrihariCadambiSrihariCadambi

NECLaboratoriesAmerica美国NEC公司实验室

PrincetonNJ普林斯顿新泽西州

cadambi@nec-cadambi@nec-

Abstract—Patternmatchingisacrucialtaskinseveralcritical摘要-模式匹配是在几个关键的关键任务

networkservicessuchasintrusiondetectionandpolicyman-网络服务,如入侵检测和政策的人

agement.agement。

Asthecomplexityofrule-setsincreases,traditional由于复杂的规则集增加,传统

stringmatchingenginesarebeingreplacedbymoresophisticated正在取代由更复杂的字符串匹配引擎

regularexpressionengines.正则表达式引擎。

Tokeepupwithlinerates,deal为了保持线路速率,处理

withdenialofserviceattacksandprovidepredictableresource拒绝服务攻击,并提供可预测的资源

provisioning,thedesignofsuchenginesmustallowexamining配置,这种发动机的设计必须允许研究

payloadtrafficatseveralgigabitspersecondandprovideworst有效载荷流量在每秒数千兆,并提供最糟糕的

casespeedguarantees.的情况下速度保证。

Whileregularexpressionmatchingusing虽然正则表达式匹配使用

deterministicfiniteautomata(DFA)isawellstudiedproblem确定性有限自动机(DFA)是一个很好的研究的问题

intheory,itsimplementationeitherinsoftwareorspecialized在理论上,它的实施,无论是在软件或专门

hardwareiscomplicatedbyprohibitivememoryrequirements.望而却步内存的要求是复杂的硬件。

ThisisespeciallytrueforDFAsrepresentingcomplexregular这尤其是对于较复杂的正则的DFA

expressionspresentinpracticalrule-sets.表达式目前在实际的规则集。

Inthispaper,weintroduceanovelmethodtodrastically在本文中,我们介绍一种新的方法大幅

reducetheDFAmemoryrequirementandstillprovideworst-case减少DFA的内存要求,并仍然提供最坏的情况

speedguarantees.速度保证。

Specifically,wemergeseveral“non-equivalent”具体来说,我们合并了几个“不等价”

statesinaDFAbyintroducinglabelsontheirinputandoutput在DFA通过引入标签上的输入和输出

transitions.转换。

Wethenproposeadatastructuretorepresentthe然后,我们提出了一个数据结构来表示

mergedstatesandthetransitionlabels.合并后的国家和过渡标签。

Weshowthat,withvery我们表明,具有非常

fewassumptionsabouttheoriginalDFA,suchatransformation原DFA的几个假设,这种转化

resultsinsignificantcompressionintheDFArepresentation.结果在显着压缩在DFA表示。

Wehaveimplementedastatemergingandtransitionlabeling我们已经实施了一个国家合并和转型期标签

algorithmforDFAs,andshowthatforSnortandBrosecurity算法的DFA,显示Snort和人权法的安全

rule-sets,statemergingresultsinmemoryreductionsofanorder规则集,状态合并顺序的内存减少的结果

ofmagnitude.数量级。

I.I一,我

NTRODUCTION引言

Inadditiontoexaminingstructuredinformationpresent此外,研究结构化信息目前

intheheadertoclassifyapacket,manycriticalnetwork头一个数据包进行分类,许多重要的网络

servicessuchasintrusiondetection(IDS),policymanagement服务,如入侵检测(IDS),策略管理

andidentificationofP2Ptraffic,requireinspectionofpacket和识别P2P流量,需要的数据包检查

payloads.有效载荷。

Alsoknownasdeeppacketinspection,thisprovides又称深层数据包检测,这提供

bettercapabilitytoclassifypacketsbaseduponapplications,更好的能力,根据应用的数据包进行分类,

contentandstate.内容和状态。

Untilrecently,rule-setsforintrusiondetec-直到最近,规则集的入侵detec

tionandotherservicesprimarilyconsistedofstrings.TION和其他服务主要包括字符串。

However,然而,

currentrule-setslikeSnort[1],Bro[2],[3]andmanyothers目前的规则集象snort[1],可租可买计划“[2][3]和其他许多人

arereplacingstringswiththemorepowerfulandexpressive正在取代与更强大的和表现的字符串

regularexpressions.正则表达式。

Theclassicalmethodtoperformregularexpressionsearch执行正则表达式搜索的经典方法

istouseadeterministicfiniteautomaton(DFA)[4],the是使用一个确定的有限自动机(DFA)[4],

focusofthispaper.本文的重点。

ThemainproblemwithDFAsispro-用的DFA的主要问题是亲

hibitivememoryusage.hibitive内存使用。

ThenumberofstatesinaDFA在DFA的一些国家

scalepoorlywiththesizeandnumberofwildcardsinthe在通配符的大小和数量,规模不佳

regularexpressionstheyrepresent.他们所代表的正则表达式。

Asthenumberofwildcards作为通配符

inaregularexpressiongrows,thenumberofDFAstates在正则表达式的增长,DFA的状态数

increasessharply,exponentiallyinsomecases.急剧增加,指数在某些情况下。

Thepresenceof在场

wildcards,oneoftheprimaryreasonswhyregularexpressions通配符,为什么正则表达式的首要原因之一

aresoexpressive,alsocomplicatesmergingmultipleregular如此表现,也复杂合并多个定期

expressions.表达式。

Tworegularexpressionswithamoderatenumber一个中等数量的正则表达式

ofDFAstateswhenconsideredindividuallymaycombinetoDFA的状态时,考虑个别可能结合起来,

formacompositeDFAwithamuchlargerstatecount.形成一个更大的国家计数复合DFA。

Since自

rule-setstypicallyconsistofmanyregularexpressions,itis规则集,通常是由许多正则表达式,它是

beneficialtocreateacombinedDFAsincecheckingindividual有利于创建以来检查个人联合DFA

DFAsone-by-oneimposessequentialityintheprocessing,and的DFA一个由施加在处理的顺序性,并

decreasesspeed.速度将随之降低。

Thismemorycomplexitymakessoftware此记忆体的复杂性使得软件

regularexpressionsearchenginesextremelyslowandnot正则表达式搜索引擎极为缓慢,而不是

scalabletolargerule-sets.可扩展到大型规则集。

Italsomakeshardwarearchitectures这也使得硬件架构

difficulttodesignandimplement.难以设计和实施。

Compoundingthisissueisthefactthatcriticalnetwork这个问题复杂化,是事实,关键的网络

servicessuchasintrusiondetectionmustbeperformedonline如入侵检测必须执行在线服务

athighspeeds.以很高的速度。

Foravarietyofreasonsincludingrouterdesign,对于各种原因,包括路由器设计,

denial-of-serviceattacksandresourceprovisioning,routers拒绝服务攻击和资源配置,路由器

mustprovideaworst-casespeedguarantee.必须提供一个最坏情况下的速度保证。

Inthecaseof在案件

aDFA,thisspeedguaranteetranslatestoanupperboundon一个DFA,这样的速度保证转换势必对上层

thenumberofstatesvisitedforeveryinputcharacterinthe在一些国家访问的每一个输入字符

payloadtraffic.有效载荷的交通。

ClassicalDFAsvisitexactlyonestateperinput古典的DFA访问正是每一个输入状态

character.字符。

However,duetomemorylimitations,manyDFA然而,由于内存的限制,许多的DFA

generatorssuchasFlex[5]buildDFAswithfewerstates,and发电机,例如Flex[5]建立的国家较少的DFA,

rollbackandrevisitcharactersintheinputmultipletimes.回滚并重新多次在输入的字符。

Such这种

astrategyisunacceptableforcritical,onlinenetworkservices.一种策略是不可接受的关键,在线网络服务。

Inthispaper,weaddressthememoryproblemforregular在本文中,我们定期解决内存问题

expressionsearch,specificallyforrealrule-setsimplemented表达式搜索,专门为实时,规则设置实施

usingDFAs.使用的DFA。

Wearguethatbydrasticallyreducingthememory我们认为,大大减少了内存

requirementforDFAs,theybecomefaster,morescalableand的DFA的要求,他们变得更快,更具扩展性和

easiertoimplementinasoftwareengineorasspecialized更容易实现在一个软件引擎或专门

hardwarearchitectures.硬件架构。

Weproposeanoveltechniquethat我们提出了一种新的技术,

allowsnon-equivalentstatesinaDFAtobemergedusing允许在一个DFA非相当于国家要合并使用

aschemewherethetransitionsintheDFAarelabeled.一个标记在DFA的转换计划。

By通过

carefullylabelingtransitions,ineffect,wearetransferring仔细标签的转换,实际上,我们正在转移

informationfromthenodestotheedgesofthegraphrepresent-从图形的边缘节点的信息代表

ingtheDFA.ING的DFA。

Weproposeanoveldatastructuretorepresent我们提出一种新的数据结构来表示

aDFAwithmergedstatesandlabeledtransitions,andshow与合并的国家和标记转换DFA,并显示

thatthislosslesscompressionmethodcanachievesignificant这种无损压缩方法,可以取得显着

memoryreductionsinpractice.在实践中的内存减少。

UnlikeotherDFAcompactionapproaches,wehavenore-不同于其他DFA的压实方法,我们没有再

quirementonthetransitionsonwhichthetwostatesreachtheirquirement这两个国家达成的过渡

commondestinations.共同的目的地。

ArecentDFAcompactionapproach[6]最近DFA压实方法[6]

(thatdoesnotdostatemerging,butinsteadremovestransitions(即不状态合并,而是删除转换

tocommondestinations)requirestwostatestonotonlyhave共同的目的地)要求这两个国家不仅有

0743-166X/07/$25.00©2007IEEE0743-166X/07/$25.00©2007年IEEE

ThisfulltextpaperwaspeerreviewedatthedirectionofIEEECommunicationsSocietysubjectmatterexpertsforpublicationintheIEEEINFOCOM2007proceedings.这全文论文同行评议在IEEE通信学会的课题发表在IEEEINFOCOM2007法律程序问题专家的方向。

10641064

Authorizedlicenseduselimitedto:

NationalChengKungUniversity.授权许可使用不限于:

成大。

DownloadedonJanuary29,2009at20:

59fromIEEEXplore.下载2009年1月29日,日20时59分从IEEEXplore。

Restrictionsapply.限制。

Page2第2页

thesamedestinations,butalsotransitiontothosedestinations同样的目的地,但也过渡到这些目的地

usingthesameinputcharacters.使用相同的输入字符。

Anothersignificantadvantage另一个显着优势

ofourschemeisthatmergingstatescreatesmorecommon我们的计划是合并国家创造更多的共同

destinationsforotherstates.目的地为其他国家。

Asanexample,ifstatesAandB作为一个例子,如果A国和B

transitiontostatesCandD,theycannotbemerged.过渡到状态C和D,它们不能合并。

However,然而,

ifCandDweremerged,thenAandBhaveacommon如果C和D被合并,那么A和B都有一个共同的

destinationandcouldbemerged.目的地,并可以合并。

Thus,mergingitselfcreates因此,合并本身创建

moreopportunitiesformemorycompaction.内存压实更多的机会。

Insummary,themajorcontributionofourpaperisthe总之,我们的论文的主要贡献是

notionofmergingdistinct,non-equivalentstatesinaDFA合并在一个DFA分明,非等效的国家概念

usingtransitionlabeling.使用过渡的标签。

Tothisend,wemakethefollowing为此,我们提出以下

specificcontributions:

具体贡献:

••

Wedescribeacompactdatastructurethatcanrepresent我们描述了一个紧凑的数据结构可以代表

aDFAwithmergedstatesandtransitionlabels.与合并后的国家和转型期标签的DFA。

••

Wepresentamergingandlabelingalgorithm.我们提出了一个合并和标签算法。

••

Weextendthebitmapdatastructureproposedforstring我们扩大位图的数据结构的字符串提出

matching[7]toDFAs,andintroduceamodificationusing匹配[7]的DFA,并提出了修改使用

pointerindirection,whichalsoreducesmemoryusagein间接指针,这也减少了内存使用

itsownright.自己的权利。

••

Wepresentananalysisofourscheme,andperforma我们目前我们的计划进行分析,并执行

systematicexperimentalstudycomparingstatemerging系统的实验研究,比较状态合并

topreviouscompactiontechniques.以前的压实技术。

Theremainderofourpaperisorganizedasfollows.我们的论文的其余部分安排如下:

In在

SectionII,wediscussrelatedwork.第二节,我们讨论了有关的工作。

InSectionIII,wein-在第三节,我们在

troducethebitmap-baseddatastructureforDFAs,andpresenttroduce的DFA的基于位图的数据结构,而目前

adiscussionofourproposedimprovements.我们提出的改进的讨论。

Wealsopresenta我们也提出了

motivationalexa

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1