A place to share code and server configurations in support of the networkQuality tool

Related tags

Networking server
Overview

Network Quality Server

Welcome!

The Network Quality Server project was created as a place to share example servers that can used by the networkQuality command line tool available in macOS 12.

You can find a textual description of what a server needs to implement here

There’s also 2 complete reference server implementations, one written in Swift and the other in Go. Also provided are configurations for HTTP server/proxy servers: Apache Traffic Server, Apache HTTPD and nginx.

All the samples require an SSL certificate to run.

Using networkQuality against your server

The networkQuality CLI takes a -C switch allowing you to point it at your server.

user@myhost ~ % networkQuality -C https://networkquality.example.com:8443/config
==== SUMMARY ====
Upload capacity: 29.662 Mbps
Download capacity: 541.622 Mbps
Upload flows: 12
Download flows: 12
Responsiveness: High (1825 RPM)

NOTE: The networkQuality CLI tool will only connect to a server presenting a valid SSL certificiate. If you are using a custom CA, ensure the CA is trusted by the system.

There are more options available to affect behavior of this utility. See the manpage of networkQuality for more info.

Contributing

Please review how to contribute if you would like to submit a pull request.

Asking Questions and Discussing Ideas

If you have any questions you’d like to ask publicly, or ideas you’d like to discuss, please raise a GitHub issue.

Project Maintenance

Project maintenance involves, but not limited to, adding clarity to incoming issues and reviewing pull requests. Project maintainers can approve and merge pull requests. Reviewing a pull request involves judging that a proposed contribution follows the project’s guidelines, as described by the guide to contributing.

Project maintainers are expected to always follow the project’s Code of Conduct, and help to model it for others.

Project Governance

Although we expect this to happen very infrequently, we reserve the right to make changes, including changes to the configuration format and scope, to the project at any time.

