Übungen zu Kommunikationssysteme
uebung5-folien.pdf
uebung5-folien.pdf
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Übungen</strong> <strong>zu</strong><br />
<strong>Kommunikationssysteme</strong><br />
Messung und Monitoring<br />
Kai-Steffen Hielscher<br />
Dr.-Ing. Falko Dreßler<br />
Lehrstuhl für Rechnernetze und <strong>Kommunikationssysteme</strong><br />
Friedrich-Alexander-Universität Erlangen-Nürnberg
Überblick<br />
• Meßaktivitäten am Lehrstuhl<br />
• Monitoring in der Leistungsbewertung<br />
• GPS-gestützes Monitoring verteilter Systeme<br />
• Netflow-Analyse, IPFIX/PSAMP (in Englisch)<br />
• Meßwerkzeuge und Benchmarks<br />
TTCP (in Englisch)<br />
NetPerf (in Englisch)<br />
NPAG<br />
HTTPerf (in Englisch)<br />
2
Meßaktivitäten am Lehrstuhl<br />
• GPS-gestützes Monitoring verteilter Systeme<br />
K. Hielscher<br />
• Monitoring-Infrastruktur für IP-Netze<br />
Filterung, Aggregation, Sampling<br />
IPFIX/PSAMP<br />
F. Dreßler<br />
• Spezifikationsgesteuertes Monitoring rekonfigurierbarer<br />
Hardware<br />
R. Hofmann<br />
• Modellgestütztes statistisches Testen<br />
Funktional, Dienstgüte<br />
W. Dulz, M. Beyer<br />
3
Methoden der Leistungsmessung<br />
• Aktives Messen<br />
Beobachtung des Objektsystems unter definierter, synthetisch<br />
erzeugter Last<br />
Benchmarking<br />
• Passives Messen<br />
Beobachtung des Objektsystems unter realer Last, ohne <strong>zu</strong>sätzlich<br />
erzeugte synthetische Last<br />
Monitoring<br />
• Ereignisgesteuerte Messung<br />
Informationsaufzeichnung beim Auftreten eines bestimmten Ereignisses<br />
z.B. Eintreffen einer Nachricht, Absenden einer Nachricht<br />
• Sampling<br />
Periodisches Aufzeichnen von Informationen<br />
z.B. Aufzeichnung der CPU-Last<br />
4
Methoden der Leistungsbewertung<br />
• Summarische Leistungswertung<br />
z.B. bei Benchmarks<br />
Kompakte Leistungsaussagen: z.B. CPU-Auslastung, Durchsatz<br />
Black-Box-Modell<br />
• Ablauforientierte Leistungsbewertung<br />
Ereignisfolgen<br />
Ereignisse: besitzen keine Dauer<br />
Aktivitäten: Beginn und Ende durch Ereignisse markiert<br />
Ereignisspur: Ereigniskennung und <strong>zu</strong>gehöriger Zeitstempel<br />
Zeitstempel<br />
1034086635.013378727<br />
1034086635.013403696<br />
1034086635.015372540<br />
Ereigniskennung und Attribute<br />
Receive ( 192.168.3.202, 54891 )<br />
Send ( 192.168.3.202, 54891 )<br />
Receive ( 192.168.3.202, 54896 )<br />
5
Ablauforientierte Leistungsmessung<br />
• Hardware-Monitoring<br />
Ereigniserkennung<br />
Generierung des Zeitstempels in Hardware<br />
Aufzeichnung der Ereignisspur<br />
Erkennung von Ereignissen auf höheren Schichten problematisch<br />
Interface<br />
Ereigniserkennung<br />
Ereignisrecorder<br />
Prozessor-Bus<br />
herausgeführter Bus<br />
Erkennt, ob ein<br />
Ereignis vorliegt<br />
(z.B. Adresse)<br />
Greift<br />
Ereigniskennung<br />
und Attribute ab<br />
(z.B. Adresse,<br />
Daten)<br />
Zeichnet<br />
Ereignisspur auf<br />
6
Hardware-Monitor ZM4<br />
Minimalkonfiguration<br />
M<br />
T<br />
G<br />
OBJ 1 OBJ 4<br />
D<br />
P<br />
U 1<br />
OBJ 5 OBJ 8<br />
D<br />
P<br />
U 1<br />
OBJ i<br />
D<br />
P<br />
U 4<br />
Takt-<br />
Kanal<br />
OBJ j<br />
D<br />
P<br />
U 1<br />
MA<br />
1<br />
: PC MA<br />
2<br />
: PC MA<br />
n<br />
:<br />
OBJ k<br />
PC<br />
D<br />
P<br />
U 4<br />
verteiltes<br />
Objektsystem<br />
verteiltes<br />
Monitorsystem<br />
ZM4<br />
Daten- und Steuernetz<br />
STAR<br />
7
Ablauforientierte Leistungsmessung<br />
• Software-Monitoring<br />
Ereigniserkennung<br />
Zeitstempelung<br />
Aufzeichnung der Ereignisse<br />
in Software auf dem Objektsystem<br />
Eventuell Verzögerungen bei Aufzeichnung von Ereignissen<br />
hardwarenaher Schichten<br />
Applikation<br />
Ereignisspuren<br />
IP Stack<br />
Uhr<br />
Ereignisaufzeichnung<br />
Betriebssystem<br />
Hardware<br />
Puffer<br />
8
Ablauforientierte Leistungsmessung<br />
• Hybrid-Monitoring<br />
Ereigniserkennung in Software<br />
Zeitstempelung in Hardware oder Software<br />
Aufzeichnung der Ereignisse in Hardware<br />
Erkennung von Ereignissen auf höheren Schichten möglich<br />
Ereignisrecorder<br />
Ereignis-<br />
Erkennung und<br />
Signalerzeugung<br />
Interface<br />
Bus<br />
herausgeführter Bus<br />
9
GPS-gestützes Monitoring verteilter Systeme<br />
• Leistungsvorhersage für clusterbasierte Webserver-<br />
Konfigurationen<br />
Simulationsmodell<br />
Am realen System gemessene Daten<br />
- Parametrierung des Modells<br />
- Kalibrierung des Modells<br />
- Überprüfung der Ergebnisse<br />
Ablauforientierte Leistungsbewertung<br />
Aktive Messung<br />
Software-Monitoring<br />
10
Webcluster: Funktion<br />
Generierung einer<br />
Anfrage<br />
Übertragung der<br />
Anfrage<br />
Auswahl eines<br />
Webserver-Knotens<br />
Modifikation der<br />
Anfrage<br />
Übertragung der<br />
Anfrage<br />
Bearbeitung der<br />
Anfrage<br />
Internet<br />
Lastgeneratoren<br />
Übertragung der<br />
Antwort<br />
Modifikation der<br />
Antwort<br />
Lastverteilungsknoten<br />
Übertragung der<br />
Antwort<br />
Webserver-Knoten<br />
Generierung der<br />
Antwort<br />
11
TCP-/UDP-Instumentierung<br />
Web<br />
Server<br />
Application<br />
User Space<br />
Analysis Process<br />
online / offline<br />
TCP/IP<br />
Stack<br />
Clock<br />
Netfilter<br />
Kernel<br />
Buffer<br />
Kernel Space<br />
Hardware<br />
12
Zeitsynchronisation<br />
• Verteiltes Objektsystem<br />
Messung der Einwegverzögerungen von TCP-Segmenten<br />
Schwankung der Meßwerte mit der Zeitdifferenz zwischen Knoten<br />
Frequenzänderung mit Temperatur führt <strong>zu</strong> veränderten<br />
Zeitdifferenzen<br />
13
Zeitdifferenzen<br />
14
NTP<br />
• Network Time Protocol<br />
• RFC 1305<br />
• Zwei-Wege-Zeitübertragung<br />
• 4 Zeitstempel <strong>zu</strong>r Berechnung der Zeitdifferenz<br />
Absendezeitpunkt Client → Server T 1<br />
(Client-Uhr)<br />
Empfangszeitpunkt Client → Server T 2<br />
(Server-Uhr)<br />
Absendezeitpunkt Server → Client T 3<br />
(Server-Uhr)<br />
Empfangszeitpunkt Server → Client T 4<br />
(Client-Uhr)<br />
• Auf Basis von periodischen Zeitdifferenzmessungen kann Frequenzdifferenz<br />
bestimmt werden<br />
• Korrektur der Uhr des Rechners mittels Anpassung der Frequenz<br />
Slew-Mode<br />
Funktion<br />
- Timer-Interrupt alle 10ms (nominal)<br />
- Erhöhung der Uhr um einen bestimmeten Betrag (≈10 ms) bei Timer-Interrupt<br />
- Anpassung des Betrages, um den die Uhr erhöht wird<br />
- Entspricht Frequenzanpassung<br />
• Zeitstempel über das Netzwerk:<br />
Genauigkeit im Millisekundenbereich<br />
17
NTP<br />
Symmetrischer Kanal, kein Offset der Uhren<br />
θ= 0<br />
T 2<br />
= 3 T 3<br />
= 7<br />
0 1 2 3 4 5 6 7 8 9 10 11 12<br />
t 1<br />
T 1<br />
= 1<br />
T 4<br />
= 9<br />
0 1 2 3 4 5 6 7 8 9 10 11 12<br />
t 2<br />
Offset:<br />
θ = ½ [(T 2<br />
- T 1<br />
) + (T 3<br />
- T 4<br />
)]<br />
= ½ [(3 - 1) + (7 - 9)]<br />
= ½ [2 - 2]<br />
= ½ · 0<br />
= 0<br />
Delay (Round-Trip):<br />
δ = (T 4<br />
- T 1<br />
) - (T 3<br />
- T 2<br />
)<br />
= (9 - 1) - (7 - 3)<br />
= 8 - 4<br />
= 4<br />
18
NTP<br />
Symmetrischer Kanal, Offset der Uhren (θ = 1)<br />
θ= 1<br />
T 2<br />
= 4 T 3<br />
= 8<br />
0 1 2 3 4 5 6 7 8 9 10 11 12<br />
t 1<br />
T 1<br />
= 1<br />
T 4<br />
= 9<br />
0 1 2 3 4 5 6 7 8 9 10 11 12<br />
t 2<br />
Offset:<br />
θ = ½ [(T 2<br />
- T 1<br />
) + (T 3<br />
- T 4<br />
)]<br />
= ½ [(4 - 1) + (8 - 9)]<br />
= ½ [3 + ( -1 )]<br />
= ½ · 2<br />
= 1<br />
Delay (Round-Trip):<br />
δ = (T 4<br />
- T 1<br />
) - (T 3<br />
- T 2<br />
)<br />
= (9 - 1) - (8 - 4)<br />
= 8 - 4<br />
= 4<br />
19
NTP<br />
Asymmetrischer Kanal, kein Offset der Uhren<br />
θ= 0<br />
T 2<br />
= 4 T 3<br />
= 8<br />
0 1 2 3 4 5 6 7 8 9 10 11 12<br />
t 1<br />
T 1<br />
= 1<br />
T 4<br />
= 9<br />
0 1 2 3 4 5 6 7 8 9 10 11 12<br />
t 2<br />
Offset:<br />
θ = ½ [(T 2<br />
- T 1<br />
) + (T 3<br />
- T 4<br />
)]<br />
= ½ [(4 - 1) + (8 - 9)]<br />
= ½ [3 + ( -1 )]<br />
= ½ · 2<br />
= 1<br />
Delay (Round-Trip):<br />
δ = (T 4<br />
- T 1<br />
) - (T 3<br />
- T 2<br />
)<br />
= (9 - 1) - (8 - 4)<br />
= 8 - 4<br />
= 4<br />
20
Zeitkorrektur durch Frequenzanpassung<br />
Gemessene Zeit<br />
Gang der Uhr korrigiert durch NTP<br />
Frequenzfehler<br />
Uhr <strong>zu</strong> langsam<br />
Gang der Uhr unkorrigiert<br />
Offset<br />
Niedrigere Frequenz <strong>zu</strong>m Ausgleich des Offsets<br />
Referenzzeit<br />
21
NTP und die PPS-API<br />
User Space<br />
NTP<br />
Clock<br />
PPS API<br />
PPS pulses<br />
Kernel Space<br />
Hardware<br />
• Zur Anbindung von (externen) Referen<strong>zu</strong>hren<br />
GPS, GALILEO, DCF-77, MSF, WWVB, LORAN-C, …<br />
• RFC 2783<br />
• Genauigkeit im Mikrosekundenbereich<br />
22
Internet<br />
Load<br />
Balancer<br />
Real Servers<br />
Load<br />
Generator<br />
PPS serial connection<br />
GPS<br />
Subsystem<br />
NTP Network<br />
NTP<br />
Server<br />
23
GPS-Hardware<br />
24
Beispiel-Messungen<br />
• Messung der Zeit (Delay) in<br />
einzelnen Teilsystemen<br />
LG<br />
C1<br />
LB<br />
C2<br />
RS<br />
1<br />
SYN<br />
SYNACK<br />
7<br />
2<br />
6<br />
SYN<br />
3<br />
5<br />
SYNACK<br />
4<br />
8<br />
ACK<br />
9<br />
ACKPSH<br />
10<br />
ACK<br />
11<br />
Request<br />
ACK<br />
ACKPSH<br />
15<br />
14<br />
ACK<br />
13<br />
ACKPSH<br />
12<br />
Reply<br />
16<br />
ACK<br />
ACK<br />
24<br />
17<br />
FINACK<br />
FINACK<br />
23<br />
25<br />
ACK<br />
18<br />
22<br />
26<br />
FINACK<br />
19<br />
21<br />
FINACK<br />
ACK<br />
27<br />
20<br />
25
Detailliertes Simulationsmodel<br />
29
Modell - TCP<br />
• RFC 793<br />
• RFC 1122<br />
• RFC 2581<br />
Slow Start<br />
Congestion Avoidance<br />
Fast Retransmit<br />
Fast Recovery<br />
• RFC 2988<br />
Retransmission Timeout:<br />
Computation and<br />
Implementation<br />
Karn’s Algorithm<br />
30
Eingabemodellierung<br />
• Auf Basis der gemessenen Verzögerungen<br />
Theoretische Verteilungsfunktionen<br />
Multimodale Verzögerungen<br />
Verzögerungen mit unsterschiedlichen Phasen<br />
Bézier-Verteilungen mit Phasen<br />
Autokorrelation<br />
31
Weitere Nut<strong>zu</strong>ng der Meßinfrastruktur<br />
• Messungsbasierte Modellierung von Ende-<strong>zu</strong>-Ende-<br />
Verzögerungen in Funknetzwerken nach IEEE 802.11b<br />
Ziele der Arbeit:<br />
- Kalibrieren des Simulationsmodells (ns-2)<br />
- realistische Leistungsbewertung auch für Konfigurationen jenseits<br />
der Laboranlage<br />
Wichtigste Ergebnisse<br />
- Kreuzkorrelationen wichtig<br />
- Anpassung des ns-2 Modells wichtig für bestimmte Systeme<br />
A. Heindl<br />
32
Infrastruktur für WLAN-Messungen<br />
33
Simulationsergebnisse WLAN<br />
• UDP-Verbindungen mit 800 Byte Nutzlast-Paketen<br />
• Gemessene Delays mit empirischen Verteilungen<br />
modelliert<br />
34
Netflow Accounting<br />
• IPFIX (IP Flow Information eXport) WG (IETF)<br />
• Formerly Cisco Netflow v5…v9<br />
• Goals<br />
Collect usage information of individual data flows<br />
Accumulate packet and byte counter to reduce the size of the monitored data<br />
• Working principle<br />
Each flow is represented by the IP 5-tupel (prot, src-IP, dst-IP, src-Port, dst-<br />
Port)<br />
For each arriving packet, the statistic counters of the appropriate flow are<br />
modified<br />
If a flow is terminated (TCP-FIN, timeout), the record is exported<br />
Sampling algorithms can be activated reducing the # of flows / data to be<br />
analyzed<br />
• Benefits<br />
Allows high-speed operation (standard PC: up to 1Gbps)<br />
Flow information can simply be used for accounting purposes as well as to<br />
detect attack signatures (increasing # of flows / time)<br />
35
IPFIX Protocol<br />
• draft-ietf-ipfix-protocol-03.txt<br />
• Information records<br />
Template Record defines the structure and interpretation of fields in a Flow Data<br />
Record<br />
Flow Data Record is a data record that contains values of the Flow parameters<br />
corresponding to a Template Record<br />
Options Template Record defines the structure and interpretation of fields in an<br />
Options Data Record, including defining how to scope the applicability of the<br />
Options Data Record<br />
Options Data Record is a data record that contains values and scope information<br />
of the Flow measurement parameters, corresponding to an Options Template<br />
Record<br />
• Transport protocol<br />
SCTP must be implemented, TCP and UDP may be implemented<br />
SCTP should be used<br />
TCP may be used<br />
UDP may be used (with restrictions – congestion control!)<br />
36
IPFIX – Terminology<br />
• IP Traffic Flow<br />
A flow is defined as a set of IP packets passing an observation point in<br />
the network during a certain time interval. All packets belonging to a<br />
particular flow have a set of common properties.<br />
• Observation Point<br />
The observation point is a location in the network where IP packets can<br />
be observed. One observation point can be a superset of several other<br />
observation points.<br />
• Metering Process<br />
The metering process generated flow records. It consists of a set of<br />
functions that includes packet header capturing, timestamping,<br />
sampling, classifying, and maintaining flow records.<br />
Packet header<br />
capturing<br />
Timestamping<br />
Classifying<br />
Maintaining<br />
flow records<br />
37
IPFIX – Terminology II<br />
• Flow Record<br />
A flow record contains information about a specific flow that was<br />
metered at an observation point. A flow record contains measured<br />
properties of the flow (e.g. the total number of bytes of all packets of<br />
the flow) and usually also characteristic properties of the flow (e.g. the<br />
source IP address).<br />
• Exporting Process<br />
The exporting process sends flow records to one or more collecting<br />
processes. The flow records are generated by one or more metering<br />
processes.<br />
• Collecting Process<br />
The collecting process receives flow records from one or more<br />
exporting processes for further processing.<br />
38
IPFIX – Working Principles<br />
• Identification of single traffic flows<br />
5-tupel: Protocol, Source-IP, Destination-IP, Source-Port, Destination-<br />
Port<br />
Example: TCP, 134.2.11.157, 134.2.11.159, 2711, 22<br />
• Collection of statistics for each traffic flow<br />
# bytes<br />
# packets<br />
• Periodical statistic export for further analysis<br />
Flow<br />
TCP, 1.2.3.4, 5.6.7.8, 4711, 22<br />
TCP, 1.2.3.4, 5.6.7.8, 4712, 25<br />
Packets<br />
10<br />
7899<br />
Bytes<br />
5888<br />
520.202<br />
39
IPFIX – Applications<br />
• Usage based accounting<br />
For non-flat-rate services<br />
Accounting as input for billing<br />
Time or volume based tariffs<br />
For future services, accounting per class of service, per time of day, etc.<br />
• Traffic profiling<br />
Process of characterizing IP flows by using a model that represents key<br />
parameters such as flow duration, volume, time, and burstiness<br />
Prerequisite for network planning, network dimensioning, etc.<br />
Requires high flexibility of the measurement infrastructure (objectives of traffic<br />
profiling can vary)<br />
• Traffic engineering<br />
Comprises methods for measurement, modeling, characterization, and control of<br />
a network<br />
The goal is the optimization of network resource utilization<br />
40
IPFIX – Applications II<br />
• Attack/intrusion detection<br />
Capturing flow information plays an important role for network security<br />
Detection of security violation<br />
1) detection of unusual situations or suspicious flows<br />
2) flow analysis in order to get information about the attacking flows<br />
• QoS monitoring<br />
Useful for passive measurement of quality parameters for IP flows<br />
Validation of QoS parameters negotiated in a service level specification<br />
Often, correlation of data from multiple observation points is required<br />
This required clock synchronization of the involved monitoring probes<br />
41
Packet Sampling<br />
• PSAMP (Packet SAMPling) WG (IETF)<br />
• Goals<br />
Network monitoring of ultra-high-speed networks<br />
Sampling of single packets including the header and parts of the<br />
payload for post-analysis of the data packets<br />
Allowing various sampling and filtering algorithms<br />
- Algorithms can be combined in any order<br />
- Dramatically reducing the packet rate<br />
• Benefits<br />
Allows very high-speed operation depending on the sampling algorithm<br />
and the sampling rate<br />
Post-analysis for statistical accounting and intrusion detection<br />
mechanisms<br />
42
ReportingThread<br />
Output<br />
buffer<br />
Implementation of PSAMP / IPFIX<br />
43<br />
ObserverThread<br />
SelectionThread<br />
packet Queue packet Queue<br />
libpcap<br />
Filter / Sampler<br />
List<br />
...
Measurement Tools and Benchmarks<br />
• Measurement Tools<br />
TTCP<br />
Netperf<br />
NPAG<br />
• Benchmarks<br />
HTTPerf<br />
44
Practical Measurement Tools: TTCP<br />
• Measure TCP throughput<br />
Ttcp on two hosts, one as active transmitter, one as receiver<br />
Can send TCP or UDP<br />
Receiver computes effective throughput<br />
Simple, light-weight, no super user privilege<br />
45
TTCP<br />
• Available for Linux<br />
• Also available as a GUI-Java application<br />
• Transmitter<br />
ttcp −t [−u] [−s] [−p port] [−l buflen]<br />
[−b size] [−n numbufs] [−A align] [−O<br />
offset] [−f format] [−D] [−v] host [out]<br />
46
TTCP Options 1<br />
−t<br />
−r<br />
−u<br />
−s<br />
−l length<br />
−b size<br />
Transmit mode.<br />
Receive mode.<br />
Use UDP instead of TCP.<br />
If transmitting, source a data pattern to network; if<br />
receiving, sink (discard) the data. Without the −s option,<br />
the default is to transmit data from stdin or print the<br />
received data to stdout.<br />
Length of buffers in bytes (default 8192). For UDP, this<br />
value is the number of data bytes in each packet. The<br />
system limits the maximum UDP packet length. This limit<br />
can be changed with the −b option.<br />
Set size of socket buffer. The default varies from system to<br />
system. This parameter affects the maximum UDP packet<br />
length. It may not be possible to set this parameter on<br />
some systems (for example, 4.2BSD).<br />
47
TTCP Options 2<br />
−n numbufs<br />
−p port<br />
−D<br />
−B<br />
−A align<br />
−O offset<br />
Number of source buffers transmitted (default 2048).<br />
Port number to send to or listen on (default 2000). On<br />
some systems, this port may be allocated to another<br />
network daemon.<br />
If transmitting using TCP, do not buffer data when sending<br />
(sets the TCP_NODELAY socket option). It may not be<br />
possible to set this parameter on some systems (for<br />
example, 4.2BSD).<br />
When receiving data, output only full blocks, using the<br />
block size specified by −l. This option is useful for<br />
programs, such as tar(1), that require complete blocks.<br />
Align the start of buffers to this modulus (default 16384).<br />
Align the start of buffers to this offset (default 0).<br />
For example, ‘‘−A8192 −O1’’ causes buffers to start at the<br />
second byte of an 8192-byte page.<br />
48
TTCP Options 3<br />
−f format<br />
−T<br />
−v<br />
−d<br />
Specify, using one of the following characters, the format<br />
of the throughput rates as kilobits/sec (’k’), kilobytes/sec<br />
(’K’), megabits/sec (’m’), megabytes/sec (’M’), gigabits/sec<br />
(’g’), or gigabytes/sec (’G’). The default is ’K’.<br />
‘‘Touch’’ the data as they are read in order to measure<br />
cache effects.<br />
Verbose: print more statistics.<br />
Debug: set the SO_DEBUG socket option.<br />
49
TTCP Java Version<br />
• java -cp . ttcp<br />
• Command line options (like Unix version)<br />
• GUI<br />
= Num Buffers ∙ Buffersize Results<br />
50
Practical Measurement Tools: Netperf<br />
• Measure available bandwidth between two nodes<br />
Generate different traffic patterns<br />
- Bulk data transfer (e.g. FTP)<br />
- Interactive data exchange (e.g. rlogin)<br />
More detailed and precise measurement than ttcp:<br />
- socket buffer sizes, amount of data, elapsed time, effective<br />
throuhghput, number of frames dropped<br />
Besides TCP/UDP, also support datalink and other network protocols<br />
51
NetperfBulkDataTransfer<br />
• TCP Stream Performance<br />
netperf -H remotehost<br />
performs a 10 second test between the local system and<br />
the system identified by remotehost. The socket buffers<br />
on either end will be sized according to the systems'<br />
default and all TCP options (e.g. TCP_NODELAY) will be<br />
at their default settings.<br />
52
Netperf TCP Stream Options<br />
-s sizespec<br />
-S sizespec<br />
-m value<br />
-M value<br />
-l value<br />
-D<br />
set the local send and receive socket buffer sizes<br />
[Default: system default socket buffer sizes]<br />
behaves just like -s but for the remote system<br />
set the local send size to value bytes.<br />
[Default: local socket buffer size]<br />
behaves like -m, setting the receive size for the remote<br />
system. [Default: remote receive socket buffer size]<br />
set the test length to value seconds when value is > 0 and<br />
to |value| bytes when value is < 0<br />
set the TCP_NODELAY option on both systems<br />
53
Netperf TCP Stream Scripts<br />
• tcp_stream_script<br />
invokes netperf with different socket (57344, 32768,<br />
8192) and send sizes (4096, 8192, 32768).<br />
• tcp_range_script<br />
invokes netperf with a fixed socket size (32768) and<br />
increasing send size (1 to 65536).<br />
• Predefined minimum (2) and maximum (10) number of<br />
observations<br />
• Confidence level (99%) and relative CI width (5%)<br />
54
Netperf TCP Stream Results<br />
netperf -l 60 -H faui7s -t TCP_STREAM -i 10,2 -I 99,5 -- -m 4096 -s 32768 -S 32768<br />
TCP STREAM TEST to faui7s : +/-2.5% @ 99% conf. : histogram : interval : dirty data<br />
Recv Send Send<br />
Socket Socket Message Elapsed<br />
Size Size Size Time Throughput<br />
bytes bytes bytes secs. 10^6bits/sec<br />
131070 212992 4096 60.01 93.60<br />
!!! WARNING<br />
!!! Desired confidence was not achieved within the specified iterations.<br />
!!! This implies that there was variability in the test environment that<br />
!!! must be investigated before going further.<br />
!!! Confidence intervals: Throughput : 19.2%<br />
!!! Local CPU util : 0.0%<br />
!!! Remote CPU util : 0.0%<br />
55
Netperf UDP Stream Options<br />
• netperf -H remotehost -t UDP_STREAM -- -m 1024<br />
• UDP unreliable protocol<br />
• Reported send rate can be much higher than the actual<br />
receive rate<br />
• always report both send and receive rates together<br />
56
Netperf – Other Bulk Data Transfer<br />
Measurements<br />
• DLPI Connection Oriented Streams<br />
• DLPI Connectionless Streams<br />
• Unix Domain Stream Sockets<br />
• Unix Domain Datagram Sockets<br />
• Fore ATM API Streams<br />
57
Netperf Request/Response Performance<br />
Measurements<br />
• TCP<br />
netperf -H remotehost -t TCP_RR<br />
default request size 1 byte<br />
default response size of 1 byte<br />
tcp_rr_script<br />
- Different RequestSize,-ResponseSize)-Pairs<br />
(1,1 64,64 100,200 128,8192)<br />
- Confidence Level 99% and 5% relative CI width<br />
• UDP<br />
netperf -H remotehost -t UDP_RR<br />
udp_rr_script<br />
• Other request/response Measurements<br />
DLPI, Unix Domain Sockets, ATM, …<br />
58
Netperf TCP Request/Response Options<br />
-r sizespec<br />
-l value<br />
-s sizespec<br />
-S sizespec<br />
-D<br />
request and/or response sizes<br />
test duration<br />
For value > 0, test duration will be value seconds.<br />
Otherwise, test duration will be |value| transactions.<br />
local send and receive socket buffer sizes<br />
[Default: system default socket buffer sizes]<br />
like-s butfortheremotesystem<br />
set the TCP_NODELAY option<br />
59
NPAG - Übersicht<br />
Header frei<br />
programmierbar<br />
Verkehrs-modell<br />
Parallelität<br />
Pakettypen<br />
Ttcp<br />
---<br />
Max. Durchsatz<br />
---<br />
TCP, UDP<br />
NetPerf<br />
---<br />
Max. Durchsatz<br />
---<br />
TCP, UDP<br />
Npag<br />
Ja<br />
Variabel<br />
Ja<br />
TCP, UDP, IP,<br />
ICMP<br />
60
NPAG - Design<br />
• Client Server Modell<br />
• Parallelität durch Threads<br />
• Messung durch Integration von Zeitstempel<br />
• Zeitsynchronisation wird vorausgesetzt<br />
Server<br />
Client<br />
Client<br />
NETZ<br />
Server<br />
User Spezifikation<br />
Client<br />
Client Generator<br />
NTP<br />
Server<br />
61
NPAG - Benutzerschnittstelle<br />
• Spezifizierung durch Skriptsprache<br />
• Einfach und übersichtlich<br />
• Schlüsselwörter<br />
stream<br />
tcp, udp, icmp6, ip, ip6<br />
traffic<br />
burst<br />
#stream specification<br />
stream {<br />
tcp {<br />
…<br />
}<br />
ip {<br />
…<br />
}<br />
traffic {<br />
burst {<br />
.…<br />
}<br />
}<br />
}<br />
62
NPAG - Verkehrsbeschreibung<br />
• In der realen Welt ist Datenrate eines Verkehrsstroms meist nicht konstant<br />
• Dies wird berücksichtigt: Datenrate kann während der Messung variiert<br />
werden<br />
Beispiel:<br />
burst1 burst2 burst3 burst4<br />
traffic {<br />
}<br />
burst {<br />
packets = 100;<br />
delay = 0.1;<br />
repeat = 2;<br />
}<br />
bust {<br />
packets = 200;<br />
delay = 0.2;<br />
repeat = 2;<br />
}<br />
63
Beispiel: Verkehrsstrom<br />
• Spezifikation eines Verkehrsstroms mit<br />
folgenden Eigenschaften:<br />
TCP: Quellport 5000<br />
Zielport 5001<br />
IPv4: Quelladresse 192.168.0.2<br />
Zieladresse 192.168.0.1<br />
Versenden von 100 Paketen je 100 Byte.<br />
Messung des maximalen Durchsatzes<br />
#stream definition<br />
stream {<br />
}<br />
#specify tcp<br />
tcp {<br />
sport = 5000;<br />
dport = 5001;<br />
}<br />
#specify ip<br />
ip {<br />
src = 192.168.178.2;<br />
dst = 192.168.178.1;<br />
}<br />
#secify traffic parameters<br />
traffic {<br />
burst {<br />
send_packets = 100;<br />
size = 100;<br />
}<br />
}<br />
64
NPAG - Anwendungsmöglichkeiten<br />
• Messung des Durchsatzes bei variabler Datenrate<br />
• Messung der Verzögerung<br />
• Paketverluste (UDP)<br />
• Zum Testen des Protokollstacks, Firewalls, ISS lassen sich verschiedene<br />
Pakete <strong>zu</strong>sammenstellen<br />
IP-Spoofing<br />
Dst_addr = src_addr;<br />
IP-Version 4<br />
Ungültige Flags<br />
Ungültige Header-Werte<br />
65
Benchmarks<br />
• Web server benchmarks: simulation of Web clients<br />
Httperf<br />
- Single client generating HTTP requests<br />
- Several optimizations to circumvent operating system restrictions<br />
- Different workload models<br />
• Constant request rate<br />
• Sequential requests<br />
• Requests from log file<br />
• Session-oriented with bursts<br />
• Cyclic set of URIs<br />
- Command line options:<br />
httperf [--burst-length N] [--client I/N] [--close-withreset]<br />
[-d|--debug N] [--failure-status N] [-h|--help]<br />
[--hog] [--http-version S] [--num-calls N] [--num-conns<br />
N] [--port N] [--rate X] [--recv-buffer N] [--sendbuffer<br />
N] [--server S] [--think-timeout X] [--timeout X]<br />
[--uri S] [-v|--verbose] [-V|--version] [--wlog y|n,F]<br />
[--wsess N,N,X] [--wset N,X]<br />
66
HTTPerf Options 1<br />
--burst-length=N<br />
--client=I/N<br />
--close-with-reset<br />
-d=N<br />
--debug=N<br />
--failure-status=N<br />
-h<br />
--help<br />
Specifies the length of bursts. Each bursts consists of<br />
N calls to the server.<br />
Specifies that the machine httperf is running on is<br />
client I out of a total of N clients. I should be in the<br />
range from 0 to N-1.<br />
Requests that httperf closes TCP connections by<br />
sending a RESET instead of going through the<br />
normal TCP connection shutdown handshake.<br />
Set debug level to N. Larger values of N will result in<br />
more output.<br />
Specifies that an HTTP response status code of N<br />
should be treated as a failure (i.e., treated as if the<br />
request had timed out, for example).<br />
Prints a summary of available options and their<br />
parameters.<br />
67
HTTPerf Options 2<br />
--hog<br />
--http-version=S<br />
--num-calls=N<br />
--num-conns=N<br />
--port=N<br />
This option requests to use up as many TCP ports as<br />
necessary.<br />
By default, version string „1.1‚“ is used. This option<br />
can be set to „1.0“ to force the generation of<br />
HTTP/1.0 requests.<br />
This option specifies number of calls to issue on each<br />
connection. If N is greater than 1, the server must<br />
support persistent connections. The default value for<br />
this option is 1.<br />
This specifies the total number of connections to<br />
create. On each connection, calls are issued as<br />
specified by options --num-calls and --burst-length.<br />
The default value for this option is 1.<br />
This option specifies the port number N on which the<br />
web server is listening for HTTP requests. By default,<br />
httperf uses port number 80.<br />
68
HTTPerf Options 3<br />
--rate=X<br />
--recv-buffer=N<br />
--send-buffer=N<br />
--server=S<br />
Specifies the fixed rate at which connections or<br />
sessions are created. A rate of 0 results in connections<br />
or sessions being generated sequentially (a new<br />
session/connection is initiated as soon as the<br />
previous one completes). The default value for this<br />
option is 0.<br />
Specifies the maximum size of the socket receive<br />
buffers used to receive HTTP replies. By default, the<br />
limit is 16KB.<br />
Specifies the maximum size of the socket send<br />
buffers used to send HTTP requests. By default, the<br />
limit is 4KB.<br />
Specifies the IP hostname of the server. By default,<br />
the hostname “localhost“ is used. This option should<br />
always be specified.<br />
69
HTTPerf Options 4<br />
--think-timeout=X<br />
--timeout=X<br />
--uri=S<br />
-v<br />
--verbose<br />
-V<br />
--version<br />
Specifies the maximum time that the server may<br />
need to produce the reply for a given request. Note<br />
that this timeout value is added to the normal<br />
timeout value (see option --timeout).<br />
Specifies the amount of time X that httperf is willing<br />
to wait for a server reaction. The timeout is specified<br />
in seconds and can be a fractional number (e.g., --<br />
timeout 3.5). By default, the timeout value is infinity.<br />
Specifies that URI S should be accessed on the<br />
server.<br />
Puts httperf into verbose mode. In this mode,<br />
additional output such as the individual reply rate<br />
samples and connection lifetime histogram are<br />
printed.<br />
Prints the version of httperf.<br />
70
HTTPerf Options 5<br />
--wlog=B,F<br />
--wsess=N1,N2,X<br />
This option can be used to generate a specific<br />
sequence of URI accesses. This is useful to replay<br />
the accesses recorded in a server log file, for<br />
example. Parameter F is the name of a file containing<br />
the ASCII NUL separated list of URIs that should be<br />
accessed. If parameter B is set to „y“, httperf will<br />
wrap around to the beginning of the file when<br />
reaching the end of the list (so the list of URIs is<br />
accessed repeatedly). With B set to „n“, the test will<br />
stop no later than when reaching the end of the URI<br />
list.<br />
Requests the generation and measurement of<br />
sessions instead of individual requests. A session<br />
consists of a sequence of bursts which are spaced<br />
out by the user think-time. Each burst consists of a<br />
fixed number L of calls to the server (L is specified<br />
by option --burst-length).<br />
71
HTTPerf Options 6<br />
--wset=N,X<br />
This option can be used to walk through a list of<br />
URIs at a given rate. Parameter N specifies the<br />
number of distinct URIs that should be generated<br />
and X specifies the rate at which new URIs are<br />
accessed. A rate of 0.25 would mean that the same<br />
URI would be accessed four times in a row before<br />
moving on to the next URI.<br />
72
HTTPerf Output<br />
Total: connections 30000 requests 29997 replies 29997 test-duration 299.992 s<br />
Connection rate: 100.0 conn/s (10.0 ms/conn,
Sample HTTPerf Server Performance Graph<br />
74