#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass beamer
\begin_preamble
%\usetheme{lankton-keynote}
\usetheme{Singapore}

\setbeamercovered{transparent}
% or whatever (possibly just delete it)
\usepackage{fontspec}
%\newfontface\cjk{ShanHeiSun-Uni}
%\newfontface\cjk{BousungEG-Light-GB}
\newfontface\cjk{GBZenKai-Medium}
%\newfontface\cjk{ZenKai-Medium}
%\newfontface\cjk{ShanHeiSun-Light}
%\newfontface\cjk{ZenKai-Uni}
\end_preamble
\options aspectratio=43
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding utf8x
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format pdf5
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Title
net
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
kern-1ex
\backslash
lower3ex
\backslash
hbox{
\end_layout

\end_inset


\begin_inset Graphics
	filename net2o-logo.pdf
	lyxscale 10
	scale 10

\end_inset


\begin_inset ERT
status open

\begin_layout Plain Layout

}
\backslash
kern-.5ex
\end_layout

\end_inset

: Reinventing the Internet
\begin_inset Argument 1
status open

\begin_layout Plain Layout
net2o
\end_layout

\end_inset


\end_layout

\begin_layout Subtitle
lightweight, scalable and userfriendly
\end_layout

\begin_layout Author
Bernd Paysan
\end_layout

\begin_layout Date
#wefixthenet, 31c3, Hamburg
\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
addtobeamertemplate{headline}{}{
\backslash
vbox{
\backslash
vspace{3ex}
\backslash
hbox to
\backslash
paperwidth{
\backslash
hfill
\end_layout

\end_inset


\begin_inset Graphics
	filename net2o-logo.pdf
	lyxscale 5
	scale 5

\end_inset


\begin_inset ERT
status open

\begin_layout Plain Layout

~~~}}}
\end_layout

\end_inset


\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Outline
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\end_deeper
\begin_layout Section
Motivation
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
1.5 years after Snowden
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
What happend to change the world:
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Description
Politics More spying, more cyberwar, more terrorist panic --- don't count
 on them
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Users 700 million users changed their behavior (that's probably 700 million
 terrorists)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Software Lots of work, even WhatsApp got some crypto!
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Protocols Most of the Internet still is a complete mess with security tugged
 in
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
The Enemies of the Internet
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Description
Criminals malware, DDoS attacks, spam, \SpecialChar \ldots{}

\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Corporations walled gardens, censorship, big honeypots for dragnet surveillance,
 \SpecialChar \ldots{}

\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Government dragnet surveillance, censorship, \SpecialChar \ldots{}

\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Users careless, uninformed, annoying, \SpecialChar \ldots{}

\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Software bloated, buggy, insecure, \SpecialChar \ldots{}

\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
How many defects?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize

\noun on
Dan Geer
\noun default
: buy all zero-days
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Condition: The number of bugs are finite.
 Are they?
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Bug density between 1/100LoC (CMM 1) to <1/10kLoC (Correct by Design 
\begin_inset CommandInset citation
LatexCommand cite
key "correctnessbyconstruction"

\end_inset

)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Networked applications and protocol stacks in orders of 1M--100MLoC
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Unless we stop bloating, we are doomed
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Therefore: 
\begin_inset Flex Bold
status open

\begin_layout Plain Layout
Keep it simple!
\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Where are the defects?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename bugs-pie.pdf
	width 100col%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Bugs by phase 
\begin_inset CommandInset citation
LatexCommand cite
key "hse238"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
net2o in a nutshell
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
net2o consists of the following 6 layers (implemented bottom up):
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Enumerate
\begin_inset ERT
status open

\begin_layout Plain Layout

[
\backslash
setcounter{enumi}{2}
\backslash
usebeamertemplate{enumerate item}]
\end_layout

\end_inset

Path switched packets with 
\begin_inset Formula $2^{n}$
\end_inset

 size writing into shared memory buffers
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Ephemeral key exchange and signatures with Ed25519, 
\begin_inset Newline newline
\end_inset

