21
<Insert Picture Here> 2. Assignment / Homework made by OTD Teacher ( 사사 사사사사사 ) for Oracle ACS & Partner 사사 [email protected] Oracle Fusion Middleware

Before OTD EDU Assignments

Embed Size (px)

DESCRIPTION

내부 임직원 및 OFM 파트너 엔지니어들에게 Oracle Traffic Director 교육을 진행하기에 앞서 만든 사전 교육 자료로 general하고 public한 내용들이라 해당 분야의 분들에게 공유함

Citation preview

Page 1: Before OTD EDU Assignments

<Insert Picture Here>

2. Assignment / Homework made by OTD Teacher ( 사전 백그라운드 )

for Oracle ACS & Partner이범 [email protected]

Oracle Fusion Middleware

Page 2: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Agenda

• Load Balancer Topology

• OTD vs HAProxy vs NetScaler …

• Linux Virtual Server

• Solaris Crossbow

Page 3: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Load Balancer Topology• Inline• One-Arm• DSR(Direct Server Return)

Page 4: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Inline – Bridge(Transparent) Mode• 같은 네트워크 대역 내에서의 Inline 구성 – Half NAT• LB 입장에서의 Request / Response

• Request : LB 가 Real Server 으로 Balancing 할 때 Destination IP 를 Real Server IP / Mac으로 변조하여 송신

• Response : LB 가 Real Server 로부터 응답을 받아서 Source IP 만 LB 의 VIP 로 변조하여 응답

Client(User)

RealServer

RealServer

S-IP D-IP

x.x.1.1x.x.10.

10

S-MAC D-MAC

C L

LB – VIPx.x.10.10 (L)

x.x.10.15 (S)

x.x.1.1 (C)

x.x.10.1 (R)

S-IP D-IP

x.x.1.1x.x.10.

15

S-MAC D-MAC

C S

Client(User)

RealServer

RealServer

S-IP D-IP

x.x.10.10

x.x.1.1

S-MAC D-MAC

S C

LB – VIPx.x.10.10 (L)

x.x.10.15 (S)

x.x.1.1 (C)

x.x.10.1 (R)

S-IP D-IP

x.x.10.15

x.x.1.1

S-MAC D-MAC

S C

Page 5: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Inline – Router Mode

Client(User)

RealServer

RealServer

S-IP D-IP

x.x.1.1x.x.10.

10

S-MAC D-MAC

C L1

LB – VIPx.x.10.10 (L1)x.x.20.10 (L2)

x.x.20.15 (S)

x.x.1.1 (C)

x.x.10.1 (R)

S-IP D-IP

x.x.1.1x.x.20.

15

S-MAC D-MAC

L2 S

Client(User)

RealServer

RealServer

S-IP D-IP

x.x.10.10

x.x.1.1

S-MAC D-MAC

L1 C

LB – VIPx.x.10.10 (L1)x.x.20.10 (L2)

x.x.20.15 (S)

x.x.1.1 (C)

x.x.10.1 (R)

S-IP D-IP

x.x.20.15

x.x.1.1

S-MAC D-MAC

S L2

x.x.20.1

x.x.10.1

x.x.20.1

x.x.10.1

• 다른 네트워크 대역 내에서의 Inline 구성 – Half NAT• LB 입장에서의 Request / Response

• Request : LB 가 Real Server 으로 Balancing 할 때 Destination IP/Mac 를 Real Server IP / Mac 으로 변조하고 네트워크 대역이 다르기 때문에 Source Mac 도 변조하여 송신

• Response : LB 가 Real Server 로부터 응답을 받아서 Source IP 만 LB 의 VIP 로 변조하여 응답

네트워크 대역이 다르기 때문에 Source Mac 도

변조

Page 6: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

One-Arm Mode – Full NAT

Client(User)

RealServer

RealServer

LB – VIP x.x.10.10 (L1)x.x.20.20 (L2)

….

x.x.20.35 (S)

x.x.1.1 (C)

x.x.10.1 (R)

S-IP D-IP

x.x.20.20

x.x.20.35

S-MAC D-MAC

L2 S

Client(User)

RealServer

RealServer

LB – VIP x.x.10.10 (L1)x.x.20.20 (L2)

….

x.x.20.35 (S)

x.x.1.1 (C)

x.x.10.1 (R)

S-IP D-IP

x.x.20.35

x.x.20.20

S-MAC D-MAC

S L2

S-IP D-IP

x.x.1.1x.x.10.

10

S-MAC D-MAC

C L1

