pavel cimbál, sven ubik cesnet tnc2005, poznan, 9 june 2005 tools for tcp performance debugging

18
Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Upload: caitlin-patrick

Post on 05-Jan-2016

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Pavel Cimbál, Sven Ubik CESNET

TNC2005, Poznan, 9 June 2005

Tools for TCP performance debugging

Page 2: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Monitoring

Looking for performance limitations in different placesrequires different monitoring approaches communication segment monitoring type

• available bandwidth in network active & passive

• faulty network component active

• transport protocol behaviour* passive & end-host

• PC hardware performance end-host

• application & OS overhead end-host

* subject of this talk

Page 3: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

TCP monitoring

TCP performance debugging tools:

• tcpdump + tcptrace + xplot

requires root access, follow-up analysis

loads CPU, can miss packets

• bulk• AIMD patch

Page 4: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Bulk tool

bulk: achievable throughput measurement (iperf-like)

+ synchronous monitoring of TCP runtime variables

• Reads kernel variables after each write() or read() call

• Does not require any kernel patch or root access

• Real-time analysis

• Low CPU overhead

• Can work together with AIMD patch to get more

information and to configure AIMD

Page 5: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Using bulk tool

Server side:bulk

Client side:bulk –c <hostname>

Set any socket option at any level: -s <optionlevel>,<optionname>

[,<initialiser1>[,<initialiser2> …]]

Get any socket option at any level: -g <optionlevel>,<optionname>

[,<member1>[,<member2> …]]

Page 6: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Option names for SOL_TCP level:

"TCP_NODELAY","TCP_MAXSEG","TCP_CORK","TCP_KEEPIDLE","TCP_KEEPINTVL","TCP_KEEPCNT","TCP_SYNCNT","TCP_LINGER2","TCP_DEFER_ACCEPT","TCP_WINDOW_CLAMP","TCP_INFO","TCP_QUICKACK"

Option members for TCP_INFO option:

"state","ca_state","retransmits","probes","backoff","options","wscales","rto","ato","snd_mss","rcv_mss","unacked","sacked","lost","retrans","fackets","last_data_sent","last_ack_sent","last_data_recv","last_ack_recv","pmtu","rcv_ssthresh","rtt","rttvar","snd_ssthresh","snd_cwnd","advmss","reordering"

Selected options to query

Page 7: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

cwnd, ssthresh monitoring

bulk –gTCP_INFO,snd_cwnd,snd_ssthresh

Page 8: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Checking window scaling

195.113.147.2.50622 > 130.59.35.14.3141: S 1245641034:1245641034> (0) win 5840 <mss 1460,sackOK,timestamp 898882455 0,nop,wscale 4>

130.59.35.14.3141 > 195.113.147.2.50622: S 3938568209:3938568209> (0) ack 1245641035 win 17896 <mss 8960,sackOK,timestamp 1759960799> 898882455,nop,wscale 7>

bulk –gTCP_INFO,wscales

71

= 0x47, client wscale: 4, server wscale: 7

Page 9: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Bulk selected switches

-r reverse transfer, server to client

-b<block_size> block size for write(), read(),

adjusts result granularity!!

-c<connections> number of connectionsin sequence and/or in parallel

-m parallel mode

Page 10: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Added CPU load

% time seconds usecs/call calls syscall------ ----------- ----------- --------- -------------- 81.53 4.148857 61 67595 write 8.45 0.429789 6 66916 getsockopt 4.97 0.253101 4 66918 gettimeofday 0.00 0.000253 253 1 poll

strace –c bulk –gTCP_INFO,. . .

sending data

monitoring (+some user space load)

with bigger block size (-b) monitoring is less frequent

Page 11: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

• Configuration of AIMD(x,y) parameters

cwnd=cwnd+x*MSS per ACK

cwnd=cwnd*y per packet loss

• Congestion Window Validation (CWV) and

Congestion Window Reduction (CWR) on / off / monitoring

• Works on a per-socket or per-system basis

• Available for Linux 2.4 and 2.6

AIMD patch

Page 12: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Example of per-system configuration:

sysctl –w net/ipv4/tcp_aimd 100 50 1 1

100% additive increase, 50% multiplicative decrease,CWV on, CWR on

AIMD patch, cont.

Page 13: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Example of per-socket configuration:

struct tcp_aimd aimd;

aimd.slope=100;aimd.ratio=50;aimd.cwven=1;aimd.cvwren=1;

setsockopt(sockfd, SOCK_TCP, TCP_AIMD, &aimd, sizeof(aimd));

AIMD patch, cont.

Page 14: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

AIMD tuning

cesnet.cz → switch.ch, RTT=40 ms, win=4MB

aggressiveness vs. responsiveness vs. fairness

Page 15: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Download bulk + AIMD patch at:

www.ces.net/project/qosip#bulk

Future directions:

• Add hardware end-host monitoring (using PAPI and other

tools)

• Downloadable PC monitoring agent

Download and future work

Page 16: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Pavel Cimbal <[email protected]> Sven Ubik <[email protected]>

Thank you for your attention

Page 17: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Backup slides

Page 18: Pavel Cimbál, Sven Ubik CESNET TNC2005, Poznan, 9 June 2005 Tools for TCP performance debugging

Per-socket monitoring:

struct tcp_counters counters;

wsize=sizeof(counters);

getsockopt(sockfd, SOCK_TCP, TCP_COUNTER, &counters, &wsize);

AIMD patch, cont.