symmetric authenticated encryption+hash+prng with Keccak,
\begin_inset Newline newline
\end_inset

symmetric block encryption with Threefish
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Timing driven delay minimizing flow control
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Stack--oriented tokenized command language
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Distributed data (files) and distributed metadata (prefix hash trie)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Apps in a sandboxed environment for displaying content
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Objectives
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
net2o's design objectives are
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Itemize
lightweight, fast, scalable
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
easy to implement
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
secure
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
media capable
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
works as overlay on current networks (UDP/IP), but can replace the entire
 stack
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Section
Topology
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Switching Packets, Routing Connections
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Switches are faster and easier to implement than routers
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Routing then is a combination of destination resolution and routing calculation
 (destination path lookup)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Block
\begin_inset Argument 2
status collapsed

\begin_layout Plain Layout
Path Switching
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Take first 
\begin_inset Formula $n$
\end_inset

 bits of path field and select destination
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Shift target address by 
\begin_inset Formula $n$
\end_inset


\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Insert bit-reversed source into the rear end of the path field to mark the
 way back
\end_layout

\end_deeper
\begin_layout Pause

\end_layout

\begin_layout Itemize
The receiver bit--flips the path field, and gets the return address
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Itemize
Easy handover possible
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Routing Algorithm
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
A node publishes ISP switch+label in the DHT
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The ISP publishs peering switch+label in the DHT
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Assumption is a hierarchical network, so a recursive lookup will give a
 good solution
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Splice the labels together, and you get a path
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Why Source Routing
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout ExampleBlock
\begin_inset Argument 2
status collapsed

\begin_layout Plain Layout
Three possible schemes
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Enumerate
switched circuit (POTS, virtual: ATM, MPLS)
\end_layout

\begin_layout Enumerate
unique identifier (IP)
\end_layout

\begin_layout Enumerate
source routing
\end_layout

\end_deeper
\begin_layout Pause

\end_layout

\begin_layout Itemize
Separation of network gear and computers: Fast, dumb, stateless equipment
 for routing/switching
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The hierarchical topology is a derived 
\begin_inset Quotes eld
\end_inset

law of nature
\begin_inset Quotes erd
\end_inset

: people cluster together and connect clusters
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Attack vector is only bandwidth--based, and this can be mitigated (see 
\begin_inset Quotes eld
\end_inset

fair routing
\begin_inset Quotes erd
\end_inset

 below)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Routing slice is an implementation detail of each network segment (i.e.
 is a unique identifier within each subnet)
\end_layout

\end_deeper
\begin_layout Subsection
Low--Overhead Packet Format
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Packet Format
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="6" columns="3">
<features rotate="0" tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="left" valignment="top" width="7cm">
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Bytes
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Comment
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Flags
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
priority, length, flow control flags
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Path
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Internet 1.0 terminology: 
\begin_inset Quotes eld
\end_inset

address
\begin_inset Quotes erd
\end_inset


\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Address
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
8
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
address in memory, 
\begin_inset Formula $\approx$
\end_inset

port+sequence number
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula $64*2^{0..15}$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
up to 2MB packet size, enough for the next 40 years
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\emph on
Chksum
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
cryptographic checksum
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Graphics
	filename header64b.fig
	lyxscale 50
	width 100text%

\end_inset


\end_layout

\end_deeper
\begin_layout Section
Encryption
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Security: Indirect Attacks are Cheaper
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\align center
\begin_inset Graphics
	filename cryptonerd.png
	width 80text%

\end_inset


\end_layout

\end_deeper
\begin_layout Subsection
Key Exchange
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Key Exchange
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Description
ECC Elliptic Curve Cryptography has still only a generic attack (i.e.
 can be considered 
\begin_inset Quotes eld
\end_inset

unscratched
\begin_inset Quotes erd
\end_inset

, as the attack uses a fundamental property of the problem), and therefore
 256 bit keys (32 bytes) have a strength of 128 bits
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Standard
Therefore the choice now is Ed25519, a variant of Curve25519 from 
\noun on
Dan Bernstein
\noun default
 that supports signatures, too.
 This is a curve where the parameters are of high quality.
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Standard
I use Ed25519 both for Diffie--Hellman--Exchange and signatures with the
 same key; 