S-IP D-IP

x.x.10.10

x.x.1.1

S-MAC D-MAC

L1 C

• 네트워크 구성 변경이 없어 Inline 모드보다는 구성 용이• LB 입장에서의 Request / Response

• Request : LB 가 Real Server 으로 Balancing 할 때 Destination IP 를 Real Server 의 IP / Mac으로 변조하여 송신

• Response : LB 가 Real Server 로부터 응답을 받아서 Source IP 만 LB 의 VIP 로 변조하여 응답

Page 7: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

L2 DSR(Direct Server Return) Mode

Client(User)

x.x.1.1 (C)

RealServer

RealServer

LB – VIP (L)x.x.10.10

x.x.10.15 (S)

S-IP D-IP

x.x.1.1x.x.10.

10S-MAC D-MAC

R L

S-IP D-IP

x.x.1.1x.x.10.

10S-MAC D-MAC

L S

• DSR 모드는 송신 패킷에 비해 응답 패킷이 큰 Streaming, Multi-Media 및 Voice Over IP에서 주로 사용되는 모드로 LB 를 통하지 않고 Client 로 바로 응답하는 메커니즘을 사용

• LB 와 Real Server 가 동일 네트워크 대역 내에 있어야 함 ( 소규모용 )• LB 입장에서의 Request / Response

• Request : LB 가 Real Server 으로 Balancing 할 때 Destination IP 를 Real Server 의 Mac 으로 변조하여 송신

• Response : Real Server 가 LB 를 통하지 않고 Source IP 를 LB 의 VIP 로 변조하여 응답• Real Server 에 LB 의 VIP 로

Loopback Alias 만드는 이유• ARP 로 Mac 주소 Broadcasting 방지• Real Server 에서 LB 의 VIP 로 패킷을

내보내기 위한 Interface

x.x.10.1 (R)

S-IP D-IP

x.x.10.10

x.x.1.1

S-MACD-

MAC

S1 R

Listen IPx.x.10.10

ConfigureLoopback Alias

x.x.10.10

Page 8: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

L3 DSR(Direct Server Return) Mode

Client(User)

x.x.1.1 (C)

RealServer

RealServer

LB – VIP (L)x.x.10.10

Configure DSCP

x.x.10.1 (R) x.x.20.15 (S1)

S-IP D-IP

x.x.1.1x.x.10.

10S-MAC D-MAC

R L

S-IP D-IP

x.x.10.10

x.x.1.1

S-MACD-

MAC

S1 R

S-IP D-IP

x.x.1.1x.x.20.

15S-MAC D-MAC

L S1Configure

Loopback Aliasx.x.10.10

RealServer

RealServer

x.x.30.15 (S2)

Real Server iptablesrewrite rule : x.x.10.10

• LB 와 Real Server 가 동일 네트워크 대역 내에 있지 않기 때문에 확장 용이 ( 대규모용 )• LB 입장에서의 Request / Response

• Request : LB 가 Real Server 으로 Balancing 할 때 Destination IP 를 Real Server IP / Mac 으로 변조하여 송신

• Response : Real Server 가 LB 를 통하지 않고 Source IP 를 LB 의 VIP 로 변조하여 응답• Real Server 에 LB 의 VIP 로

Loopback Alias 만드는 이유• ARP 로 Mac 주소 Broadcasting 방지• Real Server 에서 LB 의 VIP 로 패킷을

내보내기 위한 Interface

Listen IPx.x.10.10

DSCP(Differentiated Services Code Point) 이용 방식

L3 DSRKernelModule 구성 필요

Page 9: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

참고 DSR – Mac Address Issues

• DSR 에서 LB 의 VIP IP 주소를 Real Server 에서 Loopback alias 로 아래와 같이 설정• ifconfig lb_vip_vnic up• ifconfig lb_vip_vnic :0 inet <LB VIP> netmask 255.255.255.255 up

• Real Server 에서 LB 의 VIP IP 주소를 Loopback alias 로 구성했지만 ARP Broadcasting 이 발생하여IP 가 중복 이슈가 있을 수도 있어서 아래와 같이 ARP Broadcasting 을 막도록 설정

• echo 1 > /proc/sys/net/ipv4/conf/lb_vip_vnic/arp_ignore• echo 2 > /proc/sys/net/ipv4/conf/lb_vip_vnic/arp_announce

• 참고 사항 : 위의 방법대로 설정했음에도 불구하고 ARP 이슈가 해결되지 않을 때는 아래의 URL 참조• RedHat 5 와 RedHat 6 의 설정값 의미가 변동• https://www.centos.org/forums/viewtopic.php?t=8401 에서 발췌

