lect3..ppt - 09/12/04 cis 4100 systems performance and evaluation lecture 3 by zornitza genova...
TRANSCRIPT
Lect3..ppt - 09/12/04
CIS 4100 Systems Performance and Evaluation
Lecture 3
byZornitza Genova Prodanoff
ZGP002
Lecture Outline
Chapter 2:• Types of networks• Network protocols• Client/Server Model• Peer-to-Peer Model• Web services protocols
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
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
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)
ZGP006
Type of Networks (Continued)
ZGP007
Client/Server Performance (continued)
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
ZGP009
Client/Server Performance (continued)
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
ZGP0011
ZGP0012
Client/Server Performance (continued)
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
ZGP0014
Client/Server Performance (continued)
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
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
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
ZGP0018
Client/Server Performance (continued)
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)
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)
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)
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)
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)
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)
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
ZGP0027
Client/Server Performance (continued)
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
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 )/(
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
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
ZGP0032
Client/Server Communication