methods and systems are described for an integrated solution to rate - based dos attacks targeting service provider networks . according to one embodiment , a flow collector is capable of receiving a variety of flow statistics in industry standards from routers and switches . these flow statistics may be in the form of packets in protocols , including , but not limited to , netflow , jflow , sflow , cflow and the like . the hardware - based apparatus collects this data and converts them to granular rate statistics in a round robin database for varying periods such as past hour , past day , past week , past month , past year etc . based on the past granular traffic statistics , the apparatus can determine corresponding rate - thresholds through continuous and adaptive learning . once these granular rate thresholds are breached for any traffic parameter , the apparatus can determine the networks being attacked or protocols or transmission control protocol ( tcp ) or user diagram protocol ( udp ) ports under attack once the corresponding adaptive thresholds are violated . in an exemplary embodiment of this invention , the router closer to the edge can then be requested to divert the affected traffic to a scrubbing center potentially including multiple scrubbing appliances . the techniques for such diversion and scrubbing are described well in the literature and are thus not elaborated upon further herein . in one embodiment , a single hardware - logic based appliance collects traffic statistics data from multiple routers and switches in a service provider network . it then integrates multiple mechanisms to determine the current granular traffic rate to multiple destinations and determines if any of the protected destinations are having a rate anomaly based on behavioral threshold estimation . the collector then informs the route reflector to divert the traffic destined to the destination network via a scrubbing appliance . the scrubbing appliance then forwards the cleansed traffic on to the eventual destination in a way to avoid any routing loops . the new appliance described herein provides copper and optical connectivity . a packet interface block interfaces with external network via a physical layer ( phy ) and switch device that contains the media access control ( mac ) layer . the packet interface block forwards packets to packet processing logic . the packet processing logic gets the flow statistics packets from the packet interface . a network flow can be defined in many ways , for example , cisco standard netflow version 5 defines a flow as a unidirectional sequence of packets that all share the following 7 values : 1 . ingress interface ( snmp ifindex ); 2 . source ip address ; 3 . destination ip address ; 4 . ip protocol ; 5 . source port for user datagram protocol ( udp ) or transmission control protocol ( tcp ), 0 for other protocols ; 6 . destination port for udp or tcp , type and code for internet control message protocol ( icmp ), or 0 for other protocols ; and 7 . ip type of service . a flow statistics record can contain a wide variety of information about the traffic in a given flow . an exemplary flow statistics record from netflow is described below in table 1 . according to one embodiment , the purpose of the packet processing logic is to determine the instantaneous granular rates and enforce a policy based on the granular rate thresholds . it does this via storing the granular packet rates in an internal or external granular metering memory . exemplary derived granular rate parameters are described below in table 2 . rate anomaly meters inside the packet processing logic receive classifier output and maintain the instantaneous packet - rates and compare them against the thresholds set adaptively and continuously by the controlling host . in one embodiment , if a specific type of packets exceeds the rate threshold , packets of that type and belonging to a destination are diverted to a scrubbing appliance via a message to the route reflector . an object of various embodiments of the present invention is to provide a high - rate hardware based integrated system and method of determining attacks to a destination , the destination having layers 3 , 4 , and 7 rate anomalies as detected by the system , which is continuously and adaptively adjusting rate thresholds . another object of various embodiments of the present invention is to provide a mechanism to communicate the affected destination to the route reflector so that it can divert the traffic via an inline attack mitigation device . a still further object of various embodiments of the present invention is to provide a rate anomaly engine capable of continuously calculating the traffic rate on classified granular traffic parameters and estimating the traffic rate thresholds adaptively and thus determining the threshold violations on traffic parameters , such as syn packets / second , protocol packets / second and / or concurrent connections / destination . fig1 depicts an exemplary flow collector apparatus 106 illustrating the functionality of an integrated system 100 for the mitigation of distributed denial of service attacks on a service provider network in accordance with an embodiment of the present invention . a protected destination 101 is usually behind customer edge router ( not shown ). the customer edge router is connected to a provider edge router 102 . in an exemplary embodiment of this invention , provider edge router 102 is connected to a core router 103 , which in turn is connected to a peering router 104 . peering router 104 is in turn connected to a public network , such as the internet , via a network cloud 105 . multiple of such peering routers may be connected in a typical network via core router 103 . when there is a distributed denial of service attack on protected destination 101 , the packets overload not just protected destination 101 , but the intervening routers , including provider edge router 102 , core router 103 and peering router 104 . in the context of the present example , a flow collector or traffic statistics collector 106 is provided that can determine the attack and request a router reflector 107 to send the traffic destined to protected destination 101 via route reflector 107 such that ddos attack mitigation appliance 108 cleanses the attack inline and then forwards the traffic via route reflector 107 to protected destination 101 . when the traffic returns to normal , the traffic diversion is removed and the traffic is routed to protected destination 101 through core router 103 . in this manner , core router 103 is protected from ddos attacks . various techniques for traffic diversion , and forwarding via tunnels to avoid routing are known to those skilled in the art and therefore not elaborated upon further herein . those desiring additional background on such techniques are directed to one or more of : ( i ) the chapter entitled “ configuring traffic diversion ” of the cisco guard configuration guide , software release 6 . 0 dated february 2007 ( currently available via the web at http :// www . cisco . com / en / us / docs / security / anomaly_detection_mit igation / appliances / guard / v6 . 0 / configuration / guide / advsn . html ); ( ii ) u . s . pat . no . 7 , 225 , 270 ; ( iii ) u . s . pat . no . 7 , 665 , 135 ; and ( iv ) u . s . pat . no . 8 , 510 , 826 each of which is hereby incorporated by reference in its entirety for all purposes . fig2 illustrates further details of flow collector 106 from fig1 in accordance with an embodiment of the present invention . in the context of the present example , flow packets 201 are processed via a hardware logic board , which may be implemented using one or more field - programmable gate arrays ( fpgas ) and / or application specific integrated circuits ( asics ). in one embodiment , board 202 ( which may more generally be referred to herein as a ddos attack detection module or a hardware module ) consists of a phy and switch 206 that allows interfacing with external connectors , including , but not limited to , rj - 45 or fiber interfaces , and allows forwarding packets to other components on board 202 . packet interface block 207 receives packets , buffers them in a packet buffer 211 and serially releases them to the subsequent logic . packet processing logic 208 receives traffic flow statistics packets from packet interface 207 . packet processing logic 208 uses a granular metering memory 210 to calculate and derive granular packet rates and to determine if there are any threshold violations . in one embodiment , granular metering memory 210 may be partially inside fpga / asic based board 202 and large blocks of memory may be external , for example , in a double data rate ( ddr ) memory . according to an embodiment of this invention , a host computer 203 can read the granular packet rate parameters via host interface 209 . in the present example , host computer 203 is connected to board 202 via a peripheral component interconnect express ( pcie ) interface 205 . those skilled in the art will appreciate a variety of alternative interfaces may be used . host computer 203 can similarly set the granular packet rate thresholds based on past behavior for that granular rate parameter . in one embodiment of this invention , host computer 203 stores the derived granular traffic statistics in multiple round - robin databases ( rrds ) 204 . according to an embodiment of this invention , rrds 204 allow the statistics to be stored in a round robin way for the last 1 hour , 8 hours , 1 day , 1 week , 1 month and 1 year . depending upon the particular implementation , the storage timeframes may differ . in one embodiment of this invention , host computer 203 can use rrds 204 to forecast future traffic based on past traffic for granular parameters using techniques well known to those skilled in the art . examples of these techniques include , but are not limited to , exponential smoothing and the holt - winters forecasting method . this ensures that the thresholds are continuously and adaptively adjusted if they go above the user configured minimum value . it also ensures that the average , trend and seasonality of the granular rates are used to predict the thresholds over time to match with the traffic . packet processing logic 208 continuously monitors the packet rates per second on multiple granular parameters based on the threshold set by host computer 203 . when the traffic exceeds the threshold for a particular granular parameter , the affected destination is identified . according to one embodiment , host interface 209 then interrupts host computer 203 . host computer 203 then sends a message to route reflector 107 . further , when the traffic returns to normal ranges , host interface 209 may also interrupt host computer 203 so that host computer 203 may inform route reflector 107 . fig3 further illustrates details for fpga / asic board 202 in accordance with an embodiment of the present invention . fig3 also illustrates further details of packet processing logic 208 in accordance with an embodiment of the present invention . when a flow statistics packet arrives from packet interface 207 , a layer 2 classifier 301 receives frames from packet interface 201 and classifies packets based on their layer 2 characteristics and ensures that it is a supported layer 2 packet , such as an ethernet 802 . 3 frame . layer 2 classifier 301 also parses the layer 2 headers and passes that information to subsequent logic blocks over a classification bus 308 . in an exemplary embodiment of this invention , layer 2 classifier 301 block can parse ethernet frames and ieee 802 . 2 / 3 frames and can determine address resolution protocol ( arp ), reverse arp ( rarp ), broadcast , internet protocol ( ip ), multicast , non - ip , virtual local are network ( vlan ) tagged frames , and double encapsulated vlan tagged frames . layer 3 classifier 302 receives packet data as well as layer 2 classifier information from layer 2 classifier 301 . layer 3 classifier 302 extracts the layer 3 header information in ip version 4 ( ipv4 ) and ip version 6 ( ipv6 ) headers and passes it on to the subsequent logic over classification bus 308 . in some embodiments of this invention , layer 3 classifier 302 parses ipv4 and ipv6 packets and determines properties , including , but not limited to , type of service ( tos ), ip options , fragmentation , and protocol . layer 4 classifier 303 , similarly , parses the layer 4 information from packets that are guaranteed to be in order with respect to fragmentation . in an exemplary embodiment , this classifier looks at transmission control protocol ( tcp ), user datagram protocol ( udp ), internet control message protocol ( icmp ), internet protocol security ( ipsec )- encapsulating security payload ( esp ), and ipsec - authentication header ( ah ). this information is passed to the subsequent blocks over classification bus 308 . in an exemplary embodiment of this invention , this classifier can parse layer 4 information , including , but not limited to , tcp options , tcp ports , udp ports , icmp types / codes , tcp flags , sequence numbers , ack numbers and the like . packets that are anomalous may be dropped . layer 7 classifier 304 , similarly , parses the layer 7 information from packets . in an exemplary embodiment , this classifier looks at tcp , udp packets and parses layer 7 traffic flow statistics from protocols , including , but not limited to , netflow , sflow , jflow and cflow . this information is passed to the subsequent blocks over classification bus 308 . layer 3 rate anomaly meters 305 utilize the output of layer 3 classifier 302 and derive layer 3 granular rates for identified destinations and enforce layer 3 granular rate thresholds based thereon . layer 4 rate anomaly meters 306 utilize the output of layer 4 classifier 303 and derive layer 4 granular rates for identified destinations and enforce layer 4 granular rate thresholds based thereon . layer 7 rate anomaly meters 306 utilize the output of layer 7 classifier logic 304 and derive layer 7 granular rates for identified destinations and enforce layer 7 granular rate thresholds based thereon . fig4 further illustrates an overall process for traffic rate collection , breach detection and traffic diversion in accordance with an embodiment of the present invention . at block 401 , information is received regarding destination ips and subnets to be monitored . for example , an administrator of the system may input the destination ip addresses and subnets to be monitored . at block 402 , host computer 203 continuously monitors these destination ips and subnets via granular metering memory 210 , for example . after a representative period , a granular traffic baseline is generated and is used to set the thresholds . at block 403 , host computer 203 continuously adjust the granular thresholds based on the past traffic stored in rrds 204 . according to one embodiment , if the estimated threshold is higher than the configured minimum threshold , the estimated threshold is used . if the estimated threshold is higher than the adaptive limit configured by the administrator , it is restricted to the adaptive limit . thus , in one embodiment , the adaptive threshold set in the hardware logic is always between configured minimum threshold and adaptive limit . at block 404 , fpga / asic board 202 ensures that the granular traffic rate to a monitored destination doesn &# 39 ; t exceed the adaptive threshold . in one embodiment , if the traffic exceeds the adaptive threshold , the destination ip or subnet is identified as being under attack . in block 405 , assuming an attack has been identified , host computer 203 is notified . in one embodiment , host interface 209 raises an interrupt that is serviced by host computer 203 . host computer 203 then causes route reflector 207 to be made aware of same , for example , by sending a message to route reflector 107 . at block 406 , route reflector 107 diverts the traffic destined to the destination under attack via ddos attack mitigation appliance 108 . route reflector 107 also ensures that the diversion doesn &# 39 ; t cause any routing loops . at block 407 , fpga / asic board 202 determines whether the granular traffic rate to a monitored destination has fallen below the adaptive threshold . if so , then the destination ip or subnet is identified as no longer being under attack / out of attack and host computer 203 is notified of same , for example , by host interface 209 raising an interrupt that is serviced by host computer 203 . the host computer then causes route reflector 107 to be made aware of same , for example , by sending a message to route reflector 107 . at block 408 , route reflector 107 removes the diversion of the traffic destined to the destination . thus the traffic now once again flows to the destination via core router 103 . fig5 further illustrates an exemplary process for deriving granular traffic statistics from traffic flow statistics in accordance with an embodiment of the present invention . according to one embodiment , layer 3 destination meter 506 is part of multiple logic components of layer 3 granular rate anomaly meter 305 . when layer 3 destination meter 506 receives the flow statistics classification from classifier bus 308 , it waits for destination ip to be seen , it increments the rate for that destination in a memory table in granular metering memory 210 . as more and more packets come for that destination , the count for the destination increases . if the count exceeds the threshold set by host computer 203 via host interface 209 , it interrupts host computer 203 via host interface 209 . at a predefined interval , layer 3 destination ager 507 resets the count for the destination to zero . layer 3 destination ager 507 then stores the packet rate for the destination being monitored . this packet rate can then be read by host computer 203 via host interface 209 and can be used for adaptive threshold estimation . embodiments of the present disclosure include various steps , which have been described above . a variety of these steps may be performed by hardware components or may be tangibly embodied on a computer - readable storage medium in the form of machine - executable instructions , which may be used to cause a general - purpose or special - purpose processor programmed with instructions to perform these steps . alternatively , the steps may be performed by a combination of hardware , software , and / or firmware . although embodiments of the present invention and their various advantages have been described in detail , it should be understood that the present invention is not limited to or defined by what is shown or discussed herein . moreover , as one skilled in the art will appreciate , any digital computer systems can be configured or otherwise programmed to implement the methods and apparatuses disclosed herein , and to the extent that a particular digital computer system is configured to implement the methods and apparatuses of this invention , it is within the scope and spirit of the present invention . once a digital computer system is programmed to perform particular functions pursuant to computer - executable instructions from program software that implements the present invention , it in effect becomes a special purpose computer particular to the present invention . the techniques necessary to achieve this are well known to those skilled in the art and thus are not further described herein . computer executable instructions implementing the methods and techniques of the present invention can be distributed to users on a computer - readable medium and are often copied onto a hard disk or other storage medium . when such a program of instructions is to be executed , it is usually loaded into the random access memory of the computer , thereby configuring the computer to act in accordance with the techniques disclosed herein . all these operations are well known to those skilled in the art and thus are not further described herein . the term “ computer - readable medium ” encompasses distribution media , intermediate storage media , execution memory of a computer , and any other medium or device capable of storing for later reading by a computer a computer program implementing the present invention . accordingly , drawings , tables , and description disclosed herein illustrate technologies related to the invention , show examples of the invention , and provide examples of using the invention and are not to be construed as limiting the present invention . known methods , techniques , or systems may be discussed without giving details , so to avoid obscuring the principles of the invention . as it will be appreciated by one of ordinary skill in the art , the present invention can be implemented , modified , or otherwise altered without departing from the principles and spirit of the present invention . therefore , the scope of the present invention should be determined by the following claims and their legal equivalents .