lect3..ppt - 09/12/04 cis 4100 systems performance and evaluation lecture 3 by zornitza genova...

32
Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

Upload: thomasina-todd

Post on 25-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

Lect3..ppt - 09/12/04

CIS 4100 Systems Performance and Evaluation

Lecture 3

byZornitza Genova Prodanoff

Page 2: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP002

Lecture Outline

Chapter 2:• Types of networks• Network protocols• Client/Server Model• Peer-to-Peer Model• Web services protocols

Page 3: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP003

Communication Protocols

• Communication is between two remote processes• Protocol is a set of rules

– Addressing– Routing– Error detection– Error recovery– Sequence control– Flow control

Page 4: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP004

Communication Protocols (Continued)

• Connection oriented protocols (e.g. TCP)– Brake the message into fragments– Once connection is established no fragment routing occurs – Ensure that all fragments are processed in original order– Used for applications communicating through large messages

• Connectionless protocols (e.g. UDP)– Each message is routed independently– Used when messages are smaller than the max. fragment size

– Order of arrival is not important - a single fragment is sent

Page 5: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP005

Protocol specification

• Syntax: message format and fields (bits) designation

• Semantics: actions taken by each entity when events occur• E.g. fragment loss, timeout, message arrival

• Complex design – Solution: use layered approach- Abstract from details (at each layer) and let the

protocols at other layers handle them

Communication Protocols (Continued)

Page 6: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP006

Type of Networks (Continued)

Page 7: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP007

Client/Server Performance (continued)

Page 8: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP008

• The two most important protocols in the Internet are the

Internet Protocol (IP) and the Transmission Control Protocol (TCP)

- Suite of protocols known as TCP/IP • Figure 2.7 shows the layering of important TCP/IP-based

protocols• IP is a network layer protocol on top of which we find two

transport layer protocols: TCP-a connection-oriented protocol-and User Datagram Protocol (UDP)-a connectionless protocol

• Simple Mail Transfer Protocol (used to send e-mail), and Telnet (an interactive login protocol) use TCP

• Network File System (NFS) [8], Domain Name Server (DNS), and Simple Network Management Protocol (SNMP) are built on top of UDP

Communication Protocols: Internet Protocols

Page 9: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP009

Client/Server Performance (continued)

Page 10: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0010

Internet Protocol:

• Specifies formats of packets sent across the Internet• Connectionless protocol• Source to destination forwarding of packets (called

datagrams)• Every host connected to the Internet has a unique address,

called IP Address• Address representation is dotted decimal notation, e.g.

129.2.0.37• Prefix (identifies a network) and suffix (identifies a host)

address bits

Communication Protocols: IP

Page 11: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0011

Page 12: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0012

Client/Server Performance (continued)

Page 13: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0013

Transport Control Protocol:• Connection oriented protocol• TCP guarantees that all the packets of a message are

received in their original sequence• TCP guarantees that data is delivered without loss or

modification of bits• Packets are called segments• Connection establishment through three-way-handshake• Full-duplex communication

Communication Protocols: TCP

Page 14: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0014

Client/Server Performance (continued)

Page 15: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0015

• TCP uses ACKs (acknowledgement messages), timeouts,

and retransmissions for error control • ACK are cumulative• Flow control is implemented by TCP through a sliding

window mechanism - The window size is the maximum number of bytes that

can be sent before an acknowledgement is received - Window size is limited by

the buffer size at the receiver by network congestion as estimated by the sender

Communication Protocols: TCP

Page 16: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0016

• B is limiting bandwidth• RTT is round trip time• MSS is maximum segment size• Wc is the current window size• Wm is the maximum window size (prevents buffer overflow)• Wc doubles every RTT but cannot exceed the receivers

window Wm

Communication Protocols: TCP

Page 17: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0017

“Sliding window” flow control

• The rate with which sender can send data is determined by the rate of incoming ACKs for previous segments

• The rate of incoming ACKs is determined by the bottleneck in the round trip path (destination or the network)

• Wm is advertised by the receiver

• If network congestion is detected, the sender will reduce its window size Wc to reduce its transmission rate

Communication Protocols: TCP

Page 18: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0018

Client/Server Performance (continued)

Page 19: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0019

• Slow start phase and Congestion avoidance phase

• Consider Figure 2.10

