SlideShare ist ein Scribd-Unternehmen logo
1 von 23
IP Multicast on EC2
-- Who said VRRP doesn’t work on AWS?--
Kenta Yasukawa
Solutions Architect
Amazon Data Services Japan
What this presentation is about
My experiences on low layer networking stuff on EC2
• Around L3 or L2
• No L1 stuff
We can’t reach L1 of AWS
Do you use VPC?
EC2-Classic
Amazon Virtual Private
Cloud (VPC)
Each user gets private
sections to deploy
instances
VPC is not only for private networks
What EC2-VPC can do whereas EC2-Classic cannot
• Static private IP address allocation
• Multiple IP addresses allocation
• Multiple network interfaces
• Dynamic security group membership configuration
• Outbound packet filtering by security group
• NACL
• …
L2 looks different from an EC2 instance
EC2-Classic
• Same answer for any ARP request
EC2-VPC
• Familiar output!
It means L2 tricks may work in VPC
L2 NAT (e.g. ebtables, tc)
Software which requires L2 addressing (e.g. LVS)
DSR (Direct Server Return) Load balancer
Pseudo IP broadcast/multicast
Will explain this in more detail
How Pseudo L2 Broadcast works
VPC Subnet
IP Multicast
Dst: Ethernet Broadcast address
Src: Sender’s MAC address
Duplicate
Unicast-ify
Note: Disable Src/Dest on ENI
Fine. Let’s use
unicast then.
IP Multicast packet is sent over
Ethernet broadcast frame which
just goes into black hole on EC2
Applications bind to IP
address, not MAC
address. So most of
them just work fine.
How to implement
Script below is based on packet capturing (Just a Proof of Concept)
• Easy to understand
• It performs ok for an ENI which does not get much traffic
• Daemonizing is necessary (e.g. supervisord)
https://gist.github.com/kntyskw/5231182
How to implement
tc mirred + pedit + csum
The sample shell script configures tc to perform the job
https://gist.github.com/kntyskw/5633755
Much better both from performance and maintenance perspective
A little trickier to understand, though
Requires two ENIs for a subnet because tc mirred does not like to send
loop for copied packets
# ec2_multicast.sh 
<interface to grab multicast packets from> 
<interface to send modified packets to> 
[target MAC address 1] [target MAC address 2] ...
# ec2_multicast.sh eth0 eth1 00:11:22:33:44:55 66:77:88:99:aa:bb
Example:
Usage:
Determine neighbors’ MAC addresses
Use AWS API
• Example:
https://gist.github.com/kntyskw/5413698
Is it useful?
It has quite some overhead
since a packet is duplicated
and sent multiple times
But maybe ok to use for
infrequent messaging?
Sure. Don’t
use it for
sreaming
HD movies
Right.
So, what about using it for
node discovery and
heartbeating?
Ask yourself.
Yeah, like
VRRP?
Let’s now try to make VRRP work
Virtual Router Redundancy Protocol (VRRP)
• Gives a virtual IP address to a group of nodes (VRRP group)
which forms a fault tolerant cluster
• Nodes in a VRRP group communite with IP multicast
Verification with LVS + Keepalived
VPC Subnet
LVS +
keepalived
LVS +
keepalived
WebWebWeb
172.31.0.0/20
Elastic IP
Secondary:
172.31.24.1
Primary:
172.31.24.100
Primary:
172.31.24.101
VRRP
Normal state Request routing
path
Verification with LVS + Keepalived
VPC Subnet
LVS +
keepalived
LVS +
keepalived
WebWebWeb
172.31.0.0/20
Elastic IP
Secondary:
172.31.24.1
Primary:
172.31.24.100
Primary:
172.31.24.101
VRRP
Upon failover Request routing
path
How to take over an IP address
VPC is not using ARP to determine dest MAC address
• Needs to provision the mapping b/w IP address and ENI
Call AWS API to reassign VIP from Master to backup upon failover
https://gist.github.com/kntyskw/5417140
Keepalived configuration
Execute the script when promoted to the master
vrrp_instance VI_1 {
state BACKUP
interface eth1
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.31.24.1 dev eth0
}
notify_master /etc/keepalived/assign_vip.sh
}
Advantages of using LVS
UDP load balancing!
• Neither ELB nor HAProxy can do
LVS does not need to terminate TCP
• Lower overhead
No need to involve user land process
• Lower latency
• Higher throughput
Quick benchmarking results sss
LVS v.s. HAProxy
• Both run on a m1.small instance
• Tested to fetch a 4KB HTML file with BeesWithMachineGuns
• Each of 8 bees will fire 2000 rounds, 10 at a time.
0
500
1000
1500
2000
2500
3000
3500
4000
4500
LVS HAProxy
Requestperseconds
Throughput
0
10
20
30
40
50
60
Average tp50 tp90
ResponseTimein[ms]
Response Time
LVS
HAProxy
Things to note when you depend on L2
VPC Subnet cannot span across multiple AZs
ENI cannot reach a subnet in a different AZ
Availability Zone Availability Zone
VPC Subnet
Availability Zone Availability Zone
Building Multi-AZ architecture with LVS
VPC Subnet
LVS +
keepalived
LVS +
keepalived
WebWebWeb
172.31.0.0/20
Elatic IP
Secondary:
172.31.24.1
Primary:
172.31.24.100
Primary:
172.31.24.1
01
VRRP
If you can use multiple IP addresses
• Use DNS RR as well as ELB does
• Route53 Health Check can be used to detect failure
Request flow
VPC Subnet
LVS +
keepalived
LVS +
keepalived
WebWebWeb
172.31.64.0/20
Secondary:
172.31.78.1
Primary:
172.31.78.
100
Primary:
172.31.78.101
VRRP
Availability Zone Availability Zone
Amazon Route
53
Building Multi-AZ architecture with LVS
VPC Subnet
LVS +
keepalived
LVS +
keepalived
WebWebWeb
172.31.0.0/20
Elatic IP
Secondary:
172.31.24.1
Primary:
172.31.24.100
Primary:
172.31.24.1
01
VRRP
If you have to stick to one single IP address
(e.g. due to NAT traversal issue for UDP based services)
• Perform Heartbeating b/w VRRP master nodes and move EIP upon failover
Request flow
Availability Zone Availability Zone
VPC Subnet
LVS +
keepalived
WebWebWeb
172.31.64.0/20
Primary:
172.31.78.101
VRRP
LVS +
keepalived
Secondary:
172.31.78.1
Primary:
172.31.78.
100
Concluding remarks
VPC gives you freedom on L2 which allows:
• L2 NAT
• L2 addressing
• Pseudo Broadcast/Multicast
Pseudo IP Multicast enables most applications which
require IP multicast
• Confirmed LVS + Keepalived works well
LVS has advantages over other LBs depending on use
cases
• Don’t forget to build Multi-AZ architecture
Use VPC and get more options for architecting!
IP Multicast on ec2

