MIGSOCK A Migratable TCP Socket in Linux Bryan Kuntz Karthik Rajan Masters Thesis Presentation 21 st February 2002.

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

Remote Procedure Call (RPC)
CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
Chapter 7: Transport Layer
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
Lecture 7 Transport Layer
OSI MODEL Maninder Kaur
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Distributed components
MIGSOCK Migratable TCP Socket in Linux Demonstration of Functionality Karthik Rajan Bryan Kuntz.
Socket Programming.
Page: 1 Director 1.0 TECHNION Department of Computer Science The Computer Communication Lab (236340) Summer 2002 Submitted by: David Schwartz Idan Zak.
MobiDesk: Mobile Virtual Desktop Computing Ricardo A. Baratto, Shaya Potter, Gong Su, Jason Nieh Network Computing Laboratory Columbia University September.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
MobiDesk: Mobile Virtual Desktop Computing Ricardo A. Baratto, Shaya Potter, Gong Su, Jason Nieh Network Computing Laboratory Columbia University.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Networks 1 CS502 Spring 2006 Network Input & Output CS-502 Operating Systems Spring 2006.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
Firewalls and VPNS Team 9 Keith Elliot David Snyder Matthew While.
 The Open Systems Interconnection model (OSI model) is a product of the Open Systems Interconnection effort at the International Organization for Standardization.
Gursharan Singh Tatla Transport Layer 16-May
OIS Model TCP/IP Model.
SOCKS Group: Challenger Member: Lichun Zhan. Agenda Introduction SOCKS v4 SOCKS v5 Summary Conclusion References Questions.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Networking Basics TCP/IP TRANSPORT and APPLICATION LAYER Version 3.0 Cisco Regional Networking Academy.
Presentation on Osi & TCP/IP MODEL
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Protocol Architectures. Simple Protocol Architecture Not an actual architecture, but a model for how they work Similar to “pseudocode,” used for teaching.
Jaringan Komputer Dasar OSI Transport Layer Aurelio Rahmadian.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
Enabling Embedded Systems to access Internet Resources.
Socket Swapping for efficient distributed communication between migrating processes MS Final Defense Praveen Ramanan 12 th Dec 2002.
Networks – Network Architecture Network architecture is specification of design principles (including data formats and procedures) for creating a network.
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
Chapter 5 Transport layer With special emphasis on Transmission Control Protocol (TCP)
1 Version 3.0 Module 11 TCP Application and Transport.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
Transparent Process Migration: Design Alternatives and the Sprite Implementation Fred Douglis and John Ousterhout.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Fundamentals of Proxying. Proxy Server Fundamentals  Proxy simply means acting on someone other’s behalf  A Proxy acts on behalf of the client or user.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
1 Choices “Our object-oriented system architecture embodies the notion of customizing operating systems to tailor them to support particular hardware configuration.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
S imple O bject A ccess P rotocol Karthikeyan Chandrasekaran & Nandakumar Padmanabhan.
G.v. Bochmann, revised Jan Comm Systems Arch 1 Different system architectures Object-oriented architecture (only objects, no particular structure)
4343 X2 – The Transport Layer Tanenbaum Ch.6.
01_NF_Ch04 – OSI Transport Layer ( 傳輸層 ) Source: CCNA Exploration.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Represented BY:- Allauddin Ahmad.  What it is?  OSI model.  History.  Objectives.  Encapsulation and decapsulation.  Multiplexing and demultiplexing.
Computer System Structures
Chapter 7: Transport Layer
The Transport Layer Implementation Services Functions Protocols
Kernel Design & Implementation
Introduction to Networking
NET323 D: Network Protocols
Chapter 2: System Structures
NET323 D: Network Protocols
دیواره ی آتش.
Computer Networking A Top-Down Approach Featuring the Internet
Exceptions and networking
Presentation transcript:

MIGSOCK A Migratable TCP Socket in Linux Bryan Kuntz Karthik Rajan Masters Thesis Presentation 21 st February 2002

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Introduction What is process migration? What is socket migration? What is MIGSOCK ?

Scenario 1

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Process Migration What is it?  the act of transferring a process between two machines during its execution More specifically:  Capture the state of a running process at a given moment  Transfer this state information to the new host of the process  Resume the process execution from the point at which it was captured

Process Migration Importance Load balancing Fault tolerance Anytime system administration Data access locality

Process Migration Difficulties Places limitations on the architecture – similar computers, similar libraries, etc. Complexity of adding transparent migration to systems Overheads / performance

