3 e-mail Switzerland-devel@eff.org
4 https://falcon.eff.org/mailman/listinfo/Switzerland-devel
6 IRC #Switzerland on irc.oftc.org
8 bugs https://sourceforge.net/tracker/?func=browse&group_id=233013&atid=1088569
14 1.1. What is Switzerland?
15 1.1.1 How do I run Switzerland?
17 1.1.3 How do I understand the output of Switzerland?
18 1.2. Stability of this release
20 1.3.1. Privileged client
21 1.4. Platforms supported
26 2.1. NAT (Network Address Translation) firewalls
34 3.3. Tree organization
39 1.1. What is Switzerland?
41 Switzerland is client/server software to detect when ISPs, networks or
42 firewalls interfere with Internet traffic. Switzerland clients summarize
43 incoming and outgoing packets to a trusted server, which verifies that pairs
44 of clients receive what each other sent. If a third party injects, alters
45 or drops packets en route between clients, the Switzerland server alerts the
46 clients and records data about the event for further analysis.
49 +----------+ | Internet | +----------+
50 | Alice | --> | networks/ | --> | Bob |
51 | (client) | <-- | ISPs/ | <-- | (client) |
52 +----------+ | firewalls | +----------+
55 +---------------------------------------------+
56 | | |_____________________________| | |
58 | +----------------> = <-----------------+ |
59 | summary A summary B |
61 | Switzerland (server) |
62 +---------------------------------------------+
64 1.1.1. How do I run Switzerland?
66 Before you run Switzerland, be sure to read the sections on security, privacy
69 Once you've read those sections and installed Switzerland (see the INSTALL file
70 for instructions -- on some computers installation will be very easy, on
71 others, it may require some hacking), you can run Switzerland like this:
75 By default, the client will use EFF's Switzerland server, switzerland.eff.org.
76 If you run your own Switzerland server, you can specify that instead using the
81 When running Switzerland, you may see some errors/warnings about NTP. NTP,
82 or Network Time Protocol, is a way of making sure your computer's clock is
83 accurate. Switzerland works best with an accurate clock, but even if your
84 clock is not accurate, Switzerland must know how far off your clock is from
87 Under ideal conditions, you will have the ntp daemon installed and running, and
88 it will have set your clock to the correct time. Switzerland will try to use a
89 program called 'ntpdc' to query your ntp daemon to ask it about the clock
90 accuracy. If ntpdc is not installed on your system, or it can't connect to the
91 ntp daemon (usually because it's not running), then Switzerland will tell you
92 about it. Switzerland will then try to use the program 'ntpdate' (if installed)
93 to figure out the accuracy of your clock. If ntpdate fails (usually because
94 you don't have it installed) then Switzerland will really complain and then
97 If you are receiving warnings/errors about NTP, here are some steps you can
100 1) Make sure ntp is installed and configured properly for your system. On
101 Linux/UNIX systems, installing and configuring ntp is often as easy as
102 installing the 'ntp' package using your distributions package manager. If
103 you are on windows, you can download and install the ntp package from here:
104 http://www.meinberg.de/english/sw/ntp.htm
105 (Note: The standard Windows NTP client that comes with many Windows
106 systems is NOT sufficient for Switzerland)
107 2) If you've just recently installed ntp and Switzerland is still complaining
108 about ntp being in 'UNSPEC' mode:
109 a) Check your clock. ntp will refuse to work if your clock is more than a
110 few seconds off (while this may seem silly, there are some good reasons
111 for this behavior). Try setting your clock manually, or possibly by
112 using the 'ntpdate' command by running 'ntpdate pool.ntp.org'
113 b) If your clock is accurate, it may be that ntp hasn't been running long
114 enough to establish that it has correctly synced your clock. Try
115 waiting a bit longer. On some systems it may take upwards of 10 or 20
118 3) If, for whatever reason, you can't get ntp installed, then try installing
119 the ntpdate program, which Switzerland will try to use if it can't use ntp.
121 4) If there is no way to install ntp or ntpdate, then you can use the -u
122 option to switzerland-client to tell it the maximum number of seconds your
123 clock will be off by.
126 1.1.3 How do I understand the output of Switzerland?
128 First, see the following wiki page for an example of what Switzerland should
129 print to the screen if it's working correctly:
130 http://switzerland.wiki.sourceforge.net/output+example
132 Switzerland will output 'Now testing flow' messages when you are exchanging
133 data with another peer running Switzerland. About 20 seconds after you see
134 a 'Now testing flow' message, you should see a flow table. The columns in the
135 flow table are as follows:
136 Okay : Unmodified packet count
137 Drop : Dropped packet count
138 Mod/frg : Modified or fragmented packet count
139 Pend_t/rt : Number of packets the server is still processing
140 Prot : The flow protocol (tcp/icmp/etc.)
142 Some dropped packets are not unusual, but a high dropped packet count may be
143 indicative of traffic shaping.
145 1.2. Stability of this release
147 This is an alpha release; Switzerland is not stable software. It's been gently
148 tested but is still heavily under development. Many planned features have not
149 been implemented. We need your help!
153 This release of Switzerland may contain bugs or security vulnerabilities that
154 allow an attacker to compromise your computer's security. We recommend you do
155 not run it in a production setting, on computers that store sensitive data or
156 data that has not been backed up, or on computers exchanging sensitive data
157 over unencrypted connections.
159 1.3.1. Privileged client
161 Because the Switzerland client passively observes all traffic on your
162 computer's network interface, it needs administrative (root) privileges, much
163 like the tcpdump program.
165 1.4. Platforms supported
167 We've tested the client and server on:
171 - Darwin (Tiger, with an upgrade to python2.5)
172 - Windows XP (it runs, but as with many UNIX programs on win32, installation
175 Please help us add support for your platform of choice.
177 1.5. Privacy concerns
179 In this release, a Switzerland server publishes the IP addresses of all
182 Your client is designed to only summarize traffic exchanged with other
183 Switzerland clients, and should not tell the server anything about
184 communications with computers that are not Switzerland clients.
186 Summary information uses cryptographic hashes of packets, so it's hard to
187 reconstruct the contents of your packets from what you send to Switzerland.
188 However, when it detects forged packets, the Switzerland server may ask your
189 computer for full copies of packets sent around the time that the forgery was
190 received. Therefore it is likely that running Switzerland will result in
191 portions of your unencrypted communications being logged at the server. By
192 default, Switzerland clients will use a server run by the EFF, but you have the
193 option of running your own server and telling your clients to connect to that
196 In this release, traffic between Switzerland clients and the server is
197 unencrypted, so it's possible for an eavesdropper near the server to see
198 information about what kind of connections you have open with which other
199 Switzerland clients, and how frequently you're exchanging data (an eavesdropper
200 near you could probably see most of this information regardless of whether you
201 were running Switzerland).
203 Later releases will reduce some of these privacy issues and add more options
204 for fine-grained privacy control. For now though, treat any traffic traveling
205 between Switzerland clients as "public record" information.
209 2.1. NAT (Network Address Translation) firewalls
211 Switzerland is aware of the changes to IP addresses and port numbers that NAT
212 firewalls normally make, and will not report those as modifications to the
215 But many NAT firewalls, especially home wireless routers, make other
216 undocumented modifications to the traffic traveling through them, beyond the
217 minimum required to be a NAT firewall. As a result, Switzerland clients that
218 are behind firewalls or talking to machines that are behind firewalls will
219 often detect and report these modifications to traffic.
221 It is important not to confuse packet modification by your firewall or another
222 client's firewall with interference by an ISP. If you want to perform reliable
223 tests of an ISP, you'll need to plug your computer directly into your DSL or
224 cable modem, and only consider results obtained with non-firewalled peers.
225 Switzerland will tell you which other clients are behind NAT firewalls.
227 In the future we may be able to build a database of different models of common
228 NAT firewalls and the things they do, which would allow preliminary tests to be
229 done through the firewall. At the moment, for instance, we think that devices
230 running the DD-WRT open firmware make no unexpected modifications to traffic,
231 so you should be able to run ISP tests through them. A firewall-free setup
232 should always be used to confirm test results.
236 It is theoretically possible that interference can be performed by non-NAT
237 firewalls. These are most likely to be encountered on corporate and university
238 networks. Switzerland will detect this as interference by an intermediary. It
239 isn't a bug, it's a feature. Remember, traffic interference could be occurring
240 at any step along the way from your computer to another.
244 EFF runs a default server at switzerland.eff.org:7778 (we expect it'll crash
245 and misbehave a bit for early versions of the code), but you can run your own
246 servers elsewhere if you wish.
248 2.4 Tests you can run
250 http://switzerland.wiki.sourceforge.net/tests
252 There are a few different ways to run tests with Switzerland.
254 Any packets exchanged between Switzerland clients connected to the same server
255 will be tested automatically. The question is, how do you find other clients
256 and talk to them using the protocols you want to test?
258 For now, the easiest way to set up tests is to co-ordinate them through the
259 wiki page linked above or the IRC channel. If you want to test whether
260 BitTorrent downloads are working correctly, go to that page and find some
261 torrents that others are seeding from test machines. If you want to test if
262 your ISP is interfering with BitTorrent seeding, you can post a link to a
263 torrent file on the wiki, seed that torrent while running a Switzerland client
264 and other people can find it on the wiki and try to download it while running a
267 Another way is to run clients on two different computers, and then make the
268 machines talk to each other using whatever protocol you'd like to test. That's
269 fine if you have administrator accounts on two suitable machines for running
270 the test, and are comfortable running the right clients and servers on them.
272 If you're a developer working on an application (say a P2P or IP telephony app)
273 that might be a target for interference, you could automate one of the above
280 - use the software and report bugs / results
281 - run or write new unit test cases
282 - add or fix support for your platform (especially installation!)
283 - help find and fix security vulnerabilities
284 - implement new features
285 - send us patches, become a maintainer!
289 Switzerland's public ssh repository is available at
290 https://Switzerland.svn.sourceforge.net/svnroot/Switzerland
292 3.3. Tree organization
294 bin/ : supporting binaries
295 Switzerland/ : source code
296 client/ : client code
297 Alice.py : main file for client
298 AliceConfig.py : command-line option/configuration file handling
299 AliceFlow.py : one direction of an IP communication
300 AliceLink.py : interaction with Switzerland server
301 Cleaner.py : thread to remove stale queued packets
302 FastCollector.c : packet sniffer that writes to mmap'd buffer
303 FlowManager.py : thread to track active flows
304 Packet.py : an IP datagram
305 PacketBatch.py : group of IP datagrams
306 PacketDiff.py : figure out what changed inside a modified packet
307 PacketListener.py : thread to listen for incoming packets
308 PacketQueue.py : a queue of batches in the same flow
309 Reporter.py : thread to report traffic to server
310 TimeManager.py : interface with NTP
311 common/ : code shared between client+server
312 Flow.py : one direction of an IP communication
313 Messages.py : Switzerland protocol messages
314 PcapLogger.py : write datagrams to pcap files
315 Protocol.py : client/server socket communication
316 local_ip.py : detect IP address / network interfaces
317 util.py : miscellaneous
318 lib/ : third-party libraries
319 tweaked_cerealizer.py: modified version of python cerealizer
320 server/ : server code
321 Reconciliator.py : test whether two views of a flow agree
322 Switzerland.py : main server file
323 SwitzerlandConfig.py : command-line options/configuration file handling
324 SwitzerlandLink.py : interaction with clients
326 switzerland-client* : client
327 switzerland-server* : server