Giter Site home page Giter Site logo

iodine's Introduction

This is a piece of software that lets you tunnel IPv4 data through a DNS server. This can be usable in different situations where internet access is firewalled, but DNS queries are allowed.

COMPILING

Standard autotools build scripts, so a simple autoreconf --install && ./configure && make, followed by an optional make check, and a make install, should do it. All the usual build options for cross-compilation etc should be available, such as ./configure --help=short to find package-specific configuration options.

QUICKSTART

Try it out within your own LAN! Follow these simple steps:

  • On your server, run: ./iodined -f test.com 10.0.0.1.
    If you already use the 10.0.0.0/8 network, use another internal net like 172.16.0.0/12.
  • Enter a password.
  • On the client, run: ./iodine -f -r test.com 192.168.0.1.
    Replace 192.168.0.1 with your server's ip address.
  • Enter the same password.
  • Now the client has the tunnel ip 10.0.0.2 and the server has 10.0.0.1.
  • Try pinging each other through the tunnel.
  • Done! :)

To actually use it through a relaying nameserver, see below.

HOW TO USE

Note: server and client are required to speak the exact same protocol. In most cases, this means running the same iodine version. Unfortunately, implementing backward and forward protocol compatibility is usually not feasible.

Server side

To use this tunnel, you need control over a real domain (like mydomain.com), and a server with a public IP address to run iodined on. If this server already runs a DNS program, change its listening port and then use iodined's -b option to let iodined forward the DNS requests. (Note that this procedure is not advised in production environments, because iodined's DNS forwarding is not completely transparent.)

Then, delegate a subdomain (say, t1.mydomain.com) to the iodined server. If you use BIND for your domain, add two lines like these to the zone file:

t1		IN	NS	t1ns.mydomain.com.		; note the dot!
t1ns		IN	A	10.15.213.99

The NS line is all that's needed to route queries for the t1 subdomain to the t1ns server. We use a short name for the subdomain, to keep as much space as possible available for the data traffic. At the end of the NS line is the name of your iodined server. This can be any name, pointing anywhere, but in this case it's easily kept in the same zone file. It must be a name (not an IP address), and that name itself must have an A record (not a CNAME).

If your iodined server has a dynamic IP, use a dynamic DNS provider. Simply point the NS line to it, and leave the A line out:

t1		IN	NS	myname.mydyndnsprovider.com.	; note the dot!

Then reload or restart your nameserver program. Now any DNS queries for domains ending in t1.mydomain.com will be sent to your iodined server.

Finally start iodined on your server. The first argument is the IP address inside the tunnel, which can be from any range that you don't use yet (for example 192.168.99.1), and the second argument is the assigned domain (in this case t1.mydomain.com). Using the -f option will keep iodined running in the foreground, which helps when testing. iodined will open a virtual interface ("tun device"), and will also start listening for DNS queries on UDP port 53. Either enter a password on the commandline (-P pass) or after the server has started. Now everything is ready for the client.

If there is a chance you'll be using an iodine tunnel from unexpected environments, start iodined with a -c option. Resulting commandline in this example situation:

./iodined -f -c -P secretpassword 192.168.99.1 t1.mydomain.com

Client side

All the setup is done, just start iodine. It takes one or more arguments, the first is the the domain you used (t1.mydomain.com) and the remaining options are a list of local relaying DNS server (optional). If you don't specify more than one argument, the system's current DNS setting will be consulted.

If DNS queries are allowed to any computer, you can directly give the iodined server's address as second argument (in the example: t1ns.mydomain.com or 10.15.213.99). In that case, it may also happen that any traffic is allowed to the DNS port (53 UDP) of any computer. Iodine will detect this, and switch to raw UDP tunneling if possible. To force DNS tunneling in any case, use the -r option (especially useful when testing within your own network).

The client's tunnel interface will get an IP close to the server's (in this case 192.168.99.2 or .3 etc.) and a suitable MTU. Enter the same password as on the server either as commandline option or after the client has started. Using the -f option will keep the iodine client running in the foreground.

Resulting commandline in this example situation, adding -r forces DNS tunneling even if raw UDP tunneling would be possible:

./iodine -f -P secretpassword t1.mydomain.com

From either side, you should now be able to ping the IP address on the other end of the tunnel. In this case, ping 192.168.99.1 from the iodine client, and 192.168.99.2 from the iodine server.

MISC. INFO

IPv6

The data inside the tunnel is IPv4 only.

The server listens to both IPv4 and IPv6 for incoming requests by default. Use options -4 or -6 to only listen on one protocol. Raw mode will be attempted on the same protocol as used for the login.