Types of Solutions Operating System level support  Use a standard OS and modify kernel for migration MOSIX, CRAK, SPRITE  Use/code a custom OS better suited for migration MACH microkernel architecture User level support  Application re-link and re-compile CONDOR  Programming environment – Java libraries NOMADS

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Introduction What is a Socket ?  OS interface that abstracts TCP & UDP over IP  Behaves like a file to the user application  A two-way connection between two hosts  Sockets identified by (hostIP, hostPort, destinationIP, destinationPort)

OSI Model Application7 Presentation6 Session5 Transport4 Network3 Data Link2 Physical1 Socket Interface

Migration vs. Handoff Socket Migration  Involves transferring the end-point of the connection that is migrating with the process  Preserve the connection state  Important use: Allows processes with open sockets to migrate Socket Handoff  Transfer only the socket state, not the process  Requires some cooperation from the new socket host  Important use: Enables processes to maintain execution during a network reconfiguration. Ad-hoc private networks that suddenly go online, for example.

Migration Solutions – Proxy Migration within the proxy network using NAT Proxy Knows Current Location (IP & port) of process Advantages Easy to understand and implement Stateless Avoids changes at the OS level Disadvantages Limited Migration Proxy becomes single point of failure Hard to maintain TCP end-to-end semantics Examples  MSOCKS, “TCP Handoffs for Clustering”

Proxy Method

Migration Solutions – User Level Layer 7 of the OSI model – Application layer Wrap socket library with migratable API Use migratable API in user applications Advantages  Simple to implement  No kernel changes Disadvantages  Applications need to be re-written – not transparent  Slow as low level sockets are established again Examples  MOCKETS

Types of Solutions – OS Level Layers 4 and below of the OSI model – TCP and IP Modify TCP directly Support at the kernel level Advantages  Fast  Potentially transparent – depending on where control lies Disadvantages  Both hosts should implement TCP stack  Kernel changes require special permissions Examples  Our Design

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Our Solution: Design Goals Transparency Kernel level support Compliance with TCP semantics Modular implementation Performance  No serious overheads  Minimize message exchange Ease of integration into existing process migration environments

Assumptions Kernel support at all participating hosts Minimal security measures / not our primary concern A process migration system is already in place, otherwise steal a socket Upper layer state consistency Socket handoff requires a connected state Post-migration attempts by the remote host to reconnect to the original server IP and port will not succeed. Unavoidable latency during migration Shared file system (NFS) or some other way to transfer state

Socket Handoff Migrate only the socket connection; not the process. 1. Suspend an established connection and capture the socket state. 2. Transfer this state to a host with a running process. 3. This process must be running the same application layer, using a socket descriptor that is connected. In most applications, this will require STEALING a socket that is already in the connected state. 4. Replace this socket’s state with the transferred state. 5. Resume the connection with the remote host.

Socket Handoff Scenario

Socket Migration 1. Socket migration is initiated at source host 2. TCP message is sent to remote host suspending his side of the connection 3. Socket state is gathered and written to a file 4. State is transferred to the destination host 5. Socket is recreated with new host and port information of the destination host, and connected to remote host 6. TCP message is sent to remote host updating his half of the socket and resuming his side of the connection

Socket Migration Scenario

MIGSOCK API Send_Migration_Request(pid, sockfd ) Serialize_Socket_Data (pid, sockfd, buf ) Deserialize_Socket_Data (pid, sockfd, buf) For socket handoff Deserialize_And_Restart(pid, sockfd, buf) For socket migration Send_Remote_Restart (pid, sockfd, msg_contents) Get_Local_Host (pid, sockfd)

Usage Example Source side algorithm // Obtain the pid and socket fd for the migrating socket. Send_Migration_Request(pid, fd) num_bytes = Serialize_Socket_Data (pid, sockfd, buf) write(somefile, dest_buf, num_bytes); // Transfer somefile to destination host Destination side algorithm // Create a socket using the socket() call for the process // Obtain the pid and socket fd for the process and newly created socket. read(somefile, buf); newport = Deserialize_And_Restart(pid, sockfd, buf) newhost = Get_Local_Host(pid, sockfd) // Add the newport and newhost to msg_contents // Get oldhost and oldport from buf and add this to msg_contents Send_Remote_Restart(pid, sockfd, msg_contents)