• During slow start Wc is initialized to one segment and is increased by one for every ACK received

• Once segments are sent an ACK is received after one RTT unit

• Wc doubles every RTT unit

Communication Protocols: TCP (continued)

Page 20: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0020

• Network congestion can be detected by TCP through

−the receipt of a duplicate ACK, which indicates that the receiver received an out-of-sequence segment

−or by a timeout at the sender

• The current value of the window size is saved in a variable called slow start threshold window size, Wssthr, and Wc, is reduced

• TCP Reno: If a duplicate ACK is received, W, is divided by two and TCP enters congestion avoidance phase (described in Figure 2.11)

• TCP Reno: If a timeout occurs, Wc is set to one and TCO goes back to slow start

Communication Protocols: TCP (continued)

Page 21: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0021

• When Wc reaches Wssthr, TCP enters congestion

avoidance

• During congestion avoidance the window size Wc is incremented by one every RTT unit

Communication Protocols: TCP (continued)

Page 22: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0022

• In the example of Fig. 2.11, a duplicate ACK is received at time 5. Then, half of the current value of Wc, i.e., 8, is stored in Wssthr and the TCP connection enters a congestion avoidance phase.

• Another duplicate ACK is received at time 20. The value of Wssthr is set to 7 (14 / 2). If a timeout occurs, then Wc, is set to one and TCP goes back to slow start

Communication Protocols: TCP (continued)

Page 23: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0023

• In Fig. 2.11, a timeout occurred at time 10 and the TCP connection enters a slow start phase

• When Wc, reaches Wsethr during slow start, TCP switches to congestion avoidance. For example, at time 13 in Fig. 2.11, Wc, reaches the current value of Wssthr, which is 8, and the connection enters a congestion avoidance phase.

Communication Protocols: TCP (continued)

Page 24: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff
Page 25: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0025

TCP and congestion control

• The throughput XTCP of a TCP connection, measured in segments per second

−decreases with RTT, −decreases with the probability p that packets are dropped−increases with the receiver advertised window size Wr

measured in segments−decreases with the value of the TCP timeout To

( Based on Padhye’s expression for XTCP for a TCP Reno connection)

• A Model is implemented in the TCPModel. XLS

Communication Protocols: TCP (continued)

Page 26: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0026

Communication Protocols: TCP (Continued)

• Fig. 2.12 shows variation of the TCP throughput in KB/sec as a function of p and for four values of Wm: 10, 20, 30, and 40 segments

• TCP timeout (To) = 2 seconds• Maximum segment size of 1,460 bytes• Limiting bandwidth of the connection between sender and

receiver equal to 12,500 KB/sec• RTT = 0.04 seconds

Page 27: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0027

Client/Server Performance (continued)

Page 28: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0028

Communication Protocols: TCP (Continued)

• As Wm increases, the throughput increases

• The benefits of a larger window decrease as the packet loss probability increases because more data has to be retransmitted in case of packet losses

Page 29: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0029

• The best-case throughput of a TCP connection is obtained

when the window size Wc, reaches the receiver maximum window size Wm and no congestion occurs

• The throughput is given by segments per second

or bytes/sec where MSS is the

maximum segment size

• The throughput of a TCP connection cannot exceed the limiting bandwidth B, in bytes/sec, of the network connecting the sender and receiver =>

Communication Protocols: TCP (Continued)

})/(,min{ MSSRTTWBX mTCP

RTTWm /

MSSRTTWm )/(

Page 30: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0030

• Then, the maximum throughput is achieved when the windows size given in segments , is equal to

• The numerator is called the bandwidth-delay product.

• During slow start, TCP operates with windows that are below the window size that would be achieved during congestion avoidance.

−problem for short-lived connections that may never achieve the maximum throughput under an optimal window size

Communication Protocols: TCP (Continued)

MSS

RTTBWm

*

mW

Page 31: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0031

• Table 2.1 shows the bandwidth-delay product, and the

optimum receiver window size, , in segments, assuming a segment size of 1,460 bytes, for various types of networks.

• As shown by the table, high-bandwidth, low-latency networks require large window sizes for the throughput of the TCP connection to use as much of the network bandwidth as possible.

Communication Protocols: TCP (Continued)

*mW

Page 32: Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff

ZGP0032

Client/Server Communication