DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Creating Customized and Bootable Disk Images of Host Systems
  • Running Ansible From Windows Using Virtualization
  • Top Three Methods for iOS Development on Linux
  • Change Keyboad Bindings (Shortcuts) In the Virtual Console

Trending

  • Deploy a Session Recording Solution Using Ansible and Audit Your Bastion Host
  • Agile Metrics and KPIs in Action
  • Build a Serverless App Fast With Zipper: Write TypeScript, Offload Everything Else
  • The Convergence of Testing and Observability
  1. DZone
  2. Software Design and Architecture
  3. Performance
  4. Linux - Simulating Degraded Network Conditions

Linux - Simulating Degraded Network Conditions

When testing an application or service, it can be very useful to simulate degraded network conditions. This allows you to see how they might perform for users.

Corey Goldberg user avatar by
Corey Goldberg
·
Apr. 30, 15 · Interview
Like (0)
Save
Tweet
Share
4.20K Views

Join the DZone community and get the full member experience.

Join For Free

When testing an application or service, it can be very useful to simulate degraded network conditions. This allows you to see how they might perform for real users. Testing on a controlled LAN is not always realistic, since the LAN has much different network properties than a real user would experience over a WAN.

I will give examples using 2 tools that alter a network interface's properties. The tools are: NetEm and Wondershaper.

NetEm is an enhancement of the Linux traffic control facilities that allows you to add delay, packet loss, duplication, corruption, reordering, and more to outgoing packets from a specified network interface. NetEm is controlled by the command line tool tc, which is part of the iproute2 package and included in most Linux distros.

Wondershaper is a traffic shaping script that allows you to throttle network transfers on a specified network interface. This is useful for testing latency when bandwidth is limited.



Examples:

tc/NetEm:

add fixed 250ms delay to all outgoing packets on Ethernet interface eth1:

$ sudo tc qdisc add dev eth1 root netem delay 250ms

turn it off:

$ sudo tc qdisc del dev eth1 root netem 



Wondershaper:

limit bandwidth of eth1 interface to 256kbps upload and 128kbps download:

$ sudo wondershaper eth1 256 128

turn it off:

$ sudo wondershaper clear eth1
Network interface Linux (operating system)

Published at DZone with permission of Corey Goldberg, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Creating Customized and Bootable Disk Images of Host Systems
  • Running Ansible From Windows Using Virtualization
  • Top Three Methods for iOS Development on Linux
  • Change Keyboad Bindings (Shortcuts) In the Virtual Console

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: