p24=quads[0]+'.'+quads[1]+'.'+quads[2]+'.'+'0/24' if p24 not in problemPrefix24ToProbeMap.keys(): problemPrefix24ToProbeMap[p24]=set() problemPrefix24ToProbeMap[p24].add(probeID) if nextExpectedIP not in problemIPToProbeMap.keys(): problemIPToProbeMap[nextExpectedIP]=set() problemIPToProbeMap[nextExpectedIP].add(probeID) numberOfTraceroutesWithValidNextIP+=1 else: numberOfSuccessfulTraceroutes+=1 #for faultyIP,probesDicts in problemIPToProbeMap.items(): # print(faultyIP,float(len(probesDicts)/len(problemProbes)*100)) #for faultyprefix,probesDicts in problemPrefix24ToProbeMap.items(): # print(faultyprefix,float(len(probesDicts)/len(problemProbes)*100)) if len(problemProbesInner)>5 and len(problemIPsInner)>0: print(len(problemProbesInner), len(problemIPsInner)) sys.stdout.flush() ratio=float(len(problemIPsInner))/len(problemProbesInner) toPlotRatioFaultyIPsPerProbe.append(ratio) #print(toPlotRatioFaultyIPsPerProbe) plotter.suffix='Both' #print(toPlotRatioFaultyIPsPerProbe) plotter.ecdf(toPlotRatioFaultyIPsPerProbe,'ratioFaultyIPsPerProbe',xlabel='#Faulty IPs / #Probes',ylabel='CDF #Outages',xlim=[0,1]) #print(toPlotRatioFaultyIPsPerProbe) #print(numberOfTraceroutes,numberOfFailedTraceroutes,numberOfSuccessfulTraceroutes,numberOfTraceroutesWithValidNextIP)
): probeIDToCompleteDest[probeAS] = set() if probeAS == dstAS: probeIDToCompleteDest[probeAS].add( str(dstAS) + '|self') elif probeAS in coneDict[int(dstAS)]: try: probeIDToCompleteDest[ probeAS].add( str(dstAS) + '|provider') except: pass else: try: probeIDToCompleteDest[ probeAS].add( str(dstAS) + '|nonprovider') except: pass print('Average outage duration: ' + str(np.median(durations))) print('Average delta start: ' + str(np.median(durationsOfDeltaStart))) print('Average delta end: ' + str(np.median(durationsOfDeltaEnd))) plotter.suffix = 'End' plotter.ecdf(durationsOfDeltaEnd, 'deltaDuration') plotter.suffix = 'Start' plotter.ecdf(durationsOfDeltaStart, 'deltaDuration') #pp.pprint(successfullTraceroutesOutageIDToMsmID) pp.pprint(probeIDToCompleteDest)
vals=lineR.split('|') fPerS=vals[10] if 'percentage' in fPerS: continue lengthOfData+=1 if fPerS=='NoFTR': failurePercentages['NA']+=1 continue fPer=float(fPerS) dataToPlot.append(fPer) if (fPer==0): failurePercentages['0']+=1 elif (fPer>0 and fPer<50): failurePercentages['0to50']+=1 elif (fPer>=50 and fPer<70): failurePercentages['50to70']+=1 elif (fPer>=70 and fPer<90): failurePercentages['70to90']+=1 elif (fPer>=90): failurePercentages['90to100']+=1 percs=[] for k,v in failurePercentages.items(): perc=round(float(v/lengthOfData)*100,2) percs.append(perc) print(k,perc) plotter.ecdf(dataToPlot,'percentagePredictedTraceroutes',xlabel='Percentage of Traceroutes with Prediction',ylabel='CDF: #Outages') #print(sum(percs))
if 'percentage' in fPerS: continue lengthOfData += 1 if fPerS == 'NoFTR': failurePercentages['NA'] += 1 continue fPer = float(fPerS) dataToPlot.append(fPer) if (fPer == 0): failurePercentages['0'] += 1 elif (fPer > 0 and fPer < 50): failurePercentages['0to50'] += 1 elif (fPer >= 50 and fPer < 70): failurePercentages['50to70'] += 1 elif (fPer >= 70 and fPer < 90): failurePercentages['70to90'] += 1 elif (fPer >= 90): failurePercentages['90to100'] += 1 percs = [] for k, v in failurePercentages.items(): perc = round(float(v / lengthOfData) * 100, 2) percs.append(perc) print(k, perc) plotter.ecdf(dataToPlot, 'percentagePredictedTraceroutes', xlabel='Percentage of Traceroutes with Prediction', ylabel='CDF: #Outages') #print(sum(percs))
dstAS=ip2ASMap[dstIP] if dstAS is not None: if probeAS not in probeIDToCompleteDest.keys(): probeIDToCompleteDest[probeAS]=set() if probeAS==dstAS: probeIDToCompleteDest[probeAS].add(str(dstAS)+'|self') elif probeAS in coneDict[int(dstAS)]: try: probeIDToCompleteDest[probeAS].add(str(dstAS)+'|provider') except: pass else: try: probeIDToCompleteDest[probeAS].add(str(dstAS)+'|nonprovider') except: pass print('Average outage duration: '+str(np.median(durations))) print('Average delta start: ' + str(np.average(durationsOfDeltaStart))) print('Average delta end: ' + str(np.average(durationsOfDeltaEnd))) print('Median delta start: '+str(np.median(durationsOfDeltaStart))) print('Median delta end: '+str(np.median(durationsOfDeltaEnd))) plotter.suffix='End' plotter.ecdf(durationsOfDeltaEnd,'deltaDuration',xlabel='Delta from estimated outage end') plotter.suffix='Start' plotter.ecdf(durationsOfDeltaStart,'deltaDuration',xlabel='Delta from estimated outage start') #pp.pprint(successfullTraceroutesOutageIDToMsmID) pickle.dump(successfullTraceroutesOutageIDToMsmID,open('successfullTraceroutesOutageIDToMsmID.pickle','wb')) #pp.pprint(probeIDToCompleteDest)
if 'percentage' in fPerS: continue lengthOfData+=1 if 'No' in fPerS: failurePercentages['NA']+=1 continue fPer=float(fPerS) dataToPlot.append(fPer) if (fPer==0): print('Outage ID for 0: {0}'.format(outageID)) failurePercentages['0']+=1 elif (fPer>0 and fPer<50): failurePercentages['0to50']+=1 elif (fPer>=50 and fPer<70): failurePercentages['50to70']+=1 elif (fPer>=70 and fPer<90): failurePercentages['70to90']+=1 elif (fPer>=90): failurePercentages['90to100']+=1 percs=[] for k,v in failurePercentages.items(): perc=round(float(v/lengthOfData)*100,2) percs.append(perc) print(k,perc) print(k, v) plotter.ecdf(dataToPlot,'percentageFailedTraceroutes',xlabel='Percentage of Failed Traceroutes',ylabel='CDF: #Outages') #print(sum(percs))
numberOfTraceroutes) sys.stdout.flush() if numberOfTraceroutes > 0: if numberOfFailedTraceroutes > 0: trLoop = (numberOfLoopTraceroutes / numberOfFailedTraceroutes * 100) percentageTraceroutesWithRoutingLoop = float( "{0:.2f}".format(trLoop)) ot.write([outageID, percentageTraceroutesWithRoutingLoop]) loopdata.append(percentageTraceroutesWithRoutingLoop) for otID, setOfLoopIPs in loopIPsMap.items(): sameLoopCounts.append( len(setOfLoopIPs) / numberOfLoopTraceroutesPerOutage[otID] * 100) #loopdata=[45.91, 11.75, 0.0, 0.0, 0.0, 14.29, 15.0, 3.78, 0.0, 73.25, 22.0, 45.74, 20.0, 12.73, 20.41, 17.78, \ # 24.02, 18.26, 25.0, 0.0, 15.79, 14.58, 0.93, 1.31, 0.0, 0.62, 0.0, 50.0, 1.33, 5.71, 14.71, 6.98,\ # 33.33, 24.67, 4.74, 33.33, 9.54, 18.75, 14.58, 9.09, 15.63, 1.58, 11.43, 1.33, 9.57, 6.9, 32.09,\ # 9.71, 0.0, 13.12, 17.06, 14.29, 7.1, 16.1, 4.71, 33.33, 0.0, 5.11, 2.15, 30.14, 74.55, 6.25, 1.26,\ # 1.75, 0.0, 0.0, 1.5, 24.71, 6.31, 4.28, 5.84, 31.25, 28.54, 0.0, 11.37] plotter.ecdf(loopdata, 'percentageRoutingLoops', xlabel='Percentage of traceroutes with loops', ylabel='CDF: #Outages') plotter.ecdf(sameLoopCounts, 'sameRoutingLoops', xlabel='Percentage of traceroutes with same loop', ylabel='CDF: #Outages') print('Done.')
dstAS=AS ip2ASMap[dstIP]=AS else: dstAS=ip2ASMap[dstIP] if dstAS is not None: if probeAS not in probeIDToCompleteDest.keys(): probeIDToCompleteDest[probeAS]=set() if probeAS==dstAS: probeIDToCompleteDest[probeAS].add(str(dstAS)+'|self') elif probeAS in coneDict[int(dstAS)]: try: probeIDToCompleteDest[probeAS].add(str(dstAS)+'|provider') except: pass else: try: probeIDToCompleteDest[probeAS].add(str(dstAS)+'|nonprovider') except: pass print('Average outage duration: '+str(np.median(durations))) print('Average delta start: '+str(np.median(durationsOfDeltaStart))) print('Average delta end: '+str(np.median(durationsOfDeltaEnd))) plotter.suffix='End' plotter.ecdf(durationsOfDeltaEnd,'deltaDuration') plotter.suffix='Start' plotter.ecdf(durationsOfDeltaStart,'deltaDuration') #pp.pprint(successfullTraceroutesOutageIDToMsmID) pp.pprint(probeIDToCompleteDest)