More Related Content
Similar to Before OTD EDU Assignments (20)
Before OTD EDU Assignments
- 1. <Insert Picture Here>
2. Assignment / Homework made by OTD Teacher
(사전 백그라운드)
for Oracle ACS & Partner
이범 beom.lee@oracle.com
Oracle Fusion Middleware
- 2. Agenda
• Load Balancer Topology
• OTD vs HAProxy vs NetScaler …
• Linux Virtual Server
• Solaris Crossbow
Copyright © Oracle Corporation, 2014. All rights reserved.
- 4. 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로 변조하여 응답
x.x.1.1 (C)
Client
(User)
x.x.1.1 (C)
S-IP
D-MAC
C
C
S-IP
LB – VIP
x.x.10.10 (L)
D-MAC
S
L
x.x.1.1
S-MAC
x.x.10.1 (R)
D-IP
x.x.10.10
x.x.10.10
S-MAC
LB – VIP
x.x.10.10 (L)
S-IP
D-IP
x.x.1.1
x.x.10.1 (R)
Client
(User)
D-IP
x.x.10.15
x.x.1.1
D-MAC
S-MAC
D-MAC
C
Copyright © Oracle Corporation, 2014. All rights reserved.
x.x.10.15
S-MAC
Real
Real
Server
Server
D-IP
x.x.1.1
x.x.10.15 (S)
S-IP
S
S
C
x.x.10.15 (S)
Real
Real
Server
Server
- 5. Inline – Router Mode
• 다른 네트워크 대역 내에서의 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로 변조하여 응답
x.x.1.1 (C)
Client
(User)
x.x.1.1 (C)
S-IP
D-MAC
C
LB – VIP x.x.10.1
x.x.10.10 (L1)
x.x.20.10 (L2)
x.x.20.1
D-MAC
L1
L1
x.x.1.1
S-MAC
x.x.10.1 (R)
D-IP
x.x.10.10
x.x.10.10
S-MAC
LB – VIP x.x.10.1
x.x.10.10 (L1)
x.x.20.10 (L2)
x.x.20.1
S-IP
D-IP
x.x.1.1
x.x.10.1 (R)
Client
(User)
C
S-IP
D-IP
x.x.20.15
x.x.20.15
x.x.1.1
S-MAC
D-MAC
S-MAC
D-MAC
L2
Real
Real
Server
Server
D-IP
x.x.1.1
x.x.20.15 (S)
S-IP
S
S
L2
네트워크 대역이 다르기
때문에 Source Mac도 변조
Copyright © Oracle Corporation, 2014. All rights reserved.
x.x.20.15 (S)
Real
Real
Server
Server
- 6. One-Arm Mode – Full NAT
• 네트워크 구성 변경이 없어 Inline 모드보다는 구성 용이
• LB 입장에서의 Request / Response
•
•
Request : LB가 Real Server으로 Balancing할 때 Destination IP를 Real Server의 IP / Mac으로 변조하여 송신
Response : LB가 Real Server로부터 응답을 받아서 Source IP만 LB의 VIP로 변조하여 응답
x.x.1.1 (C)
Client
(User)
x.x.1.1 (C)
Client
(User)
S-IP
S-IP
D-IP
x.x.1.1
x.x.10.10
x.x.10.10
x.x.1.1
S-MAC
D-MAC
S-MAC
D-MAC
C
x.x.10.1 (R)
D-IP
L1
L1
C
LB – VIP
x.x.10.10 (L1)
x.x.20.20 (L2)
….
x.x.10.1 (R)
LB – VIP
x.x.10.10 (L1)
x.x.20.20 (L2)
….
S-IP
S-IP
D-IP
x.x.20.20
x.x.20.35
x.x.20.35
x.x.20.20
S-MAC
x.x.20.35 (S)
D-IP
D-MAC
S-MAC
D-MAC
L2
S
S
L2
Real
Real
Server
Server
Copyright © Oracle Corporation, 2014. All rights reserved.
x.x.20.35 (S)
Real
Real
Server
Server
- 7. L2 DSR(Direct Server Return) Mode
• 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로 변조하여 응답
LB – VIP (L)
x.x.10.10
Real Server에 LB의 VIP로
Loopback Alias 만드는 이유
•
•
ARP로 Mac 주소 Broadcasting 방지
Real Server에서 LB의 VIP로 패킷을
내보내기 위한 Interface
S-IP
D-IP
S-IP
D-IP
x.x.1.1
x.x.10.10
x.x.1.1
x.x.10.10
S-MAC
D-MAC
S-MAC
D-MAC
R
L
L
S
x.x.1.1 (C)
Client
(User)
x.x.10.1 (R)
x.x.10.15 (S)
S-MAC
S-IP
D-IP
S1
Copyright © Oracle Corporation, 2014. All rights reserved.
D-MAC
R
x.x.10.10
x.x.1.1
Configure
Loopback Alias
x.x.10.10
Real
Real
Server
Server
Listen IP
x.x.10.10
- 8. L3 DSR(Direct Server Return) Mode
• 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 만드는 이유
•
•
LB – VIP (L)
x.x.10.10
Configure DSCP
ARP로 Mac 주소 Broadcasting 방지
Real Server에서 LB의 VIP로 패킷을
내보내기 위한 Interface
S-IP
D-IP
S-IP
D-IP
x.x.1.1
x.x.10.10
x.x.1.1
x.x.20.15
S-MAC
D-MAC
S-MAC
D-MAC
R
L
L
S1
Real Server iptables
rewrite rule : x.x.10.10
x.x.1.1 (C)
Client
(User)
x.x.10.1 (R)
x.x.20.15 (S1)
S-MAC
D-MAC
S-IP
D-IP
S1
R
x.x.10.10
x.x.1.1
DSCP(Differentiated Services Code Point) 이용 방식
Copyright © Oracle Corporation, 2014. All rights reserved.
Configure
Loopback Alias
x.x.10.10
Real
Real
Server
Server
Listen IP
x.x.10.10
x.x.30.15 (S2)
Real
Real
Server
Server
L3 DSR
Kernel
Module
구성 필요
- 9. 참고 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
Copyright © Oracle Corporation, 2014. All rights reserved.
- 10. L3 DSR(Direct Server Return) Mode
•
•
•
IP in IP라는 IP Tunneling 프로토콜 이용 방식
받은 IP Packet을 한번 더 IP 헤더를 붙여서 전달하는 방식
Outer IP 헤더에 Destination IP를 Real Server IP로
설정하여 실제 Real Server로 전달될 수 있게 함
•
•
•
•
•
Outer
IP Header
Inner
IP Header
IP Payload
LB는 Inner IP 헤더의 TOS 값을 Outer IP 헤더에 복사
이를 위해서는 Real Server에 IP in IP를 처리할 수
있는 Kernel Module을 구성 필요
DSCP(Differentiated Services Code Point) 이용 방식
IP in IP을 이용하는 방식과의 주요
차이는 Outer IP 헤더가 없는 것임
추가적인 Outer IP 헤더가 붙지
않기 때문에 특별히 Fragmentation에
대한 대비를 할 필요가 없음
참고 사항 : 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 )
Copyright © Oracle Corporation, 2014. All rights reserved.
참고
•
•
•
•
•
•
•
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/NANOG51.
Talk45.nanog51-Schaumann.pdf
http://www.tucny.com/Home/dscp-tos
http://tools.ietf.org/html/rfc2474 & http://tools.ietf.org/html/rfc2475
- 11. 참고 : 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.html
Copyright © Oracle Corporation, 2014. All rights reserved.
- 12. Physical Load Balancer Topology
NAT-based, route-path, one-armed SLB
NAT-based, route-path, two-armed SLB
http://oreilly.com/catalog/serverload/chapter/ch07.html
Copyright © Oracle Corporation, 2014. All rights reserved.
- 13. Physical Load Balancer Topology
NAT-based network topology with DSR
redundancy scenario
http://oreilly.com/catalog/serverload/chapter/ch07.html
Copyright © Oracle Corporation, 2014. All rights reserved.
- 14. OTD vs HAProxy vs NetScaler
Copyright © Oracle Corporation, 2014. All rights reserved.
- 15. OTD vs HAProxy vs NetScaler
Copyright © Oracle Corporation, 2014. All rights reserved.
- 19. Solaris Crossbow – Network Cloud
Copyright © Oracle Corporation, 2014. All rights reserved.
- 20. 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
Copyright © Oracle Corporation, 2014. All rights reserved.
Stateless DSR Topology
- 21. Thanks to
DSR에 많은 정보와 도움을 주신 후배 이태근님에게
감사의 인사를 전하며…
Copyright © Oracle Corporation, 2014. All rights reserved.