Linux Virtual Server Tutorial



Similar documents
Active-Active Servers and Connection Synchronisation for LVS

Active-Active Servers and Connection Synchronisation for LVS

Netfilter. GNU/Linux Kernel version 2.4+ Setting up firewall to allow NIS and NFS traffic. January 2008

Creating Web Farms with Linux (Linux High Availability and Scalability)

Availability Digest. Redundant Load Balancing for High Availability July 2013

Netfilter Failover. Connection Tracking State Replication. Krisztián Kovács

ICS 351: Today's plan. IP addresses Network Address Translation Dynamic Host Configuration Protocol Small Office / Home Office configuration

Network Load Balancing

An Introduction to Open vswitch

TECHNICAL NOTES. Security Firewall IP Tables

Intro to Linux Kernel Firewall

Linux High Availability

UNIVERSITY OF BOLTON CREATIVE TECHNOLOGIES COMPUTING AND NETWORK SECURITY SEMESTER TWO EXAMINATIONS 2014/2015 NETWORK SECURITY MODULE NO: CPU6004

Deploying the BIG-IP LTM with IBM QRadar Logging

Chapter 11. User Datagram Protocol (UDP)

High Performance Cluster Support for NLB on Window

Protecting and controlling Virtual LANs by Linux router-firewall

MULTI WAN TECHNICAL OVERVIEW

Final for ECE374 05/06/13 Solution!!

Linux Virtual Server Tutorial

A Research Study on Packet Sniffing Tool TCPDUMP

Firewalls. Chien-Chung Shen

Load Balancing Web Proxies Load Balancing Web Filters Load Balancing Web Gateways. Deployment Guide

How to replicate the fire: HA for netfilter based firewalls

OpenFlow Based Load Balancing

Are Second Generation Firewalls Good for Industrial Control Systems?

Network packet capture in Linux kernelspace

An Implementation Model and Solutions for Stepwise Introduction of SDN -A proposal of AP-GW model-

Scalable Linux Clusters with LVS

Load Balancing McAfee Web Gateway. Deployment Guide

Load Balancing SIP Quick Reference Guide v1.3.1

Leveraging NIC Technology to Improve Network Performance in VMware vsphere

Introduction To Computer Networking

Introduction to Linux Virtual Server and High Availability

Iperf Tutorial. Jon Dugan Summer JointTechs 2010, Columbus, OH

50. DFN Betriebstagung

ΕΠΛ 674: Εργαστήριο 5 Firewalls

Lab VI Capturing and monitoring the network traffic

ODP Application proof point: OpenFastPath. ODP mini-summit

High Availability Low Dollar Load Balancing

Smoothwall Web Filter Deployment Guide

An API for dynamic firewall control and its implementation for Linux Netfilter

Introduction to Analyzer and the ARP protocol

Load Balancing Sophos Web Gateway. Deployment Guide

How To Analyze The Security On An Ipa Wireless Sensor Network

Telematics. 14th Tutorial - Proxies, Firewalls, P2P

Load Balancing Bloxx Web Filter. Deployment Guide

ETM System SIP Trunk Support Technical Discussion

2. What is the maximum value of each octet in an IP address? A. 28 B. 255 C. 256 D. None of the above

Deploying Windows Streaming Media Servers NLB Cluster and metasan

Load Balancing Barracuda Web Filter. Deployment Guide

OpenFlow with Intel Voravit Tanyingyong, Markus Hidell, Peter Sjödin

Load Balancing und Load Sharing

Linux LKM Firewall v 0.95 (2/5/2010)

Load balancing MySQL with HaProxy. Peter Boros Percona 4/23/13 Santa Clara, CA

Multicast-based Distributed LVS (MD-LVS) for improving. scalability and availability

Improving DNS performance using Stateless TCP in FreeBSD 9

Load Balancing Trend Micro InterScan Web Gateway

ΕΠΛ 475: Εργαστήριο 9 Firewalls Τοίχοι πυρασφάλειας. University of Cyprus Department of Computer Science

Linux Networking Basics

Monitor network traffic in the Dashboard tab

Bridgewalling - Using Netfilter in Bridge Mode

Dynamic Host Configuration Protocol (DHCP) 02 NAT and DHCP Tópicos Avançados de Redes