Weitere ähnliche Inhalte

Was ist angesagt?

Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Steffen Gebert
 
Rust と Wasmの現実
Rust と Wasmの現実Rust と Wasmの現実
Rust と Wasmの現実ShogoTagami1
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchTe-Yen Liu
 
Routed Provider Networks on OpenStack
Routed Provider Networks on OpenStack Routed Provider Networks on OpenStack
Routed Provider Networks on OpenStack Romana Project
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking ExplainedThomas Graf
 
Mlag invisibile layer 2 redundancy
Mlag invisibile layer 2 redundancyMlag invisibile layer 2 redundancy
Mlag invisibile layer 2 redundancyCumulus Networks
 
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화NAVER D2
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Diverajdeep
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about cephEmma Haruka Iwao
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Weaveworks
 
Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0Ceph Community
 
Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門VirtualTech Japan Inc.
 
Deeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDeeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDocker, Inc.
 
フロー技術によるネットワーク管理
フロー技術によるネットワーク管理フロー技術によるネットワーク管理
フロー技術によるネットワーク管理Motonori Shindo
 
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
10年効く分散ファイルシステム技術 GlusterFS & Red Hat StorageEtsuji Nakai
 
分散仮想ストレージシステム紹介
分散仮想ストレージシステム紹介分散仮想ストレージシステム紹介
分散仮想ストレージシステム紹介OSSラボ株式会社
 
