Changeset 121 for trunk/src

Show
Ignore:
Timestamp:
07/30/10 16:12:20 (13 years ago)
Author:
andreu
Message:

add multisampling for matrix and aggregation mode based on router ID

Location:
trunk/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dataFlowSet.c

    r119 r121  
    995995                  } 
    996996#else 
     997 
    997998                  if (myPtrs->currentRouterPtr->sampled != 0 ){ 
    998999                    /* IN ("traffic to the prefix/subnet")  */ 
     
    10221023                res2 = bsearch(&prefixKey, V4PTab, nbPV4,  
    10231024                               sizeof(struct PrefixV4), prefGlobalCmp); 
    1024                 if (res2!=NULL){                 
     1025                if (res2!=NULL){ 
     1026#if defined(MULTISAMPLING) 
     1027                  if (myPtrs->currentRouterPtr->sampled != res2->sampling ){ 
     1028                    ((struct POP *)((myPtrs->matrixPOP) 
     1029                                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1030                                    +((res2->routerNb))))->pktsNb += agCache.pkts*myPtrs->currentRouterPtr->sampled/res2->sampling; 
     1031                    ((struct POP *)((myPtrs->matrixPOP) 
     1032                                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1033                                    +((res2->routerNb))))->bytesNb += agCache.bytes*myPtrs->currentRouterPtr->sampled/res2->sampling; 
     1034                    ((struct POP *)((myPtrs->matrixPOP) 
     1035                                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1036                                    +((res2->routerNb))))->flowNb++; 
     1037                  } else { 
     1038                    ((struct POP *)((myPtrs->matrixPOP) 
     1039                                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1040                                    +((res2->routerNb))))->pktsNb += agCache.pkts; 
     1041                    ((struct POP *)((myPtrs->matrixPOP) 
     1042                                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1043                                    +((res2->routerNb))))->bytesNb += agCache.bytes;  
     1044                    ((struct POP *)((myPtrs->matrixPOP) 
     1045                                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1046                                    +((res2->routerNb))))->flowNb++; 
     1047                  } 
     1048#else 
    10251049                  ((struct POP *)((myPtrs->matrixPOP) 
    10261050                                  +((res->routerNb)*ROUTER_INDEX_MAX) 
     
    10321056                                  +((res->routerNb)*ROUTER_INDEX_MAX) 
    10331057                                  +((res2->routerNb))))->flowNb++;  
    1034                 } else { 
     1058#endif 
     1059                } else {  
     1060                  /* here we'll make the choice that in multisampling mode, 
     1061                   * the virtual POP that represent the reste of world is  
     1062                   * in 1:10 packets mode */ 
     1063#if defined(MULTISAMPLING) 
     1064                  ( 
     1065                   ((struct POP *)(myPtrs->matrixPOP) 
     1066                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1067                    +((ROUTER_INDEX_MAX-1))))->pktsNb += agCache.pkts*myPtrs->currentRouterPtr->sampled/10;  
     1068                  ( 
     1069                   ((struct POP *)(myPtrs->matrixPOP) 
     1070                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1071                    +((ROUTER_INDEX_MAX-1))))->bytesNb += agCache.bytes*myPtrs->currentRouterPtr->sampled/10;  
     1072                  ( 
     1073                   ((struct POP *)(myPtrs->matrixPOP) 
     1074                    +((res->routerNb)*ROUTER_INDEX_MAX) 
     1075                    +((ROUTER_INDEX_MAX-1))))->flowNb++; 
     1076#else 
    10351077                  ( 
    10361078                   ((struct POP *)(myPtrs->matrixPOP) 
     
    10441086                   ((struct POP *)(myPtrs->matrixPOP) 
    10451087                    +((res->routerNb)*ROUTER_INDEX_MAX) 
    1046                     +((ROUTER_INDEX_MAX-1))))->flowNb++;  
     1088                    +((ROUTER_INDEX_MAX-1))))->flowNb++; 
     1089#endif           
    10471090                } 
    10481091                /* end interpop matrix accounting */ 
     
    11401183#if defined(IPV4AGGIDR)  
    11411184              if ( myPtrs->routersID[res->routerNb] == agCache.routerAd  ) { 
     1185#if defined(MULTISAMPLING) 
     1186                if (myPtrs->currentRouterPtr->sampled != res->sampling ){ 
     1187                  res->bytesNbIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     1188                  res->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/res->sampling; 
     1189                  if (agCache.dscp>>2 == FIRST_CoS) { 
     1190                    res->firstCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     1191                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     1192                    res->secondCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     1193                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     1194                    res->thirdCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     1195                  } else { 
     1196                    res->fourthCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     1197                  } 
     1198                }else{ 
     1199                  res->bytesNbIN += agCache.bytes; 
     1200                  res->pktsNbIN += agCache.pkts; 
     1201                  (res->flowNbIN)++; 
     1202                  if (agCache.dscp>>2 == FIRST_CoS) { 
     1203                    res->firstCoSIN += agCache.bytes; 
     1204                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     1205                    res->secondCoSIN += agCache.bytes; 
     1206                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     1207                    res->thirdCoSIN += agCache.bytes; 
     1208                  } else { 
     1209                    res->fourthCoSIN += agCache.bytes; 
     1210                  } 
     1211                } 
     1212#else 
    11421213                if (myPtrs->currentRouterPtr->sampled != 0 ){ 
    11431214                  /* IN ("traffic to the prefix")  */ 
     
    11551226                  } 
    11561227                } 
     1228#endif 
    11571229              } 
    11581230              if (res->sampling == 0  
  • trunk/src/get_conf.c

    r95 r121  
    251251    { 
    252252#if defined(IPV4AGGIDR) 
     253#if defined(MULTISAMPLING) 
     254      sscanf(prefixStrTab[i],"%hu.%hu.%hu.%hu/%hu-%hu %hu\n", 
     255             &n0,&n1,&n2,&n3,&n4,&n5,&n6); 
     256#else 
    253257      sscanf(prefixStrTab[i],"%hu.%hu.%hu.%hu/%hu-%hu\n", 
    254258             &n0,&n1,&n2,&n3,&n4,&n5); 
     259#endif 
    255260#endif 
    256261#if defined(IPV4AGGIDSNMP) 
  • trunk/src/renetcol.c

    r120 r121  
    868868 
    869869  if ((ethernetPacket = pcap_next(myPcapHandle, &myPcapHeader)) == NULL) { 
     870    fprintf (stderr, "IP: %llu , UDP: %llu, NDEv9: %llu, drops: %llu, FS: %llu, Flows: %llu, realFl: %llu Diff:%llu\n", 
     871             myPtrs.currentMIB->ipPacketNb, 
     872             myPtrs.currentMIB->udpPacketNb, 
     873             myPtrs.currentMIB->v9PacketNb, 
     874             myPtrs.currentMIB->v9UnSeqNb, 
     875             myPtrs.currentMIB->flowSetNb, 
     876             myPtrs.currentMIB->flowNb, 
     877             myPtrs.currentMIB->realFlowNb, 
     878             myPtrs.currentMIB->flowNb - myPtrs.currentMIB->realFlowNb 
     879             ); 
    870880    pcap_close(myPcapHandle); 
    871881    exit(0); 
  • trunk/src/renetcolAgg.c

    r115 r121  
    44 * Authors: ANDREU Francois-Xavier  
    55 * 
    6  * Copyright (C) 2007 - 2009 GIP RENATER  
     6 * Copyright (C) 2007 - 2010 GIP RENATER  
    77 */ 
    88 
     
    2929 * When your system is too fast and the number of your subnet too big 
    3030 * (> 1024), the create and update process can be too fast and before the  
    31  * creation end the maximum number of files which can be opened for one process 
    32  * in the same time is reached. So we must temporize. 
     31 * end of creation. So the maximum number of files which can be opened for one 
     32 * process in the same time is reached and we must temporize. 
    3333 */ 
    3434 
  • trunk/src/renetcolAgg.h

    r115 r121  
    44 * Authors: ANDREU Francois-Xavier  
    55 * 
    6  * Copyright (C) 2005 2006 2007 GIP RENATER  
     6 * Copyright (C) 2005-2010 GIP RENATER  
    77 */ 
    88