320 likes | 418 Views
CIS 4100 Systems Performance and Evaluation. Lecture 3 by Zornitza Genova Prodanoff. Lect3..ppt - 09/12/04. Lecture Outline. Chapter 2: Types of networks Network protocols Client/Server Model Peer-to-Peer Model Web services protocols. ZGP00 2. Communication Protocols.
E N D
CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff Lect3..ppt - 09/12/04
Lecture Outline • Chapter 2: • Types of networks • Network protocols • Client/Server Model • Peer-to-Peer Model • Web services protocols ZGP002
Communication Protocols • Communication is between two remote processes • Protocol is a set of rules • Addressing • Routing • Error detection • Error recovery • Sequence control • Flow control ZGP003
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 ZGP004
Communication Protocols (Continued) • 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 ZGP005
Type of Networks (Continued) ZGP006
Communication Protocols: Internet Protocols • 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 ZGP008
Communication Protocols: IP • 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 ZGP0010
Communication Protocols: TCP • 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 ZGP0013
Communication Protocols: TCP • 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 ZGP0015
Communication Protocols: TCP • 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 ZGP0016
Communication Protocols: TCP • “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 ZGP0017
Communication Protocols: TCP (continued) • 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 ZGP0019
Communication Protocols: TCP (continued) • 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 ZGP0020
Communication Protocols: TCP (continued) • When Wc reaches Wssthr, TCP enters congestion avoidance • During congestion avoidance the window size Wc is incremented by one every RTT unit ZGP0021
Communication Protocols: TCP (continued) • 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 Wssthris set to 7 (14 / 2). If a timeout occurs, then Wc, is set to one and TCP goes back to slow start ZGP0022
Communication Protocols: TCP (continued) • 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. ZGP0023
Communication Protocols: TCP (continued) • 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 ZGP0025
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 ZGP0026
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 ZGP0028
Communication Protocols: TCP (Continued) • 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 MSSis 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 => ZGP0029
Communication Protocols: TCP (Continued) • 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 ZGP0030
Communication Protocols: TCP (Continued) • 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. ZGP0031
Client/Server Communication ZGP0032