Disaggregating Ceph using NVMeoF
Disaggregating Ceph using NVMeoFDisaggregating Ceph using NVMeoF
Disaggregating Ceph using NVMeoFShapeBlue
 

Was ist angesagt? (20)

Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
 
Rust と Wasmの現実
Rust と Wasmの現実Rust と Wasmの現実
Rust と Wasmの現実
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Routed Provider Networks on OpenStack
Routed Provider Networks on OpenStack Routed Provider Networks on OpenStack
Routed Provider Networks on OpenStack
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Mlag invisibile layer 2 redundancy
Mlag invisibile layer 2 redundancyMlag invisibile layer 2 redundancy
Mlag invisibile layer 2 redundancy
 
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about ceph
 
LXC入門 - Osc2011 nagoya
LXC入門 - Osc2011 nagoyaLXC入門 - Osc2011 nagoya
LXC入門 - Osc2011 nagoya
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0
 
Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門
 
Deeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDeeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay Networks
 
フロー技術によるネットワーク管理
フロー技術によるネットワーク管理フロー技術によるネットワーク管理
フロー技術によるネットワーク管理
 
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
10年効く分散ファイルシステム技術 GlusterFS & Red Hat Storage
 
分散仮想ストレージシステム紹介
分散仮想ストレージシステム紹介分散仮想ストレージシステム紹介
分散仮想ストレージシステム紹介
 
Disaggregating Ceph using NVMeoF
Disaggregating Ceph using NVMeoFDisaggregating Ceph using NVMeoF
Disaggregating Ceph using NVMeoF
 

Andere mochten auch

Applibot presents Smartphone Game on AWS
Applibot presents Smartphone Game on AWSApplibot presents Smartphone Game on AWS
Applibot presents Smartphone Game on AWSKenta Yasukawa
 
Radical ideas from the book: The Practice of Cloud System Administration
Radical ideas from the book: The Practice of Cloud System AdministrationRadical ideas from the book: The Practice of Cloud System Administration
Radical ideas from the book: The Practice of Cloud System AdministrationTom Limoncelli
 
Multicast on Cisco Network
Multicast on Cisco NetworkMulticast on Cisco Network
Multicast on Cisco Networkhome
 
IP Multicast Explained
IP Multicast ExplainedIP Multicast Explained
IP Multicast ExplainedMetaswitch NTD
 
Redis & Redis HA design with Keepalived
Redis & Redis HA design with KeepalivedRedis & Redis HA design with Keepalived
Redis & Redis HA design with KeepalivedToshiki Inami
 
Redis High availability and fault tolerance in a multitenant environment
Redis High availability and fault tolerance in a multitenant environmentRedis High availability and fault tolerance in a multitenant environment
Redis High availability and fault tolerance in a multitenant environmentIccha Sethi
 
Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2Amazon Web Services
 
A FINANCIAL ANALYSIS OF RATIOS & CASH FLOW STATETMENT
A FINANCIAL ANALYSIS OF RATIOS &  CASH FLOW STATETMENT A FINANCIAL ANALYSIS OF RATIOS &  CASH FLOW STATETMENT
A FINANCIAL ANALYSIS OF RATIOS & CASH FLOW STATETMENT kartik patel
 
EMC Academic Alliance Partnering Schools
EMC Academic Alliance Partnering SchoolsEMC Academic Alliance Partnering Schools
EMC Academic Alliance Partnering SchoolsEMC
 
The midnight visitor
The midnight visitorThe midnight visitor
The midnight visitorGirish Arabbi
 
Presentation 4Q15 - CPFL Energia
Presentation 4Q15 - CPFL EnergiaPresentation 4Q15 - CPFL Energia
Presentation 4Q15 - CPFL EnergiaCPFL RI
 
2 Key Terms
2 Key Terms2 Key Terms
2 Key TermsBEverson
 

Andere mochten auch (20)

Ha of load balancer
Ha of load balancerHa of load balancer
Ha of load balancer
 
Applibot presents Smartphone Game on AWS
Applibot presents Smartphone Game on AWSApplibot presents Smartphone Game on AWS
Applibot presents Smartphone Game on AWS
 