Migration Initiation Request (Source Host) 1. Suspend local process 2. Flag set in struct sock tells packet-send routine that migration is under way. 3. Special TCP message generated over the socket 4. Remote host sets a flag in struct sock 5. Remote host unimpeded unless he tries to write (send()) to the socket, in which case he blocks 6. Capture and record socket state, return it in a buffer to the user

State transfer 1. The user program should write the buffer to a file or a network message 2. Send the file or message to the destination host 3. The data in this buffer should not be modified in any way or it could become unreadable by the API

Migration Completion (Destination Host) 1. Obtain socket descriptor that is used by the application layer in an appropriate state 2. Call a deserialize function to construct a connected socket – it returns a local port number 3. User constructs the restart message by adding the new and old ports and IP addresses 4. Special TCP message generated to remote host 5. Remote host resets the migration flag, repoints the socket to the new destination, and signals any blocking send() calls.

Message Timeline SourceRemoteDestination SYN SYN + ACK ACK Established MIG REQ ACK MIG RST ACK Socket Migration Start Transfer of State End of Migration Time

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Implementation Modules Kernel function changes Kernel data structures Message format

Migsock Architecture C Libraries / OS Services User Application User Space Kernel Space OS CORE TCP/IP ProtocolMIGSOCK Module System Call Interface

Modules Syscalls implemented using the device ioctl() interface Requires the creation of a device /dev/migsock Most functionality is contained within the modules except for the bottom-half side of the kernel TCP implementation Migratable socket option can be selected / deselected in the kernel configuration menu

Kernel Flow (Socket Read) Network Driver IP Layer Processor TCP Layer Processor struct sock data queues TCP Layer Read Socket Layer Read C Socket Library Application Socket Call User Space Kernel Space Top Half Bottom Half

Kernel Function Changes (TCP) The bottom-half portion of the TCP functionality needs to be changed to Send specially flagged migration request messages – source and destination Prevent the passing of migration messages to the upper layer (application) – remote Update IP address and port information after migration – remote Achieved by changing the following source files: tcp_input.c, tcp_output.c, tcp_ipv4.c

Kernel Data Structures struct sock struct socket struct tcp_opt struct file struct task_struct

Message Format Message Code OPERATION Old Host IP Old PortNew Port New Host IP 0 32 bits

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Testing and Demo Handoff  Handoff one end of a live socket from a process on a host to another host’s process Migration  Migrate a program along with its TCP socket from one host to another

Integration with CRAK MIGSOCK aware CRAK Source side – prevent CRAK from aborting Destination side – recreate socket entity Serialize socket state before checkpointing process Process restarts only after sockets are restored Change scheduling to account for delay in socket restoration

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Impact Flexible and easy to integrate into any system level process migration schema – demonstrated with CRAK Implementation is kernel level and modular Low messaging overheads Transparent to running processes  Any binary program compiled for Linux is eligible for socket migration Control can be integrated or separate from migrating application Maintained TCP semantics Modular implementation

Future Work Build on a security infrastructure Reconstruct a listening socket Improve compatibility with non-migration hosts Port it to other Kernels Merge with the official Linux kernel source tree Submit patch to LKML and Linus Integrate with other process migration systems Add a state-transportation mechanism – remove responsibility from user or shared file system Initiate an RFC

Agenda Introduction Process Migration Socket Migration Design Implementation Testing and Demo Impact and Future Work Related Work (time permitting) Demo (at NSH 1604)

Mockets Part of the NOMADS project from the University of West Florida User level socket migration Provides API on top of Java sockets Abstracts the re-connection process Each Mocket uses a Java socket Specially coded applications Large overheads

Mockets Structure

TCP Handoff From HP Labs and Michigan State Univ. Hand-off one end of a live socket connection Typical use in HTTP web clusters Client is unaware of the handoff How is it different from ours ?  One-way handoff only (ours is two- way)  Client protocol stack can remain unchanged

M-TCP Rutgers University Meant for Clustered Service Providers Decouples service provider from service Servers keep connection-specific state Lazy transfer of client connection state How is it different from ours ?  Client Initiated migration  No client side migration  Transfer takes place AFTER SYN is sent, leading to a possible performance weakness

M-TCP State Transitions

CRAK Columbia University No support of Socket Migration – Aug 01 Method described – Jan 02 No binaries or source code released to prove it! Proposed solution:  User level (application layer) calls  Remote host can still communicate during migration Data is retransmitted / lost during this process  Extra overhead due to user level calls  Restore slower than our implementation: CRAK = SSH MIGSOCK = Existing socket

Questions?

Scenario 2