Giter Site home page Giter Site logo

zerotier / zerotierone Goto Github PK

View Code? Open in Web Editor NEW
13.4K 293.0 1.6K 185.67 MB

A Smart Ethernet Switch for Earth

Home Page: https://zerotier.com

License: Other

Makefile 2.14% Shell 3.32% C++ 69.64% C 13.16% JavaScript 0.24% Objective-C 0.72% HTML 0.06% CMake 0.57% Java 0.71% C# 0.76% Batchfile 0.01% Python 0.31% Roff 0.01% Assembly 7.62% Dockerfile 0.04% Objective-C++ 0.08% Ruby 0.01% Rust 0.35% Jsonnet 0.11% M4 0.15%
decentralization networking peer-to-peer sd-wan sdn virtual-network vpn

zerotierone's Introduction

ZeroTier - Global Area Networking

This document is written for a software developer audience. For information on using ZeroTier, see the: Website, Documentation Site, and Discussion Forum.

ZeroTier is a smart programmable Ethernet switch for planet Earth. It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.

This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.

All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connections.

The goals and design principles of ZeroTier are inspired by among other things the original Google BeyondCorp paper and the Jericho Forum with its notion of "deperimeterization."

Visit ZeroTier's site for more information and pre-built binary packages. Apps for Android and iOS are available for free in the Google Play and Apple app stores.

ZeroTier is licensed under the BSL version 1.1. See LICENSE.txt and the ZeroTier pricing page for details. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license.

A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See AUTHORS.md for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.).

Getting Started

Everything in the ZeroTier world is controlled by two types of identifier: 40-bit/10-digit ZeroTier addresses and 64-bit/16-digit network IDs. These identifiers are easily distinguished by their length. A ZeroTier address identifies a node or "device" (laptop, phone, server, VM, app, etc.) while a network ID identifies a virtual Ethernet network that can be joined by devices.

ZeroTier addresses can be thought of as port numbers on an enormous planet-wide enterprise Ethernet smart switch supporting VLANs. Network IDs are VLAN IDs to which these ports may be assigned. A single port can be assigned to more than one VLAN.

A ZeroTier address looks like 8056c2e21c and a network ID looks like 8056c2e21c000001. Network IDs are composed of the ZeroTier address of that network's primary controller and an arbitrary 24-bit ID that identifies the network on this controller. Network controllers are roughly analogous to SDN controllers in SDN protocols like OpenFlow, though as with the analogy between VXLAN and VL2 this should not be read to imply that the protocols or design are the same. You can use our convenient and inexpensive SaaS hosted controllers at my.zerotier.com or run your own controller if you don't mind messing around with JSON configuration files or writing scripts to do so.

Project Layout

The base path contains the ZeroTier One service main entry point (one.cpp), self test code, makefiles, etc.

  • artwork/: icons, logos, etc.
  • attic/: old stuff and experimental code that we want to keep around for reference.
  • controller/: the reference network controller implementation, which is built and included by default on desktop and server build targets.
  • debian/: files for building Debian packages on Linux.
  • doc/: manual pages and other documentation.
  • ext/: third party libraries, binaries that we ship for convenience on some platforms (Mac and Windows), and installation support files.
  • include/: include files for the ZeroTier core.
  • java/: a JNI wrapper used with our Android mobile app. (The whole Android app is not open source but may be made so in the future.)
  • node/: the ZeroTier virtual Ethernet switch core, which is designed to be entirely separate from the rest of the code and able to be built as a stand-alone OS-independent library. Note to developers: do not use C++11 features in here, since we want this to build on old embedded platforms that lack C++11 support. C++11 can be used elsewhere.
  • osdep/: code to support and integrate with OSes, including platform-specific stuff only built for certain targets.
  • rule-compiler/: JavaScript rules language compiler for defining network-level rules.
  • service/: the ZeroTier One service, which wraps the ZeroTier core and provides VPN-like connectivity to virtual networks for desktops, laptops, servers, VMs, and containers.
  • windows/: Visual Studio solution files, Windows service code, and the Windows task bar app UI.
  • zeroidc/: OIDC implementation used by ZeroTier service to log into SSO-enabled networks. (This part is written in Rust, and more Rust will be appearing in this repository in the future.)

Contributing

Please do pull requests off of the dev branch.

Releases are done by merging dev into main and then tagging and doing builds.

Build and Platform Notes

