Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • A Radius UDR belonging to a specific login session must always arrive before its corresponding Netflow UDRs. If a Netflow UDR arrives without a preceding Radius UDR, it must be deleted.

  • Within a Netflow UDR, the user initiating the session may act as a source or destination, depending on the direction of data transfer. Thus, it is important to match the IP address from the Radius UDRs with source or destination IP from the Netflow UDRs.

    Note
    titleNote!

    The Radius specific response handling will not be discussed in this example. For further information, see 9.60 64 Radius Agents.


Session Definition

For each session, all the necessary data must be saved. A suggestion of useful variables for this scenario is described below.

...

The Radius UDRs are the Aggregation session-initiating units. They may be of two types in this example; start or stop.

Pay attention to the use of the Additional Expression. The fields associating the start and stop Radius UDRs are framedIPAddress and acctSessId. However, since there is no field matching the latter within the Netflow UDRs, this field cannot be entered in the ID Fields area.


The Aggregation profile - Association tab - Radius UDRs

...

  1. Initially, the UDR is evaluated against the Primary Expression. If it evaluates to false, all further validation is interrupted and the UDR will be deleted without logging (since no more rules exist). Usually invalid UDRs are set to be deleted. In this case, only the UDRs of type start (acctStatusType=1) or stop (acctStatusType=2) are of interest.
     

  2. If If the Primary Expression evaluation was successful, the fields field Framed_IP_Address entered in the ID Fields areathe ID Fields area, together with the Additional Expressionthe Additional Expression (if any) are used as a secondary verification. If it evaluates to true, the UDR will be added to the session, if not - refer to subsequent step.
     

  3. Create Session on Failure is the final setting. It indicates if a new session will be created if no matching session has been found in step 2.

...

Code Block
languagetext
themeEclipse
import ultra.Example.Out;

sessionInit { 
  Accounting_Request_Int radUDR = 
    (Accounting_Request_Int) input;
  session.user = radUDR.User_Name; 
  session.IPAddress = radUDR.framedIPAddress; 
  session.sessionID = radUDR.acctSessionId; 
}

consume { 
  /* Radius UDRs. 
  If a matching session is found, then there are two Radius UDRs 
  and the session is considered completed. 
  Remove session and route the new UDR. */

  if (instanceOf(input, Accounting_Request_Int)) { 
    Accounting_Request_Int radUDR = (Accounting_Request_Int)input;

    if (radUDR.acctStatusType == 2 ) { 
      OutputUDR finalUDR = udrCreate( OutputUDR ); 
      finalUDR.user = session.user; 
      finalUDR.IPAddress = (string)session.IPAddress; 
      finalUDR.downloadedBytes = session.downloadedBytes; 
      finalUDR.uploadedBytes = session.uploadedBytes; 
      udrRoute( finalUDR );
      sessionRemove(session); 
      return; 
    } 
  }

  /* Netflow UDRs. 
  Depending on if the user downloaded or uploaded bytes, the 
  corresponding field data is used to update session variables. */

  if (instanceOf(input, V5UDR)) { 
    V5UDR nfUDR = (V5UDR)input;

      if ( session.IPAddress == nfUDR.SourceIP ) { 
        session.downloadedBytes = session.downloadedBytes + 
          nfUDR.BytesInFlow; 
      } else { 
        session.uploadedBytes = session.uploadedBytes + 
          nfUDR.BytesInFlow; 
      } 
  }

  // A session will be considered outdated in 5 days. 
  date timer=dateCreateNow(); 
  dateAddDays( timer, 5 ); 
  sessionTimeout( session, timer ); 
}

timeout { 
   // Outdated sessions are removed, and a resulting UDR is sent on. 
   OutputUDR finalUDR = udrCreate( OutputUDR ); 
   finalUDR.user = session.user; 
   finalUDR.IPAddress = (string)session.IPAddress; 
   finalUDR.downloadedBytes = session.downloadedBytes; 
   finalUDR.uploadedBytes = session.uploadedBytes; 
   udrRoute( finalUDR );
   sessionRemove(session); 
}


Scroll ignore
scroll-viewportfalse
scroll-pdftrue
scroll-officefalse
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmlfalse


Next section:



Scroll pagebreak