Comments
  • Generating cert-file and key-file?

    Generating cert-file and key-file?

    I would like to create a Dockerfile for the server side that I can run on a VPS out on the internet or a Raspberry Pi in my home. This would work like the Dockerfile that's in the Go RPM client repo to produce an easily-created server instance for testing.

    To make the implementation easier, it would help for this repo to include the specification of the cert-file and the key-file required by networkqualityd. For example, the go implementation's README simply provides this information:

      -cert-file string
        	cert to use
      ...
      -key-file string
        	key to use
    
    • Would you provide sample information for creating the cert-file and the key-file? (What commands are necessary for creating them?)
    • These instructions should take into account I'll likely use a private 192.168.x.0/24 address for the implementation on my Raspberry Pi. No DNS name will be available; no external access available for verifying any certificates (such as Let's Encrypt).

    Many thanks!

    opened by richb-hanover 18
  • Should base-port be used in the config payload URLs? (large/small/slurp)

    Should base-port be used in the config payload URLs? (large/small/slurp)

    Trying to run the server purely within LAN environment (and huge fan of the whole networkQuality project btw)

    Running networkQuality -C https://my.domain.com:4043/config on client machine fails when trying to access https://my.domain.com/large. The server is correctly serving at https://my.domain.com:4043/large, but puts https://my.domain.com/large in the config payload, so I'm wondering if 4043 (or whatever is chosen with -base-port) should be referenced in the config payload URLs generated by networkqualityd?

    (The public version serves over port 443 I believe? https://mensura.cdn-apple.com/api/v1/gm/large is supplied in the payload at https://mensura.cdn-apple.com/api/v1/gm/config, and using -base-port 443 on my local test server makes everything work correctly.)

    Setup:

    1. Running the go version of the server on Ubuntu 20 with letsencrypt certs, and with my.domain.com resolving to the local IP address of the server machine - 192.168.1.2

    2. Invoking networkqualityd like this (sudo so it can see the certs) and local IP

    $ sudo ./networkqualityd --cert-file /etc/letsencrypt/live/my.domain.com/fullchain.pem --key-file /etc/letsencrypt/live/my.domain.com/privkey.pem --public-name my.domain.com -domain my.domain.com -listen-addr 192.168.1.2
    2021/12/19 12:14:51 Network Quality URL: https://my.domain.com:4043/config
    
    1. Running networkQuality -C https://my.domain.com:4043/config on the client machine returns
    ==== SUMMARY ====                                                                                         
    Upload capacity: 0.000 bps
    Download capacity: 0.000 bps
    Upload flows: 0
    Download flows: 0
    Responsiveness: Low (0 RPM)
    Error: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600001f25a40 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0, ipv4, ipv6, dns, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <3A32613B-AD13-432A-BD6F-9087AE607060>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
        "LocalDataTask <3A32613B-AD13-432A-BD6F-9087AE607060>.<1>"
    ), NSLocalizedDescription=**Could not connect to the server., NSErrorFailingURLStringKey=https://my.domain.com/large**, NSErrorFailingURLKey=https://my.domain.com/large, _kCFStreamErrorDomainKey=1}
    
    1. Adding -base-port 443 to the server command at 2 makes the command on client at 3 run correctly returning as follows:
    ==== SUMMARY ====                                                                                         
    Upload capacity: 359.871 Mbps
    Download capacity: 437.361 Mbps
    Upload flows: 12
    Download flows: 20
    Responsiveness: High (2394 RPM)
    
    opened by spm1001 3
  • panic: sync: WaitGroup is reused before previous Wait has returned

    panic: sync: WaitGroup is reused before previous Wait has returned

    Hello! FIrst of all, thanks for working on a better Internet. I'm doing some rough tests and got this error on the client side:

    gustavo@ubuntu:~/goresponsiveness$ ./networkQuality --config networkquality.nosotros.ong.br --port 4043
    08-31-2022 19:05:05 UTC Go Responsiveness to networkquality.nosotros.ong.br:4043...
    Download:   4.184 Mbps (  0.523 MBps), using 12 parallel connections.
    Upload:    34.293 Mbps (  4.287 MBps), using 28 parallel connections.
    panic: sync: WaitGroup is reused before previous Wait has returned
    
    goroutine 1535 [running]:
    sync.(*WaitGroup).Wait(0xc0000397d0?)
    	/usr/local/go/src/sync/waitgroup.go:138 +0x85
    github.com/network-quality/goresponsiveness/rpm.ForeignProber.func1.1()
    	/home/gustavo/goresponsiveness/rpm/rpm.go:290 +0x1d
    github.com/network-quality/goresponsiveness/utilities.OrTimeout.func1.1()
    	/home/gustavo/goresponsiveness/utilities/utilities.go:167 +0x5b
    created by github.com/network-quality/goresponsiveness/utilities.OrTimeout.func1
    	/home/gustavo/goresponsiveness/utilities/utilities.go:161 +0x85
    
    

    On the server side, I have this:

    gustavo@srv2:~/server/go$ ./networkqualityd  --cert-file fullchain.pem --key-file privkey.pem --public-name networkquality.nosotros.ong.br --listen-addr 0.0.0.0
    2022/08/31 16:04:48 Network Quality URL: https://networkquality.example.com:4043/config
    2022/08/31 16:04:59 http: TLS handshake error from 198.199.98.246:59986: EOF
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: write tcp 192.168.1.5:4043->177.38.98.213:50925: write: connection reset by peer
    2022/08/31 16:05:16 Error writing content of length 4294967296: write tcp 192.168.1.5:4043->177.38.98.213:6981: write: connection reset by peer
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: client disconnected
    2022/08/31 16:05:16 Error writing content of length 4294967296: write tcp 192.168.1.5:4043->177.38.98.213:48967: write: connection reset by peer
    
    

    What am I missing?

    opened by gadolf66 2
  • networkQuality -v -I en0, en7 (returns error)

    networkQuality -v -I en0, en7 (returns error)

    networkQuality -v -I en0, en7
    could not initialize NetworkQualityExecutions

    is there a specific format for doing two interfaces ?

    networkQuality -vsI en0 en7 that did work without error but did not show results separate.

    so the MAN page shows using commas to separate the interfaces, guessing that's wrong?

    opened by careyjames 1
  • Docker configuration and README updates

    Docker configuration and README updates

    After the most recent updates to the go implementation of the server to address some consistency issues, the Docker file and the README file fell out of date. These changes will correct outdated references to older versions of command line options.

    opened by hawkinsw 1
  • Unable to build Go server for 32-bit platform architectures

    Unable to build Go server for 32-bit platform architectures

    Here it is:

    $ env GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -o nqd.linux.mipsle
    # github.com/network-quality/server/go
    ./networkqualityd.go:170:48: cannot use largeContentLength (untyped int constant 4294967296) as int value in argument to strconv.Itoa (overflows)
    ./networkqualityd.go:172:33: cannot use largeContentLength (untyped int constant 4294967296) as int value in argument to chunkedBodyWriter (overflows)
    ./networkqualityd.go:173:56: cannot use largeContentLength (untyped int constant 4294967296) as int value in argument to log.Printf (overflows)
    

    I will provide PR to fix this issue.

    opened by afedotov 1
  • Error

    Error

    MacBook Air (M1, 2020) macOS 12.3

    Error: Error Domain=NetworkQualityErrorDomain Code=1003 "(null)" UserInfo={URL=https://mensura.cdn-apple.com/api/v1/upload, statusCode=413}

    opened by lincainan 1
  • A grab bag of changes

    A grab bag of changes

    Including:

    • Additional switches for setting TCP_NOTSENT_LOWAT and IP_TOS
    • Disable CORS headers by default (enable via --enable-cors)
    • Support for enabling h2c, HTTP/1.x and HTTP/3
    • Reduce some noise in logging of inconsequential errors
    • Upgrade to latest modules dependencies
    • Drop timing/response body from slurp handler (spec doesn't mention/need this)
    • Backwards incompatible: -config-port CLI switch renamed to -public-port
    opened by randall 0
  • Support higher performance

    Support higher performance

    By default the HTTP2 window size parameters (per connection and stream) in go's HTTP2 implementation are too small to achieve high performance. This patch changes those defaults so that it is possible for the go RPM server to support measurement by clients with connections with high-speed connections.

    opened by hawkinsw 0
  • Support CORS

    Support CORS

    If (when!) we support wasm clients that calculate RPM from a web browser, CORS headers are needed to allow those web socket connections from the browser.

    opened by hawkinsw 0
  • Consistency/bug fixes

    Consistency/bug fixes

    1. Rename domain to config-name to match all nomenclature in documentation
    2. Configure the connections performing the measurement to use the same port as the config requests; rename the -base-port option to -config-port.
    3. Listen for debugging connections on the same address as the user specified with the -listen-address CLI option.
    opened by hawkinsw 0
  • Support Docker file automatically creating a self-signed cert

    Support Docker file automatically creating a self-signed cert

    Though we have had extensive discussion (see https://github.com/network-quality/server/issues/9) about certificates and SSL (etc), the fans demand (and they get what they want!) an option for automatically generating a self-signed certificate in the Dockerfile to make it easier for a zero-config deployment of the go-based RPM server.

    cc @richb-hanover

    opened by hawkinsw 0
  • open source client implementation ?

    open source client implementation ?

    As there is a RFC and a Golang server implementation of the test protocol, is there any hope that Apple or community will release a FOSS alternative to networkQuality on macOS ?

    Context : target usage is to incorporate the test in our organisation monitoring (25000 users with the corresponding WLAN / LAN)

    opened by aglossa 4
  • Add instructions for generating certs

    Add instructions for generating certs

    For us duffers out here, could you provide instructions for generating the certs that are necessary to use the swift/go versions? (Even if it's a self-signed cert...) Thanks.

    opened by richb-hanover 1
Owner
null
Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf.

Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app!

Kirill Biakov 17 Jun 25, 2020
👋 A place for Jeep owners to buy and sell Jeep parts. O|||||||O

Features Look for Jeep parts anywhere in the world. ?? Sign up for an account to post your own jeep parts. ?? Favorites parts to save them for later.

xYello 77 Dec 9, 2022
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

PerfectlySoft Inc. 13.9k Jan 6, 2023
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

Kitura 7.6k Jan 6, 2023
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.

Why Zewo? • Support • Community • Contributing Zewo Zewo is a lightweight library for web applications in Swift. What sets Zewo apart? Zewo is not a w

Zewo 1.9k Dec 22, 2022
🔌 Non-blocking TCP socket layer, with event-driven server and client.

Original authors Honza Dvorsky - http://honzadvorsky.com, @czechboy0 Matthias Kreileder - @matthiaskr1 At the request of the original authors, we ask

Vapor Community 574 Dec 7, 2022
A simple GCD based HTTP client and server, written in 'pure' Swift

SwiftyHTTP Note: I'm probably not going to update this any further - If you need a Swift networking toolset for the server side, consider: Macro.swift

Always Right Institute 116 Aug 6, 2022
WebSocket implementation for use by Client and Server

WebSocket ⚠️ This module contains no networking. To create a WebSocket Server, see WebSocketServer. To create a WebSocket Client, see WebSocketClient.

Zewo Graveyard 63 Jan 29, 2022
Setup your class structure in Xcode Interface Builder and save() in Parse Server.

ISParseBind With ISParseBind you can save, update and query PFObjects using the power of Xcode Interface Builder resources. https://www.youtube.com/wa

Weni 10 Mar 28, 2022
A slim implementation of a websocket server using Swift and Vapor 4.0.

Swift Websocket Server Example using Vapor 4.0 This project includes a minimum working example for a websocket server written in Swift. To interact wi

Adrian Hupka 5 Sep 22, 2022
💧 A server-side Swift web framework.

Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project. Take

Vapor 22.4k Jan 2, 2023
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Dec 31, 2022
Swift Express is a simple, yet unopinionated web application server written in Swift

Documentation <h5 align="right"><a href="http://demo.swiftexpress.io/">Live ?? server running Demo <img src="https://cdn0.iconfinder.com/data/icons/

Crossroad Labs 850 Dec 2, 2022
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Embassy Super lightweight async HTTP server in pure Swift. Please read: Embedded web server for iOS UI testing. See also: Our lightweight web framewor

Envoy 540 Dec 15, 2022
Access Xcode Server API with native Swift objects.

Xcode Server SDK Use Xcode Server's API with native Swift objects. First brought to you in Buildasaur, now in an independent project. This is an unoff

Buildasaurs 401 Dec 29, 2022
Swift HTTP server using the pre-fork worker model

Curassow Curassow is a Swift Nest HTTP Server. It uses the pre-fork worker model and it's similar to Python's Gunicorn and Ruby's Unicorn. It exposes

Kyle Fuller Archive 397 Oct 30, 2022
Swift backend / server framework (Pure Swift, Supports Linux)

NetworkObjects NetworkObjects is a #PureSwift backend. This framework compiles for OS X, iOS and Linux and serves as the foundation for building power

Alsey Coleman Miller 258 Oct 6, 2022
Apple Push Notifications (APNs) Server-Side library.

Perfect-Notifications 简体中文 APNs remote Notifications for Perfect. This package adds push notification support to your server. Send notifications to iO

PerfectlySoft Inc. 113 Oct 28, 2022
High Performance (nearly)100% Swift Web server supporting dynamic content.

Dynamo - Dynamic Swift Web Server Starting this project the intention was to code the simplest possible Web Server entirely in Swift. Unfortunately I

John Holdsworth 68 Jul 25, 2022