Radical ideas from the book: The Practice of Cloud System Administration
Radical ideas from the book: The Practice of Cloud System AdministrationRadical ideas from the book: The Practice of Cloud System Administration
Radical ideas from the book: The Practice of Cloud System Administration
 
Multicast on Cisco Network
Multicast on Cisco NetworkMulticast on Cisco Network
Multicast on Cisco Network
 
IP Multicast Explained
IP Multicast ExplainedIP Multicast Explained
IP Multicast Explained
 
Advanced Topics in IP Multicast Deployment
Advanced Topics in IP Multicast DeploymentAdvanced Topics in IP Multicast Deployment
Advanced Topics in IP Multicast Deployment
 
IP Multicasting
IP MulticastingIP Multicasting
IP Multicasting
 
Redis & Redis HA design with Keepalived
Redis & Redis HA design with KeepalivedRedis & Redis HA design with Keepalived
Redis & Redis HA design with Keepalived
 
Ip multicast
Ip multicastIp multicast
Ip multicast
 
IP Multicasting
IP MulticastingIP Multicasting
IP Multicasting
 
Redis High availability and fault tolerance in a multitenant environment
Redis High availability and fault tolerance in a multitenant environmentRedis High availability and fault tolerance in a multitenant environment
Redis High availability and fault tolerance in a multitenant environment
 
Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2Bootstrapping - Session 1 - Your First Week with Amazon EC2
Bootstrapping - Session 1 - Your First Week with Amazon EC2
 
OpenSIPS Workshop
OpenSIPS WorkshopOpenSIPS Workshop
OpenSIPS Workshop
 
A FINANCIAL ANALYSIS OF RATIOS & CASH FLOW STATETMENT
A FINANCIAL ANALYSIS OF RATIOS &  CASH FLOW STATETMENT A FINANCIAL ANALYSIS OF RATIOS &  CASH FLOW STATETMENT
A FINANCIAL ANALYSIS OF RATIOS & CASH FLOW STATETMENT
 
EMC Academic Alliance Partnering Schools
EMC Academic Alliance Partnering SchoolsEMC Academic Alliance Partnering Schools
EMC Academic Alliance Partnering Schools
 
Método nissino
Método nissinoMétodo nissino
Método nissino
 
Apostila
ApostilaApostila
Apostila
 
The midnight visitor
The midnight visitorThe midnight visitor
The midnight visitor
 
Presentation 4Q15 - CPFL Energia
Presentation 4Q15 - CPFL EnergiaPresentation 4Q15 - CPFL Energia
Presentation 4Q15 - CPFL Energia
 
2 Key Terms
2 Key Terms2 Key Terms
2 Key Terms
 

Ähnlich wie IP Multicast on ec2

Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerJorge Juan Mendoza
 
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWSArquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWSAmazon Web Services LATAM
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksAdrien Blind
 
Meetup docker using software defined networks
Meetup docker   using software defined networksMeetup docker   using software defined networks
Meetup docker using software defined networksOCTO Technology
 
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWSPLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWSPROIDEA
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge MigrationJames Denton
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceEvan McGee
 
Building services on AWS in China region
Building services on AWS in China regionBuilding services on AWS in China region
Building services on AWS in China regionRoman Naumenko
 
Overlay/Underlay - Betting on Container Networking
Overlay/Underlay - Betting on Container NetworkingOverlay/Underlay - Betting on Container Networking
Overlay/Underlay - Betting on Container NetworkingLee Calcote
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsCarlos Sanchez
 
IPVS for Docker Containers
IPVS for Docker ContainersIPVS for Docker Containers
IPVS for Docker ContainersBob Sokol
 
[En] IPVS for Docker Containers
[En] IPVS for Docker Containers[En] IPVS for Docker Containers
[En] IPVS for Docker ContainersAndrey Sibirev
 
Bitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesBitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesNathan Burrell
 
Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk Eran Gampel
 
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...Amazon Web Services
 
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantImplementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantShixiong Shang
 
Dragonflow 01 2016 TLV meetup
Dragonflow 01 2016 TLV meetup  Dragonflow 01 2016 TLV meetup
Dragonflow 01 2016 TLV meetup Eran Gampel
 
AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...
AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...
AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...Amazon Web Services
 

