Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Nebula | 12,541 | 125 | 4 days ago | 49 | June 01, 2023 | 125 | mit | Go | ||
A scalable overlay networking tool with a focus on performance, simplicity and security | ||||||||||
Netshoot | 6,578 | a month ago | 23 | apache-2.0 | Shell | |||||
a Docker + Kubernetes network trouble-shooting swiss-army container | ||||||||||
Mininet | 4,913 | 10 days ago | 352 | bsd-3-clause | Python | |||||
Emulator for rapid prototyping of Software Defined Networks | ||||||||||
Realreachability | 3,069 | 100 | a year ago | 13 | October 22, 2018 | 11 | mit | Objective-C | ||
We need to observe the REAL reachability of network. That's what RealReachability do. | ||||||||||
Pms Docker | 2,605 | a month ago | 5 | Smarty | ||||||
Plex Media Server Docker repo, for all your PMS docker needs. | ||||||||||
Reactivenetwork | 2,508 | 75 | 10 months ago | 28 | September 17, 2019 | 36 | apache-2.0 | Java | ||
Android library listening network connection state and Internet connectivity with RxJava Observables | ||||||||||
Sup | 2,312 | 3 | 2 years ago | 7 | January 21, 2022 | 55 | mit | Go | ||
Super simple deployment tool - think of it like 'make' for a network of servers | ||||||||||
Nagioscore | 1,339 | 11 days ago | 3 | November 17, 2022 | 222 | gpl-2.0 | C | |||
Nagios Core | ||||||||||
Evillimiter | 928 | 2 years ago | 38 | mit | Python | |||||
Tool that monitors, analyzes and limits the bandwidth of devices on the local network without administrative access. | ||||||||||
Ncrack | 927 | 7 months ago | 1 | February 27, 2018 | 59 | other | C | |||
Ncrack network authentication tool |
Spin up and interact with virtual networks using Mininet and Node.js
npm install mininet
var mininet = require('mininet')
var mn = mininet()
// create a switch
var s1 = mn.createSwitch()
// create some hosts
var h1 = mn.createHost()
var h2 = mn.createHost()
// link them to the switch
h1.link(s1)
h2.link(s1)
// start the network
mn.start()
// run a server in node
var proc = h1.spawn('node server.js')
proc.on('message:listening', function () {
// when h1 signals it is listening, run curl
var proc2 = h2.spawn('curl --silent ' + h1.ip + ':10000')
proc2.on('stdout', function (data) {
process.stdout.write('h2 ' + data)
mn.stop() // stop when h2 messages
})
})
proc.on('stdout', function (data) {
process.stdout.write('h1 ' + data)
})
Assuming server.js looks like this
var http = require('http')
var mn = require('mininet/host')
var server = http.createServer(function (req, res) {
console.log('Server responding')
res.end('hello from server\n')
})
server.listen(10000, function () {
console.log('Server listening on', this.address().port)
mn.send('listening') // msg the host
})
var mn = mininet([options])
Create a new mininet instance. Options include
{
clean: false, // if true run mn -c first
sudo: true, // use sudo if needed
sock: '/tmp/mn.sock', // explictly set the .sock file used
debug: false, // set to true to enable debug output
stdio: null, // passed to host.spawn as a default option
prefixStdio: false // passed to host.spawn as a default option
}
If for some reason your mininet instance stops working
you probably wanna try using clean: true
.
mn.start([callback])
Start the mininet network. Usually you call this after defining your hosts, switches and links.
After the network has fully started start
is emitted.
mn.stop([callback])
Stop the mininet network. You should not call any other methods after this.
After the network has fully stopped stop
is emitted.
mn.switches
Array of all created switches.
mn.hosts
Array of all created hosts.
var sw = mn.createSwitch()
Create a new switch
sw.link(other, [options])
Link the switch with another switch or host. Options include:
{
bandwidth: 10, // use 10mbit link
delay: '100ms', // 100ms delay
loss: 10, // 10% package loss
htb: true // use htb
}
var host = mn.createHost()
Create an new host
host.ip
The IP address of the host. Populated after the network is started.
host.mac
The MAC address of the host. Populated after the network is started.
host.link(other, [options])
Link the host with another host or switch.
Takes the same options as sw.link
.
host.exec(cmd, [callback])
Execute a command and buffer the output and return it in the callback.
var proc = host.spawn(cmd, [options])
Spawn a new process to run the in background of the host. Options include:
{
stdio: 'inherit', // set this to forward stdio
prefixStdio: 'some-prefix' // all stdio is prefixed with this
}
If you set prefixStdio: true
it will be converted to {host.id}.{process.id}
.
When debugging it can be useful to set both {stdio: 'inherit', prefixStdio: true}
.
var proc = host.spawnNode(programSource, [options])
Helper that spawns a Node.js source inside the host. Useful when using multiline strings
host.spawnNode(`
console.log('starting timer...')
setInterval(() => console.log('Time is', Date.now()))
`, {
stdio: 'inherit',
prefixStdio: true
})
proc.id
Unique string id of the process
proc.kill([signal])
Kill the process.
proc.send(type, data)
Send a message to the process.
proc.on('stdout', data)
Emitted when the process has output.
proc.on('message', type, data)
Emitted when the process received a message.
proc.on('message:{type}', data)
Same as above but with the type as part of the event name for convenience.
proc.on('exit')
Emitted when the process exits.
If you are spawning a node process you can require mininet/host
to communicate with the host.
var host = require('mininet/host')
Require this in a spawned process.
host.send(type, data)
Send a message to the host.
host.sendTo(processId, type, data)
Send a message to another process.
host.broadcast(type, data)
Send a message to all processes.
host.on('message', type, data, metadata)
Emitted when a message is received from the host. The metadata argument contains the following data
{
from: 'some-process-id-or-host' // who sent this message
}
host.on('message:{type}', data, metadata)
Same as above but with the type as part of the event name for convenience.
MIT