Service Redundancy and Traffic Balancing Using Anycast

4,645 views
4,408 views

Published on

Presentation for Large Scale Production Engineering (#lspe) January 2012 meeting.

Published in: Health & Medicine, Technology
1 Comment
4 Likes
Statistics
Notes
  • Thanks for sharing nice post. It is good if you post configuration + Example. If any one want to know OSPF Load Balancing in broadcast network, try to bellow link, that has nice description with example + Diagram. http://gponsolution.com/ospf-load-balancing-example.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
4,645
On SlideShare
0
From Embeds
0
Number of Embeds
29
Actions
Shares
0
Downloads
81
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide
  • show route table inet 172.17.13.10 show route forwarding-table family inet destination 172.17.13.10 # show ip cef 172.17.13.10 internal # show ip cef 172.17.13.10 interface # show ip cef # show cef interface gix/x/x
  • Service Redundancy and Traffic Balancing Using Anycast

    1. 1. Service Redundancy and Traffic Balancing Using Anycast Sean Jain Ellis [email_address] Twitter @bandarji
    2. 2. Traditional Load Balancer Function <ul><li>Balances connections between servers </li></ul><ul><li>Routes requests to healthy systems </li></ul><ul><li>Handles site failure </li></ul>
    3. 3. What is Anycast? <ul><li>Anycast is a method by which dynamic routing protocols are used to direct traffic to the best candidate server or servers within a group of potential destinations, all sharing the same address. </li></ul><ul><li>Benefits </li></ul><ul><li>High availability </li></ul><ul><li>Load balancing </li></ul><ul><li>Consistent configuration </li></ul><ul><li>Dispersed deployment </li></ul>
    4. 4. Really, what is Anycast? <ul><li>Each service assigned an address </li></ul><ul><li>Same address applied to all servers ’ on loopback </li></ul><ul><li>Servers advertise host route to loopback address </li></ul><ul><ul><li>Servers become routers, integrating with infrastructure </li></ul></ul><ul><ul><li>Use zebra or quagga software daemons </li></ul></ul><ul><ul><li>Ethernet interface becomes gateway for upstream routers </li></ul></ul><ul><li>Regardless of location </li></ul><ul><ul><li>Refer client connections to service address </li></ul></ul><ul><ul><li>Routers determine server to terminate connections </li></ul></ul>
    5. 5. Anycast Addressing <ul><li>All servers share logical address 172.17.13.10. </li></ul>
    6. 6. Routers As Load Balancers <ul><li>Traffic directed to destination with least cost </li></ul><ul><li>When two or more destinations are equal </li></ul><ul><ul><li>Select gateways by round robin algorithm </li></ul></ul><ul><ul><li>Maintain connection table, ensuring server affinity </li></ul></ul><ul><li>When low cost destinations disappear </li></ul><ul><ul><li>Select gateway(s) to destination of equal, higher cost </li></ul></ul><ul><ul><li>Listen for returning low cost routes </li></ul></ul><ul><li>Why not? The hardware is already present </li></ul>
    7. 8. What You Need <ul><li>Routing protocol daemon zebra or quagga </li></ul><ul><li>Tool to monitor service </li></ul><ul><ul><li>monit, netcat, curl </li></ul></ul><ul><li>Coordination from network team </li></ul><ul><ul><li>Routing protocol parameters </li></ul></ul><ul><ul><li>SNMP access </li></ul></ul><ul><ul><li>Console (administrative) access too much to ask? </li></ul></ul>
    8. 9. Server Configuration <ul><li>First: define logical addressing scheme </li></ul><ul><li>Determine routing protocol </li></ul><ul><li>Assign an address for service </li></ul><ul><li>Configure loopback interface with service address </li></ul><ul><li>Configure routing protocol on server </li></ul>
    9. 10. Server Configuration in Detail <ul><li>Example is for CentOS host using quagga from EPEL </li></ul><ul><li>/etc/sysconfig/network-scripts/ifcfg-lo:[0-x] </li></ul><ul><li>/etc/quagga/zebra.conf </li></ul><ul><li>/etc/quagga/ospfd.conf </li></ul>
    10. 11. Sample /etc/quagga/zebra.conf <ul><li>hostname ServerA </li></ul><ul><li>interface lo:0 </li></ul><ul><li>  ip address 172.17.13.10/32 </li></ul><ul><li>interface eth0 </li></ul><ul><li>  ip address 172.17.13.40/27 </li></ul>
    11. 12. Sample /etc/quagga/ospfd.conf <ul><li>hostname ServerA </li></ul><ul><li>interface eth0 </li></ul><ul><li>  ip ospf authentication message-digest </li></ul><ul><li>  ip ospf message-digest-key 1 md5 apasswd </li></ul><ul><li>  ip ospf priority 0 </li></ul><ul><li>  ip ospf hello-interval 1 </li></ul><ul><li>  ip ospf dead-interval 4 </li></ul><ul><li>router ospf </li></ul><ul><li>  ospf router-id 172.17.12.40 </li></ul><ul><li>  area 94.40.30.0 authentication message-digest </li></ul><ul><li>  network 172.17.13.10/32 area 94.40.30.0 </li></ul><ul><li>  network 172.17.12.32/27 area 94.40.30.0 </li></ul>
    12. 13. Routing Must Be Per-Flow <ul><li>JUNOS </li></ul><ul><li>set policy-options policy-statement ecmp then load-balance per-packet </li></ul><ul><li>set routing-options forwarding-table export ecmp </li></ul><ul><li>edit forwarding-options hash-key family inet </li></ul><ul><li>  set layer-3 </li></ul><ul><li>  set layer-4 </li></ul><ul><li>cisco IOS </li></ul><ul><li>int gi0/0/0 </li></ul><ul><li>  ip load-sharing per-destination </li></ul><ul><li>router ospf 1 </li></ul><ul><li>  maximum-paths 8 </li></ul><ul><li>ip cef accounting load-balance-hash </li></ul>
    13. 14. Standby Host <ul><li>Failure of the server(s) on Network One causes routing to switch to server(s) on Network Two. Network One could be a single system with server in Network Two serving as a standby host, if per-flow routing is not an option. </li></ul>
    14. 15. Failure Recovery <ul><li>OSPF hello packets </li></ul><ul><ul><li>One second interval </li></ul></ul><ul><ul><li>Dead timer of four seconds </li></ul></ul><ul><li>Faster? Use bidirectional forwarding detection (BFD) </li></ul>
    15. 16. OSPF vs BGP <ul><li>vi vs emacs </li></ul><ul><li>Go with whatever network folks offer </li></ul><ul><li>However! </li></ul><ul><li>BGP allows for server-side policies to control traffic </li></ul><ul><li>OSPF traffic controls are configured per router interface </li></ul>
    16. 17. Thank You Sean Jain Ellis [email_address] Twitter @bandarji

    ×