session-based mobility an end-to-end approach alex c. snoeren mit laboratory for computer science...

30
Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Upload: victor-caldwell

Post on 12-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Session-Based MobilityAn End-to-End Approach

Alex C. Snoeren

MIT Laboratory for Computer Science(with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Page 2: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

An Example: SSH Session

• Remote log in / port forwarding Provides secure remote communication Data compressed and encrypted as a stream

SSHd

shell

elm

Xapp

serverclient

ssh

Page 3: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Today’s Network Abstraction

• System provides a connection service Binds [<IP, port>, <IP, port>] tuple

• Any change invalidates the connection• No support for periods of disconnectivity

<18.31.0.139, 2345> <169.229.60.64, 22>

SSHClient

TCP IPSSH

ServerTCPIP

Each application must perform ad-hocrecovery and disconnection management, or fail

Page 4: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Mobile Networking Challenges

1. Changing end points Change in node attachment point Multi-homing (multiple network interfaces) Readdressing: DHCP renewal, NAT crash, etc.

2. Internet “Suspend/Resume” Wireless device goes out of range Save device power or connectivity costs Transient Internet connectivity outage

Complete solution needs to address both

Page 5: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Current Approaches

• Only solve half the problem Mobile IP, VIP, Physical Media Independence, … MSOCKS, SLM, Application check-pointing, …

• Don’t support intelligent adaptation Rocks, Mobile sockets, Mobile file systems, …

• Use application-specific point solutions RTSP, SCTP, SIP multimedia calls, … Web shopping carts, J2EE servlets, … HTTP range requests, FTP restart points, …

Page 6: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Reconsider System Abstraction

• Many applications create “sessions” Long-lived: collections of connections Entity of processing and resource allocation

• Can we provide a useful system abstraction? Flexible enough for different users, applications Efficient to implement, leverage shared resources Easy to use, but backwards compatible

Session is the salient mobility entity

Page 7: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

1, 2, 3… Mobility

1. System Session Abstraction [SBK’01] Collaborative management of end point changes Support for unmodified legacy apps [SaSB’02]

2. Preserving Reliable Connections TCP connection migration [SB’00]

3. Session Continuations [SSaBK’02] Application-guided disconnection handling System support for long-lived sessions [SAB’01]

Page 8: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Goals: Minimally Invasive

• Overhead only on mobility events

• As secure as non-mobile situations

• Require no infrastructure support Demonstrate pure end-to-end solution Deployable via proxies if desired

• Enable intelligent session adaptationTransparency is always an option

Page 9: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Managing Changing End Points

• Applications handle discovery Lots of ways to resolve to <IP, port> pair

• User specifies local network policy Different users, different choices

• System manages tracking Clear semantics, scalable, and efficient

Page 10: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

End-to-End Session Tracking

Discovery Service(e.g., Dynamic DNS)

Mobile Nodefoo.bar.edu

Discovery Query(e.g., DNS Lookup)

Session Initiation

xxx.xxx.xxx.xxx

CorrespondentNode

Discovery Update(e.g., DNS Update)

Session Update<xxx.xxx.xxx.xxx, P>

<yyy.yyy.yyy.yyy, Q>

yyy.yyy.yyy.yyy

Page 11: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

System Session Abstraction

• Set of network connections to remote end point All involved in single

collaborative activity

• Application identifies end points, initiates connections

• System manages tracking Maintains semantics of

reliable protocols Exposes changes to apps

that register interest

/* Find remote end point */dhost = gethostbyname(dst);/* Validate remote end point */daddr = valid_address(dhost);

/* Create a new session */sid = session_create(flags, …);

/* Specify end points discovery */set_lookupfunc(sid, gethostbyname,

dst, hostname);

/* Create two connections */connect(a, daddr, …);add_connection(sid, a);connect(b, daddr, …);add_connection(sid, b);

/* Register interest in changes */register_handler(sid, mobhandler);

Page 12: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

session_create()add_connection()

Robust Session Management

Established LostConnecting Migrating

Frozen

Mobility Daemon

Se

ssio

n L

aye

r

App

NotSupported

Diffie-Hellman Key ExchangeChallenge/Response Protocol

C, P C, P

Po

licy

En

gin

e

Mobility Daemon

Se

ssio

n L

aye

r

App

Po

licy

En

gin

e

Page 13: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Dynamic Library Interposition

LegacyApplication

libmigrate

Kernel

connect(…) fd

MigrateDaemon

sid = session_create();add_connection(sid, …);

Session Handle

libc

connect(…)

syscall(connect,…)

fd

fd

SessionEstablishment

• Intercept POSIX API Wrap each connection in its

own session

Page 14: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

PART 1

• Problem: Track changing end points

• Solution: System session abstraction

PART 2

• Problem: Preserve reliable connections

• Solution: TCP Migrate Options

PART 3

• Problem: Internet “Suspend/Resume”

• Solution: Session continuations

Page 15: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Connection Preservation

• Provide stable view of dynamic kernel socket• But what about reliable connections?

User level: Double buffer, session layer re-sync Full access: Extend transport protocol

KernelApp Kernel App

SessionLayer

SessionLayer

Page 16: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

SYN 0

ACK 1

Transmission Control Protocol

• The reliable protocol 91% of all bytes, 83% of

all packets [CAIDA ’00] SSH, FTP, HTTPS,

telnet, IMAP, SMTP, etc.

• SYN/ACK handshake Negotiates options,

sequence space

• Reliable transport In-order delivery Retransmits lost data

ACK 2

DATA 1

ACK 3

DATA 2

DATA 2

SYN 0 / ACK 1

Page 17: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

TCP Connection Migration

• Resume previous connection with new one Provide special Migrate TCP option Sent on SYN packets of new connection

• Preserve buffers and sequence space Retransmission engine just works Compatible with SACK, FACK, Snoop…

• Entirely backwards compatible

Page 18: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

TCP ConnectionMigration

1. Initial SYN

2. SYN/ACK

3. ACK (with data)

4. Normal data transfer

5. Migrate SYN

6. Migrate SYN/ACK

7. ACK (with data)

SYN 0

ACK 1

SYN 0 / ACK 1

fixedmobile

(MigrateOK, …)

(MigrateOK, …)

1.

3.

SYN 22(Migrate T, …)

5.

ACK 48 7.

2.

SYN 46 / ACK 23 6.

DATA 47ACK 23

4.

DATA 22ACK 47

Page 19: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

TCP StateMachineChanges

MIGRATE_WAIT2MSL timeout

recv: SYN (migrate T, R)

send: SYN, ACK

• 2 new transitions between existing states

- and -• 1 new state

handles pathological race condition

recv

: S

YN

(m

igra

te T

, R)

sen

d:

SY

N, A

CK

recv

: RST

appl:

migrat

e

send: S

YN (migr

ate T

, R)

Page 20: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Migration Trace

SYN/ACK

BufferedPackets

(old address)

Migrate SYN

Page 21: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

A Lossy Trace with SACK

SYN/ACK

Migrate SYN

BufferedPackets

(old address)

ACKw/SACK

Page 22: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

PART 1

• Problem: Track changing end points

• Solution: System session abstraction

PART 2

• Problem: Preserve reliable connections

• Solution: TCP Migrate Options

PART 3

• Problem: Internet “Suspend/Resume”

• Solution: Session continuations

Page 23: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Internet Suspend/Resume

• Intelligent disconnection handling Buffer otherwise lost communications Emulate remote services locally Release resources while disconnected

• Graceful resumption handling Reallocate resources and restore state Adapt to new network conditions Indicate how to resume processing

Page 24: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Motivating Continuations

• Observation: complete context inappropriate Some previous state irrelevant, or, even worse, Invalidated due to change in conditions (C.f. TCP Connection state)

• Similar problem in programming languages Block when state and context is complex Pass continuation if state and context is small

• Continuations can request blocking behavior

Page 25: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Using Continuations

User level

App

Kernel

SL

• Expand session notion Align with application Annotate state, resources, associated computation Include system state

• Provide synchronization and preservation assistance Shared attribute/value store Persist local system IPC, file descriptors

• System invokes continuation at session resumption Generated in response to disconnection notification

Page 26: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Conserving Session Resources

SSHd

emacs

SocketBuffers

NetworkPorts

OpenFiles

Kernel

Resources dedicated toactive session

>>Resources dedicated to

suspended session

Release systemresources as well

Continuation generation is recursive!

Page 27: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

SSH Continuation

• Don’t suspend until it’s convenient Process pending data, deliver to app or network

• Only a minimum of state to preserve Auth, crypto, and compression state Preserve IPC to child processes

• Notify child processes of disconnection Tunneled apps share connectivity fate

Added ~250 LOC in an afternoon

Page 28: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Continuation Efficiency

Anecdotal evidence of size and speed

SSHd FTPd0

200

400

600

800

1000

1200

1400

1600

1800

2000

Mem

ory

Usa

ge (

KB

)

0

50

100

150

200

250

300

Res

tart

Lat

ency

(m

sec)

SSHd FTPd

System Resources

Shared Pages

Non-Shared Pages

Startup Latency

Session Overhead

SessionContinuation

Page 29: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Continuation Solution Spectrum

• Fast TCP handoff One RTT

• Normal movement Four RTTs + re-sync

• Suspend/Resume Complete flexibility

Control Channel SYN

Response

Challenge

Data SYN

Data SYN/ACK

Control Channel SYN/ACK

Request

Continuation Info

Resumed connection

+

Page 30: Session-Based Mobility An End-to-End Approach Alex C. Snoeren MIT Laboratory for Computer Science (with Hari Balakrishnan, Frans Kaashoek, and Jon Salz)

Conclusion & Future Directions

• Sessions are viable system abstractions Useful, flexible, and easy to use Admit robust, efficient implementation

• Continuations enable “suspend/resume”

• Useful for mobility across hosts? Continuations eliminate dependencies An area for future exploration…