Technical Support Information

How To Build A Virtual Server Cluster In Linux 2003

Lab 5 Explicit Proxy Performance, Load Balancing & Redundancy

Allocating Network Bandwidth to Match Business Priorities

Exploration of Large Scale Virtual Networks. Open Network Summit 2016

Linux Virtual Server Clusters

Advanced routing scenarios POLICY BASED ROUTING: CONCEPTS AND LINUX IMPLEMENTATION

SDN/OpenFlow. Dean Pemberton Andy Linton

How To Configure Virtual Host with Load Balancing and Health Checking

Linux Firewalls (Ubuntu IPTables) II

1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet

The IP Transmission Process. V1.4: Geoff Bennett

GPRS and 3G Services: Connectivity Options

VERITAS Cluster Server Traffic Director Option. Product Overview

D1.2 Network Load Balancing

NetFlow Collection and Processing Cartridge Pack User Guide Release 6.0

QualNet 4.5 Network Emulation Interface Model Library

short introduction to linux high availability description of problem and solution possibilities linux tools

TCP Session Load-balancing in Active-Active HA Cluster

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Slide 1 Introduction cnds@napier 1 Lecture 6 (Network Layer)

Scalable Linux Clusters with LVS

H0/H2/H4 -ECOM100 DHCP & HTML Configuration. H0/H2/H4--ECOM100 DHCP Disabling DHCP and Assigning a Static IP Address Using HTML Configuration

Definition of firewall

Load Balancing Smoothwall Secure Web Gateway

YANG Data Model for Stateless Packet Filter Configuration draft-huang-netmod-acl-03

I3: Maximizing Packet Capture Performance. Andrew Brown

Firewalls, IDS and IPS

EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics and Computer Science

Linux MDS Firewall Supplement

Transport Layer Protocols

