Python-Powered, Public, Personal Protocol Peers

“A 2-Tier Host Mesh Network Approach to Secure, Interpersonal Communications Enabled by Protocol and Transport Layer Separation in the Twisted Internet Framework and Various Components of Divmod, Inc's 'Mantissa' Application Server and Quotient application.”

“Glyph Lefkowitz”

<glyph@divmod.com>

Q2Q

Quotient to Quotient

A Warning

This talk took a lot of work

It's the last talk of the con

I know you have nowhere to go afterwards

I have almost 100 slides

You will notice helpful Divmod employees standing near all the exits

Why?

I

Why?

just

Why?

want

Why?

to

Why?

send

Why?

data

Why?

over

Why?

the

Why?

INTERNET

!@#$%&?

<expletive deleted>

Is it really so much to ask?

...

Is it really so much to ask?

Yes.

For Example

Alice wants to send a file to Bob.

For Example

What is going to get in her way?

For Example

“Alice”

<alice@A.com>

“Bob”

<bob@B.com>

For Example

“Alice”

<alice@A.com>

“Bob”

<bob@B.com>

Why not just... connect?

“Alice”

<alice@A.com>

Problem #1: NAT

“Alice”

<alice@A.com>

“Bob”

<bob@B.com>

“Bob”

<bob@B.com>

Problem #2: Naming

Where is Bob, anyway?

“Alice”

<alice@A.com>

?????

?????

Problem #3: Security

Even if we can get through, are we really sure we want to?

“Alice”

<alice@A.com>

“H1zx4x0r1”

“<' FROM

USERS “@B.com>

Problem #3: Security

“HI ALIEC WHATS UR PASS I KEEP GETTIN THIS ERR MSG ABOTU UR PAYPAL ACCT IT NEEDS UR CC# OR STH THX”

“Alice”

<alice@A.com>

“H1zx4x0r1,

I mean,

Bob”

<bob@B.com>

Problem #4:
Lots of Non-Solutions

Problem #4:
Lots of Non-Solutions

EVERYTHING

Problem #4:
Lots of Non-Solutions

“Why bother when I can use...”

Problem #4.1:
Email

No Security

Single-Purpose

Slow

Bulky

Too Public

Limited

Broken

Full of Spam

...

Problem #4.2:
SIP

No Security

Single-Purpose

Flaky

Incompatible Implementations

Designed for “Outbound Proxy”

Problem #4.3:
IAX

No Security

Single-Purpose

Nothing actually uses it

It's incompletely specified

Asterisk is unstable

for example, with very large numbers of users, or with obscure plugins

Problem #4.4:
IRC & DCC

No Security

Single-Purpose

Exposes too much information

Doesn't cope with firewalls (in practice)

Too centralized

Problem #4.5:
AOL/IM

Minimal Security

Single-Purpose

With extensions

Domain-Specific

TOTALLY Centralized

Slow

Doesn't work across most NATs in practice

Problem #4.6:
Jabber

Single-Purpose

Again, With extensions

Half a million half-implemented JEPs

Confusing Ecosystem

Too many people doing too many things at once

Everybody just uses AIM anyway :-)

Problem #4.7:
SSH/SFTP/-L/-P

Oddly enough, Insecure

(Do you really want to give EVERYONE a shell account on your home machine?)

Requires Good Connectivity

Nearly impossible on Windows

Doesn't resolve naming issues

Requires NAT understanding to bootstrap

Let's Talk About Solutions

Enough Negativity Already!

P2P

Peer to Peer wasn't good enough...

P2P

So let's go one better.

>>>

>>> ''.join([(c.isdigit() and c)

... or chr(ord(c)+1)

... for c in 'p2p'])

'q2q'

Q2Q

Origins

Q2Q

This problem exists on servers too!

Q2Q

First Use Case:

LJ Style Friends List

Q2Q

Without LJ-Style Central Naming

Divmod Blog

Alice wants to post on Bob's blog.

Divmod Blog

Bob wants Alice to be able to post.

Divmod Blog

But...

Divmod Blog

Bob doesn't want anyone else to.

Divmod Blog

Alice and Bob have different QSPs.

Divmod Blog

QSPs.

Divmod Blog

I totally didn't make up that word.

Divmod Blog

Seriously! It was Brian Warner.

