...
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
...
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.
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 totrue
, the UDR will be added to the session, if not - refer to subsequent step.
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 | ||||
---|---|---|---|---|
| ||||
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 pagebreak |
---|