chengjunjia / pcg Goto Github PK
View Code? Open in Web Editor NEWPacket Classification Group
Packet Classification Group
赫哥的1M规则集,存在末尾为0,1的问题;
统一格式后分析结果。
对于PC_Visor的TSS代码,运行得到其平均access time的次数。(每个bucket下的item个数的均值、一共有多少组)
然后增加规则mark,再运行得到平均access time的次数。
首先得到Matrix结果
def getRuleMatrix(filename):
global logger
rs = pc.load_rules(filename)
start = time.time()
logger.info("="*50)
# Convert rules into the policySpace
rsPolicySpaceList = []
for r in rs:
cur_rule = PolicySpace([HyperRect(deepcopy(r[:5]))])
rsPolicySpaceList.append(cur_rule)
ruleNum = len(rsPolicySpaceList)
logger.info("Finish the PolicySpace Analysis.")
# init the matrix
result = np.matlib.eye(n=ruleNum, dtype=int)
for i in range(1, ruleNum):
curRule = rsPolicySpaceList[i]
for j in range(0, i):
cmpRule = rsPolicySpaceList[j]
if not curRule.and(cmpRule): # curRule /\ cmpRule == None
continue
else:
result[i,j] = result[j,i] = 1
end = time.time()
logger.info("The time runs for {total_time}s".format(total_time=end-start))
return result
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.