\noun on
Peter Schwabe
\noun default
 warned me that this might be insecure in some circumstances and that they
 are working on some recommendations how to do this securely.
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Ephemeral Key Exchange+Validation
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\align center
\begin_inset Graphics
	filename connection-setup.fig
	lyxscale 50
	height 80theight%

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Key Replacement
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
Problem with key revocation: you really want to 
\emph on
replace
\emph default
 your compromised key; signing the revocation with the secret key is a bad
 idea, because the secret key is compromised (the attacker might be the
 source of the key replacement)
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Itemize
Only the creator of the secret key can revoke it
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
A thief of the secret key can't (i.e.
 further information is necessary)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Revocation must present a trustworthy replacement key
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Third parties must trust both the revocation and the replacement key without
 another trustworthy instance, i.e.
 trusting only their communication partner
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Solution: 
\begin_inset Quotes eld
\end_inset

proof of creation
\begin_inset Quotes erd
\end_inset

, i.e.
 you prove you made the key with a separately stored secret
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Proof of Creation
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Create two 256 bit random numbers 
\begin_inset Formula $s_{1}$
\end_inset

 and 
\begin_inset Formula $s_{2}$
\end_inset


\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Create pubkeys 
\begin_inset Formula $p_{1}=base*[s_{1}]$
\end_inset

 and 
\begin_inset Formula $p_{2}=base*[s_{2}]$
\end_inset


\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Compute 
\begin_inset Formula $[s]=[s_{1}*p_{2}]$
\end_inset

 as "work secret" and 
\begin_inset Formula $p=base*[s]$
\end_inset

, the pubkey
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Publish 
\begin_inset Formula $p$
\end_inset

 and 
\begin_inset Formula $p_{1}$
\end_inset

, destroy 
\begin_inset Formula $s_{1}$
\end_inset

 (no longer needed), keep 
\begin_inset Formula $s_{2}$
\end_inset

 as offline copy (e.g.
 on paper)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
To revoke a key, publish 
\begin_inset Formula $p_{2}$
\end_inset

, which the recipient can validate by 
\begin_inset Formula $p_{1}*[p_{2}]\equiv p$
\end_inset

.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
To proof possession of all secrets, sign new key with 
\begin_inset Formula $s_{2}$
\end_inset

, 
\begin_inset Formula $s$
\end_inset

, and 
\begin_inset Formula $s_{new}$
\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Subsection
Symmetric Crypto
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Symmetric Crypto: Keccak
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
Keccak used for the following reasons:
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Itemize
Good cryptanalysis
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Keccak in duplex mode provides perfect side--channel protected AEAD operation
 (no constant key to snoop)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Strength >256 bits: very good security margin
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Keccak is a universal crypto primitive (hash+encrypt+authenticate)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Keccak is both NIST--approved and (still) NSA--independent.
 I use Keccak with 
\begin_inset Formula $r=1024$
\end_inset

 and capacity 
\begin_inset Formula $c=576$
\end_inset

 as suggested by the Keccak authors.
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Key Usage
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout FrameSubtitle
All keys are one--time--use only!
\end_layout

\begin_layout Standard
\align center
\begin_inset Graphics
	filename keyusage.fig
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Symmetric Crypto: Threefish
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
Keccak has one disadvantage: No ECB mode.
 Application for ECB mode:
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Itemize
Encryption of hash values for the DHT --- to store key/value pairs in a
 pubic DHT without revealing the content.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
For net2o--in--net2o tunnels (to be used for onion--routing), no authentication
 and no IV is desirable, so use an ECB mode algorithm.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Strength >256 bits, tweaksable to make ECB mode more secure (counter as
 tweak)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
SHA--3 finalist, so sufficiently good cryptanalysis
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Section
Flow Control
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Flow Control (Broken)
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
TCP fills the buffer, until a packet has to be dropped, instead of reducing
 rate before.
 Name of the symptom: 