He doesn't even work for Divmod.

Divmod Blog

I like it, though.

Say it - “QSP”.

It just sort of rolls off the tongue.

...

(The writer responsible for the previous few slides has been sacked.)

Moving Right Along

Notdivmod.com

DIVMOD.COM

alice@notdivmod.com

Bob@Divmod.Com's

Personal

Universe

Bob's Web Log

Design Goal: Security

Divmod values Alice's privacy.

Design Goal: Security

“Systems like Flickr, which require giving away your username and password, are illustrating that security flaws in login systems like Drupal and TypeKey are fast going to become a relevant trust issue for users.”

-Anonymous

Design Goal: Security

“Systems like Flickr, which require giving away your username and password, are illustrating that security flaws in login systems like Drupal and TypeKey are fast going to become a relevant trust issue for users.”

-Glyph

Shared Secrets Should Stay Secrets

Alice should only ever give her password to her site, and only when the SSL lock shows up.

Design Goal: Convenience

Bob should be able to grant Alice permission without knowing how key or certificate exchange works.

Design Goal: Convenience

divmod.com & notdivmod.com exchange certificates so Bob and Alice don't have to.

Design Goal: Convenience
(...)

Yes, I am aware that this isn't real security, but it's better than nothing.

Design Goal: Convenience

At least Bob and Alice can have some automated base level of trust for each other, and once you've exchanged certificates...

Design Goal: Convenience

Bob should use a way of referring to Alice that he already knows.

Design Goal: Convenience

Your Q2Q ID looks just like your email address:

<alice@notdivmod.com>

How is this related to networking?

If A.com and B.com remember each other's certificates...

How is this related to networking?

They can introduce Bob & Alice with a greater degree of confidence.

How is this related to networking?

Since Bob and Alice are both users of well-connected servers “in the sky”...

Let's look at a picture

A.COM

B.COM

“Alice”

<alice@A.com>

“Bob”

<bob@B.com>

Let's look at a picture

A.COM

B.COM

“Alice”

<alice@A.com>

“Bob”

<bob@B.com>

Let's look at a picture

A.COM

B.COM

“Alice”

<alice@A.com>

“Bob”

<bob@B.com>

How does it work?

Alice says to B, “Where's Bob?”

How does it work?

B says to Bob, “Alice wants to know where you are.”

How does it work?

Bob responds to B,

B responds to alice,

Alice connects.

How does it work?

It's not quite that simple...

How does it work?

Bob actually says “here are all the ways you can connect to me”

How does it work?

Implemented connection mechanisms

Connecting

Behind-NAT TCP

Just make a connection to google.com

Public-IP TCP

Ask your QSP who it thinks you are

Reliable UDP layer (“GIN”)

Generic Internet Networking

Uses well-documented techniques

How does it look from Python?

q2qService.listenQ2Q(
q2qid('bob@B.com'),
['http'], Site(...))

q2qService.connectQ2Q(
q2qid('alice@A.com'),
q2qid('bob@B.com'),
'http', webClientFactory)

How does it look from <icky language>?

Port forwarding!

How does it look from <icky language>?

Protocol-Complexity: SIMPLE

X-Friendly-To: IETF-STYLE

Sample Conversation
(From bob@B's P.O.V.)

C: -ask: 1

C: -command: INBOUND

C: Protocol: http

C: From: alice@A.com

C: To: bob@B.com

C:

S: -answer: 1

S: Methods: tcp@10.0.0.1:4321, tcp@4.3.2.1:4321, gin@4.3.2.1:4736, virtual

Future Work
(It's Just the Beginning)

Chat application that uses persistent connections to your buddies

Port forwarder

Full-featured file-transfer tool

deployment on divmod.com

free notdivmod.com site

Future Work
(It's Just the Beginning)

VoIP proxy (bringing Skype techniques to standard tools)

New mail notification

Automated VNC port forwarding for tech support

Future Work
(It's Just the Beginning)

Official presence protocol

Improved efficiency of UDP layer

Hairpin translation support

Simultaneous TCP Open

Server-based proxying scheme

... LOTS MORE!!!

Come help out!

The code will be on divmod.org within a few days

svn://svn.divmod.org/svn/Quotient/branches/
glyph/pycon-q2q

2005-03-24T23:58:54