Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:50:31+00:00 2026-05-26T08:50:31+00:00

I am trying to create a test environment to test the handling of network

  • 0

I am trying to create a test environment to test the handling of network errors between a client and a server. I cannot change the software on either. The two devices will be connected across a Linux bridge and I will be using various bandwidth shaping tools to restrict bandwidth or block traffic altogether to simulate various error conditions.

Another thing I need to do, which I have no idea yet how to achieve, is to generate socket errors on existing connections. I’d prefer to use an existing Linux tool/utility, but may be able to write my own with enough guidance. I’m pretty familiar with basic networking, TCP and UDP and all that, but not with bridging.

Can anyone suggest a way I can generate socket errors, e.g. by triggering unexpected FIN packets, to both ends of a socket that connects across a bridge?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:50:32+00:00Added an answer on May 26, 2026 at 8:50 am

    You can generate with scapy FIN or RST packets easily sniffing in the bridge (usually br0) and crafting proper RST or FIN packets.

    Here goes an example, where a RST is sent in the same direction of a packet with data.

    #!/usr/bin/python
    from scapy.all import *
    import random
    
    def sendRST(p):
        flags = p.sprintf("%TCP.flags%")
        if flags != "S":
            ip = p[IP]      # Received IP Packet
            tcp = p[TCP]    # Received TCP Segment
            if ip.len   <= 40:
                return
            i = IP()        # Outgoing IP Packet
            i.dst = ip.dst
            i.src = ip.src
            t = TCP()       # Outgoing TCP Segment
            t.flags = "R"
            t.dport = tcp.dport
            t.sport = tcp.sport
            t.seq = tcp.seq
            new_ack = tcp.seq + 1
            print "RST sent to ",i.dst,":",t.dport
            send(i/t)
    
    while (1):
    PKT = sniff (iface = "br0", filter = "tcp and src host x.x.x.x", count=1, prn=sendRST)
    exit()
    

    Check the options of sniff, wich is extremely powerfull 🙂

    Hope to help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a very simple REST server. I just have a test
I'm trying to create an environment using virtualenv. virtualenv test New python executable in
I'm trying to create a test environment for using an external C++ API so
I am trying to create a test harness for our QA staff to test
I have the below configuration where I'm trying to create a test C function
I'm trying to create an Android test project from within my main project. Exactly
I am trying to create a unit test for a method that takes a
I'm trying to create an UIImage test pattern for an iOS 5.1 device. The
Specifically, I'm trying to create a unit test for a method which requires uses
I am trying to learn how to create and test for the expiration of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.