\begin_inset Quotes eld
\end_inset

Buffer bloat
\begin_inset Quotes erd
\end_inset

.
 But buffering is essential for good network performance.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename bufferbloat.fig
	width 100text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Buffer Bloat
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Alternatives?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
LEDBAT tries to achieve a low, constant delay: Works, but not good on fairness
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
CurveCP's flow control is still 
\begin_inset Quotes eld
\end_inset

a lot of research
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Therefore, something new has to be done
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename bufferused.fig
	width 100text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
That's how proper flow control should look like
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
net2o Flow Control
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename flowcontrol.fig
	width 100text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Measure the bottleneck using a burst of packets
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Client Measures, Server Sets Rate
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Description
Client recores the 
\emph on
time
\emph default
 of the first and last packet in a burst, and calculates the achieved rate
 for received packets, extrapolating to the achievable rate including the
 dropped packets.
 This results in the requested 
\emph on
rate
\emph default
.
\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Formula 
\[
rate:=\Delta t*\frac{burstlen}{packets}
\]

\end_inset


\end_layout

\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Description
Server would simply use this rate
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Fairness
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
Fairness means that concurrent connections achieve about the same data rate,
 sharing the same line in a fair way.
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Itemize
Ideally, a router/switch would schedule buffered packets round--robin, giving
 each connection a fair share of the bandwidth (fair queuing).
 That would change the calculated rate appropriately, and also be a big
 relief for current TCP buffer bloat symptoms, as each connection would
 have its private buffer to fill up.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Unfortunately, routers use a single FIFO policy for all connections
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Finding a sufficiently stable algorithm to provide fairness
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
We want to adopt to new situations as fast as possible, there's no point
 in anything slow.
 Especially on wireless connections, achievable rate changes are not only
 related to traffic.
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
net2o Flow Control --- Fair Router
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename flowcontrol-fair.fig
	width 100text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Fair queuing results in correct measurement of available bandwidth
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
net2o Flow Control --- FIFO Router
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename flowcontrol-unfair.fig
	width 100text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Unfair FIFO queuing results in twice the available bandwidth calculated
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Fairness I
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
To improve stability of unfair queued packets, we need to improve that P
 regulator (proportional to measured rate) to a full PID regulator
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The integral part is the accumulated slack (in the buffer), which we want
 to keep low, and the D part is growing/reducing this slack from one measurement
 to the next
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
We use both parts to decrease the sending rate, and thereby achieve better
 fairness
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The I part is used to exponentially lengthen the rate 
\begin_inset Formula $\Delta t$
\end_inset

 with increasing slack up to a maximum factor of 16.
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Standard
\begin_inset Formula 
\[
s_{exp}=2^{\frac{slack}{T}}\quad\mathrm{where\,}T=\max(10ms,\max(slacks))
\]

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Fairness D
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
To measure the differential term, we measure how much the slack grows (a
 
\begin_inset Formula $\Delta t$
\end_inset

 value) from the first to the last burst we do for one measurement cycle
 (4 bursts by default, first packet to first packet of each burst)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
This is multiplied by the total packets in flight (head of the sender queue
 vs.
 acknowledged packet), divided by the packets within the measured interval
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
A low--pass filter is applied to the obtained D to prevent from speeding
 up too fast, with one round trip delay as time constant
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
\begin_inset Formula $\max(slacks)/10ms$
\end_inset

 is used to determine how aggressive this algorithm is
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Add the obtained 
\begin_inset Formula $\Delta t$
\end_inset

 both to the rate's 
\begin_inset Formula $\Delta t$
\end_inset

 for one burst sequence and wait that time before starting the next burst
 sequence.
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
VDSL
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 30c3-1.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
One connection on a VDSL--50 line
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
VDSL, Congestion
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 30c3-2.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
One of four connections on a VDSL--50 line
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Unreliable Air Cable (WLAN)
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 31c3-3.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Single connection using WLAN
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Unreliable Air Cable, Congestion
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 31c3-4.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
One of four connections using WLAN
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
LAN, 1GBE
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 31c3-5.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Single connection using 1GBE
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
LAN 1GBE, Congestion (4 servers)
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 30c3-6.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
One of four connections using 1GBE
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
LAN 1GBE, Congestion (1 server)
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename 30c3-7.png
	lyxscale 50
	width 80text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