How To Run A Web Farm On Linux (Ahem) On A Single Computer (For Free) On Your Computer (With A Freebie) On An Ipv4 (For Cheap) Or Ipv2 (For A Free) (For

Lab 2. CS-335a. Fall 2012 Computer Science Department. Manolis Surligas

Can PowerConnect Switches Be Used in IP Multicast Networks?

finger, ftp, host, hostname, mesg, rcp, rlogin, rsh, scp, sftp, slogin, ssh, talk, telnet, users, w, walla, who, write,...

Transcription:

Linux Virtual Server Tutorial Horms (Simon Horman) horms@valinux.co.jp VA Linux Systems Japan, K.K. www.valinux.co.jp with assistance from NTT Comware Corporation www.nttcom.co.jp July 2003 http://www.ultramonkey.org/

Connection Synchronisation (TCP Fail-Over) Active/Stand-By Linux Directors can be used to create High Availability After fail-over occurs the new active Linux Director is able to forward packets for new connections However, it does not know about existing connections and can t forward them This means that when fail-over occurs all existing connections will break or stall indefinitely This is particularly undesirable for long connections such as streaming or large software downloads 2

Active/Stand-By One LinuxDirector, Single Point of Failure Active/Stand-By Linux Directors 3

Synchronising Connections To alleviate this problem a system of synchronisation between the Linux Directors was developed The critical information that needs to synchronised is: protocol (TCP or UDP) source ip address and port virtual ip address and port destination ip address and port state of the connection 4

Synchronising Connections (continued) A connection is synchronised once it passes a threshold on the number of packets received (default is 3) The connection is then synchronised every 50 packets 5

Synchronisation Packets When a connection is to be synchronised it is added to a queue Periodically the queue is flushed Connection synchronisation information from the queue is packed into a packet The connection synchronisation information for up to 50 connections may be packed into a single packet The synchronisation packet is sent using Multicast UDP 6

Synchronisation Packet Header 7

Synchronisation Packet Entry 8

Master / Slave A Master/Slave relationship is used The master linux director sends synchronisation information using Multicast UDP The slave(s) receive this information and update their in-kernel LVS connection table Sending and receiving is handled by kernel threads 9

Master / Slave Problem After failover slave is the active Linux Director Thus, connections are not synchronised When a second failover occurs connections will break 10

Master/Slave Problem (continued) Master Linux Director is Active, connections are synchronised 11

Master/Slave Problem (continued) Failover occurs, syncronised connections continue 12

Master/Slave Problem (continued) Slave is Active, connections are not synchronised 13

Master/Slave Problem (continued) Another failiver occurs, unsychronised connections break. 14

Enhancements A number of enhancements have been made to the existing LVS connection synchronisation code Synchronisation Method Hooks User-Space Synchronisation Method Additional tuning parameters 15

Synchronisation Method Hooks Allow any user-defined functions to be used to send and receive synchronisation data Typically implemented as a kernel module that starts a kernel thread to handle the sending and receiving Default functions implements the existing Master/Slave behaviour 16

User-Space Synchronisation Method Sends and receives synchronisation data to and from user-space via a netlink socket Allows more sophisticated synchronisation methods to be implemented Synchronisation data is very low volume Thus, there is no performance disadvantage in moving it to user-space A sample user-space synchronisation daemon has been implemented implements peer/peer synchronisation instead of master/slave 17

User-Space Synchronisation Block Diagram 18

Additional Tuning Parameters sync frequency: How often the a connection will be synchronised after the sync threshold is reached. Default is 50 msg max size: The maximum size of the synchronisation packet. Default is 1248 which allows synchronisation of up to 50 connections in one packet 19

Active Active The maximum throughput of the cluster is limited by the Linux Director Active Active allows throughput to be increased by adding Linux Directors The aim is to have multiple Linux Directors load balance traffic for the same virtual service But each connection should be load balanced by only one Linux Director 20

Common MAC and IP address Each Linux Director is given a common MAC and IP address ARP requests for the common IP address will always be answered with the common MAC address Thus, packets to the common IP address will be sent to the common MAC address The NIC and kernel on all the Linux Directors will accept these packets as it is to their IP and MAC address 21

Common MAC and IP address 22

Switch Port Problem Switches send packets to for a given MAC address only to the port that MAC address is attached to In this case multiple ports have the same MAC address attached But the switch may still want so send the packets down only one of these ports This means that only one Linux Director will received packets for the common IP and MAC address 23

Switch Port Solution Switches know which MAC address is connected to which port by observing packets which are received from the port If the Switch doesn t know which port a MAC address belongs to it will sent packets for that MAC address to all ports If Packets are never sent with the common MAC address then the switch is not able to associate the MAC address with a port Thus packets for the common MAC address will be sent to all ports 24

Switch Port Solution: Implementation The MAC address of the NIC is used to receive packets This is the normal behaviour Patch the Kernel so an alternate MAC address can be used to send packets Alternate MAC is set using /proc/sys/net/ipv4/conf/*/outgoing mac Simple change to ethernet.c to check this proc value and use it if set Otherwise the address of the NIC is used 25

Filtering All the Linux Directors receive all packets for the common IP address Filtering ensures that only one Linux Director load balances each connection This can be done using netfilter/ipchains Static filters are easy to establish But do not adapt as Linux Directors are added and removed 26

Dynamic Filtering Netfilter module that can have its rules changed on the fly User-Space daemon that updates the module s filter rules 27

Dynamic Filtering Block Diagram 28

Dynamic Filtering: User Space-Daemon Monitors the other Linux Directors in the cluster Master is elected to simplify resource allocations Master allocates blocks of the available connection-space to the available Linux Directors Blocks are reallocated by the master as Linux Directors join and leave the cluster If the master leaves the cluster a new one is elected 29

Blocks It is important that the decision about which Linux Director should load balance which connection is made in advance Making this decision as connections arrive would be too slow This is done by dividing the available connections into blocks 30

Blocks (continued) Currently this can be done by dividing the sorce or destination ports or IP addresses into into 512 blocks Ports are divided up using port/512, thus there are 2 16 /512 = 32 contiguous ports per block. 31

Blocks (continued) IP addreses are divided up using (addr mod 2 16 ) mod 512, thus there are 2 16 sub-blocks of 2 32 /2 16 /512 = 32 contiguous addresses per block. 32

Blocks (continued) When a connection is recieved its block is looked up If this block has been allocated to the node by saru then the packet is accepted Otherwise it is dropped another node will accept it 33

Active-Active Applications Designed to run on Linux Directors running LVS But the design is generic - may handle any type of network packets Thus, may be used on any type of server 34

Questions 35