• Both RHEL6 and RHEL5 ship with a default /etc/sysctl.conf that sets this sysctl to 1, but the meaning of this value is different between the RHEL6 and the RHEL5 kernel.

• The problem is in a modification of rp_filter in RHEL 6. rp_filter = 1 worked fine in RHEL 5 and earlier versions. With RHEL 6 rp_filter needs to be set to 0 or 2

Page 10: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

L3 DSR(Direct Server Return) Mode• IP in IP 라는 IP Tunneling 프로토콜 이용 방식• 받은 IP Packet 을 한번 더 IP 헤더를 붙여서 전달하는 방식• Outer IP 헤더에 Destination IP 를 Real Server IP 로

설정하여 실제 Real Server 로 전달될 수 있게 함• LB 는 Inner IP 헤더의 TOS 값을 Outer IP 헤더에 복사• 이를 위해서는 Real Server 에 IP in IP 를 처리할 수

있는 Kernel Module 을 구성 필요

OuterIP

Header

InnerIP Header

IP Payload

참고 URL• http://en.wikipedia.org/wiki/IP_in_IP• http://en.wikipedia.org/wiki/Type_of_service• https://github.com/yahoo/l3dsr• http://bogpeople.com/networking/dscp.shtml• http://www.nanog.org/meetings/nanog51/presentations/Monday/NANO

G51.Talk45.nanog51-Schaumann.pdf• http://www.tucny.com/Home/dscp-tos• http://tools.ietf.org/html/rfc2474 & http://tools.ietf.org/html/rfc2475

참고 사항 : DiffServ uses the 6-bit Differentiated services Field(DS field) in the IP header for packet classification purposes.The DS field and ECN field replace the outdated IPv4 TOS field.(RFC 3260 : http://tools.ietf.org/html/rfc3260 )

• DSCP(Differentiated Services Code Point) 이용 방식• IP in IP 을 이용하는 방식과의 주요

차이는 Outer IP 헤더가 없는 것임• 추가적인 Outer IP 헤더가 붙지

않기 때문에 특별히 Fragmentation 에대한 대비를 할 필요가 없음

Page 11: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

참고 : Citrix NetScaler DSR Mode• Brocade(Foundry), Alteon, F5 등등의 Load Balancer 장비들은 DSR 모두를 제공하고 있으며

요즘 대부분의 Load Balancer 장비들은 TOS(DSCP) 와 IP in IP(IP over IP) 방식 모두 제공하고 있음 .• 예로 NetScaler 를 살펴봐도 모두 제공함 .

• http://support.citrix.com/proddocs/topic/netscaler-load-balancing-93/ns-lb-usecases-dsrmode-con.html• http://support.citrix.com/proddocs/topic/netscaler-load-balancing-93/ns-lb-usecases-dsrmode-tos-tsk.html• http://support.citrix.com/proddocs/topic/netscaler-load-balancing-93/ns-lb-usecases-dsrmode-tos-ipoverip-con.h

tml

Page 12: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

http://oreilly.com/catalog/serverload/chapter/ch07.html

Physical Load Balancer Topology

NAT-based, route-path, one-armed SLBNAT-based, route-path, two-armed SLB

Page 13: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

http://oreilly.com/catalog/serverload/chapter/ch07.html

Physical Load Balancer Topology

NAT-based network topology with DSR

redundancy scenario

Page 14: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

OTD vs HAProxy vs NetScaler

Page 15: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

OTD vs HAProxy vs NetScaler

Page 16: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Linux Virtual Server

Page 17: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Linux Virtual Serverhttps://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Virtual_Server_Administration/index.html

LVS Implemented with Direct Routing (same as DSR)

Basic LVS Configuration

Three-Tier LVS Configuration

LVS Implemented with NAT Routing

LVS Components

Page 18: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Solaris Crossbow

Page 19: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Solaris Crossbow – Network Cloud

Page 20: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Solaris Crossbow – Network Cloud

• http://docs.oracle.com/cd/E26502_01/html/E28993/gmhbd.html#gmhiq• Stateless DSR topology• NAT mode (full-NAT and half-NAT) topology

NAT mode Topology Stateless DSR Topology

Page 21: Before OTD EDU Assignments

Copyright © Oracle Corporation, 2014. All rights reserved.

Thanks to

DSR 에 많은 정보와 도움을 주신 후배 이태근님에게감사의 인사를 전하며…