---
title: Flooding packets for VoIP testing - ECG
description: It's sometimes useful to saturate a network with simple traffic to test your QoS measures. What you want is something that'll send a controlled amount of b
---

[![ECG](https://www.ecg.co/hubfs/lp/cloud-migration/logo-vector.svg)](https://www.ecg.co)

- Who We Are
  
  Company
  
  [**About ECG** Learn about the team behind the networks and services that solve real problems.](https://www.ecg.co/about) [**Careers** Join a fun, collaborative, engineer-owned company.](https://www.ecg.co/careers)
  
  Industries We Serve
  
  [**Enterprises** Optimize multi-site voice networks while meeting compliance requirements.](https://www.ecg.co/sectors/enterprise) [**Universities** Professional services designed for the unique needs of campus networks.](https://www.ecg.co/sectors/universities) [**Government** Engineering services built for government agency voice challenges.](https://www.ecg.co/sectors/government) [**Service Providers** Deep voice expertise to maintain compliance and keep customers connected.](https://www.ecg.co/sectors/service-providers)
- Technologies
  
  **Carrier & Trunking Services** SIP trunking, resilience & carrier interconnect
  
  **Compliance & Call Authentication** STIR/SHAKEN, 603+ & secure signaling
  
  **Unified Communications & Collaboration** UC capabilities & platform expertise
  
  **Platform Reliability & Security** Infrastructure, capture & network fundamentals

  ### Carrier & Trunking Services
  
  Design, harden, and secure the carrier side of your voice network — from SIP trunking to encrypted media and compliant recording.
  
  [SIP Trunking](https://www.ecg.co/technologies/sip-trunking-consulting-expertise) [SIP Trunking High Availability](https://www.ecg.co/technologies/sip-trunking-high-availability) [STIR/SHAKEN](https://www.ecg.co/technologies/stir-shaken) [603+](https://www.ecg.co/technologies/603-plus-do-not-originate) [eSIM & FMC](https://www.ecg.co/technologies/esim-fmc) [VoIP TLS & SRTP](https://www.ecg.co/technologies/voip-encryption-tls-srtp) [SIPREC](https://www.ecg.co/technologies/siprec-call-recording)

  ### Compliance & Call Authentication
  
  Meet regulatory requirements end-to-end — call authentication, robocall mitigation, lawful capture, and encrypted signaling.
  
  [STIR/SHAKEN](https://www.ecg.co/technologies/stir-shaken) [603+](https://www.ecg.co/technologies/603-plus-do-not-originate) [Packet Capture / PCAP](https://www.ecg.co/technologies/pcap-wireshark-packet-capture-analysis) [VoIP TLS & SRTP](https://www.ecg.co/technologies/voip-encryption-tls-srtp)

  ### Unified Communications & Collaboration
  
  Modern UC capabilities backed by deep, hands-on expertise across every major voice platform.
  
  [E911](https://www.ecg.co/technologies/e911) [Business Texting](https://www.ecg.co/technologies/business-texting) [Teams Replace Phone System](https://www.ecg.co/technologies/ms-teams-replace-phone-system) [Provisioning & Endpoint Mgmt](https://www.ecg.co/technologies/sip-provisioning-endpoint-management) [Call Control & Features](https://www.ecg.co/technologies/call-control-features) [SIP Trunking HA](https://www.ecg.co/technologies/sip-trunking-high-availability) [SIPREC](https://www.ecg.co/technologies/siprec-call-recording) [vCon](https://www.ecg.co/technologies/vcon-virtualized-conversations)
  
  Platform Expertise
  
  [BroadWorks](https://www.ecg.co/technologies/broadworks) [NetSapiens](https://www.ecg.co/technologies/netsapiens-support) [Metaswitch Alianza Core](https://www.ecg.co/technologies/metaswitch-alianza-core) [Oracle Communications](https://www.ecg.co/technologies/oracle-communications-support) [Metaswitch Perimeta](https://www.ecg.co/technologies/metaswitch-perimeta) [Sansay VSXi](https://www.ecg.co/sansay-vsxi-session-border-controller)

  ### Platform Reliability & Security
  
  The infrastructure layer underneath your voice services — engineered, monitored, and secured by people who run it every day.
  
  [EKS / Kubernetes](https://www.ecg.co/technologies/kubernetes-eks) [Critical Network Fundamentals](https://www.ecg.co/technologies/critical-network-fundamentals) [Packet Capture / PCAP](https://www.ecg.co/technologies/pcap-wireshark-packet-capture-analysis) [VMware & Alternatives](https://www.ecg.co/technologies/vmware-alternatives) [Routing, Switching & Firewalls](https://www.ecg.co/technologies/routing-switching-firewalls) [Freeswitch](https://www.ecg.co/technologies/freeswitch-open-source-call-processing)
- How We Do It
  
  Services
  
  [**Services Overview** Our experience and expertise in voice and data engineering.](https://www.ecg.co/services) [**Network Operations** Keep your voice network running with outsourced network operations.](https://www.ecg.co/services/network-operations) [**Staff Augmentation** Expert engineering support to meet deadlines and fill knowledge gaps.](https://www.ecg.co/services/staff-augmentation) [**IT Consulting & Engineering** Complete short-term projects faster with a dedicated project manager.](https://www.ecg.co/services/it-consulting-and-engineering)
- Resources
  
  #### [Utilities Launch Delay Calculator Estimate what a potential product launch delay would cost your business. Try the calculator](https://www.ecg.co/cost-delay-calculator)
  
  #### [Resource Library Guides, White Papers & Tools In-depth resources on voice engineering, compliance, and AI — built from real client work. Explore resources](https://www.ecg.co/resource-library)
  
  #### [Blog Latest from the ECG Team Practical articles on SIP, UC platforms, network operations, and voice AI. Read the blog](https://www.ecg.co/blog)
- [Events](https://www.ecg.co/events)

[Login](https://portal.ecg.co) [Contact](https://www.ecg.co/contact)

Who We Are

[About ECG](https://www.ecg.co/about) [Careers](https://www.ecg.co/careers)

Industries We Serve

[Enterprises](https://www.ecg.co/sectors/enterprise) [Universities](https://www.ecg.co/sectors/universities) [Government](https://www.ecg.co/sectors/government) [Service Providers](https://www.ecg.co/sectors/service-providers)

Technologies

Carrier & Trunking Services

[SIP Trunking](https://www.ecg.co/technologies/sip-trunking-consulting-expertise) [SIP Trunking High Availability](https://www.ecg.co/technologies/sip-trunking-high-availability) [STIR/SHAKEN](https://www.ecg.co/technologies/stir-shaken) [603+](https://www.ecg.co/technologies/603-plus-do-not-originate) [eSIM & FMC](https://www.ecg.co/technologies/esim-fmc) [VoIP TLS & SRTP](https://www.ecg.co/technologies/voip-encryption-tls-srtp) [SIPREC](https://www.ecg.co/technologies/siprec-call-recording)

Compliance & Call Authentication

[STIR/SHAKEN](https://www.ecg.co/technologies/stir-shaken) [603+](https://www.ecg.co/technologies/603-plus-do-not-originate) [Packet Capture / PCAP](https://www.ecg.co/technologies/pcap-wireshark-packet-capture-analysis) [VoIP TLS & SRTP](https://www.ecg.co/technologies/voip-encryption-tls-srtp)

Unified Communications & Collaboration

[E911](https://www.ecg.co/technologies/e911) [Business Texting](https://www.ecg.co/technologies/business-texting) [Teams Replace Phone System](https://www.ecg.co/technologies/ms-teams-replace-phone-system) [Provisioning & Endpoint Mgmt](https://www.ecg.co/technologies/sip-provisioning-endpoint-management) [Call Control & Features](https://www.ecg.co/technologies/call-control-features) [SIP Trunking HA](https://www.ecg.co/technologies/sip-trunking-high-availability) [SIPREC](https://www.ecg.co/technologies/siprec-call-recording) [vCon](https://www.ecg.co/technologies/vcon-virtualized-conversations)

Platform Expertise

[BroadWorks](https://www.ecg.co/technologies/broadworks) [NetSapiens](https://www.ecg.co/technologies/netsapiens-support) [Metaswitch Alianza Core](https://www.ecg.co/technologies/metaswitch-alianza-core) [Oracle Communications](https://www.ecg.co/technologies/oracle-communications-support) [Metaswitch Perimeta](https://www.ecg.co/technologies/metaswitch-perimeta) [Sansay VSXi](https://www.ecg.co/sansay-vsxi-session-border-controller)

Platform Reliability & Security

[EKS / Kubernetes](https://www.ecg.co/technologies/kubernetes-eks) [Critical Network Fundamentals](https://www.ecg.co/technologies/critical-network-fundamentals) [Packet Capture / PCAP](https://www.ecg.co/technologies/pcap-wireshark-packet-capture-analysis) [VMware & Alternatives](https://www.ecg.co/technologies/vmware-alternatives) [Routing, Switching & Firewalls](https://www.ecg.co/technologies/routing-switching-firewalls) [Freeswitch](https://www.ecg.co/technologies/freeswitch-open-source-call-processing)

How We Do It

Services

[Services Overview](https://www.ecg.co/services) [Network Operations](https://www.ecg.co/services/network-operations) [Staff Augmentation](https://www.ecg.co/services/staff-augmentation) [IT Consulting & Engineering](https://www.ecg.co/services/it-consulting-and-engineering)

Resources

[Launch Delay Calculator](https://www.ecg.co/cost-delay-calculator) [Guides, White Papers & Tools](https://www.ecg.co/resource-library) [Latest from the ECG Team](https://www.ecg.co/blog)

[Events](https://www.ecg.co/events)

[Login](https://portal.ecg.co) [Contact](https://www.ecg.co/contact)

# Flooding packets for VoIP testing

 By: Mark Lindsey

 1 min read

 Jan 19, 2008

![](https://www.ecg.co/hubfs/Imported_Blog_Media/content_3364040_f8bdb63bb4_o-1-1.jpg)It's sometimes useful to saturate a network with simple traffic to test your QoS measures. What you want is something that'll send a controlled amount of bandwidth. A [TCP-friendly](http://web.archive.org/web/20121005104242/http://www.psc.edu/index.php/projects/networking) connection won't work, because TCP slows down to the available amount of bandwidth. [iperf from NLANR](http://dast.nlanr.net/Projects/Iperf/) is one such tool. However, you have to have it running on both the sender and the receiver.

I couldn't find anything quick and easy that would do it. [Here's a tool that does it.](http://web.archive.org/web/20090105231449/http://vielle.net/~mark/flood_udp.pl) You'll need Perl and [Time-HiRes](http://search.cpan.org/~jhi/Time-HiRes-1.9711/HiRes.pm) to use it.

```
#!/usr/bin/perl -w 
## Mark R. Lindsey, lindsey@acm.org
## Flood a destination with fixed-sized UDP packets.

use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
use IO::Socket; 

$number_of_args = $#ARGV + 1;
if ($number_of_args < 3) {
 print "Usage: flood_udp.pl target_ip target_udp_port packets_per_second\n" ;
 die "Not enough arguments"
}

$target = $ARGV[0]; 
$target_port = $ARGV[1];
$packets_per_second = $ARGV[2];

$interpacket_delay_microseconds = 1 / $packets_per_second  * 1000000;

socket(BLAST, PF_INET, SOCK_DGRAM, getprotobyname("udp")); 

## This assumes a 1500-byte path MTU. The idea is to make a maximum-sized packet without fragmentation. 
## But if there's some fragmentation, that's not all so terrible.
my $payload_size = 1472;  
my $ip_packet_size = $payload_size + 8; ## assuming Ethernet
$msg = "u" x $payload_size;

my $bytes_per_second = $ip_packet_size * $packets_per_second;
my $bits_per_second = $bytes_per_second * 8;

print "$bits_per_second bits/second, $bytes_per_second bytes/second\n";
print "Sending to $target at UDP port $target_port\n";

## Send the UDP packet 
$ipaddr = inet_aton($target); 
$sendto = sockaddr_in($target_port,$ipaddr); 

while (1) {
 send(BLAST, $msg, 0, $sendto) ;
 usleep ($interpacket_delay_microseconds);
}
```

![](https://www.ecg.co/hubfs/Imported_Blog_Media/missing-image-Mar-25-2024-07-03-19-7278-AM.png)

[testing](https://www.ecg.co/blog/tag/testing)

## Similar posts

[![SIP and Fragments: Together Forever?](https://www.ecg.co/hubfs/Imported_Blog_Media/regular_26664897842_9f2f1b18db_o-1.jpg)](https://www.ecg.co/blog/125-sip-and-fragments-together-forever)

### [SIP and Fragments: Together Forever?](https://www.ecg.co/blog/125-sip-and-fragments-together-forever)

[![See only a Sampling of RTP frames in a Wireshark Packet Capture](https://www.ecg.co/hubfs/ecg-site/blog-listing-placeholder.jpg)](https://www.ecg.co/blog/117-see-only-a-sampling-of-rtp-frames-in-a-wireshark-packet-capture)

### [See only a Sampling of RTP frames in a Wireshark Packet Capture](https://www.ecg.co/blog/117-see-only-a-sampling-of-rtp-frames-in-a-wireshark-packet-capture)

[![Selling more than you have for sale](https://www.ecg.co/hubfs/ecg-site/blog-listing-placeholder.jpg)](https://www.ecg.co/blog/60-selling-more-than-you-have-for-sale)

### [Selling more than you have for sale](https://www.ecg.co/blog/60-selling-more-than-you-have-for-sale)

## Need Help With Your Network or AI Project?

Get expert advice from engineers who've solved complex problems for carriers, enterprises, and government agencies.

[Let's Talk](https://www.ecg.co/contact)

[![ecg-logo-white](https://www.ecg.co/hubfs/ecg-site/global/ecg-logo-white.svg "ecg-logo-white")](https://www.ecg.co/)

505 North Toombs St. Suite A  
Valdosta, Georgia 31601 USA

#### Headquarters

- 1.866.324.0700 US Toll-free
- 1.229.244.2099 International
- 1.229.244.2399 Fax
- [info@e-c-group.com](mailto:info@e-c-group.com)

#### Services

- [Overview](https://www.ecg.co/services)
- [Network Operations](https://www.ecg.co/services/network-operations)
- [Custom AI Development](https://www.ecg.co/services/custom-ai-development)
- [Outsourced NOC Support](https://www.ecg.co/services/outsourced-noc-support)
- [Staff Augmentation](https://www.ecg.co/services/staff-augmentation)
- [IT Consulting & Engineering](https://www.ecg.co/services/it-consulting-and-engineering)

#### Company

- [About](https://www.ecg.co/about)
- [Careers](https://www.ecg.co/careers)
- [Blog](https://www.ecg.co/blog)
- [Resources](https://www.ecg.co/resource-library)
- [Events](https://www.ecg.co/events)

© ECG, Inc. [Privacy Policy](https://9353907.hs-sites.com/privacy)

<https://twitter.com/ECGdotCO> <https://www.linkedin.com/company/-ecg-inc/>

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Mark Lindsey",
    "url" : "https://www.ecg.co/blog/author/mark-lindsey"
  },
  "dateModified" : "2024-03-25T07:05:57.393Z",
  "datePublished" : "2008-01-19T05:00:00.000Z",
  "headline" : "Flooding packets for VoIP testing - ECG",
  "mainEntityOfPage" : {
    "@id" : "https://www.ecg.co/blog/38-flooding-packets-for-voip-testing",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://www.ecg.co/hubfs/ECG_hexagons_and_url_borderless.jpeg"
    },
    "name" : "ECG, Inc"
  }
}
```