One of four connections using 1GBE, fair queuing
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Section
Commands
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Data and Commands
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Data of several files/streams can be transferred interleaving, so a single
 connection can do multiple things in parallel
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Commands are send in command blocks, i.e.
 there is not just one command per block, but a sequence of commands!
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Commands are encoded like protobuf, i.e.
 7 bits per byte, and if the MSB of the byte is 1, there's another byte
 to follow (allowing arbitrary many commands)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The command 
\begin_inset Quotes eld
\end_inset

machine
\begin_inset Quotes erd
\end_inset

 is a stack architecture.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The command VM is object oriented, i.e.
 commands are messages to objects
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The command interpreter itself is extremely simple
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Example: Download three files
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout ExampleBlock
\begin_inset Argument 2
status collapsed

\begin_layout Plain Layout
reading three files
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout LyX-Code
0 file-id "net2o.fs" 0
\end_layout

\begin_layout LyX-Code
    open-file get-size get-stat endwith
\end_layout

\begin_layout LyX-Code
1 file-id "data/2011-05-13_11-26-57-small.jpg" 0
\end_layout

\begin_layout LyX-Code
    open-file get-size get-stat endwith
\end_layout

\begin_layout LyX-Code
2 file-id "data/2011-05-20_17-01-12-small.jpg" 0
\end_layout

\begin_layout LyX-Code
    open-file get-size get-stat endwith
\end_layout

\begin_layout LyX-Code

\end_layout

\end_deeper
\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Reading Files: Reply
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout ExampleBlock
\begin_inset Argument 2
status collapsed

\begin_layout Plain Layout
reading three files: replies
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout LyX-Code
0 file-id 12B9A set-size
\end_layout

\begin_layout LyX-Code
    138D607CB83D0F06 1A4 set-stat endwith
\end_layout

\begin_layout LyX-Code
1 file-id 9C65C set-size
\end_layout

\begin_layout LyX-Code
    13849CAE1F3B6EA8 1A4 set-stat endwith
\end_layout

\begin_layout LyX-Code
2 file-id 9D240 set-size
\end_layout

\begin_layout LyX-Code
    13849CAE2643FDCC 1A4 set-stat endwith
\end_layout

\end_deeper
\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Basics
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Five data types: Integer (64 bits signed+unsigned), flag, string (generic
 byte array), IEEE double float, objects
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Instructions and data encoding derived from Protobuf (7 bits per byte, MSB=1
 means 
\begin_inset Quotes eld
\end_inset

data continues
\begin_inset Quotes erd
\end_inset

, most significant part first)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Four stacks: integer, float, objects, strings
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize

\family typewriter
endwith
\family default
 and 
\family typewriter
endcmd
\family default
 for ending object message blocks and commands
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize

\family typewriter
oswap
\family default
 to transfer the current object to the object stack, to be inserted in the
 outer object
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize

\family typewriter
words
\family default
 for reflection (words are listed with token number, identifier and stack
 effect to make automatic bindigs possible)
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Why binary encoding?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Faster and simpler to parse (simpler means smaller attack vector)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Ability to enter commands on the fly in text form through a frontend interpreter
 still exists
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Debugging with a de--tokenizer is also very easy
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Object--oriented approach makes writing application--specific logic extremely
 simple
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Why a programming language as data?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout FrameSubtitle
Lemma: every glue logic will become Turing complete
\end_layout

\begin_layout Itemize
Implement only the things you need --- but you shouldn't have to implement
 more than 
\emph on
one
\emph default
 generic interpreter
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Typical idea of sending remote procedure calls: serialize the entire object
 (with subobjects), and call a function on that object
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Net2o idea (derived from ONF): Keep the entire object synchronized by sending
 only the changes to it --- these changes are simple messages (setters)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
