38
M. S. Thesis Defense, 09/24/2001 1 Migratory TCP (MTCP) Transport Layer Support for Highly-Available Network Services Kiran Srinivasan DisCoLab Division of Computer and Information Sciences Rutgers University Advisor: Liviu Iftode

M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 1

Migratory TCP (MTCP)Transport Layer Support for Highly-

Available Network Services

Kiran SrinivasanDisCoLab

Division of Computer and Information SciencesRutgers University

Advisor: Liviu Iftode

Page 2: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 2

Services Rather Than Servers

Client oblivious to a given server’s location Client is interested only in the content

provided and QoS A Service -> set of equivalent servers Internet services

Most services are based on TCP Clients demand both high-availability and

performance

Page 3: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 3

TCP-based Internet Services Adverse conditions

Core network congestion, overloaded servers, failed servers or under DoS attack

TCP response Network delays => packet loss => retransmission

TCP limitations Creates an implicit binding of service to a server ! Clients cannot change to another server for

sustained service

Page 4: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 4

Migratory TCP

Transport layer protocol that supports dynamic connection migration

Extension to TCP A client connection can transparently migrate to

different servers during its lifetime Modified server applications cooperate to support the

handoff Client applications do not change

Servers can be geographically distributed Does not depend on application-specific info

Page 5: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 5

Contributions

Designed a transport layer protocol that enables dynamic connection migration

Implemented a prototype on FreeBSD Demonstrated the utilization of our protocol

in building highly-available services Conducted preliminary performance

evaluation F. Sultan, K. Srinivasan, L. Iftode - “Transport

Layer Support for Highly-Available Network Services ”, HotOS 2001

Page 6: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 6

Outline

Motivation Protocol Design Prototype Implementation Preliminary Performance Evaluation Protocol Utilization Related Work Conclusions and Future Work

Page 7: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 7

The Migration Model

Client

Server 1 - overloaded

Server 2

congestion

Page 8: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 8

Triggers and Initiators

Client

Server 1

Server 2

MIGRATE_TRIGGE

R

MIGRATE_TRIGGER

MIGRATE_TRIGGERMIGRATE_INITIATE

Page 9: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 9

Design Issues

How to resume the service at the new server? Without the involvement of the client application Without full migration of the server application With low overhead

What is the state that needs to be transferred? Application state Protocol state

Page 10: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 10

Contract Between Server Application and MTCP

Application Define fine-grained per-connection application state Export per-connection application state snapshot

periodically to the kernel After migration, import per-connection state to

resume service MTCP

Transfer the per-connection state Synchronize the application state with the protocol

state

Page 11: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 11

Server Application Interface export_state

Export the state snapshot at the origin server Many times periodically

import_state Import the state snapshot at the destination

server Enables the destination server to resume from the

last snapshot Only once at the destination server

Light-weight connection migration

Page 12: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 12

Server Application Examplewhile ((s = accept(ssock)) != -1){ if (import_state(s, &state))

num = state else

num = 0recv(s, &buf)

state = ++ num export_state(s, &state) recv(s, &buf) state = ++ num

export_state(s, &state) . . .

}

Page 13: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 13

Contract Between Server Application and MTCP

Application Define fine-grained per-connection application

state Export per-connection application state snapshot

periodically After migration, import per-connection state to

resume service MTCP

Transfer the per-connection state Synchronize the application state with the

protocol state

Page 14: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 14

MTCP ProtocolServer 1 Server

2

Application

Protocol

Connections Connections

Page 15: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 15

State Synchronization Examplewhile ((s = accept(ssock)) != -1){ if (import_state(s, &state))

num = state else

num = 0recv(s, &buf)

state = ++ num export_state(s, &state) recv(s, &buf) state = ++ num

export_state(s, &state) . . .

}

1

13 2

Export

Application

MTCP

Page 16: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 16

State Synchronization Example

while ((s=accept(ssock)) != -1){ if (import_state(s, &state))

num = state else

num = 0recv(s, &buf)

state = ++num export_state(s, &state) recv(s, &buf) state = ++num

export_state(s, &state) . . .

}

2

14 3

RE

CV

Out of Sync

Application

MTCP

Page 17: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 17

State Synchronization Example

1

13 2

RE

CV

MTCP

2

13 2

Application

MTCP

2

23 2

ApplicationApplication