The client can use IPv4 or IPv6 nameservers to connect to iodined. The relay nameservers will translate between protocols automatically if needed. Use options -4 or -6 to force the client to use a specific IP version for its DNS queries.

Routing

It is possible to route all traffic through the DNS tunnel. To do this, first add a host route to the nameserver used by iodine over the wired/wireless interface with the default gateway as gateway. Then replace the default gateway with the iodined server's IP address inside the DNS tunnel, and configure the server to do NAT.

However, note that the tunneled data traffic is not encrypted at all, and can be read and changed by external parties relatively easily. For maximum security, run a VPN through the DNS tunnel (=double tunneling), or use secure shell (SSH) access, possibly with port forwarding. The latter can also be used for web browsing, when you run a web proxy (for example Privoxy) on your server.

Testing

The iodined server replies to NS requests sent for subdomains of the tunnel domain. If your iodined subdomain is t1.mydomain.com, send a NS request for foo123.t1.mydomain.com to see if the delegation works.
dig is a good tool for this:

% dig -t NS foo123.t1.mydomain.com
ns.io.citronna.de.

Also, the iodined server will answer requests starting with 'z' for any of the supported request types, for example:

dig -t TXT z456.t1.mydomain.com
dig -t SRV z456.t1.mydomain.com
dig -t CNAME z456.t1.mydomain.com

The reply should look like garbled text in all these cases.

Mac OS X

On Mac OS X 10.6 and later, iodine supports the native utun devices built into the OS - use -d utunX.

Operational info

The DNS-response fragment size is normally autoprobed to get maximum bandwidth. To force a specific value (and speed things up), use the -m option.

The DNS hostnames are normally used up to their maximum length, 255 characters. Some DNS relays have been found that answer full-length queries rather unreliably, giving widely varying (and mostly very bad) results of the fragment size autoprobe on repeated tries. In these cases, use the -M switch to reduce the DNS hostname length to, for example 200 characters, which makes these DNS relays much more stable. This is also useful on some “de-optimizing” DNS relays that stuff the response with two full copies of the query, leaving very little space for downstream data (also not capable of EDNS0). The -M switch can trade some upstream bandwidth for downstream bandwidth. Note that the minimum -M value is about 20, since the first 10 bytes or so are the Base32 encoded data header and the remainder is the actual encoded data and packets can be split into up to 255 fragments.

The upstream data is sent gzipped encoded with Base32; or Base64 if the relay server supports mixed case and + in domain names; or Base64u if _ is supported instead; or Base128 if high-byte-value characters are supported. This upstream encoding is autodetected. The DNS protocol allows one query per packet, and one query can be max 255 chars. Each domain name part can be max 63 chars. So your domain name and subdomain should be as short as possible to allow maximum upstream throughput.

Several DNS request types are supported, with the NULL and PRIVATE types expected to provide the largest downstream bandwidth. The PRIVATE type uses value 65399 in the private-use range. Other available types are TXT, SRV, MX, CNAME and A (returning CNAME), in decreasing bandwidth order. Normally the “best” request type is autodetected and used. However, DNS relays may impose limits on for example NULL and TXT, making SRV or MX actually the best choice. This is not autodetected, but can be forced using the -T option. It is advisable to try various alternatives especially when the autodetected request type provides a downstream fragment size of less than 200 bytes.

Note that SRV, MX and A (returning CNAME) queries may/will cause additional lookups by "smart" caching nameservers to get an actual IP address, which may either slow down or fail completely.

DNS responses for non-NULL/PRIVATE queries can be encoded with the same set of codecs as upstream data. This is normally also autodetected, but no fully exhaustive tests are done, so some problems may not be noticed when selecting more advanced codecs. In that case, you'll see failures/corruption in the fragment size autoprobe. In particular, several DNS relays have been found that change replies returning hostnames (SRV, MX, CNAME, A) to lowercase only when that hostname exceeds ca. 180 characters. In these and similar cases, use the -O option to try other downstream codecs; Base32 should always work.

Normal operation now is for the server to not answer a DNS request until it has timed out (see server timeout), a.k.a. being “lazy”. This way, the server will always have a DNS request handy when new downstream data has to be sent. This greatly improves (interactive) performance and latency, and allows to slow down the quiescent ping requests to 4 second intervals by default, and possibly much slower. Some DNS servers are more impatient and will give SERVFAIL errors (timeouts) randomly or consistently if the target timeout is too high. All data should still get through in these cases, but iodine will reduce the target interval slowly to reduce the number of SERVFAILS. In these scenarios, it is best to manually set the target interval to something which is definitely less than the most impatient DNS server timeout in the connection to ensure maximum reliability. Some very impatient DNS relays like dnsadvantage.com (ultradns), which time out in 1 second or even less can cause issues. Yet data will still get trough, and you can probably ignore the SERVFAIL errors.