This allows multi--message passing, and reduces latency
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Security
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout FrameSubtitle
Lemma: every sufficiently complex format can be exploited
\end_layout

\begin_layout Standard
Therefore stick to a very simple format, i.e.: simplify and factor the code
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Block
\begin_inset Argument 2
status open

\begin_layout Plain Layout
Interpreter (pseudocode)
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout LyX-Code
get_cmd:  p -> p cmd
\end_layout

\begin_layout LyX-Code
    cmd = *p++;
\end_layout

\begin_layout LyX-Code
n2cmd:  n -> call
\end_layout

\begin_layout LyX-Code
    call = o ? token_table[n] : setup_table[n];
\end_layout

\begin_layout LyX-Code
cmd_dispatch:  p -> p
\end_layout

\begin_layout LyX-Code
    p, cmd = get_cmd(p);
\end_layout

\begin_layout LyX-Code
    invoke(n2cmd(n));
\end_layout

\begin_layout LyX-Code
cmd-loop: p -> void
\end_layout

\begin_layout LyX-Code
  do { p = cmd-dispatch(p);
\end_layout

\begin_layout LyX-Code
  } while(len(p) > 0)
\end_layout

\end_deeper
\end_deeper
\begin_layout Section
Distributed Data
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Distributed Data
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Following the 
\begin_inset Quotes eld
\end_inset

everything is a file
\begin_inset Quotes erd
\end_inset

 principle, every data object is a file
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Data objects are accessed by their hash.
 The associated metadata are 
\begin_inset Quotes eld
\end_inset

tags
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Metadata is organized as a distributed prefix hash tree
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Efficient distribution of data is important!
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Tree Distribution Network
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Graphics
	filename avalanche.fig
	width 100text%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Avalanche distribution with quad--tree of depth 2
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Possible Performance
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Trees with a bigger base reduce latency.
 Example: To transfer a Justin Bieber tweet to 50 million followers, a binary
 tree needs 25.5 hops on average, a quad--tree 12.8 hops, and an oct--tree
 8.5 hops.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
A typical domestic (inside e.g.
 Germany) hop--to--hop time is just 20ms.
 International hops can be in the order of 250ms.
 Assuming there is only one international hop in the chain, the latency
 to distribute Justin Bieber's babbling is typically just 500ms in a quad--tree.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Rule of thumb: 
\begin_inset Formula $bandwidth=latency$
\end_inset

, i.e.
 if it takes 20ms from hop to hop, each node should replicate data for 20ms
 --- if we make the tree wider, the linear effort of replicating data will
 dominate transfer time, if we make the tree more narrow, the hop--to--hop
 time will dominate.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The tree--like graph greatly reduces the number of nodes to know
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Distributed Hashes
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
Most DHT approaches have poor performance
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Still working out what is both simple and fast
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Model: Directory servers know how stores which subset of the hashes
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Replicated servers send updates through a distribution tree (low latency
 mirroring)
\end_layout

\end_deeper
\begin_layout Section
Applications
\end_layout

\begin_layout Subsection
Apps in a Sandbox
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Content or Apps?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
The current web is defined by content --- web apps (JavaScript) are an afterthou
gh
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Therefore, the application logic is usually on the server side
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
This doesn't work for a P2P network!
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Content is structured text, images, videos, music, etc.
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
App--Centric World
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
There's a phenomenon I call 
\begin_inset Quotes eld
\end_inset

Turing creep
\begin_inset Quotes erd
\end_inset

