Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Layer 4-7
F5
Layer4-7
Switch
4-7
NetScale 4-7
r
LVS
HAProxy 4-7
2/29
Schedule
Basically
Persistence
SNAT/RNAT
Server Protection
ACL/Content Switch
GSLB
Performance
3/29
We are here
LB related
Persistence
Basically
SNAT/RNAT
Server Protection
GSLB
ACL/CS
4/29
Hardware/GUI/CLI/HA
Commercial
F5
NetScaler
Hardware
GUI
CLI
HA
5/29
Open Source
LVS
HAProxy
6/29
pid
We are here
LB related
Persistence
Basically
SNAT/RNAT
Server Protection
GSLB
ACL/CS
7/29
Concepts
Monitor
Incoming
request
Availability requirement
SNAT/NAT
VIP
VIP
192.168.101.1
192.168.101.2
Priority-based member
activation virtual server
192.168.101.1:443
ACTION of service
down
Intelligent
Traffic
Control
pool
pool
Pool/pool
member member member
member
(server=
(server=
(server=
(server=
member
statistics
10.1.1.1:80) 10.1.1.2:80) 10.1.1.3:80)
10.1.1.4:80)
(name=
ssl_boxes)
member
member
(server=
(server=
10.1.1.5:80) 10.1.1.6:80)
8/29
member
member
(look at URL,
client IP addr.,
etc.)
member
(server=
(server=
(server=
10.1.1.1:443) 10.1.1.2:443) 10.1.1.6:443)
Load
Balancing
pool
Port-based
Traffic
Direction
virtual server
192.168.101.1:80
IP Addr.based
Traffic
Direction
Monitors
Monitor
Simple
ECV
EAV
ICMP/GW
ICMP/TCP
ECHO
TCP/HTTP/HTT /FTP
PS
LTM
/IMAP/LDAP/M
SSQL/NNTP/O
racle/POP3/R
ADIUS/Real
Server/SIP/SM
TP/SOAP/WMI
monitor
9/29
HAProxy Monitor
http://www.chinaunix.net
10/29
Updating...
12/29
We are here
LB related
Persistence
Basically
SNAT/RNAT
Server Protection
GSLB
ACL/CS
14/29
Persistence
TCP handshake
First Hit
pick
server
TCP handshake
Second Hit
specifies
MSRDP
TCP handshake
HTTP request (with same cookie)
server
server webD
192.168.1.14:80
cookie
D
check
SSL persistence
HTTP/1.1 200 OK
Universal persistence
HTTP reply (no cookie)
HTTP/1.1 200 OK
HTTP reply (updated cookie)
15/29
Server A
RNAT
External vlan
backend transparent_ssl1
# Connect to the
SSL
farm from the client's source address
MAPPED
IP: 10.10.1.1
source 192.168.1.200 usesrc clientip
SNAT
server railsA 192.168.1.11:80
sourceInternal
192.168.1.201
check
vlan
eth0: 10.10.1.2
server railsB 192.168.1.12:80 minconn 4 maxconn 12 check
server railsC 192.168.1.13:80 minconn 4 maxconn 12 check
eth1: 192.168.1.2
16/29
We are here
LB related
Persistence
Basically
SNAT/RNAT
Server Protection
GSLB
ACL/CS
17/29
Server Protection
Attack (SYN Flood)listen appfarm 192.168.1.1:80
Syn Proxy
mode http
F5
Connection Limit maxconn 10000ACL/iControl/iRules
option httpclose
Timeout
Surge Queue
Slow Start
option abortonclose
NetScal Syn Cookie/TCP
option forwardfor
er
offload/Content
balance roundrobin
Filter/ACL
server railsA 192.168.1.11:80
minconn 4 maxconn 12 check
server
LVSrailsB 192.168.1.12:80
Iptables?minconn 4 maxconn 12 check
server railsC 192.168.1.13:80 minconn 4 maxconn 12 check
contimeout
HAProx60000
ACL
weight
maxconn
18/29
Timeout
Timeout client
Client
timeout clitimeout
timeout connect
( )
timeout contimeout
timeout http-request
timeout server
HTTP (
header DDoS
)
timeout srvtimeout
timeout tarpit
19/29
reqtarpit
proxy
timeout queue
server
We are here
LB related
Persistence
Basically
SNAT/RNAT
Server Protection
ACL/CS
20/29
GSLB
HAProxy ACL
Layer 4 and below
Layer 7 Content
eq 0
src/dst acl missing_cl hdr_cnt(Content-length)
method
src_port/dst_port
block if METH_GET HTTP_CONTENT
req_ver
nbsrv(backend)
and to every request on the "img", "video",url_*
"download" and "ftp" hosts :
url_static path_beg
Layer 4aclContent
acl url_static path_end
req_lenacl host_www
hdr_*
hdr_beg(host) -i www
Pre-defined ACL
HTTP_1.1
wait_end
# now use backend "static" for all static-only hosts, and for static urls
if host_www
21/29
backend stats
22/29
We are here
LB related
Persistence
Basically
SNAT/RNAT
Server Protection
ACL/CS
23/29
GSLB
Illu
s
GSLB
CDN
24/29
tra
te
Performance
Keep-Alive
Compression
In-memory Cache
Server Offload
TCP Buffering
25/29
Logging
listen proxy-out
mode http
option httplog
option logasap
log global
server cache1 192.168.1.1:3128
# log the name of the virtual server
capture request header Host len 20
# log the amount of data uploaded during a POST
capture request header Content-Length len 10
# log the beginning of the referrer
capture request header Referer len 20
# server name (useful for outgoing proxies only)
capture response header Server len 20
# logging the content-length is useful with "option logasap"
capture response header Content-Length len 10
# log the expected cache behaviour on the response
capture response header Cache-Control 26/29
len 8
reqdel
reqdeny
reqpass
reqtarpit
reqsetbe
reqisetbe
reqirep
reqidel
reqideny
reqipass
reqiallow
reqitarpit
reqadd
rsp*
27/29
28/29
Bibliography
[5] F5 Networks:
[6] Citrix:
THE END
29/29