If you are running on a local network without any DNS server in-between, try -I 50 (iodine and iodined close the connection after 60 seconds of silence). The only time you'll notice a slowdown, is when DNS reply packets go missing; the iodined server fragment will have to time-out to be resent. You can speed this up by generating some upstream traffic (keypress, ping). If this happens often, check your network for bottlenecks and/or run with -I1.

The delayed answering in lazy mode will cause some “carrier grade” commercial DNS relays to repeatedly re-send the same DNS query to the iodined server. If the DNS relay is actually implemented as a pool of parallel servers, duplicate requests may even arrive from multiple sources. This effect will only be visible in the network traffic at the iodined server, and will not affect the client's connection. Iodined will notice these duplicates, and send the same answer (when its time has come) to both the original query and the latest duplicate. After that, the full answer is cached for a short while. Delayed duplicates that arrive at the server even later, get a reply that the iodine client will ignore (if it ever arrives there).

If you have problems, try inspecting the traffic with network monitoring tools like tcpdump or ethereal/wireshark, and make sure that the relaying DNS server has not cached the response. A cached error message could mean that you started the client before the server. The -D (and -DD) option on the server can also show received and sent queries. To assist in diagnosis, you may wish to recompile with make debug and use -DDDDD to see more debug output.

TIPS & TRICKS

If your port 53 is taken on a specific interface by an application that does not use it, use -p on iodined to specify an alternate port (like -p 5353) and use for instance iptables (on Linux) to forward the traffic:

iptables -t nat -A PREROUTING -i eth0 -p udp --dport 53 -j DNAT --to :5353

(Sent in by Tom Schouten)

Iodined will reject data from clients that have not been active (data/pings) for more than 60 seconds. Similarly, iodine will exit when no downstream data has been received for 60 seconds. In case of a long network outage or similar, just restart iodine (re-login), possibly multiple times until you get your old IP address back. Once that's done, just wait a while, and you'll eventually see the tunneled TCP traffic continue to flow from where it left off before the outage.

With the introduction of the downstream packet queue in the server, its memory usage has increased with several megabytes in the default configuration. For use in low-memory environments (e.g. running on your DSL router), you can decrease USERS and undefine OUTPACKETQ_LEN in user.h without any ill conse- quence, assuming at most one client will be connected at any time. A small DNSCACHE_LEN is still advised, preferably 2 or higher, however you can also undefine it to save a few more kilobytes.

PERFORMANCE

Please note: The following performance is outdated and does not apply to the current version of iodine. Since the protocol was updated to use a sliding window for sending fragments, the throughput was greatly increased and should be much higher even on high-latency connections.

This section tabulates some performance measurements.

Measurements were done in protocol 00000502 in lazy mode; upstream encoding always Base128; iodine -M255; iodined -m1130. Network conditions were not extremely favorable; results are not benchmarks but a realistic indication of real-world performance that can be expected in similar situations.

Upstream/downstream throughput was measured by scp'ing a file previously read from /dev/urandom (i.e. incompressible), and measuring size with ls -l ; sleep 30 ; ls -l on a separate non-tunneled connection. Given the large scp block size of 16 kB, this gives a resolution of 4.3 kbit/s, which explains why some values are exactly equal. Ping round-trip times measured with ping -c100, presented are average rtt and mean deviation (indicating spread around the average), in milliseconds.

Situation 1: Laptop -> Wifi AP -> Home server -> DSL provider -> Datacenter

	 iodine    DNS "relay"        bind9           DNS cache        iodined
	
	                        downstr.  upstream downstr.  ping-up       ping-down
	                        fragsize   kbit/s   kbit/s  avg +/-mdev   avg +/-mdev
	-----------------------------------------------------------------------------
	
	iodine -> Wifi AP :53
	  -Tnull (= -Oraw)           982    43.6    131.0   28.0    4.6   26.8    3.4
	
	iodine -> Home server :53
	  -Tnull (= -Oraw)          1174    48.0    305.8   26.6    5.0   26.9    8.4
	
	iodine -> DSL provider :53  
	  -Tnull (= -Oraw)          1174    56.7    367.0   20.6    3.1   21.2    4.4
	  -Ttxt -Obase32             730    56.7    174.7*
	  -Ttxt -Obase64             874    56.7    174.7
	  -Ttxt -Obase128           1018    56.7    174.7
	  -Ttxt -Oraw               1162    56.7    358.2
	  -Tsrv -Obase128            910    56.7    174.7
	  -Tcname -Obase32           151    56.7     43.6
	  -Tcname -Obase128          212    56.7     52.4
	
	iodine -> DSL provider :53  
	  wired (no Wifi) -Tnull    1174    74.2    585.4   20.2    5.6   19.6    3.4
	
	 [174.7* : these all have 2frag/packet]