: Every sufficiently complex system contains a user--accessible Turing--complete
 language
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Corollary: Every efficient sufficiently complex system can execute native
 machine code
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
The application logic is to present the data; data itself is as above: structure
d text, images, videos, music, etc.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
Executing (especially efficient) code from the net raises obvious questions
 about security
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
How to securely execute code?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Standard
There are several options tried; as usual, things are broken:
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Enumerate
Execute code in a controlled secure VM, see for example Java.
 This is broken by design, as securing something from the inside doesn't
 work.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Execute code in a sandbox.
 This has shown as more robust, depending on how complex the outside of
 the sandbox is.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Public inspection of code.
 This is how the open source world works, but the underhanded C contest
 shows that inspection is tricky.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Scan for known evil code.
 This is the security industry's approach, and it is not working.
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Code signing can work together with public inspection --- but using it for
 accountability doesn't work
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Standard
Therefore the choice is to sandbox public inspected code.
\end_layout

\end_deeper
\begin_layout Subsection
API Basics
\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Formats&Requirements
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout FrameSubtitle
How to display things
\end_layout

\begin_layout Standard
\align center
\begin_inset Graphics
	filename formats+io.fig
	scale 36

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Why OpenGL?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout FrameSubtitle
OpenGL can do everything
\end_layout

\begin_layout Standard
OpenGL renders:
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Enumerate
Triangles, lines, points --- simple components
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
Textures and gradients
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Enumerate
and uses shader programs --- the most powerful thing in OpenGL from 2.0.
\end_layout

\begin_layout Pause

\end_layout

\begin_layout Standard
Real requirement: visualization of 
\emph on
any 
\emph default
data.
 OpenGL can do that.
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
How to connect the media?
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout FrameSubtitle
Lemma: every glue logic will become Turing complete
\end_layout

\begin_layout Itemize
currently used glue: HTML+CSS+JavaScript
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
containers with Flash, Java, ActiveX, PDF, Google's NaCl\SpecialChar \ldots{}

\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
conclusion: use a powerful tool right from start!
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
browser: run--time and development tool for applications
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Frame
\begin_inset Argument 4
status open

\begin_layout Plain Layout
Frameworks
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Itemize
libsoil for images (PNG+JPEG loading into a texture)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
freetype-gl for fonts (TrueType/OpenType into a texture)
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
OpenMAX on Android, gstreamer on Linux: videos into a texture
\end_layout

\begin_deeper
\begin_layout Pause

\end_layout

\end_deeper
\begin_layout Itemize
MINOΣ2: Lightweight OpenGL--based widget library in Forth (still a lot of
 work in progress)
\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\begin_layout Section*
\start_of_appendix
Appendix
\end_layout

\begin_layout Subsection*
For Further Reading
\end_layout

\begin_layout Frame
\begin_inset Argument 3
status open

\begin_layout Plain Layout
allowframebreaks
\end_layout

\end_inset


\begin_inset Argument 4
status open

\begin_layout Plain Layout
For Further Reading
\end_layout

\end_inset


\end_layout

\begin_deeper
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "In20"

\end_inset


\noun on
Bernd Paysan 
\noun default

\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
newblock
\end_layout

\end_inset


\emph on
net2o source repository and wiki 
\emph default

\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
newblock
\end_layout

\end_inset

 
\begin_inset Flex URL
status open

\begin_layout Plain Layout

http://fossil.net2o.de/net2o
\end_layout

\end_inset


\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "hse238"

\end_inset

H
\noun on
ealth & Safety Executive HSE – UK
\noun default

\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
newblock
\end_layout

\end_inset

 
\emph on
Out of control, 2nd edition 2003
\emph default
 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
newblock
\end_layout

\end_inset

 
\begin_inset Flex URL
status open

\begin_layout Plain Layout

http://www.hse.gov.uk/pubns/priced/hsg238.pdf
\end_layout

\end_inset


\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "correctnessbyconstruction"

\end_inset


\noun on
Martin Croxford
\noun default
 and 
\noun on
Dr.
 Roderick Chapman
\noun default

\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
newblock
\end_layout

\end_inset

 Correctness by Construction: A Manifesto for High-Integrity Software
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
newblock
\end_layout

\end_inset


\begin_inset Flex URL
status open

\begin_layout Plain Layout

http://www.crosstalkonline.org/storage/issue-archives/2005/200512/200512-Croxford.p
df
\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Separator

\end_layout

\end_body
\end_document
