Compare commits

...
4 Commits
Author SHA1 Message Date
Adam Ierymenko a1c1c82b0d VERSION 0.8.1
This, quick on the heels of 0.8.0, fixes the fact that TCP tunneling was
broken. :)

There was a bug that only manifested in some cases, and not on my testnet.
I took the opportunity to clean up some of that logic generally. I need a
better testnet, but that will have to wait until we exit beta and hopefully
I can earn a little bit of money off this. A better testnet will require
a big beefy virtualization box or two to run hundreds to thousands of KVMs.

Also fixed a tiny cosmetic issue on Windows. Other than that no changes.
2014-04-09 13:03:33 -07:00
Adam Ierymenko 83a0d988ec Text point size readjustment not needed on child windows in Windows? 2014-04-09 12:19:46 -07:00
Adam Ierymenko a8c12369fd More tweaks to TCP logic for GitHub issue #60 2014-04-09 12:10:05 -07:00
Adam Ierymenko 28a6d328a5 Some adjustments to TCP logic for GitHub issue #60 2014-04-09 11:55:24 -07:00
6 changed files with 58 additions and 54 deletions

No files matched your search

+2
View File
@@ -42,12 +42,14 @@ AboutWindow::AboutWindow(QWidget *parent) :
ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nDesktop Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko");
#ifdef __WINDOWS__
/*
QWidgetList widgets = this->findChildren<QWidget*>();
foreach(QWidget *widget, widgets) {
QFont font(widget->font());
font.setPointSizeF(font.pointSizeF() * 0.75);
widget->setFont(font);
}
*/
this->raise();
#endif
}
+3 -3
View File
@@ -20,10 +20,10 @@
<ROW Property="CTRLS" Value="2"/>
<ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/>
<ROW Property="Manufacturer" Value="ZeroTier Networks LLC"/>
<ROW Property="ProductCode" Value="1033:{AA711430-ADF1-44ED-9561-6D32F005009C} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{11E1CFBC-7A03-4B39-883E-5EAD0FD9A134} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="ZeroTier One"/>
<ROW Property="ProductVersion" Value="0.8.0" Type="32"/>
<ROW Property="ProductVersion" Value="0.8.1" Type="32"/>
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
<ROW Property="RUNAPPLICATION" Value="1" Type="4"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
@@ -291,7 +291,7 @@
<ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent">
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Order="2" Flags="14" Text="0"/>
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Order="2" Flags="14" Text="1"/>
<ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Order="0" Flags="14" Text="false"/>
<ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Order="0" Flags="14" Text="0"/>
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Order="1" Flags="14" Text="8"/>
+30 -37
View File
@@ -255,7 +255,7 @@ error_no_byte_order_defined;
/**
* Delay between scans of the topology active peer DB for peers that need ping
*/
#define ZT_PING_CHECK_DELAY 7000
#define ZT_PING_CHECK_DELAY 10000
/**
* Delay between checks of network configuration fingerprint
@@ -283,52 +283,45 @@ error_no_byte_order_defined;
/**
* Delay in core loop between checks of network autoconf newness
*/
#define ZT_NETWORK_AUTOCONF_CHECK_DELAY 7000
/**
* Minimum delay in Node service loop
*
* This is the shortest of the check delays/periods.
*/
#define ZT_MIN_SERVICE_LOOP_INTERVAL 5000
/**
* Activity timeout for links
*
* A link that hasn't spoken in this long is simply considered inactive.
*/
#define ZT_PEER_PATH_ACTIVITY_TIMEOUT ((ZT_PEER_DIRECT_PING_DELAY * 2) + 10000)
/**
* Close TCP tunnels if unused for this long
*/
#define ZT_TCP_TUNNEL_ACTIVITY_TIMEOUT (ZT_PEER_PATH_ACTIVITY_TIMEOUT + 10000)
/**
* Try TCP tunnels if nothing received for this long
*/
#define ZT_TCP_TUNNEL_FAILOVER_TIMEOUT 5000
/**
* Try to ping supernodes this often until we get something from somewhere
*/
#define ZT_STARTUP_AGGRO 5000
#define ZT_NETWORK_AUTOCONF_CHECK_DELAY 10000
/**
* Time since a ping was sent to be considered unanswered
*/
#define ZT_PING_UNANSWERED_AFTER 2500
#define ZT_PING_UNANSWERED_AFTER 1500
/**
* Try to ping supernodes this often until we get something from somewhere
*/
#define ZT_STARTUP_AGGRO (ZT_PING_UNANSWERED_AFTER * 2)
/**
* Maximum delay between runs of the main service loop
*
* This is the shortest of the check delays/periods.
*/
#define ZT_MAX_SERVICE_LOOP_INTERVAL ZT_STARTUP_AGGRO
/**
* Try TCP tunnels if nothing received for this long
*/
#define ZT_TCP_TUNNEL_FAILOVER_TIMEOUT (ZT_STARTUP_AGGRO * 5)
/**
* Path activity timeout
*/
#define ZT_PEER_PATH_ACTIVITY_TIMEOUT ((ZT_PEER_DIRECT_PING_DELAY * 2) + ZT_PING_CHECK_DELAY)
/**
* Close TCP tunnels if unused for this long
*/
#define ZT_TCP_TUNNEL_ACTIVITY_TIMEOUT ZT_PEER_PATH_ACTIVITY_TIMEOUT
/**
* Stop relaying via peers that have not responded to direct sends in this long
*/
#define ZT_PEER_RELAY_CONVERSATION_LATENCY_THRESHOLD 10000
/**
* Number of outgoing verb/packetId pairs to keep for sends expecting responses
*/
#define ZT_PEER_REQUEST_HISTORY_LENGTH 8
/**
* IP hops (a.k.a. TTL) to set for firewall opener packets
*
+7 -3
View File
@@ -546,14 +546,18 @@ Node::ReasonForTermination Node::run()
_r->timeOfLastResynchronize = Utils::now();
while (impl->reasonForTermination == NODE_RUNNING) {
//TRACE("--- BEGIN main I/O loop");
/* This is how the service automatically shuts down when the OSX .app is
* thrown in the trash. It's not used on any other platform for now but
* could do similar things. It's disabled on Windows since it doesn't really
* work there. */
#ifdef __UNIX_LIKE__
if (Utils::fileExists(shutdownIfUnreadablePath.c_str(),false)) {
FILE *tmpf = fopen(shutdownIfUnreadablePath.c_str(),"r");
if (!tmpf)
return impl->terminateBecause(Node::NODE_NORMAL_TERMINATION,"shutdownIfUnreadable exists but is not readable");
fclose(tmpf);
}
#endif
uint64_t now = Utils::now();
bool resynchronize = false;
@@ -664,7 +668,7 @@ Node::ReasonForTermination Node::run()
// Sleep for loop interval or until something interesting happens.
try {
unsigned long delay = std::min((unsigned long)ZT_MIN_SERVICE_LOOP_INTERVAL,_r->sw->doTimerTasks());
unsigned long delay = std::min((unsigned long)ZT_MAX_SERVICE_LOOP_INTERVAL,_r->sw->doTimerTasks());
uint64_t start = Utils::now();
_r->sm->poll(delay);
lastDelayDelta = (long)(Utils::now() - start) - (long)delay; // used to detect sleep/wake
+15 -10
View File
@@ -117,25 +117,28 @@ void Peer::receive(
_lastMulticastFrame = now;
}
bool Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,uint64_t now)
{
Mutex::Lock _l(_lock);
bool useTcp = _isTcpFailoverTime(_r,now);
bool useTcpOut = _isTcpFailoverTime(_r,now);
std::vector<Path>::iterator p(_paths.begin());
if (useTcp) {
while ((p->tcp())&&(p != _paths.end()))
if (!useTcpOut) {
// If we don't want to initiate TCP, seek past TCP paths if they are at the front
// to find the first UDP path as our default.
while ((p != _paths.end())&&(p->type() == Path::PATH_TYPE_TCP_OUT))
++p;
}
if (p == _paths.end())
return false;
uint64_t bestPathLastReceived = p->lastReceived();
// Treat first path as default and look for a better one based on time of
// last packet received.
std::vector<Path>::iterator bestPath = p;
uint64_t bestPathLastReceived = p->lastReceived();
while (++p != _paths.end()) {
uint64_t lr = p->lastReceived();
if ( (lr > bestPathLastReceived) && ((useTcp)||(!p->tcp())) ) {
if ( (lr > bestPathLastReceived) && ((useTcpOut)||(p->type() != Path::PATH_TYPE_TCP_OUT)) ) {
bestPathLastReceived = lr;
bestPath = p;
}
@@ -167,12 +170,12 @@ bool Peer::sendPing(const RuntimeEnvironment *_r,uint64_t now)
bool sent = false;
SharedPtr<Peer> self(this);
Mutex::Lock _l(_lock);
bool useTcp = _isTcpFailoverTime(_r,now);
bool useTcpOut = _isTcpFailoverTime(_r,now);
TRACE("PING %s (useTcp==%d)",_id.address().toString().c_str(),(int)useTcp);
TRACE("PING %s (useTcpOut==%d)",_id.address().toString().c_str(),(int)useTcpOut);
for(std::vector<Path>::iterator p(_paths.begin());p!=_paths.end();++p) {
if ((useTcp)||(!p->tcp())) {
if ((useTcpOut)||(p->type() != Path::PATH_TYPE_TCP_OUT)) {
p->pinged(now); // we log pings sent even if the send "fails", since what we want to track is when we last tried to ping
if (_r->sw->sendHELLO(self,*p)) {
p->sent(now);
@@ -207,15 +210,17 @@ bool Peer::_isTcpFailoverTime(const RuntimeEnvironment *_r,uint64_t now) const
uint64_t lastUdpPingSent = 0;
uint64_t lastUdpReceive = 0;
bool haveUdp = false;
for(std::vector<Path>::const_iterator p(_paths.begin());p!=_paths.end();++p) {
if (p->type() == Path::PATH_TYPE_UDP) {
lastUdpPingSent = std::max(lastUdpPingSent,p->lastPing());
lastUdpReceive = std::max(lastUdpReceive,p->lastReceived());
haveUdp = true;
}
}
return ( (lastUdpPingSent > lastResync) && (lastUdpPingSent > lastUdpReceive) && ((now - lastUdpPingSent) >= ZT_TCP_TUNNEL_FAILOVER_TIMEOUT) );
return ( (!haveUdp) || ( (lastUdpPingSent > lastResync) && ((now - lastUdpReceive) >= ZT_TCP_TUNNEL_FAILOVER_TIMEOUT) ) );
}
return false;
}
+1 -1
View File
@@ -41,6 +41,6 @@
/**
* Revision
*/
#define ZEROTIER_ONE_VERSION_REVISION 0
#define ZEROTIER_ONE_VERSION_REVISION 1
#endif