Professional Documents
Culture Documents
ThisdocumentdescribestheNetFlowfeatureanditsconfigurationonEnterasysswitch/routers.
For information about... What Is NetFlow? Why Would I Use It in My Network? How Can I Implement NetFlow? Understanding Flows Configuring NetFlow on the Enterasys Matrix DFE Configuring NetFlow on the Matrix X Core Router Terms and Definitions NetFlow Version 5 Record Format NetFlow Version 9 Templates Refer to page... 1 1 2 3 6 10 13 14 15
What Is NetFlow?
NetFlowisaflowbaseddatacollectionprotocolthatprovidesinformationaboutthepacketflows beingsentoveranetwork.NetFlowcollectsdatabyidentifyingunidirectionalIPpacketflows betweenasinglesourceIPaddress/portandasingledestinationIPaddress/port,usingthesame Layer3protocolandvaluesfoundinafixedsetofIPpacketfieldsforeachflow.NetFlowcollects identifiedflowsandexportsthemtoaNetFlowcollector.ANetFlowmanagementapplication retrievesthedatafromthecollectorforanalysisandreportgeneration.
Page 1 of 19
Page 2 of 19
Understanding Flows
locallyinacacheuntilaflowexpirationcriteriahasbeenmet.Asshown,NetFlowexportpackets aresenttotheNetFlowcollectorserver,whereacollectorandmanagementapplicationhasbeen installed.Themanagementapplicationwillprocesstherecordsandgenerateusefulreports.These reportsprovideyouwithaclearpictureoftheflowsthattraverseyournetwork,baseduponsuch datapointsassourceanddestinationaddress,startandendtime,application,andpacketpriority. ThefollowingstepsprovideahighleveloverviewofaNetFlowimplementation: 1. 2. DeterminethebusinessornetworkpurposeoftheinformationNetFlowwillprovideyou. ChooseacollectorandDragonSecurityCommandConsole(DSCC)orthirdparty managementapplication(s)bestsuitedforthepurposeyouarecollectingthedata.Installthe application(s)ontheNetFlowcollectorserver. IdentifythepathsusedbythedatatobecollectedbyNetFlow. IdentifythechokepointinterfaceswheretheIPpacketflowsyouwantNetFlowtocapture aggregate. EnableNetFlowontheidentifiedinterfaces. IdentifytheNetFlowcollectorserverbyconfiguringitsIPaddress. UsethedatareportinggeneratedbytheNetFlowmanagementapplicationtoaddressthe purposedeterminedinstep1.
3. 4. 5. 6. 7.
Understanding Flows
TheconceptofaflowiscriticaltounderstandingNetFlow.AflowisastreamofIPpacketsin whichthevalueofafixedsetofIPpacketfieldsisthesameforeachpacketinthestream.Aflowis identifiedbysevenkeyfieldsinanIPpacket: Sourceinputinterface SourceIPaddress DestinationIPaddress Destinationport(UDP/TCPportnumber) Sourceport(UDP/TCPportnumber) IPTOSfield Layer3protocol
Page 3 of 19
Understanding Flows
Theactivetimerdeterminesthemaximumamountoftimealonglastingflowwillremainactive beforeexpiring.Whenalonglastingactiveflowexpires,duetotheactivetimerexpiring,another flowisimmediatelycreatedtocontinuetheongoingflow.Itistheresponsibilityofthe managementapplication,ontheNetFlowcollector,torejointhesemultipleflowsthatmakeupa singlelogicalflow.TheactivetimerisconfigurableintheCLI(seeConfiguringtheActiveFlow ExportTimeronpage 6). TheinactivetimerdeterminesthelengthoftimeNetFlowwaitsbeforeexpiringtheflowoncea flowhasstopped.Theinactivetimerisafixedvalueof40secondsandcannotbeconfigured. RulesforexpiringNetFlowcacheentriesinclude: Flowswhichhavebeenidlefor40seconds(fixedvalueinfirmware)areexpiredandremoved fromthecache. Longlivedflowsareexpiredandremovedfromthecache.(Flowsarenotallowedtolivemore than30minutesbydefault;theunderlyingpacketconversationremainsundisturbed). Flowsassociatedwithaninterfacethathasgonedownareautomaticallyexpired.
Figure 2providesagraphicdepictionofhowthesetimersinteract.Flows1and3showasingle longlastinglogicalflow.Flow1timesoutandexpiresat30minutes,theactivetimerlength. Becausetheflowexpires,anexportpacketissenttotheNetFlowcollector.Flow3continuesthis longlastingflowforanother10minutes.Attime40minutestheflowends.The40secondinactive timerinitiatesandexpiresat40minutesand40secondsresultinginanexportpackettothe NetFlowcollectorforflow3.AttheNetFlowcollector,themanagementapplicationjoinsthetwo flowsintoasinglelogicalflowforpurposesofanalysisandreporting. Flow2isa7.5minuteflowthatneverexpirestheactivetimer.Itbeginsat2.5minutesandendsat 10minutes.At10minutestheinactivetimercommencesandexpirestheflowat10minutesand40 seconds.Atthistime,NetFlowsendsanexportpacketfortheflowtotheNetFlowcollectorfor processing.
Page 4 of 19
Understanding Flows
Figure 2
Page 5 of 19
Page 6 of 19
responsibilityofthemanagementapplicationtorecognizethemultipleflowsasasinglelogical flowforanalysisandreportingpurposes.Theactiveflowtimerdefaultsto30minutes.
Notes: Some NetFlow management applications expect to see export packets prior to some set interval that is often as low as 1 minute. Check the documentation for your management application and make sure that the active flow timer is configured for a value that does not exceed that value.
Page 7 of 19
systemmustbedetermined,sincethedefaultsettingsofa20packetrefreshrateanda30minute timeoutmaynotbeoptimalforyourenvironment.SeeConfiguringNetFlowExportVersion Refresh. NetFlowVersion9recordsgeneratedbyDFEmodulesusetrueMIB2ifIndexvaluessincethe templatemechanismpermitstransmissionof4byteifIndexes.Version9alsouses8bytepacket andbytecounters,sotheyarelesslikelytorollover.Checkwithyourcollectorproviderto determineiftheyprovidethenecessarysupport. ThecurrentVersion9implementation: Doesnotsupportaggregationcaches. Providesfourpredefinedtemplates.Theappropriatetemplateisselectedforeachflow dependingonwhethertheflowisroutedorswitched,andwhetheritisaTCP/UDPpacketor not.SeeTable 5onpage 15foracompletelistingofthefieldsforeachoftheNetFlowVersion 9supportedtemplates.
Usethesetnetflowexportversion{5|9}commandtosettheNetFlowexportversion. Usetheclearnetflowexportversioncommandtoresettheexportversiontothedefaultvalue.
Templaterefreshbasedonthetimeoutperiodisperformedoneverymodule.SinceeachDFE modulehandlesitsownpackettransmissions,templaterefreshbasedonnumberofexport packetssentismanagedbyeachmoduleindependently. TherefreshratedefinesthemaximumdelayaneworrestartedNetFlowcollectorwould experience,beforeitlearnstheformatofthedatarecordsbeingforwarded(fromthetemplate referencedbythedatarecords).RefreshratesaffectNetFlowcollectorsduringtheirstartup. Collectorsmustignoreincomingdataflowreportsuntiltherequiredtemplateisreceived. Thedefaultbehaviorisforthetemplatetobesentafter20exportdatapacketsaresent.Sincedata recordpacketsaresentoutperflow,alongFTPflowmaycausethetemplatetimeouttimerto expirebeforethemaximumnumberofpacketsaresent.Inanycasearefreshofthetemplateis sentattimeoutexpirationaswell. SettingtheappropriaterefreshrateforyourEnterasysMatrixsystemmustbedetermined, becausethedefaultsettingsofa20packetrefreshrateanda30minutetimeoutmaynotbe optimalforyourenvironment.Forexample,aswitchprocessinganextremelyslowflowrateof, say,20packetsperhalfhour,wouldrefreshthetemplatesonlyeveryhalfhourusingthedefault settings,whileaswitchsending300flowreportpacketspersecondwouldrefreshthetemplates 15timespersecond. EnterasysrecommendsthatyouconfigureyourEnterasysMatrixsystemsoitdoesnotrefresh templatesmoreoftenthanoncepersecond. Usethesetnetflowtemplate{[refreshrate#ofPackets][timeoutminutes]}tosettheNetFlow exporttemplaterefreshrateandtimeoutforthissystem. Usetheclearnetflowtemplate{[refreshrate][timeout]}toresettheNetFlowexporttemplate refreshrateandtimeouttothedefaultvalues.
Page 8 of 19
3.
4. 5.
Optionally, change NetFlow record format Matrix(rw)->set netflow between version 5 and version 9 for this system. export-version version
Page 9 of 19
Procedure 1
Step 6. Task
If using version 9, optionally modify the number of export packets sent that cause a template to be retransmitted by an individual DFE module and/or the length of the timeout period, in minutes, after which a template is retransmitted by all modules in the system. Verify any configuration changes made.
7.
Export Version
Version 5
Timeout-period
30 minutes
Page 10 of 19
datatotheCMforexportwhentheconfiguredexportintervaltimeexpires(defaultis30minutes) orwhenthecacheisfull. TheNetFlowexportprocessontheCMgathersanyfurtherdataneededtocompletethedata recordformatfortheconfiguredNetFlowversionandsendstheflowrecordstotheconfigured NetFlowcollector.NotethatonlyoneNetFlowexportdestination(collector)canbeconfigured perX Routersystem. NetFlowcanbeenabledonanyportontheX Router. TheMatrixXRoutercurrentlysupportsdataexportVersion1andVersion5.CLIcommandsare providedtoconfigurecertainrecordformatvaluesrequiredforVersion5,suchasengineIDand enginetype. YoumustconfigureaNetFlowexportdestinationbeforeyoucanenableNetFlowgloballyoron anyports.NetFlowwillstartsamplingpacketsafteryouenableNetFlowgloballyandonthe desiredports. Procedure 2
Step 1. 2. 3. Task Optionally, check the current NetFlow configuration settings and sampling rate. Optionally, change the sampling rate for packets. Configure the NetFlow collector destination. You cannot enable NetFlow globally or on ports until an export destination has been configured. Configure the administrative interface used as the source IP address of the exported NetFlow packets. Configure the NetFlow flow record version to be used for the flow data packets. Version 5 is the default. Optionally, also configure the BGP AS address type. Default is peer-as. 6. 7. 8. If using Version 5, configure the engine ID and engine type. Optionally, configure the export interval. The default is 30 minutes. Optionally, configure the maximum number of flows that can be saved into the cache. The default is 64 KB. Enable NetFlow globally. Enable NetFlow on the desired ports. set netflow engine-id engine-id type engine-type set netflow export-interval min set netflow entries max-num
4.
5.
9. 10.
Disabling NetFlow
TodisableNetFlowonaport,useeitherofthefollowingcommands:
set netflow port port-string disable
Page 11 of 19
Whenyouexecutetheclearnetflowallcommand,allNetFlowsettingsarereturnedtotheir defaultcondition.InthecaseoftheglobalNetFlowcachesetting,thedefaultisdisabled.
TodisplayNetFlowstatisticsonaperportbasis:
show netflow statistics port-string
TodisplayflowcountersforthecurrentcachedNetFlowinformation,onasystemwideor IOMspecificbasis:
show netflow cache-flow [slot-id]
Parameter Cache Status Sampling Rate Engine ID Engine Type Administrative Interface Destination IP Destination UDP port Export Version
Page 12 of 19
Table 2
peer AS 84 KB Disabled
Flow Flow Record Inactive Flow Timer NetFlow Cache NetFlow Collector
NetFlow Export
Page 13 of 19
NetFlow Version 5 Header Data Field count sys_uptime unix_secs unix_nsecs flow_sequence engine_type engine_id sampling_interval count NetFlow Version 5 Data Record Format Data Field srcaddr dstaddr nexthop input output dPkts dOctets first last srcport dstport pad1 tcp_flags Support Source IP address of the device that transmitted the packet. IP address of the destination of the packet. IP address of the next hop router. SNMP index of input interface. SNMP index of output interface. Number of packets in the flow. Total number of Layer 3 bytes in the packets of the flow. SysUptime at start of flow. SysUptime at the time the last packet of the flow was received. TCP/UDP source port number or equivalent. TCP/UDP destination port number or equivalent. Unused (zero) bytes. Cumulative OR of TCP flags. Support Number of flows exported in this packet (1-30). Current time in milliseconds since the export device booted. Current count of seconds since 0000 UTC 1970. Residual nanoseconds since 0000 UTC 1970. Sequence counter of total flows seen. Type of flow-switching engine. Slot number of the flow-switching engine. First two bits hold the sampling mode; remaining 14 bits hold value of sampling interval. Number of flows exported in this packet (1-30).
Page 14 of 19
Table 4
prot tos src_as dst_as src_mask dst_mask pad2
NetFlow Version 9 Header Data Field Format Version Flow Record Count Support 9 The total number of records in the export packet, which is the sum of the options flow set records, template flowset records, and data flowset records. Time in milli-seconds since this device was first booted. Time in seconds since 0000 UTC 1970, at which the export packet leaves the exporter. Incremental sequence counter of all export packets sent from the exporter. This is an accumulative count that lets the collector know if any packets have been missed. Engine Type (1 = Line Card). Engine ID (One based module slot number). NetFlow Version 9 Data Record (Template 256, Switch ID) Data Field SIP Support (Source) IP address of the device that transmitted the packet.
Source ID
Page 15 of 19
Table 5
DIP
Dest IfIndex Source IfIndex Packet Count Byte Count Start Time Last Time IP Protocol TOS
V9 NetFlow Data Record (Template 257, Next Hop ID) Data Field SIP DIP Dest IfIndex Source IfIndex Packet Count Byte Count Start Time Last Time IP Protocol TOS Next Hop Router Support (Source) IP address of the device that transmitted the packet. (Destination) IP address of the destination device. MIBII 32-bit ID of the interface on which the packet was transmitted. MIBII 32-bit ID of the interface on which the packet was received. The number of packets switched through this flow. The number of bytes switched through this flow. sysUptime in msec at which the first packet of this flow was switched. sysUptime in msec at which the last packet of this flow was switched. IP protocol for this flow. Type of service field value for this flow. Specifies the BGP next-hop address.
V9 NetFlow Data Record (Template 258, Switch ID with TCP/UDP) Data Field SIP Support (Source) IP address of the device that transmitted the packet.
Page 16 of 19
Table 5
DIP
Dest IfIndex Source IfIndex Packet Count Byte Count Start Time Last Time IP Protocol TOS L4 Source Port L4 Dest Port
V9 NetFlow Data Record (Template 259, Next Hop ID with TCP/UDP) Data Field SIP DIP Dest IfIndex Source IfIndex Packet Count Byte Count Start Time Last Time IP Protocol TOS Next Hop Router Support (Source) IP address of the device that transmitted the packet. (Destination) IP address of the destination device. MIBII 32- bit ID of the interface on which the packet was transmitted. MIBII 32- bit ID of the interface on which the packet was received. The number of packets switched through this flow. The number of bytes switched through this flow. sysUptime in msec at which the first packet of this flow was switched. sysUptime in msec at which the last packet of this flow was switched. IP protocol for this flow. Type of service field value for this flow. Specifies the BGP next-hop address.
Page 17 of 19
Table 5
Page 18 of 19
Revision History
Date January 16, 2008 February 26, 2008 Description First Release. Modifications due to product branding changes.
Enterasys Networksreservestherighttomakechangesinspecificationsandotherinformationcontainedinthis documentanditswebsitewithoutpriornotice.ThereadershouldinallcasesconsultEnterasys Networksto determinewhetheranysuchchangeshavebeenmade. Thehardware,firmware,orsoftwaredescribedinthisdocumentissubjecttochangewithoutnotice. INNOEVENTSHALLENTERASYS NETWORKSBELIABLEFORANYINCIDENTAL,INDIRECT,SPECIAL, ORCONSEQUENTIALDAMAGESWHATSOEVER(INCLUDINGBUTNOTLIMITEDTOLOSTPROFITS) ARISINGOUTOFORRELATEDTOTHISDOCUMENT,WEBSITE,ORTHEINFORMATIONCONTAINEDIN THEM,EVENIFENTERASYS NETWORKSHASBEENADVISEDOF,KNEWOF,ORSHOULDHAVEKNOWN OF,THEPOSSIBILITYOFSUCHDAMAGES. Enterasys Networks, Inc. 50MinutemanRoad Andover,MA01810 2008Enterasys Networks, Inc.Allrightsreserved. ENTERASYS,ENTERASYS NETWORKS,ENTERASYSMATRIX,ENTERASYSNETSIGHT,LANVIEW, WEBVIEW,andanylogosassociatedtherewith,aretrademarksorregisteredtrademarksof Enterasys Networks, Inc.,intheUnitedStatesandothercountries. Allotherproductnamesmentionedinthismanualmaybetrademarksorregisteredtrademarksoftheirrespective companies.