To build on Mac and Linux just type make. On FreeBSD and OpenBSD gmake (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in windows/.

  • Mac
    • Xcode command line tools for macOS 10.13 or newer are required.
    • Rust for x86_64 and ARM64 targets if SSO is enabled in the build.
  • Linux
    • The minimum compiler versions required are GCC/G++ 4.9.3 or CLANG/CLANG++ 3.4.2. (Install clang on CentOS 7 as G++ is too old.)
    • Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
    • Rust for x86_64 and ARM64 targets if SSO is enabled in the build.
  • Windows
    • Visual Studio 2022 on Windows 10 or newer.
    • Rust for x86_64 and ARM64 targets if SSO is enabled in the build.
  • FreeBSD
    • GNU make is required. Type gmake to build.
    • binutils is required. Type pkg install binutils to install.
    • Rust for x86_64 and ARM64 targets if SSO is enabled in the build.
  • OpenBSD
    • There is a limit of four network memberships on OpenBSD as there are only four tap devices (/dev/tap0 through /dev/tap3).
    • GNU make is required. Type gmake to build.
    • Rust for x86_64 and ARM64 targets if SSO is enabled in the build.

Typing make selftest will build a zerotier-selftest binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.

Running

Running zerotier-one with -h option will show help.

On Linux and BSD, if you built from source, you can start the service with:

sudo ./zerotier-one -d

On most distributions, macOS, and Windows, the installer will start the service and set it up to start on boot.

A home folder for your system will automatically be created.

The service is controlled via the JSON API, which by default is available at 127.0.0.1:9993. It also listens on 0.0.0.0:9993 which is only usable if allowManagementFrom is properly configured in local.conf. We include a zerotier-cli command line utility to make API calls for standard things like joining and leaving networks. The authtoken.secret file in the home folder contains the secret token for accessing this API. See service/README.md for API documentation.

Here's where home folders live (by default) on each OS:

  • Linux: /var/lib/zerotier-one
  • FreeBSD / OpenBSD: /var/db/zerotier-one
  • Mac: /Library/Application Support/ZeroTier/One
  • Windows: \ProgramData\ZeroTier\One (That's the default. The base 'shared app data' folder might be different if Windows is installed with a non-standard drive letter assignment or layout.)

Basic Troubleshooting

For most users, it just works.

If you are running a local system firewall, we recommend adding a rules permitting zerotier. If you installed binaries for Windows this should be done automatically. Other platforms might require manual editing of local firewall rules depending on your configuration.

See the documentation site for more information.

The Mac firewall can be found under "Security" in System Preferences. Linux has a variety of firewall configuration systems and tools.

On CentOS check /etc/sysconfig/iptables for IPTables rules. For other distributions consult your distribution's documentation. You'll also have to check the UIs or documentation for commercial third party firewall applications like Little Snitch (Mac), McAfee Firewall Enterprise (Windows), etc. if you are running any of those. Some corporate environments might have centrally managed firewall software, so you might also have to contact IT.

ZeroTier One peers will automatically locate each other and communicate directly over a local wired LAN if UDP port 9993 inbound is open. If that port is filtered, they won't be able to see each others' LAN announcement packets. If you're experiencing poor performance between devices on the same physical network, check their firewall settings. Without LAN auto-location peers must attempt "loopback" NAT traversal, which sometimes fails and in any case requires that every packet traverse your external router twice.

Users behind certain types of firewalls and "symmetric" NAT devices may not be able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will attempt to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.

If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is very slow compared to UDP or direct peer to peer connectivity.

Additional help can be found in our knowledge base.

Prometheus Metrics

Prometheus Metrics are available at the /metrics API endpoint. This endpoint is protected by an API key stored in metricstoken.secret to prevent unwanted information leakage. Information that could be gleaned from the metrics include joined networks and peers your instance is talking to.

Access control is via the ZeroTier control interface itself and metricstoken.secret. This can be sent as a bearer auth token, via the X-ZT1-Auth HTTP header field, or appended to the URL as ?auth=<token>. You can see the current metrics via cURL with the following command:

// Linux
curl -H "X-ZT1-Auth: $(sudo cat /var/lib/zerotier-one/metricstoken.secret)" http://localhost:9993/metrics

// macOS
curl -H "X-ZT1-Auth: $(sudo cat /Library/Application\ Support/ZeroTier/One/metricstoken.secret)" http://localhost:9993/metrics

// Windows PowerShell (Admin)
Invoke-RestMethod -Headers @{'X-ZT1-Auth' = "$(Get-Content C:\ProgramData\ZeroTier\One\metricstoken.secret)"; } -Uri http://localhost:9993/metrics

To configure a scrape job in Prometheus on the machine ZeroTier is running on, add this to your Prometheus scrape_config:

- job_name: zerotier-one
  honor_labels: true
  scrape_interval: 15s
  metrics_path: /metrics
  static_configs:
  - targets:
    - 127.0.0.1:9993
    labels:
      group: zerotier-one
      node_id: $YOUR_10_CHARACTER_NODE_ID
  authorization:
    credentials: $YOUR_METRICS_TOKEN_SECRET

If neither of these methods are desirable, it is probably possible to distribute metrics via Prometheus Proxy or some other tool. Note: We have not tested this internally, but will probably work with the correct configuration.

Metrics are also available on disk in ZeroTier's working directory:

// Linux /var/lib/zerotier-one/metrics.prom

// macOS /Library/Application\ Support/ZeroTier/One/metrics.prom

//Windows C:\ProgramData\ZeroTier\One\metrics.prom

Available Metrics

Metric Name Labels Metric Type Description
zt_packet packet_type, direction Counter ZeroTier packet type counts
zt_packet_error error_type, direction Counter ZeroTier packet errors
zt_data protocol, direction Counter number of bytes ZeroTier has transmitted or received
zt_num_networks Gauge number of networks this instance is joined to
zt_network_multicast_groups_subscribed network_id Gauge number of multicast groups networks are subscribed to
zt_network_packets network_id, direction Counter number of incoming/outgoing packets per network
zt_peer_latency node_id Histogram peer latency (ms)
zt_peer_path_count node_id, status Gauge number of paths to peer
zt_peer_packets node_id, direction Counter number of packets to/from a peer
zt_peer_packet_errors node_id Counter number of incoming packet errors from a peer

If there are other metrics you'd like to see tracked, ask us in an Issue or send us a Pull Request!

HTTP / App server

There is a static http file server suitable for hosting Single Page Apps at http://localhost:9993/app/

Use zerotier-cli info -j to find your zerotier-one service's homeDir

cd $ZT_HOME
sudo mkdir -p app/app1
sudo mkdir -p app/appB
echo '<html><meta charset=utf-8><title>appA</title><body><h1>hello world A' | sudo tee app/appA/index.html 
echo '<html><meta charset=utf-8><title>app2</title><body><h1>hello world 2' | sudo tee app/app2/index.html 
curl -sL http://localhost:9993/app/appA http://localhost:9993/app/app2 

Then visit http://localhost:9993/app/app1/ and http://localhost:9993/app/appB/

Requests to paths don't exist return the app root index.html, as is customary for SPAs. If you want, you can write some javascript that talks to the service or controller api.

zerotierone's People

Contributors

adamierymenko avatar asidorenko avatar atopuzov avatar bostick avatar bradleydiggs avatar capruro avatar danielskowronski avatar darkain avatar dch avatar dependabot[bot] avatar dosuperuser avatar erikh avatar glimberg avatar janjaapbos avatar jonathonf avatar joseph-henry avatar keesbos avatar krisek avatar laduke avatar mwarning avatar nelsonjchen avatar pablohn26 avatar rcoder avatar rjsocha avatar robertschreib avatar showipintbri avatar someara avatar stephencwills avatar unquietwiki avatar zielmicha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zerotierone's Issues

no systemd support for installer

Just tried running the installer on an Arch x64 linux system and it failed like so:

Installing and (re-)starting zerotier-one daemon...
ZeroTierOneInstaller-linux-x64: line 65: chkconfig: command not found
ZeroTierOneInstaller-linux-x64: line 66: service: command not found
FATAL ERROR: no token specified on command line and could not read '/var/lib/zerotier-one/authtoken.secret' or '/root/.zeroTierOneAuthToken'

Can systemd support please be added to the installer?

segfault while using the soft.

Hi,

I started it, used for a while, and I was wondering why it was not working.

╭─<cubox@Thunderaan>-<~/Documents/softs/ZeroTierOne>-<12:26:44>-◇
╰─➤ sudo ./zerotier-one '/Library/Application Support/ZeroTier/One'
debug: pam_yubico.c:478 (do_challenge_response): Failed initializing YubiKey
debug: pam_yubico.c:655 (do_challenge_response): Yubikey core error: no yubikey present
Password:
zerotier-one(80730,0x103281000) malloc: *** error for object 0x103003db0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

EDIT: I am running Mac 10.8.4.

Windows 8.1: stays in "WAITING_FOR_FIRST_AUTOCONF" forever

User reported via e-mail, sent some helpful information. It appears to be likely to be a driver issue. EthernetTap might get a partial overhaul on Windows soon. He fixed it by uninstalling, deleting everything, and reinstalling.

Windows = pain and suffering

*nix interface numbers are not sticky

If you join a network and it comes up at 'zt1', next time it might come up as 'zt0'. This is annoying and could interfere with scripts and firewall setups.

Build errors on OS X 10.9 "mkernel for C++ on Darwin/i386", "kern/locks.h file not found"

By default I get this

g++ -arch x86_64 -Wall -O3 -ftree-vectorize -fstack-protector -pthread -mmacosx-version-min=10.8 -DNDEBUG   -fno-rtti -o zerotier-one main.cpp ext/lz4/lz4hc.o ext/lz4/lz4.o node/C25519.o node/CertificateOfMembership.o node/Defaults.o node/Demarc.o node/EthernetTap.o node/Identity.o node/InetAddress.o node/Logger.o node/Multicaster.o node/Network.o node/NetworkConfig.o node/Node.o node/NodeConfig.o node/Packet.o node/PacketDecoder.o node/Peer.o node/Poly1305.o node/Salsa20.o node/Service.o node/SHA512.o node/Switch.o node/SysEnv.o node/Topology.o node/UdpSocket.o node/Utils.o -lm
strip zerotier-one
g++ -arch x86_64 -Wall -O3 -ftree-vectorize -fstack-protector -pthread -mmacosx-version-min=10.8 -DNDEBUG   -fno-rtti -o zerotier-cli cli.cpp ext/lz4/lz4hc.o ext/lz4/lz4.o node/C25519.o node/CertificateOfMembership.o node/Defaults.o node/Demarc.o node/EthernetTap.o node/Identity.o node/InetAddress.o node/Logger.o node/Multicaster.o node/Network.o node/NetworkConfig.o node/Node.o node/NodeConfig.o node/Packet.o node/PacketDecoder.o node/Peer.o node/Poly1305.o node/Salsa20.o node/Service.o node/SHA512.o node/Switch.o node/SysEnv.o node/Topology.o node/UdpSocket.o node/Utils.o -lm
strip zerotier-cli
cd mac-tap/tuntap ; make tap.kext
cd src/tap && make TUNTAP_VERSION=20111101 -f Makefile all
llvm-g++ -Wall -mkernel -force_cpusubtype_ALL -fno-builtin -fno-stack-protector -arch i386 -arch x86_64 -DKERNEL -D__APPLE__ -DKERNEL_PRIVATE -DTUNTAP_VERSION=\"20111101\" -DTAP_KEXT_VERSION=\"20111101\" -I.. -I/System/Library/Frameworks/Kernel.framework/Headers -c ../tuntap.cc -o ../tuntap.o
clang: error: the clang compiler does not support 'mkernel' for C++ on Darwin/i386
make[2]: *** [../tuntap.o] Error 1
make[1]: *** [tap.kext] Error 2
make: *** [mac-tap] Error 2

After removing all -arch i386 flags I got this:

g++ -arch x86_64 -Wall -O3 -ftree-vectorize -fstack-protector -pthread -mmacosx-version-min=10.8 -DNDEBUG   -fno-rtti -o zerotier-one main.cpp ext/lz4/lz4hc.o ext/lz4/lz4.o node/C25519.o node/CertificateOfMembership.o node/Defaults.o node/Demarc.o node/EthernetTap.o node/Identity.o node/InetAddress.o node/Logger.o node/Multicaster.o node/Network.o node/NetworkConfig.o node/Node.o node/NodeConfig.o node/Packet.o node/PacketDecoder.o node/Peer.o node/Poly1305.o node/Salsa20.o node/Service.o node/SHA512.o node/Switch.o node/SysEnv.o node/Topology.o node/UdpSocket.o node/Utils.o -lm
strip zerotier-one
g++ -arch x86_64 -Wall -O3 -ftree-vectorize -fstack-protector -pthread -mmacosx-version-min=10.8 -DNDEBUG   -fno-rtti -o zerotier-cli cli.cpp ext/lz4/lz4hc.o ext/lz4/lz4.o node/C25519.o node/CertificateOfMembership.o node/Defaults.o node/Demarc.o node/EthernetTap.o node/Identity.o node/InetAddress.o node/Logger.o node/Multicaster.o node/Network.o node/NetworkConfig.o node/Node.o node/NodeConfig.o node/Packet.o node/PacketDecoder.o node/Peer.o node/Poly1305.o node/Salsa20.o node/Service.o node/SHA512.o node/Switch.o node/SysEnv.o node/Topology.o node/UdpSocket.o node/Utils.o -lm
strip zerotier-cli
cd mac-tap/tuntap ; make tap.kext
cd src/tap && make TUNTAP_VERSION=20111101 -f Makefile all
llvm-g++ -Wall -mkernel -force_cpusubtype_ALL -fno-builtin -fno-stack-protector -arch x86_64 -DKERNEL -D__APPLE__ -DKERNEL_PRIVATE -DTUNTAP_VERSION=\"20111101\" -DTAP_KEXT_VERSION=\"20111101\" -I.. -I/System/Library/Frameworks/Kernel.framework/Headers -c ../tuntap.cc -o ../tuntap.o
In file included from ../tuntap.cc:30:
In file included from ../tuntap.h:35:
../lock.h:35:10: fatal error: 'kern/locks.h' file not found
#include <kern/locks.h>
         ^
1 error generated.
make[2]: *** [../tuntap.o] Error 1
make[1]: *** [tap.kext] Error 2
make: *** [mac-tap] Error 2

No IPv6 by default on OSX

Annoying OSX network services issue, or maybe something to fix in tap.kext... have to investigate. It works if you enable it manually of course.

Probably a release blocker. 💅

Improve the way latency is measured

Just to capture this thought:

Latency should not be computed from TS in HELLO. It should be computed from the time HELLO is sent to the time a matching OK(HELLO) is received. This takes into account lost packets, causing supernodes and others that have gone down to fall to the bottom of the priority list.

Segmentation fault in ZeroTier::Identity::Identity

This segfault doesn't occur the first time it is run with a given "home directory" (i.e, it goes away if I delete it), but thereafter it happens every time. I still don't get an IP address.

#0  0x00007ffff798e2fb in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/libstdc++.so.6
#1  0x000000000040a5eb in ZeroTier::Identity::Identity (this=0x757020, id=...) at node/Identity.hpp:98
#2  0x000000000044000a in ZeroTier::Peer::Peer (this=0x756fe0, myIdentity=..., peerIdentity=...) at node/Peer.cpp:55
Python Exception <type 'exceptions.IndexError'> list index out of range: 
#3  0x000000000045014c in ZeroTier::Topology::setSupernodes (this=0x74d450, sn=std::map with 3 elements)
    at node/Topology.cpp:86
#4  0x0000000000425c1c in ZeroTier::Node::run (this=0x743af0) at node/Node.cpp:392
#5  0x0000000000404a66 in main (argc=2, argv=0x7fffffffe628) at main.cpp:155

(unlikely) Identity collisions are not handled

While there are both cryptographic and "oldest wins" protections against identity replacement or "claim jumping" as I call it, what happens then? The client currently does not handle it if its identity is rejected as duplicate.

The client should respond to this by double-checking with the config authority (to prevent this as a DOS attack) followed by the generation of a new identity.

This has a low chance of happening, about one in 2^20 or one in a million new identities (accounting for the birthday paradox). But if this gets super-popular it will happen eventually.

I don't get an IPv4 address

zt0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 2800
    inet6 fe80::<withheld>  prefixlen 64  scopeid 0x20<link>
    ether 32:<withheld>  txqueuelen 500  (Ethernet)
    RX packets 1  bytes 164 (164.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 6  bytes 468 (468.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Any advice on how to figure out why?

TCP tunneling to supernodes

Two users so far have reported that their firewalls block this app. Have to research how to do this... should I go as far as to make it HTTP-based so that it will pass things like BlueCoat?

Build problems: make[2]: llvm-g++: No such file or directory

...
llvm-g++ -Wall -mkernel -force_cpusubtype_ALL -fno-builtin -fno-stack-protector -arch i386 -arch x86_64 -DKERNEL -D__APPLE__ -DKERNEL_PRIVATE -DTUNTAP_VERSION=\"20111101\" -DTAP_KEXT_VERSION=\"20111101\" -I.. -I/System/Library/Frameworks/Kernel.framework/Headers -c ../tuntap.cc -o ../tuntap.o
make[2]: llvm-g++: No such file or directory
make[2]: *** [../tuntap.o] Error 1
make[1]: *** [tap.kext] Error 2
make: *** [mac-tap] Error 2

Basic search skills directed me here: http://stackoverflow.com/questions/12652701/how-to-use-g-in-terminal-in-mac and here https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/llvm-g++.1.html

Installed Command Line Tools (OS X Mountain Lion) for Xcode - September 2013 form https://developer.apple.com/downloads/index.action# (login required)

Opened new terminal tab, it seems like it isn't installed:

llvm-g++
bash: llvm-g++: command not found

Can you help me with the build?

Pretty sure it's as simple as changing single flag in the make file / adding some bin folder to $PATH.

(another reason for posting is to allow other journeymen to find this issue and avoid build reef)

Linux installation issues -- missing chkconfig, disown, etc.

(Reported via e-mail)

2 of us downloaded and ran the installer this morning - Sun 02 Mar
one installed to Ubuntu 13.10
i'm installing on Mint 13 cinnamon (about 3 year old release)

there is no version info in the installer script.

installer tries to use chkconfig (line 105) -
which isn't installed (by default)
( sysv-rc-conf is equiv but also not installed by default,
and upstart is the new kid on the Ubuntu-block, right ?
)
and
/etc/init.d/zerotier-one invokes disown which is not defined

would using the bash builtin
chkconfig=type -Pp chkconfig be useful
instead of :
if [ -e /sbin/chkconfig -o -e /usr/sbin/chkconfig -o -e /bin/chkconfig -o -e /usr/bin/chkconfig ]; then
~ ~ ~ ~ ~ ~ ~ ~ ~

sudo ./ZeroTierOneInstaller-linux-x86
*** ZeroTier One install/update ***
Extracting files...
tmp/
tmp/systemd_zerotier-one.service
tmp/init.d_zerotier-one
var/
var/lib/
var/lib/zerotier-one/
var/lib/zerotier-one/zerotier-one
var/lib/zerotier-one/uninstall.sh
Installing zerotier-cli command line utility...
Installing and (re-)starting zerotier-one daemon...
./ZeroTierOneInstaller-linux-x64: line 105: chkconfig: command not found
/etc/init.d/zerotier-one: 33: [: Illegal number:
Restarting ZeroTier One...
/etc/init.d/zerotier-one: 81: /etc/init.d/zerotier-one: disown: not found

WAN route/address discovery does not validate the route bidirectionally

If you replay a valid packet but from an invalid IP address / port, you could execute a DOS attack by populating the receiver's endpoint cache with an incorrect address.

Some thought needs to be put into endpoint learning. Perhaps we should only do it in response to replies.

This is considered minor since it's not exploitable to crash or gain entry into anything. It could be used to trick node A into thinking node B is at an incorrect IP/port in order to interrupt peer to peer communication between them.

Valgrind error ioctl pointing to 0x0

Hey @adamierymenko, really nice job on cleaning up the valgrind output! I just get this one now, and everything else seems fine.

==14787== Syscall param ioctl(generic) points to unaddressable byte(s)
==14787==    at 0x5B4F237: ioctl (in /lib64/libc-2.15.so)
==14787==    by 0x411F98: ZeroTier::EthernetTap::EthernetTap(ZeroTier::RuntimeEnvironment const*, ZeroTier::MAC const&, unsigned int, void (*)(void*, ZeroTier::MAC const&, ZeroTier::MAC const&, unsigned int, ZeroTier::Buffer<4096u> const&), void*) (EthernetTap.cpp:139)
==14787==    by 0x41C174: ZeroTier::Network::newInstance(ZeroTier::RuntimeEnvironment const*, unsigned long) (Network.cpp:147)
==14787==    by 0x42D48E: ZeroTier::NodeConfig::NodeConfig(ZeroTier::RuntimeEnvironment const*, char const*) (NodeConfig.cpp:86)
==14787==    by 0x425B83: ZeroTier::Node::run() (Node.cpp:372)
==14787==    by 0x404A65: main (main.cpp:155)
==14787==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Windows firewall treats ZT1 virtual nets as untrusted by default, need instructions or UI help to change

I have a Win 8.1 machine and 2 Linux machines in a private ZeroTier network. Windows can ping both the Linux systems, and the Linux systems can ping each other, but the Linux systems can't ping/access Windows.

The Windows machine was successfully added to the network, got an IP address, and is able to ping out other machines on the network, but others can't ping it. I double checked the Windows firewall and added rules to allow UDP port 9993, but it's still not working.

It appears that an error occurred. Try again later.

Try pinging earth.zerotier.net

ping earth.zerotier.net
PING earth.zerotier.net (28.121.216.29): 56 data bytes
64 bytes from 28.121.216.29: icmp_seq=0 ttl=64 time=415.861 ms
64 bytes from 28.121.216.29: icmp_seq=1 ttl=64 time=199.386 ms
64 bytes from 28.121.216.29: icmp_seq=2 ttl=64 time=203.589 ms
^C

And going to http://earth.zerotier.net/ in a browser to see if you're online.

screen shot 2013-10-17 at 1 13 07 am

To be precise, the file is not displayed in the browser but saved to disk as download with no extension. Potentially php server is not running, potentially mime-type of file interprets as download?

Just letting you now.

Excessive duplicate multicasts

There seem to be extra duplicate multicasts, as if the bloom filter mechanism isn't working reliably to limit their propagation.

question: are ip addresses static?

hi!

I am really excited about this project - I'm working on some distributed stuff,
and this removes the NAT problem, so I can focus on the application!

I am wondering, though, will I need to keep track of the IPs each node uses?
or will same computer have the same ip address next time?

Raspberry Pi / Raspbian Build Discussion Thread

Not sure if anyone's got it going on a Pi yet, hopefully I'm the first :)

I'm failing to build on Raspberry Pi, it looks like it's due to the architecture, and where it expects to find libcrypto.

$ make -f Makefile.linux 
g++ -Wall -O3 -fno-unroll-loops -fstack-protector -pthread -Iext/bin/libcrypto/include -Iext/jsoncpp/include -DNDEBUG -DZT_ARCH="armv6l" -DZT_OSNAME="linux" -DZT_TRACE -fno-rtti -o zerotier-one main.cpp ext/http-parser/http_parser.o ext/huffandpuff/huffman.o ext/jsoncpp/src/json_reader.o ext/jsoncpp/src/json_value.o ext/jsoncpp/src/json_writer.o ext/kissdb/kissdb.o ext/lz4/lz4hc.o ext/lz4/lz4.o node/Defaults.o node/Demarc.o node/EllipticCurveKeyPair.o node/EthernetTap.o node/Filter.o node/HMAC.o node/Http.o node/Identity.o node/InetAddress.o node/Logger.o node/Network.o node/Node.o node/NodeConfig.o node/Packet.o node/PacketDecoder.o node/Pack.o node/Peer.o node/Salsa20.o node/Switch.o node/SysEnv.o node/Thread.o node/Topology.o node/UdpSocket.o node/Utils.o ext/bin/libcrypto/linux-armv6l/libcrypto.a
g++: error: ext/bin/libcrypto/linux-armv6l/libcrypto.a: No such file or directory
make: *** [one] Error 1
$ ls -l ext/bin/libcrypto
total 32
drwxr-xr-x 3 pi pi 4096 Jul 31 22:29 include
drwxr-xr-x 2 pi pi 4096 Jul 31 22:29 linux-i686
drwxr-xr-x 2 pi pi 4096 Jul 31 22:29 linux-x86_64
drwxr-xr-x 2 pi pi 4096 Jul 31 22:29 mac-x86_combined
-rw-r--r-- 1 pi pi  347 Jul 31 22:29 openssl-config-linux-i686.sh
-rw-r--r-- 1 pi pi  376 Jul 31 22:29 openssl-config-linux-x86_64.sh
-rw-r--r-- 1 pi pi  891 Jul 31 22:29 openssl-config-osx.sh
-rw-r--r-- 1 pi pi   15 Jul 31 22:29 VERSION.txt

Windows NBT (Netbios) is noisy on broadcast (ff:ff:ff:ff:ff:ff)

The broadcast channel gets noisy if Windows boxes are on the net with all their NBT announcements, so add a local toggle to subscribe/unsubscribe to the wildcard broadcast channel. This wouldn't affect more specific multicasts (a.k.a. better designed protocols), nor would it affect IPv4 ARP since we add ADI to that.

EthernetTap does not shut down properly

When ZeroTier One exits, EthernetTap often hangs or does not shut down properly. On OSX this can actually cause the process to become a zombie in permanent "exiting" state. Currently working on this.

Anyone can request a network certificate push

For private networks, anyone can cause a network membership cert to be pushed to them. This is not an issue right now as the cert contains nothing important or private, but in the future if we support things like geolocation certs this would become a privacy problem. So in the future we do need a mechanism of restricting this to only peers that have some claim on network membership, or maybe encrypting it somehow.

Another possibility would be to make sure that any privacy-sensitive info in a cert is encoded in some privacy-preserving or anonymizing way. This is more in line with the concept of a certificate, which in crypto is generally okay to be public information.

Rework peer-to-peer route handling

When we're sending to a peer but it stops sending us something, we should ping it by way of an alternate path (e.g. random supernode). This should carry some information such as "hey, this is an alternate path check" that affects its state and permits it to switch paths if a path is no longer working. This could be the mechanism for ceasing direct NAT-t if that stops working (e.g. router reboot) or switching supernodes if a supernode goes down.

This goes with, if GitHub supported such things, an omnibus ticket involving latency improvements and the replay attack / NAT-t issue.

Add help / guide to web UI so people know how to set up a private network.

Please correct me if I'm wrong, but currently it appears that end users must manually assign IP addresses to the ztX interface of each host participating in a private ZeroTier network. This is unlike the public ZeroTier network where a 28.x.x.x block address is automatically assigned.

If I'm missing something and there's already a way to automatically assign IP addresses to hosts in private networks, please let us know.

I can fork and submit a pull request if you like, otherwise I have pasted some additional suggested lines to add to RUNNING.txt below.

If you want to create a private network, please note that IP addresses must be assigned manually to each host participating in the private network.

Use the command "zerotier-cli listnetworks" to find the correct interface name to assign an IP for your private network(s).

MTU size bug in tap driver back on OSX

OSX seems to be having the problem again as of Mavericks of dropping packets to the tap device if they equal the MTU. Seems that the MTU is now interpreted as including the Ethernet header, while it did not appear to be interpreted that way on previous releases. Fun, fun, fun...

I searched high and wide for a way to avoid using a tap kext in OSX to no avail. Same goes with Windows, which is even more restricted in that way.

Segmentation fault in EllipticCurveKey

I'm running 0.4.0 like so:

./zerotier-one /var/lib/zerotier

Stack trace:

#0  0x00007ffff6f33446 in __memcpy_ssse3_back () from /lib64/libc.so.6
#1  0x000000000040a3ff in ZeroTier::EllipticCurveKey::EllipticCurveKey (this=0x739058, 
    k=...) at node/EllipticCurveKey.hpp:87
#2  0x0000000000410c32 in ZeroTier::EllipticCurveKeyPair::EllipticCurveKeyPair (
    this=0x739010, pair=...) at node/EllipticCurveKeyPair.cpp:104
#3  0x000000000040a560 in ZeroTier::Identity::Identity (this=0x74cf80, id=...)
    at node/Identity.hpp:95
#4  0x000000000043edee in ZeroTier::Peer::Peer (this=0x74cf40, myIdentity=..., 
    peerIdentity=...) at node/Peer.cpp:55
Python Exception <type 'exceptions.IndexError'> list index out of range: 
#5  0x000000000044f472 in ZeroTier::Topology::setSupernodes (this=0x743450, sn=
    std::map with 3 elements) at node/Topology.cpp:86
#6  0x0000000000425716 in ZeroTier::Node::run (this=0x739af0) at node/Node.cpp:392
#7  0x00000000004047fa in main (argc=2, argv=0x7fffffffe678) at main.cpp:119

By the way, why do you strip the binary and not have debugging information enabled? It meant more work for me to report the problem..

Send a message to drop P2P links after netconf fingerprint change

When the netconf fingerprint changes, it almost certainly means your P2P links are now invalid. So a message should be sent by way of super node relays to all peers with whom you are actively communicating that says "drop old P2P links."

I'm starting to wonder if P2P links should be more ephemeral.

Address collisions currently unhandled

Right now, address collisions are not handled. If you happen to generate an already-claimed address, your client will not work and you'd have to manually stop the service and delete identity.secret. This is phenomenally unlikely -- about 1 in 2^40/2 -- but it's likely enough that it should be handled. Recording here so as not to forget.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.