Situation 2: Laptop -> Wifi+vpn / wired -> Home server

	 iodine                            iodined
	
	                        downstr.  upstream downstr.  ping-up       ping-down
	                        fragsize   kbit/s   kbit/s  avg +/-mdev   avg +/-mdev
	-----------------------------------------------------------------------------
	
	wifi + openvpn  -Tnull      1186   166.0   1022.3    6.3    1.3    6.6    1.6
	
	wired  -Tnull               1186   677.2   2464.1    1.3    0.2    1.3    0.1

Notes

Multiple fragments in-flight like TCP is allowed in iodine, which does increase performance, but it may overload some low-bandwidth intermediary DNS servers. Using carrier-grade DNS servers such as those provided by your ISP should be able to handle a high volume of DNS queries, and it is recommended to use as many DNS nameservers as possible to balance the load.

PORTABILITY

iodine has been tested on Linux (arm, ia64, x86, AMD64 and SPARC64), FreeBSD (ia64, x86), OpenBSD (x86), NetBSD (x86), MacOS X (ppc and x86, with http://tuntaposx.sourceforge.net/). and Windows (with OpenVPN TAP32 driver, see win32 readme file). It should be easy to port to other unix-like systems that have TUN/TAP tunneling support. Let us know if you get it to run on other platforms.

THE NAME

The name iodine was chosen since it starts with IOD (IP Over DNS) and since iodine has atomic number 53, which happens to be the DNS port number.

THANKS

  • To kuxien for FreeBSD and OS X testing
  • To poplix for code audit

AUTHORS & LICENSE

Copyright (c) 2006-2014 Erik Ekman [email protected], 2015 Frekk van Blagh, 2006-2009 Bjorn Andersson [email protected]. Also major contributions by Anne Bezemer.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

MD5 implementation by L. Peter Deutsch (license and source in src/md5.[ch]) Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.

iodine's People

Contributors

andrewg-felinemenace avatar anime4000 avatar barak avatar cpatulea avatar endomandi avatar frekky avatar fuzion24 avatar gregoa avatar hakankvist avatar jedisct1 avatar jesultra avatar jwyllie83 avatar lcapello avatar lexa avatar masaq- avatar mmuman avatar mscherer avatar mxb78 avatar nbraud avatar ppergame avatar vincentbernat avatar wgh- avatar yarrick avatar zx2c4 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iodine's Issues

Build error

iodine.c: In function 'main':
iodine.c:741:3: warning: 'remote_forward_port' may be used uninitialized in this function [-Wmaybe-uninitialized]
   fprintf(stderr, "Requesting TCP data forwarding from server to %s:%d\n",
   ^
CC client.c
LD ../bin/iodine
CC iodined.c
iodined.c: In function 'main':
iodined.c:564:3: error: 'dns_fds' undeclared (first use in this function)
   dns_fds.v4fd = SD_LISTEN_FDS_START;
   ^
iodined.c:564:3: note: each undeclared identifier is reported only once for each function it appears in
Makefile:40: recipe for target 'iodined.o' failed
make[1]: *** [iodined.o] Error 1
make[1]: Leaving directory '/root/tmp/iodine-frekky/src'
Makefile:20: recipe for target 'all' failed
make: *** [all] Error 2
[root@vps193617 iodine-frekky]# 

Windows build error

I'm compiling with mingw on windows.

D:\mingw\msys\1.0\home\denny\iodine-master>make
make[1]: Entering directory `/usr/home/denny/iodine-master/src'
OS is WINDOWS32, arch is i686
CC common.c
fatal: Not a git repository (or any of the parent directories): .git
In file included from common.c:54:0:
common.h:60:0: warning: "BITS_32" redefined
 #define BITS_32 1
 ^
common.h:52:0: note: this is the location of the previous definition
 #define BITS_32
 ^
common.c: In function 'format_addr':
common.c:124:3: warning: implicit declaration of function 'getnameinfo' [-Wimplicit-function-declaration]
   getnameinfo((struct sockaddr *)sockaddr, sockaddr_len, dst, sizeof(dst) - 1, NULL, 0, NI_NUMERICHOST);
   ^
common.c: In function 'get_addr':
common.c:162:2: warning: implicit declaration of function 'getaddrinfo' [-Wimplicit-function-declaration]
  res = getaddrinfo(host, portnum, &hints, &addr);
  ^
common.c:167:3: warning: implicit declaration of function 'freeaddrinfo' [-Wimplicit-function-declaration]
   freeaddrinfo(addr);
   ^
common.c: In function 'open_dns_opt':
common.c:200:32: error: 'IPV6_V6ONLY' undeclared (first use in this function)
   setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*) &v6only, sizeof(v6only));
                                ^
common.c:200:32: note: each undeclared identifier is reported only once for each function it appears in
common.c: In function 'socket_set_blocking':
common.c:411:31: warning: passing argument 3 of 'ioctlsocket' from incompatible pointer type
  if (ioctlsocket(fd, FIONBIO, &blocking) != 0) {
                               ^
In file included from common.c:33:0:
d:\mingw\include\winsock2.h:540:32: note: expected 'u_long *' but argument is of type 'int *'
 WINSOCK_API_LINKAGE int PASCAL ioctlsocket(SOCKET,long,u_long *);
                                ^
common.c: In function 'open_tcp_nonblocking':
common.c:445:21: error: 'EINPROGRESS' undeclared (first use in this function)
   == -1 && errno != EINPROGRESS) {
                     ^
common.c: In function 'check_tcp_error':
common.c:465:43: warning: passing argument 4 of 'getsockopt' from incompatible pointer type
  if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &errornum, &len) != 0) {
                                           ^
In file included from common.c:33:0:
d:\mingw\include\winsock2.h:543:32: note: expected 'char *' but argument is of type 'int *'
 WINSOCK_API_LINKAGE int PASCAL getsockopt(SOCKET,int,int,char*,int*);
                                ^
make[1]: *** [common.o] Error 1
make[1]: Leaving directory `/usr/home/denny/iodine-master/src'
make: *** [all] Error 2

buffer overflow detected

when running without make debug i get a buffer overflow:

$ sudo ./bin/iodined -f -F /var/run/iodined.iodined.pid -P "VerySecret" -d dns0 -p 53 -n 203.0.113.119 -c 100.126.3.1/24 does.not.exist
Opened dns0
Setting IP of dns0 to 100.126.3.1
Setting MTU of dns0 to 1130
Opened IPv4 UDP socket
Opened IPv6 UDP socket
Listening to dns for domain does.not.exist
*** buffer overflow detected ***: ./bin/iodined terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f7d71d5738f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f7d71deec9c]
/lib/x86_64-linux-gnu/libc.so.6(+0x109b60)[0x7f7d71dedb60]
./bin/iodined[0x40e780]
./bin/iodined[0x40f11d]
./bin/iodined[0x40fdcb]
./bin/iodined[0x4028e0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f7d71d05ec5]
./bin/iodined[0x402cc1]
======= Memory map: ========
00400000-00415000 r-xp 00000000 ca:01 275894 /home/ubuntu/iodine/bin/iodined
00614000-00615000 r--p 00014000 ca:01 275894 /home/ubuntu/iodine/bin/iodined
00615000-00616000 rw-p 00015000 ca:01 275894 /home/ubuntu/iodine/bin/iodined
00616000-00629000 rw-p 00000000 00:00 0
00810000-00831000 rw-p 00000000 00:00 0 [heap]
7f7d7122d000-7f7d71243000 r-xp 00000000 ca:01 396054 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7d71243000-7f7d71442000 ---p 00016000 ca:01 396054 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7d71442000-7f7d71443000 rw-p 00015000 ca:01 396054 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7d71443000-7f7d71ce4000 rw-p 00000000 00:00 0
7f7d71ce4000-7f7d71e9f000 r-xp 00000000 ca:01 397636 /lib/x86_64-linux-gnu/libc-2.19.so
7f7d71e9f000-7f7d7209e000 ---p 001bb000 ca:01 397636 /lib/x86_64-linux-gnu/libc-2.19.so
7f7d7209e000-7f7d720a2000 r--p 001ba000 ca:01 397636 /lib/x86_64-linux-gnu/libc-2.19.so
7f7d720a2000-7f7d720a4000 rw-p 001be000 ca:01 397636 /lib/x86_64-linux-gnu/libc-2.19.so
7f7d720a4000-7f7d720a9000 rw-p 00000000 00:00 0
7f7d720a9000-7f7d720c1000 r-xp 00000000 ca:01 396113 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f7d720c1000-7f7d722c0000 ---p 00018000 ca:01 396113 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f7d722c0000-7f7d722c1000 r--p 00017000 ca:01 396113 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f7d722c1000-7f7d722c2000 rw-p 00018000 ca:01 396113 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f7d722c2000-7f7d722e5000 r-xp 00000000 ca:01 397629 /lib/x86_64-linux-gnu/ld-2.19.so
7f7d72310000-7f7d724da000 rw-p 00000000 00:00 0
7f7d724e1000-7f7d724e4000 rw-p 00000000 00:00 0
7f7d724e4000-7f7d724e5000 r--p 00022000 ca:01 397629 /lib/x86_64-linux-gnu/ld-2.19.so
7f7d724e5000-7f7d724e6000 rw-p 00023000 ca:01 397629 /lib/x86_64-linux-gnu/ld-2.19.so
7f7d724e6000-7f7d724e7000 rw-p 00000000 00:00 0
7fffdffb6000-7fffdffd9000 rw-p 00000000 00:00 0 [stack]
7fffdffeb000-7fffdffed000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Understanding the iodine landscape

hi @frekky,

thanks for your work!!!

years ago i used iodine when the only protocol option was ping-pong -which was unworkable for connections with any latency to speak of- and never used it again since. at the time i thought of forking iodine myself to fix this, but never got to do it.

in 2015 you contributed an update to yarrick/iodine that included a sliding window protocol to decouple throughput from latency and fix this issue. however, for whatever reason it was never merged.

later you kept on developing your fork for many years, to an old pre-0.8-stable, master in 2017, and unsable to this date.

i have a couple of open questions that would help me and other newbies understand the iodine landscape as it is now. hopefully you can clarify some.

  1. did "mainline" yarrick/iodine merge any competing solution to increase throughput in high latency networks?

  2. why, do you think, your changes were not mainlined?

  3. if someone where to use your fork, what version/branch would you recommend?

again, thanks so much for your work!

Running Iodine behind BIND9

I successfully configure and running BIND9 on VPS.

However, I tried to run Iodine in same server, so run Iodine at port 5353.

I configure /etc/bind/named.conf.local

zone "i.domain.org" {
	type forward;
	forward only;
	forwarders {
		127.0.0.1 port 5353;
	};
};

Iodine tell me: .Got NXDOMAIN as reply: domain does not exist

when I try using iptable
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 53 -j DNAT --to :5353
cause BIND9 not responding.

You have any idea?

tcp to tcp forward

would be nicer to have tcp to tcp forwarding instead of stdio to tcp, I tried to use socat with rsyncd but it won't work

can not build unstable branch

Master builds fine on fedora 26 (beside systemd support previously reported),
However unstable doesn't :

[sheepdestroyer@sheepora-X220 iodine]$ make 
make  all-am
make[1]: Entering directory '/home/sheepdestroyer/temp/iodine'
gcc -DHAVE_CONFIG_H -I.  -DLINUX  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-base32.o -MD -MP -MF src/.deps/iodine-base32.Tpo -c -o src/iodine-base32.o `test -f 'src/base32.c' || echo './'`src/base32.c
mv -f src/.deps/iodine-base32.Tpo src/.deps/iodine-base32.Po
gcc -DHAVE_CONFIG_H -I.  -DLINUX  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-base64.o -MD -MP -MF src/.deps/iodine-base64.Tpo -c -o src/iodine-base64.o `test -f 'src/base64.c' || echo './'`src/base64.c
mv -f src/.deps/iodine-base64.Tpo src/.deps/iodine-base64.Po
gcc -DHAVE_CONFIG_H -I.  -DLINUX  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-base128.o -MD -MP -MF src/.deps/iodine-base128.Tpo -c -o src/iodine-base128.o `test -f 'src/base128.c' || echo './'`src/base128.c
mv -f src/.deps/iodine-base128.Tpo src/.deps/iodine-base128.Po
gcc -DHAVE_CONFIG_H -I.  -DLINUX  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-base64u.o -MD -MP -MF src/.deps/iodine-base64u.Tpo -c -o src/iodine-base64u.o `test -f 'src/base64u.c' || echo './'`src/base64u.c
mv -f src/.deps/iodine-base64u.Tpo src/.deps/iodine-base64u.Po
gcc -DHAVE_CONFIG_H -I.  -DLINUX  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-common.o -MD -MP -MF src/.deps/iodine-common.Tpo -c -o src/iodine-common.o `test -f 'src/common.c' || echo './'`src/common.c
In file included from src/common.c:58:0:
src/common.c: In function ‘send_raw’:
src/common.h:176:7: error: ‘INSTANCE’ undeclared (first use in this function); did you mean ‘ESTALE’?
   if (INSTANCE.debug >= level) {\
       ^
src/common.c:378:2: note: in expansion of macro ‘DEBUG’
  DEBUG(3, "TX-raw: client %s (user %d), cmd %d, %d bytes",
  ^~~~~
src/common.h:176:7: note: each undeclared identifier is reported only once for each function it appears in
   if (INSTANCE.debug >= level) {\
       ^
src/common.c:378:2: note: in expansion of macro ‘DEBUG’
  DEBUG(3, "TX-raw: client %s (user %d), cmd %d, %d bytes",
  ^~~~~
make[1]: *** [Makefile:1019: src/iodine-common.o] Error 1
make[1]: Leaving directory '/home/sheepdestroyer/temp/iodine'
make: *** [Makefile:632: all] Error 2
[sheepdestroyer@sheepora-X220 iodine]$ 

Fails to build on Linux

Tested on both Ubuntu 16.04 and Fedora 27.
iodine
Am I just missing something on both or is this a bug or something?

making frekky iodine a service?

Hi, a bit of a noob but I think I built it correctly.

Can this be run as a service?

sudo systemctl enable iodined.service
sudo systemctl restart iodined.service

no file in /etc/init.d/ or /etc/default/
Not sure if I'm doing something wrong or maybe it's not in this fork. Can someone more experienced confirm or show me the way to set it up properly? Thanks!!

msys-mingw32

I using XhmikosR's Builds for MSYS (GCC 7.1.0)
and it has a bit older autoconf, I can simply update by get latest source and make install

however, for long time, your build a bit different, which is need autoconf

I run this command

autoreconf --install
export CC=x86_64-w64-mingw32-gcc
./configure

and this error came in
windows 7 pro 64-bit-2017-07-02-08-00-41

sorry, I new into autoconf 🙇

./configure can't find systemd on fedora

fedora 26 with systemd-devel and systemd-libs installed

./configure gives :

checking systemd... checking for library containing sd_listen_fds... 
checking for sd_listen_fds... no
disabled: systemd

Feature request: Wirehsark dissector for iodine protocol

Wouldn't it be fun to see all your iodine protocol metadata in Wireshark?
Wireshark plugins can be written in C and it should be possible to re-use at least some of the iodine client/server code in a dissector/plugin code.
If anyone wants to try or has experience writing such things then please give it a go!

-c or --noipcheck ignored

Attempted to update my working yarrick 0.7.0 iodined to frekkys 0.8.0 and found that -c (--noipcheck) option is ignored. Note I am attempting to connect with yarrick 0.7.0 client.

$ ./iodine.exe -f -r -TSRV -m922 -L1 -I4 -P <PASS_REMOVED> <DOMAIN_REMOVED>
Opening device Local Area Connection
Opened IPv4 UDP socket
Opened IPv4 UDP socket
Sending DNS queries for iodine.danols.com to 181.225.231.110
Using DNS type SRV queries
Opened IPv4 UDP socket
Version ok, both using protocol v 0x00000502. You are user #0
Received bad handshake
Retrying login...
Enabling interface 'Local Area Connection'
Setting IP of interface 'Local Area Connection' to 10.0.0.2 (can take a few seco
nds)...

Server tunnel IP is 10.0.0.1
Skipping raw mode
Using EDNS0 extension
Switching upstream to codec Base128
Server switched upstream to codec Base128
Autodetecting downstream codec (use -O to override)
Switching downstream to codec Base128
Server switched downstream to codec Base128
Switching to lazy mode for low-latency
Server switched to lazy mode
Setting downstream fragment size to max 922...
Connection setup complete, transmitting data.
BADIP: Server rejected sender IP address (maybe iodined -c will help), or server kicked us due to timeout. Will exit if no downstream data is received in 60 seconds.
BADIP: Server rejected sender IP address (maybe iodined -c will help), or server kicked us due to timeout. Will exit if no downstream data is received in 60 seconds.

Minor build issue on Linux/OSX

Hi!
Just signed up to let you know about this small hiccup when building the master tree on both Debian 8 and OSX 10.13:

  • ./configure fails with the following error:
./configure: line 5122: syntax error near unexpected token `CHECK,'
./configure: line 5122: `PKG_CHECK_MODULES(CHECK, check,'

since I lack any understanding of configure files, I worked around the issue like that:

#PKG_CHECK_MODULES(CHECK, check,
#  { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled: unit testing" >&5
#$as_echo "enabled: unit testing" >&6; },
#  { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled: unit testing" >&5
#$as_echo "disabled: unit testing" >&6; })

# if test -z "${CHECK_PKG_ERRORS}"; then
#  HAVE_CHECK_TRUE=
#  HAVE_CHECK_FALSE='#'
#else
  HAVE_CHECK_TRUE='#'
  HAVE_CHECK_FALSE=
#fi

another run of ./configure completes successfully and make produces a working binary.

How to Cross-Build for Windows

Hello,

can someone give me some tips on how to compile a Windows binary on Linux?

I am using Debian 9 and have tried the following:

  • autoreconf --install
  • /configure --build=turingmachine-unknown-linux-gnu --host=mingw32
  • make

Then I get the following error:

make  all-am
make[1]: Verzeichnis „/opt/iodine“ wird betreten
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I.  -DWINDOWS32  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-common.o -MD -MP -MF src/.deps/iodine-common.Tpo -c -o src/iodine-common.o `test -f 'src/common.c' || echo './'`src/common.c
In file included from src/common.c:19:0:
./config.h:234:19: error: two or more data types in declaration specifiers
 #define socklen_t int
                   ^
In file included from src/common.c:58:0:
src/common.h:64:0: warning: "BITS_64" redefined
 #define BITS_64 1

src/common.h:56:0: note: this is the location of the previous definition
 #define BITS_64

src/common.c: In function ‘socket_set_blocking’:
src/common.c:415:31: warning: passing argument 3 of ‘ioctlsocket’ from incompatible pointer type [-Wincompatible-pointer-types]
  if (ioctlsocket(fd, FIONBIO, &blocking) != 0) {
                               ^
In file included from src/common.c:37:0:
/usr/share/mingw-w64/include/winsock2.h:977:34: note: expected ‘u_long * {aka long unsigned int *}’ but argument is of type ‘int *’
   WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
                                  ^~~~~~~~~~~
src/common.c: In function ‘check_tcp_error’:
src/common.c:469:43: warning: passing argument 4 of ‘getsockopt’ from incompatible pointer type [-Wincompatible-pointer-types]
  if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &errornum, &len) != 0) {
                                           ^
In file included from src/common.c:37:0:
/usr/share/mingw-w64/include/winsock2.h:980:34: note: expected ‘char *’ but argument is of type ‘int *’
   WINSOCK_API_LINKAGE int WSAAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen);
                                  ^~~~~~~~~~
Makefile:969: die Regel für Ziel „src/iodine-common.o“ scheiterte
make[1]: *** [src/iodine-common.o] Fehler 1
make[1]: Verzeichnis „/opt/iodine“ wird verlassen
Makefile:628: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2

It's my first time trying to cross-build so i don't have really a glue....

Thanks in advance

Build error on macOS

$ ./configure
checking for a BSD-compatible install... /Users/siraben/.nix-profile/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /Users/siraben/.nix-profile/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking environment to compile for... checking build system type... aarch64-apple-darwin21.6.0
checking host system type... aarch64-apple-darwin21.6.0
configure: host_os: darwin21.6.0
configure: uname_os: DARWIN
configure: adjusted OS: DARWIN
checking whether configure should try to set CFLAGS... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang accepts -g... yes
checking for clang option to enable C11 features... none needed
checking whether clang understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of clang... gcc3
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for vfork.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
./configure: line 4868: AX_CFLAGS_WARN_ALL: command not found
checking for library containing uncompress... -lz
checking systemd... checking for library containing sd_listen_fds... no
checking for sd_listen_fds... no
disabled: systemd
checking for library containing setcon... no
checking for setcon... no
disabled: selinux
./configure: line 5169: syntax error near unexpected token `CHECK,'
./configure: line 5169: `PKG_CHECK_MODULES(CHECK, check,'

Binary releases

Would you consider posting built binary releases to github?

Botched find/replace for "connected"?

There is a place in client.c where connected has been replaced with this.connected:

warnx("No suitable DNS query type found. Are you this.connected to a network?");

And here, though it is just a comment and technically still correct (maybe even intentional):
Note: only start fixing up connection AFTER we have this.connected

The former this.connected is not present in the original yarrick iodine; the latter is from a comment that doesn't exist in the original.

windows binary

Hi,
with the current windows build (version 0.7.0) from yarrick I can connect successful to my server, but are not able to ping or make any other connection to the server. The Server Firewall is not the problem, what I have verified. On the net I found also 2 other ppl which have the problem.

  1. https://hardforum.com/threads/anyone-use-iodine.1843748/
  2. http://lists.wpkg.org/pipermail/iodine-users/2011-August/000355.html
    With the android client andiodine I can successful connect and establish connection to the server.
    So it must me a problem on the Windows client.

So possible your fork/code fixed any problem which is involved? Have you any prebuild binarys for windows?

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.