[HN Gopher] Open-source network emulators and simulators
       ___________________________________________________________________
        
       Open-source network emulators and simulators
        
       Author : transpute
       Score  : 161 points
       Date   : 2023-10-11 08:23 UTC (7 hours ago)
        
 (HTM) web link (www.brianlinkletter.com)
 (TXT) w3m dump (www.brianlinkletter.com)
        
       | dark-star wrote:
       | eve-NG is still the easiest to use IMHO, me and many of my
       | coworkers used it to prepare for our CCNA/CCNP/CCIE
       | certifications.
       | 
       | I would swap it in an instant for an equally user-friendly open-
       | source one though, if there was anything comparable, as some of
       | the features lacking in eve-NG Community were really annoying to
       | deal with (e.g. no connection to a real, physical network and/or
       | the internet)
        
       | omnibrain wrote:
       | Really nice list. Back in the day when I started out and did a
       | bit of CCNA material I used the proprietary Cisco Packet Tracer a
       | lot. Ultimatively I did not follow the networking route for
       | various reasons, but if I would have, then GNS3 would have been
       | my simulator of choice. You can load the original Cisco firmware
       | into it (if you can get hold of it) and really study in depth.
        
       | yjftsjthsd-h wrote:
       | Does anyone know if any of these tools support emulating wifi
       | radios such that a person could test, say, hostapd
       | configurations, independently or in the context of a network to
       | make sure all the pieces are working together? (That is, without
       | ever connecting anything to a live wireless card)
        
       | cebert wrote:
       | Does anyone have recommendations if you want to simulate
       | poor/unreliable/slow networks in order to ensure a client
       | application handles these scenarios? Would a network emulator be
       | the appropriate tool for this?
        
         | Libcat99 wrote:
         | You can configure the Linux network stack to include packet
         | loss and latency using tc.
         | 
         | Not sure about other os.
         | 
         | https://www.pico.net/kb/how-can-i-simulate-delayed-and-dropp...
        
         | c0nsumer wrote:
         | Look at using pf on OpenBSD. Specifically, look at the
         | probability and set delay options:
         | https://man.openbsd.org/pf.conf
         | 
         | Couple this with inserting pf as a transparent firewall and you
         | can make a good hop become all sorts of crappy. And you can do
         | this on very low end hardware with just a pair of NICs.
        
         | NexRebular wrote:
         | FreeBSD with dummynet. Has always worked great for testing
         | different network conditions.
        
       | runamuck wrote:
       | Thank you for this list. I started my career with Opnet (Riverbed
       | purchased them in 2013) and IIRC the license cost mid five
       | figures per year. This list tipped me to OmNet++ which may
       | provide a similar DES environment. I look forward to checking it
       | out.
        
       | racked wrote:
       | +1 for GNS3. I used it to mimic my home network (MikroTik gear)
       | and test out VLAN configs. Great tool, quick to learn, easy to
       | use, works flawlessly on Linux!
        
       | mch82 wrote:
       | CORE has been updated twice since the list was created. It's
       | actively maintained. CORE emulates mobile, changing networks like
       | IoT devices, phones, or network-connected vehicles.
       | 
       | GitHub - https://github.com/coreemu/core
       | 
       | Community Discord - https://discord.gg/AKd7kmP
        
       | aeonik wrote:
       | I used to use a network Emulator+Physics/Traffic Simulator called
       | NCTUns to research vehicle networking back in 2010.
       | 
       | I remember it was pretty cool. If I recall correctly, I could run
       | several instances of all kinds of networking gear, configure
       | wireless interfaces, place physical barriers, roads, etc... then
       | I could see how packets and routing tables would behave while the
       | emulated instances of routers/switches/APs moved around the
       | physical world.
       | 
       | Pausing the would, clicking on a little car, and serialing into a
       | particular router that was running Cisco IOS was always pretty
       | mind blowing to me though.
       | 
       | They had all kinds of custom protocols that could route network
       | traffic depending on which direction the traffic was flowing: you
       | didn't want packets to get stuck in loops, hopping back and forth
       | between oncoming traffic. Especially in sparse environments.
       | 
       | I don't know what happened to it, it looks like it got spun off
       | into a commercial company:
       | 
       | http://nsl.cs.nctu.edu.tw/NSL/nctuns.html
        
       | jiggawatts wrote:
       | The most important and most useful thing is the hardest to
       | obtain: latency simulators.
       | 
       | I just want an IPv4/IPv6 proxy that does _nothing_ other than
       | delay, rate-limit, and /or drop packets.
       | 
       | This is a critical aspect of application performance that all
       | developers just ignore because it's such a PITA to simulate.
       | 
       | Your loopback adapter has a latency of 30 microseconds, but that
       | same web-to-database connection might traverse multiple switches,
       | routers, firewalls, and load balancers and have a latency of over
       | 1,000 microseconds (1ms) in production. That's _thirty times
       | worse_ , and I'm not even talking about zone-redundant
       | deployments, regional-to-region failover, or any such thing!
       | 
       | Ditto with web apps, where every developer mistakenly believes
       | that their Angular or React monstrosity is "performant"...
       | because it is... on their own machine. With loopback networking.
       | Try that over a 3G connection... in rural India. Not Indiana.
       | India.
        
         | az09mugen wrote:
         | Your proxy adding latency is a very good idea. I'm wondering
         | what it would be wrote in. Go, so you can integrate it easily
         | on a k8s as a side container or else ? Rust, so it can be
         | performant and at low level ? Nim, so it can be easy to write
         | and performant ? I think that can't be that difficult to write,
         | but maybe I'm wrong. I will look into it but I don't promise
         | anything. I think it is a good pet/side project.
        
           | murkt wrote:
           | You can also write it in Python, so it can be slow while it
           | slows down your packets.
        
         | Borg3 wrote:
         | Huh? FreeBSD had this 15 years ago already (if not more).
         | Thingie is called DUMMYNET. Imunes utilizes netgraph thingie
         | that can be connected thro pipes (DUMMYNET) to emulate whatever
         | delay, bandwidth and BER you want. Very handy thing to check
         | out how your stuff will behave on dialup for example.
         | 
         | This is my BGP troll lab for some testing ;)
         | 
         | http://ds-1.ovh.uu3.net/~borg/pics/bgp-lab.png
        
         | discord23 wrote:
         | > I just want an IPv4/IPv6 proxy that does nothing other than
         | delay, rate-limit, and/or drop packets.
         | 
         | About 15 years ago I needed to emulate a network over a
         | satellite link. We had limited amount of time on the dish and
         | it was a fairly costly affair. We had a small rack of hardware
         | together with a bunch of measuring instruments that would be in
         | the field for data acquisition. It would be sending back data
         | home where it would be processed and then sent back into the
         | field. The (limited) bandwidth reserved and the inherent
         | latency on the link gave us some interesting issues to deal
         | with, but it required a few iterations to get things working
         | smoothly.
         | 
         | The rack had a Linux box which acted as a router (among other
         | things), and while it was in the office we'd just hook it up
         | via ethernet. So I used tc[0] on there to introduce a fixed
         | latency on transmission and cap the outgoing bandwith to
         | whatever was available on the link. I did the same on the
         | homestation for outgoing traffic but there I just used an old
         | box with two ethernet ports and set it up as a bridge.
         | 
         | For dropping packets I used iptables, and some other things.
         | 
         | It requires some familiarity with the LARTC[1], which isn't the
         | most readable document, and how things work in Linux. It gave
         | us exactly what we needed without having to pay for time on the
         | dish for testing.
         | 
         | It's been over a decade and the details are extremely vague,
         | but I'm sure that if you want to you could mark certain packets
         | with netfilter and then delay those packets somehow, rather
         | than just delay the entire network device. I remember that with
         | iptables we used to mark packets from SSH in the mangle table
         | and then use that mark with tc to give traffic marked priority
         | on the outgoing device.
         | 
         | It's not exactly a proxy, but back in the day it worked for
         | that specific use case.
         | 
         | [0] : https://linux.die.net/man/8/tc
         | 
         | [1] : https://tldp.org/HOWTO/Adv-Routing-HOWTO/
        
           | okl wrote:
           | tc is the way to go if the options are sufficient. You can
           | bridge two interfaces (also virtual ones) in a VM and set
           | qdiscs. Also works asynchronously, e.g., different rules for
           | up/downlink. Instead of a VM setup one could use a cheap
           | linux/openWrt router or an SBC-type board.
        
         | SSLy wrote:
         | https://github.com/tylertreat/Comcast
        
         | cris-ward wrote:
         | For web apps, chrome has a throttling tool in the dev tools.
         | Not sure how sophisticated it is, but I've used occasionally to
         | recreate bugs only noticed by clients on slower connections.
        
         | TickleSteve wrote:
         | Does 'tc' fit your need? its a simple solution to that sort of
         | need: https://man7.org/linux/man-pages/man8/tc.8.html
        
         | belter wrote:
         | On Cloud you could look at the AWS Fault Injection Simulator.
         | This example is in the context of EKS but you could use it for
         | EC2.
         | 
         | "AWS Fault Injection Simulator supports chaos engineering
         | experiments on Amazon EKS Pods" -
         | https://aws.amazon.com/blogs/containers/aws-fault-injection-...
        
         | circuit10 wrote:
         | I've noticed that Hacker News is a lot faster than other sites
         | and apps on a bad connection probably because it's just basic
         | HTML
        
           | lionkor wrote:
           | Because not every letter is a 500 line, 30 dependency
           | component, in other words
        
           | jesse_faden wrote:
           | Basic HTML isn't static HTML. The comments and posts for
           | Hacker News still needs to be stored and loaded from a
           | database.
        
             | circuit10 wrote:
             | That doesn't happen over my mobile data connection so I
             | don't see how that's relevant to my point
        
             | grotorea wrote:
             | That doesn't matter for the client through. As long as the
             | data can come in a single small file, for example the <3KB
             | HTML file for the tab I'm writing this on, what the server
             | is doing doesn't matter.
        
             | diggan wrote:
             | Well, kind of, at least considering the last public version
             | of Arc, that HN uses (found here: http://arclanguage.org/)
             | 
             | It seems to be storing stuff directly on disk, on the same
             | host that the software itself runs on.
             | 
             | So you're right if you consider the filesystem a sort of
             | database, but otherwise no :)
        
               | robertlagrant wrote:
               | It was announced in 2008! 15% into the 100 year language.
        
             | mysterydip wrote:
             | Not sure their tech stack (I'm sure there's a post on it
             | somewhere) but there was a forum software way back that
             | would compile replies and such into static html pages when
             | the submit button was hit, on the assumption that they
             | would be read a lot more times than written to. Worked
             | pretty well from what I recall.
        
               | diggan wrote:
               | Great idea in theory until you want to change the
               | presentation and now have to recompile 37843105
               | (37843314) items :)
        
         | iam-TJ wrote:
         | Linux's tc-netem [0] is designed for this:
         | 
         | "The netem queue discipline provides Network Emulation
         | functionality for testing protocols by emulating the properties
         | of real-world networks.
         | 
         | The queue discipline provides one or more network impairments
         | to packets such as: delay, loss, duplication, and packet
         | corruption."
         | 
         | [0] https://man7.org/linux/man-pages/man8/tc-netem.8.html
        
         | _flux wrote:
         | I suppose any proxy can be used in combination with
         | https://www.linux.org/docs/man8/tc-netem.html but it is a bit
         | tedious.
         | 
         | Perhaps one of the linked projects can help with it?
        
         | enlyth wrote:
         | I use this to simulate delays between various local services:
         | 
         | https://github.com/Shopify/toxiproxy
         | 
         | If you have Docker all you need is a few terminal commands
        
         | adql wrote:
         | > I just want an IPv4/IPv6 proxy that does nothing other than
         | delay, rate-limit, and/or drop packets.
         | 
         | Built-in into linux kernel, althought it's per interface unless
         | you get dirty with traffic shaping tools.
         | 
         | Also you probably _dont_ want proxy as support for proxy
         | servers can be pretty iffy across software stack.
         | 
         | > Your loopback adapter has a latency of 30 microseconds, but
         | that same web-to-database connection might traverse multiple
         | switches, routers, firewalls, and load balancers and have a
         | latency of over 1,000 microseconds (1ms) in production. That's
         | thirty times worse, and I'm not even talking about zone-
         | redundant deployments, regional-to-region failover, or any such
         | thing!
         | 
         | Reminds me of a time when COVID hit and the suddenly-remote
         | developers were suprised the time to start of their application
         | went from 5 to 30 minutes (they connected their app to DB
         | server on dev environment to not carry big-ass database with
         | them)...
         | 
         | > Ditto with web apps, where every developer mistakenly
         | believes that their Angular or React monstrosity is
         | "performant"... because it is... on their own machine. With
         | loopback networking. Try that over a 3G connection... in rural
         | India. Not Indiana. India.
         | 
         | And that reminds me of this time frontend developers loading
         | 700MB of data to load the site and _not noticing_ that, but
         | sending ticket to ops  "server is a bit slow, could you give it
         | more cores?". Said developers were working in office that had
         | direct connection to data center 500m away with sub-ms latency
         | and plenty of bandwidth.
         | 
         | I had many times pondered traffic shaping frontend devs
         | connection to like 10Mbit after that... maybe 56kbit for repeat
         | offenders.
        
         | smusamashah wrote:
         | There is _clumsy_ which simulates bad network
         | http://jagt.github.io/clumsy/
        
           | diggan wrote:
           | This looks great! Besides that it seems to be only for
           | Windows and requiring a GUI to configure the values...
           | 
           | Anyone know of something similar for Linux that can be
           | configured via config/env vars/cli?
        
             | milkshakes wrote:
             | there's labrea which is pretty dusty:
             | https://github.com/dustin/labrea
             | 
             | you could probably achieve something similar with bpf
             | today.
        
           | theblazehen wrote:
           | And comcast: https://github.com/tylertreat/comcast
        
       | softg wrote:
       | Dumb question, has anyone tried LLMs for network design? I got a
       | CCNA few years ago and I remember being surprised that most of
       | that stuff wasn't automated already. I feel like most things that
       | CCNA or even CCNP require can be done by a LLM if it's trained on
       | enough examples.
        
         | [deleted]
        
       | [deleted]
        
       | gbajson wrote:
       | Would anyone of you know any tool that would simulate working on
       | GSM connection (EDGE, 3G, LTE) on Linux box?
       | 
       | I am looking for any reliable way of simulating user application
       | working on mobile phone.
        
         | remram wrote:
         | Already answered in thread (built into Linux, use tc command)
        
       | tyingq wrote:
       | If you're using a tool that drives headless chrome, there's also
       | programmatic access to Network.emulateNetworkConditions... the
       | same knobs used for network throttling in the Chrome dev tools
       | network tab.
       | 
       | https://chromedevtools.github.io/devtools-protocol/tot/Netwo...
        
       | Borg3 wrote:
       | Nice sum up of simulators and emulators.
       | 
       | My personal favorite is IMUNES. Works very nicely as VM and its
       | lightweight. You can run 100s of instances without problem.
        
       ___________________________________________________________________
       (page generated 2023-10-11 16:01 UTC)