EXPORT MTCP

Page 18: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 18

Log-Based State Synchronization

Logs are maintained in the protocol At export time, protocol discards logs

(sync-ed) Logs form part of the state to be

transferred during migration Resumption of service starts from the last

state snapshot

Page 19: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 19

Implementation

Modified the TCP/IP stack in FreeBSD kernel

Lazy connection migration mechanism Evaluation on synthetic benchmarks Target applications

HTTP server PostgreSQL front-end

Page 20: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 20

Lazy Connection Migration

C (0)

C’

< S

tat e

Requ

est

> (

2)

< S

tate

Reply

> (

3)

Client

Server 1

Server 2

<SYN C,…> (1)

<SYN + ACK> (4)

Page 21: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 21

Implementation: Per-Connection State

snap

not ack’ed

Write Buffer

Application Write

Application

Protocol

Page 22: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 22

Implementation: Per-Connection State

X

From network

Read pointer

Read since snap

Read before snap

ack’ed

Application

ProtocolRead Buffer

snap

Page 23: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 23

Preliminary Performance Evaluation

Experimental setup Two servers and a client: P III 233MHz, 256 MB

RAM Servers are connected by a dedicated network

link Benchmarks

Microbenchmark Simple web server like application

Page 24: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 24

Microbenchmark

• One migration averaged over 200 runs for each state size

• All times are in microseconds

• The state size is in bytes

Page 25: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 25

Microbenchmark

The time for migration varies linearly with state size

Page 26: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 26

Stream Server Experiment

Server application sends a stream of 256K bytes in chunks of 1K each

Server performance degrades after a threshold Degradation is emulated by means of delays in

the server Migration policy module inserted into kernel at the

client Smoothed rate estimator Migration occurs when the estimated rate drops to 70%

of max. observed rate

Page 27: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 27

Stream Server Experiment Results

Effective rate is almost equal to the best rate from the server

Page 28: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 28

Implementation Summary

Addition of ~5000 lines of kernel code Changes to TCP finite state machine

Addition of two logical TCP states: Migrating and Blackhole

Time spent on the design and implementation was 9 months

Page 29: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 29

Protocol Utilization

For high availability For performance through load balancing

schemes Servers trigger migrations based on a load

balancing policy Fault tolerance

Eager transfer of connection state information

Page 30: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 30

Related Work

Classes of related work TCP Fault tolerance Process migration

Page 31: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 31

TCP Related Works

HTTP server fail-over by connection migration [Snoeren ‘00]

soft TCP and HTTP state maintained at back-up server Fault-tolerant TCP [Alvisi ‘00]

failure masking persistent connections across server crashes

Stream Control Transmission Protocol (SCTP) - RFC 2960

multi-homing (many IP addresses / endpoint) ensures connectivity in the face of network failure

Page 32: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 32

TCP Related Works (cont’d)

MSOCKS [Bhagwat `98] Proxy based “TCP splicing” for mobile clients

with multiple interfaces Indirect TCP [Bakre ‘95]

Connection handoffs between MSRs allow mobile hosts to maintain open connections with a fixed host

Page 33: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 33

Fault Tolerance Related Works

Log-based rollback recovery The NonStop kernel [Bartlett ’81]

Page 34: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 34

Process Migration Related Works

Condor [Litzkow ‘88] Locus [Popek ‘81] MOSIX [Barak ‘85] Sprite [Ousterhout ‘88]

Page 35: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 35

Conclusions

We provide a transport layer protocol that enables building of highly-available services

The transport layer protocol allows dynamic server endpoint connection migration

We implemented a prototype in a FreeBSD kernel We designed an API for the server applications Preliminary performance evaluation on a web

server-like application achieved constant rate in the presence of server degradation

http://discolab.rutgers.edu/mtcp

Page 36: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 36

Future Work

Investigate migration policies Alternate state transfer

implementations Recursive connection migration

mechanism Future applications

Page 37: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 37

Acknowledgment

Florin – for contributing to the design and implementation of the project

Other members of DisCo Lab

Page 38: M. S. Thesis Defense, 09/24/20011 Migratory TCP (MTCP) Transport Layer Support for Highly- Available Network Services Kiran Srinivasan DisCoLab Division

M. S. Thesis Defense, 09/24/2001 38

Thank You

Demo in CoRE 336 !