page 1 network tuning parameter 2002. 9. 17 강사 : 최원규 과장 hpcs/tsec
TRANSCRIPT
Page 1
Network Tuning Parameter
2002. 9. 17
강사 : 최원규 과장
HPCS/TSEC
Page 2
Agenda
1. Ndd parameter
2. Oracle DB Server Tuning
3. Web Server Tuning
4. ndd parameter for security
5. 100BT NIC configuration
6. Nettl trace
7. APA
8. Utilization 측정
Page 3
NetworkTuning
Parameter NDD Parameter
The command ndd is a networking configuration tool used to customize the behavior of the networking kernel. To make the 11i system more internet friendly and easier to get running "out of the box", some of the ndd tunables have been enhanced.
Network parameter 를 “ tune” 할 수 있는 tool
Page 4
NetworkTuning
Parameter NDD / IP
ip_forwarding
HP hosts 가 gateway 로 사용시 IP 을 forward 할 것인가 말것인가 .
0 -> forward 안함 . 1 -> forward 함 . 2 -> Interface 가 2 이상인 경우에만 forward 함 .
Ver Min Max Default
11.0 0 2 2
11.i 0 2 2
Page 5
NetworkTuning
Parameter NDD / IP
ip_ire_gw_probe
Turns the Dead Gateway Detection on and off. HP-UX 11.0 에서는 default gateway 를 ICMP 을 이용하여 주기적으로 check 하는데 일부 router 의 경우 ICMP 에 응답을 하지 않는 경우가 있는데 대개의 경우 Firewall 에서 default router 로 ping 이 않되게 setting 하는 경우가 대부분 . 그때 이 시간을 넘어서면 router 넘어로 network connection fail.
Ver Min Max Default
11.0 0 1 1
11.i 0 1 1
Page 6
NetworkTuning
Parameter NDD / IP
ip_pmtu_strategy 0 -> any non-local networks have a maximum MTU of 576
1 -> All outbout packet 에 DF(Don't Fragment) 를 set 한다 . 의미는 HP machine 의 outbound MTU size 를 그대로 두라는 것이다 . destination 과 HP machine 사이의 MTU size 값이 틀려 fragmenetion
이 필요한 필요한 경우 router 로 부터 ICMP Fragmentation Needed 를 받으면 IP 는 MTU size 을 수정한다 . 이를 지원하지 않는 router 의 경우는 순차적으로 작은 MTU 을 사용한다 . 2 -> Disable
3 -> pmtu option "-p“
Ver Min Max Default
11.0 0 3 1
11.i 0 3 1
Page 7
NetworkTuning
Parameter NDD / IP
ip_ire_gw_probe_interval
HP-UX 11.0 에서는 default gateway 를 ICMP 을 이용하여 주기적으로 check하는데
일부 router 의 경우 ICMP 에 응답을 하지 않는 경우가 있는데 대개의 경우 Firewall 에서 default router 로 ping 이 않되게 setting 하는 경우가 대부분 . 그때 이 시간을 넘어서면 router 넘어로 network connection fail. IBM 2212 router 에 VRRP(Virtaul Router Redundancy Protocol RFC 2338) 을 enable 한 경우 primary router 에 문제가 발생하여 backup 으로 넘어가는 경우 이 backup router 에서 ICMP ECHO reply 을 하지 않음으로 HP machin 에서 gateway 를 인식하지 못함 . CISCO 의 HSRP(Hot Standby Routing Protocol) 에서 firewall 로 ICMP Reply 을 disable 한 경우 .
Ver Min Max Default
11.0 15000 X 180000
11.i 15000 X 180000
Page 8
NetworkTuning
Parameter NDD / IP
ip_send_source_quench
IP packets 이 처리할 수 있는 용량보다 빨리 node 에 도착하는것인데 ICMP packet 을 받아서 처리 할때 만일 ICMP 을 처리하는 Process 가 system 에 running 중인 경우 ICMP packet 을 해당 process 의 socket 에 넣는데 socket full 이 발생시 ICMP Source Quench Message 가 상대방에게 보내진다 .
이를 0 로 하면 Source Quench 을 check 하지 않는다 .
Ver Min Max Default
11.0 0 1 1
11.i 0 1 1
Page 9
NetworkTuning
Parameter NDD / IP
ip_max_bcast_ttl
Hop count 가 1 로 bcast packet 이 router 을 넘어가지 못함 . C class 로 subnet 하여 사용시 . 199.3.20 199.3.201 199.3.208 20 subnet 에서 braodcast 가 208 에 도달하게 하기위한 방법 . Broadcast 하는 program 에서 조정하는 방법 . System gloval 변수 조정 . ndd -set /dev/ip ip_max_bcast_ttl 3
Ver Min Max Default
11.0 0 255 1
11.i 0 255 1
Page 10
NetworkTuning
Parameter NDD / IP
ip_check_subnet_addr
Controls the subnet portion of a host address
RFC 1122 을 check, 즉 subnet mask 255.255.255.192 을 허용하지 않음.
0 -> RFC 1122 check 을 bypass 함 . Host IP 205.185.219.252 subnet mask 255.255.255.192.
The error he gets is: ifconfig: ioctl (SIOCSIFADDR).
RFC 1122 에 따른 Guide 을 HP 에서 준수하기 때문에 발생한 문제 .
Ver Min Max Default
11.0 0 1 0
11.i 0 1 1
Page 11
NetworkTuning
Parameter NDD / TCP
tcp_conn_request_max
Max number of outstanding connection request
동시에 Connection 을 맺을 수 있는 각 socket 에 대한 listen queue limit.
socket program 에서 listen() 에서 define 할 수 있는 최대크기 . Application 에서의 Create 한 socket port 에대한 listen queue 의 제한은
실제로 Application program 내부의 listen() 에서 사용된 size 에의해서 제한을 받는다 . / usr/include/sys/socket.h: #define SOMAXCONN 20
For a web server it might be a good idea to set this value to 1024 or higher.
Ver Min Max Default
11.0 1 undefined 20
11.i 1 undefined 20
Page 12
NetworkTuning
Parameter NDD / TCP
tcp_fin_wait_2_timeout
Ver Min Max Default
11.0
0 undefined 0
11.i 0 undefined 0
Page 13
NetworkTuning
Parameter NDD / TCP
tcp_syn_rcvd_max
Controls the SYN attack defense of TCP effective.
SYN packet 을 (SYN_RECV in netstat -a) 보관하는 table space 을 지정한다 . 여기을 거쳐서 각 socket 별로 listen queue 에 들어 간다 .
Ver Min Max Default
11.0 1 1000 500 connections
11.i 1 1000 500
Page 14
NetworkTuning
Parameter NDD / TCP
tcp_time_wait_interval
How long stream persists in TIME_WAIT
Amount of time TCP endpoints persist in TCPS_TIME_WAIT state.
netstat -an 으로 확인시 모든 TCP session 은 정상적으로 Session 이 종료시 TIME_WAIT 상태을 거치게 된다 . 이 값을 조정하는 Parameter 임 . 10.X 에서는 default 로 2MSL 을 사용하며 MSL 이 60 Second 이기에 2 분을 Waiting
하다 Session 이 netstat -an 시 보이지 않는다 . 10.x OS 에서는 조정이 불가능함 . / usr/conf/h/protosw.h: #define PR_SLOWHZ 2
/usr/conf/netinet/tcp_timer.h: #define TCPTV_MSL ( 30*PR_SLOWHZ)
Ver Min Max Default
11.0 1000 (1sec) 600000(10min) 60000 (1min)
11.i 1000 (1sec) 600000(10min) 240000 (4min)
Page 15
NetworkTuning
Parameter NDD / TCP
tcp_discon
ndd -get /dev/tcp tcp_status | grep -e state -e TCP_FIN_WAIT_2
tcp_discon - Terminate a TCP connection -> TCP session 을 disconnection 하기 위한 ndd option $ ndd -get /dev/tcp tcp_statusTCP dest snxt suna swnd cwnd rnxtrack rwnd rto mss [lport,fport] state0183b8b4 015.043.233.086 533cb8ce 533cb8ce 00008000 00003000
533bc583533bc583 00000000 02812 04096 [c00a,cea9] TCP_FIN_WAIT_2
$ ndd -set /dev/tcp tcp_discon 0x0183b8b4
Page 16
NetworkTuning
Parameter NDD / TCP
tcp_discon_by_addr
TCP session disconnection by address.
Local IP: 192.1.2.3 (0xc0010203)
Local Port: 1024 (0x0400)
Remote IP : 192.4.5.6 (0xc0040506)
Remote Port: 2049 (0x0801)
$ ndd -set /dev/tcp tcp_discon_by_addr "c00102030400c00405060801"
Page 17
NetworkTuning
Parameter NDD / Sockets
socket_buf_max
Specifies the maximum socket buffer size for AF_UNIX sockets.
Ver Min Max Default
11.0 X X X
11.i 1024 2147483647 256000
Page 18
NetworkTuning
Parameter NDD / Sockets
socket_caching_tcp
Used to enable socket caching on TCP AF_INET sockets. This value determines how many cached data structures for TCP sockets the system keeps. This could cause the system to speed up considerably if there are many short-lived connections on the system.
A value between 1 and 512 will set a minimum of 512. Any number above512 will set that value.
Ver Min Max Default
11.0 X X X
11.i 0 2147483647 0
Page 19
NetworkTuning
Parameter Oracle DB Server Tuning
Parameter Default value Suggested value
ip_send_source_quench 1 0tcp_conn_request_max 20 20000tcp_rexmit_interval_max 60000 10000tcp_rexmit_interval_min 500 1500tcp_xmit_lowater_def 8192 24576tcp_syn_rcvd_max 500 1024tcp_xmit_hiwater_def 32768 1048576
Page 20
NetworkTuning
ParameterApache 1.3.x Web Server Tuning
Parameter Default value Suggested value tcp_conn_request_max 20 1024tcp_fin_wait_2_timeout 0 (infinite) 900000tcp_ip_abort_interval 600000 60000tcp_keepalive_interval 72000000 900000tcp_rexmit_interval_initial 500 Site-specific (see note)
Page 21
NetworkTuning
ParameterNetscape & Iplanet Web Server Tining
Parameter Default value Suggested value tcp_time_wait_interval 60000 60000 tcp_conn_request_max 20 1024 --> 4096 tcp_ip_abort_interval 600000 60000tcp_keepalive_interval 72000000 900000tcp_rexmit_interval_initial 1500 1500tcp_rexmit_interval_max 60000 60000tcp_rexmit_interval_min 500 500tcp_xmit_hiwater_def 32768 32768tcp_recv_hiwater_def 32768 32768
Page 22
NetworkTuning
Parameter ndd parameter for security
Parameter Default value Suggested value Comment ip_forward_directed_broadcasts 1 0 Don't forward directed broadcasts ip_forward_src_routed 1 0 Don't forward packets with source route options ip_forwarding 2 0 Disable IP forwarding ip_ire_gw_probe 1 0 Disable dead gateway detection (currently no ndd help text; echo-requests interact badly with firewalls) ip_pmtu_strategy 1 1 Don't use echo-request PMTU strategy (can be used for amplification attacks and we don't want to send echo-requests anyway) ip_send_redirects 1 0 Don't send ICMP redirect messages (if we have no need to send redirects) ip_send_source_quench 1 0 Don't send ICMP source quench messages (deprecated) tcp_conn_request_max 20 500 Increase TCP listen queue maximum (performance) tcp_syn_rcvd_max 500 500 HP SYN flood defense ip_check_subnet_addr 1 0 Permit 0 in local network part (should be the default) ip_respond_to_address_mask_broadcast 0 0 Don't respond to ICMP address mask request broadcasts ip_respond_to_echo_broadcast 1 0 Don't respond to ICMP echo request broadcasts ip_respond_to_timestamp_broadcast 0 0 Don't respond to ICMP timestamp request broadcasts ip_respond_to_timestamp 0 0 Don't respond to ICMP timestamp requests tcp_text_in_resets 1 0 Don't send text messages in TCP RST segments (should be the default)
Page 23
NetworkTuning
Parameter 100BT configuration file
Configuration Filein /etc/rc.config.d Variables btlan hpbtlanconf xxx_INTERFACE_NAME : Name of interface (lan0, lan1...) xxx_STATION_ADDRESS : Station address of interface. This will be the MAC address
of your interface. xxx_SPEED : set the card speed. Value are : 10HD, 10FD,100HD, 100FD, auto_on.
For EISA see Note1. 11.0btlan0 -> hpeisabtconf btlan1 -> hpbasetconf btlan3 -> hpbase100conf btlan4 -> hpgsc100conf btlan5 -> hppci100conf btlan6 -> hpsppci100conf 11.I hpbtlanconf
Page 24
NetworkTuning
Parameter Nettl trace
packet 분석 tool
#nettl -start
#nettl -tn pduin pduout -e ns_ls_ip -s 1024 –tm 99999 -f /tmp/trace
-> 이러면 / tmp/trace.TRC00 와 trace1.TRC01 의 file 이 생깁니다 . 필요한 action 수행
#nettl -tf -e all
#vi /tmp/filter
filter ip_saddr 10.1.61.212
filter ip_daddr 10.1.61.212
-> 대상 장비의 IP
#netfmt -c /tmp/filter -Nlf /tmp/trace.TRC00 > /tmp/trace.txt0
Page 25
NetworkTuning
Parameter APA(Auto Port Aggregation)
1. Cisco’s Protocol for Automatic Trunk Discovery and
Automatic Link Aggregate Configuration
2. High Availability via Multiple Links with Failover Capability
3. High Availability Servers
4. Load Balancing
5. High Throughput
6. Advanced Interoperability
7. Basic Interoperability
8. Single IP Address Capability
9. Flexibility
10. Application Transparency
Page 26
NetworkTuning
Parameter APA(Example) /etc/rc.config.d/hp_apaconfHP_APA_INTERFACE_NAME[0]=lan100HP_APA_LOAD_BALANCE_MODE[0]=LB_MACHP_APA_MANUAL_LA[0]=1,2 HP_APA_HOT_STANDBY[0]=on
/etc/rc.config.d/hp_apaportconfHP_APAPORT_INTERFACE_NAME[0]=lan1HP_APAPORT_GROUP_CAPABILITY[0]=5HP_APAPORT_PRIORITY[0]=0 HP_APAPORT_CONFIG_MODE[0]=MANUAL#HP_APAPORT_INTERFACE_NAME[1]=lan2HP_APAPORT_GROUP_CAPABILITY[1]=5HP_APAPORT_PRIORITY[1]=0 HP_APAPORT_CONFIG_MODE[1]=MANUAL
/etc/rc.config.d/netconfINTERFACE_NAME[1]=lan100IP_ADDRESS[1]=150.100.1.3SUBNET_MASK[1]="255.255.0.0"BROADCAST_ADDRESS[1]=""INTERFACE_STATE[1]=upDHCP_ENABLE[1]=0
Page 27
NetworkTuning
Parameter Utilization 측정
FTP 는 performance 측정도구로 적절하지 않다 .System 에서 제공하는 command 는 lanadmin, netstat, glance
등이 있다정확한 측정은 NMS 나 analyze 가 있어야 한다 .
정확한 계산방법은 packet 의 수가 아니라 bit 수이다 . (IfInOctet + IfOutOctet) * 8 /IfSpeed * 1/100
Page 28
Thanks