Ähnlich wie IP Multicast on ec2 (20)

Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in docker
 
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWSArquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined Networks
 
Meetup docker using software defined networks
Meetup docker   using software defined networksMeetup docker   using software defined networks
Meetup docker using software defined networks
 
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWSPLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
PLNOG 17 - Tomasz Stachlewski - Infrastruktura sieciowa w chmurze AWS
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
Building services on AWS in China region
Building services on AWS in China regionBuilding services on AWS in China region
Building services on AWS in China region
 
nested-kvm
nested-kvmnested-kvm
nested-kvm
 
Overlay/Underlay - Betting on Container Networking
Overlay/Underlay - Betting on Container NetworkingOverlay/Underlay - Betting on Container Networking
Overlay/Underlay - Betting on Container Networking
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
 
IPVS for Docker Containers
IPVS for Docker ContainersIPVS for Docker Containers
IPVS for Docker Containers
 
[En] IPVS for Docker Containers
[En] IPVS for Docker Containers[En] IPVS for Docker Containers
[En] IPVS for Docker Containers
 
Bitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesBitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by Kubernetes
 
Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk Dragonflow Austin Summit Talk
Dragonflow Austin Summit Talk
 
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
AWS re:Invent 2016: Optimizing Network Performance for Amazon EC2 Instances (...
 
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantImplementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
 
Sheep it
Sheep itSheep it
Sheep it
 
Dragonflow 01 2016 TLV meetup
Dragonflow 01 2016 TLV meetup  Dragonflow 01 2016 TLV meetup
Dragonflow 01 2016 TLV meetup
 
AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...
AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...
AWS re:Invent 2016: NextGen Networking: New Capabilities for Amazon’s Virtual...
 

Kürzlich hochgeladen

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Kürzlich hochgeladen (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

IP Multicast on ec2

  • 1. IP Multicast on EC2 -- Who said VRRP doesn’t work on AWS?-- Kenta Yasukawa Solutions Architect Amazon Data Services Japan
  • 2. What this presentation is about My experiences on low layer networking stuff on EC2 • Around L3 or L2 • No L1 stuff We can’t reach L1 of AWS
  • 3. Do you use VPC? EC2-Classic Amazon Virtual Private Cloud (VPC) Each user gets private sections to deploy instances
  • 4. VPC is not only for private networks What EC2-VPC can do whereas EC2-Classic cannot • Static private IP address allocation • Multiple IP addresses allocation • Multiple network interfaces • Dynamic security group membership configuration • Outbound packet filtering by security group • NACL • …
  • 5. L2 looks different from an EC2 instance EC2-Classic • Same answer for any ARP request EC2-VPC • Familiar output!
  • 6. It means L2 tricks may work in VPC L2 NAT (e.g. ebtables, tc) Software which requires L2 addressing (e.g. LVS) DSR (Direct Server Return) Load balancer Pseudo IP broadcast/multicast Will explain this in more detail
  • 7. How Pseudo L2 Broadcast works VPC Subnet IP Multicast Dst: Ethernet Broadcast address Src: Sender’s MAC address Duplicate Unicast-ify Note: Disable Src/Dest on ENI Fine. Let’s use unicast then. IP Multicast packet is sent over Ethernet broadcast frame which just goes into black hole on EC2 Applications bind to IP address, not MAC address. So most of them just work fine.
  • 8. How to implement Script below is based on packet capturing (Just a Proof of Concept) • Easy to understand • It performs ok for an ENI which does not get much traffic • Daemonizing is necessary (e.g. supervisord) https://gist.github.com/kntyskw/5231182
  • 9. How to implement tc mirred + pedit + csum The sample shell script configures tc to perform the job https://gist.github.com/kntyskw/5633755 Much better both from performance and maintenance perspective A little trickier to understand, though Requires two ENIs for a subnet because tc mirred does not like to send loop for copied packets # ec2_multicast.sh <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ... # ec2_multicast.sh eth0 eth1 00:11:22:33:44:55 66:77:88:99:aa:bb Example: Usage:
  • 10. Determine neighbors’ MAC addresses Use AWS API • Example: https://gist.github.com/kntyskw/5413698
  • 11. Is it useful? It has quite some overhead since a packet is duplicated and sent multiple times But maybe ok to use for infrequent messaging? Sure. Don’t use it for sreaming HD movies Right. So, what about using it for node discovery and heartbeating? Ask yourself. Yeah, like VRRP?
  • 12. Let’s now try to make VRRP work Virtual Router Redundancy Protocol (VRRP) • Gives a virtual IP address to a group of nodes (VRRP group) which forms a fault tolerant cluster • Nodes in a VRRP group communite with IP multicast
  • 13. Verification with LVS + Keepalived VPC Subnet LVS + keepalived LVS + keepalived WebWebWeb 172.31.0.0/20 Elastic IP Secondary: 172.31.24.1 Primary: 172.31.24.100 Primary: 172.31.24.101 VRRP Normal state Request routing path
  • 14. Verification with LVS + Keepalived VPC Subnet LVS + keepalived LVS + keepalived WebWebWeb 172.31.0.0/20 Elastic IP Secondary: 172.31.24.1 Primary: 172.31.24.100 Primary: 172.31.24.101 VRRP Upon failover Request routing path
  • 15. How to take over an IP address VPC is not using ARP to determine dest MAC address • Needs to provision the mapping b/w IP address and ENI Call AWS API to reassign VIP from Master to backup upon failover https://gist.github.com/kntyskw/5417140
  • 16. Keepalived configuration Execute the script when promoted to the master vrrp_instance VI_1 { state BACKUP interface eth1 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 172.31.24.1 dev eth0 } notify_master /etc/keepalived/assign_vip.sh }
  • 17. Advantages of using LVS UDP load balancing! • Neither ELB nor HAProxy can do LVS does not need to terminate TCP • Lower overhead No need to involve user land process • Lower latency • Higher throughput
  • 18. Quick benchmarking results sss LVS v.s. HAProxy • Both run on a m1.small instance • Tested to fetch a 4KB HTML file with BeesWithMachineGuns • Each of 8 bees will fire 2000 rounds, 10 at a time. 0 500 1000 1500 2000 2500 3000 3500 4000 4500 LVS HAProxy Requestperseconds Throughput 0 10 20 30 40 50 60 Average tp50 tp90 ResponseTimein[ms] Response Time LVS HAProxy
  • 19. Things to note when you depend on L2 VPC Subnet cannot span across multiple AZs ENI cannot reach a subnet in a different AZ Availability Zone Availability Zone VPC Subnet Availability Zone Availability Zone
  • 20. Building Multi-AZ architecture with LVS VPC Subnet LVS + keepalived LVS + keepalived WebWebWeb 172.31.0.0/20 Elatic IP Secondary: 172.31.24.1 Primary: 172.31.24.100 Primary: 172.31.24.1 01 VRRP If you can use multiple IP addresses • Use DNS RR as well as ELB does • Route53 Health Check can be used to detect failure Request flow VPC Subnet LVS + keepalived LVS + keepalived WebWebWeb 172.31.64.0/20 Secondary: 172.31.78.1 Primary: 172.31.78. 100 Primary: 172.31.78.101 VRRP Availability Zone Availability Zone Amazon Route 53
  • 21. Building Multi-AZ architecture with LVS VPC Subnet LVS + keepalived LVS + keepalived WebWebWeb 172.31.0.0/20 Elatic IP Secondary: 172.31.24.1 Primary: 172.31.24.100 Primary: 172.31.24.1 01 VRRP If you have to stick to one single IP address (e.g. due to NAT traversal issue for UDP based services) • Perform Heartbeating b/w VRRP master nodes and move EIP upon failover Request flow Availability Zone Availability Zone VPC Subnet LVS + keepalived WebWebWeb 172.31.64.0/20 Primary: 172.31.78.101 VRRP LVS + keepalived Secondary: 172.31.78.1 Primary: 172.31.78. 100
  • 22. Concluding remarks VPC gives you freedom on L2 which allows: • L2 NAT • L2 addressing • Pseudo Broadcast/Multicast Pseudo IP Multicast enables most applications which require IP multicast • Confirmed LVS + Keepalived works well LVS has advantages over other LBs depending on use cases • Don’t forget to build Multi-AZ architecture Use VPC and get more options for architecting!