Introduction to the Transport Layer

Slides:



Advertisements
Similar presentations
Chapter 15 Transmission Control Protocol (TCP)
Advertisements

11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 Data Link Control (DLC) Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 Data Link Control
Data link control. Data Link Control –Flow Control how much data may sent –Error Control How can error be detected and corrected.
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
11-5 NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 13 Introduction to the Transport.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
流式视频服务器和客户机的 实现 钱叶魁. 主要内容 目标和功能 采用的方法原理 实现 目标和功能 实现流式视频服务器和客户机 — 流式存储视频应用 客户机发送 SETUP,PLAY,PAUSE 和 TEARDOWN 等 RTSP 命 令,并且服务器应答这些命令; 当服务器处于播放状态时,它周期性地抓取.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
第 4 章 过程与变量的作用范围. 4.1 Visual Basic 的代码模块 Visual Basic 的应用程序是由过程组成的, 过程代码存放在模块中。 Visual Basic 提供了 三类模块,它们是窗体模块、标准模块和类 模块。 窗体模块 窗体模块是大多数 Visual Basic.
Ch 23 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Ameera Almasoud.
第二章 通信技术基础 谈英姿 东南大学自控系工业自动化教研室. 通信技术基础 2.1 通信的基本概念 2.2 通信协议与网络层次分析 2.3 常用串行通信技术.
Process-to-Process Delivery:
Process-to-Process Delivery:
Chapter 16 Stream Control Transmission Protocol (SCTP)
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 8 Address Resolution Protocol.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 2 The OSI Model and the TCP/IP.
1 Kyung Hee University Chapter 13 Introduction to the Transport Layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Transmission Control Protocol (TCP)
23.1 Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
力的合成 力的合成 一、力的合成 二、力的平行四边形 上一页下一页 目 录 退 出. 一、力的合成 O. O. 1. 合力与分力 我们常常用 一个力来代替几个力。如果这个 力单独作用在物体上的效果与原 来几个力共同作用在物体上的效 果完全一样,那么,这一个力就 叫做那几个力的合力,而那几个 力就是这个力的分力。
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
Computer Networks and Internets 《计算机网络与因特网》课件 林坤辉
Chapter 13 Introduction to the Transport Layer
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 9 Internet Control Message.
11.1 Flow and Error Control Flow Control Error Control.
U niversity of S cience and T echnology of C hina VxWorks 及其应用开发 陈香兰 年 7 月.
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 16 Stream Control Transmission.
Chapter 11 Data Link Control.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Chapter 3 Transport Layer.
Part III. Data Link Layer Chapter 11. Data Link Control COMP 3270 Computer Networks Computing Science Thompson Rivers University.
Chapter 11 Data Link Control and Protocols Flow and Error Control Flow Control Error Control.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Ch 3. Transport Layer Myungchul Kim
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Process-to-Process Delivery:
上机任务 认真查看课件内容,理解: ① ① I/O 接口的含义 ② ② I/O 端口与编址 上网查阅资料,至少找一篇 “I/O 接口 ” 有关的技术 资料(比如显卡、或声卡、网卡、磁盘控制器等 ) 的工作原理)并仔细阅读,扩展知识面。
Data Link Layer.
Chapter 23 Introduction To Transport Layer Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
2.10 Flow and Error Control Before that ...
Part III Datalink Layer 10.
Chapter 11 Data Link Control
Chapter 23 Introduction To Transport Layer
Chapter 11 Data Link Control
PART 5 Transport Layer Computer Networks.
6 Transport Layer Computer Networks Tutun Juhana
TCP Transport layer Er. Vikram Dhiman LPU.
Introduction to the Transport Layer
Chapter 23 Introduction To Transport Layer
Chapter 11 Data Link Control (DLC)
Transport Layer Our goals:
Chapter 11 Data Link Control
1 安全体系结构 曹天杰 中国矿业大学计算机科学与技术学院. 2 安全体系结构 安全体系结构的内容包括:提供安全服务与 有关安全机制在本系统下的一般描述,这些 服务和机制必须为本系统所配备;确定本系 统内部可以提供这些服务的位置。 一个信息系统安全体系结构的形成主要是根.
Presentation transcript:

Introduction to the Transport Layer Chapter 13 Introduction to the Transport Layer TCP/IP Protocol Suite Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

OBJECTIVES: To define process-to-process communication at the transport layer and compare it with host-to-host communication at the network layer. To discuss the addressing mechanism at the transport layer, to discuss port numbers, and to define the range of port numbers used for different purposes. To explain the packetizing issue at the transport layer: encapsulation and decapsulation of messages. To discuss multiplexing (many-to-one) and demultiplexing (one-to-many) services provided by the transport layer. To discuss flow control and how it can be achieved at the transport layer. TCP/IP Protocol Suite

OBJECTIVES (continued): To discuss error control and how it can be achieved at the transport layer. To discuss congestion control and how it can be achieved at the transport layer. To discuss the connectionless and connection-oriented services at the transport layer and show their implementation using an FSM. To discuss the behavior of four generic transport-layer protocols and their applications: simple protocol, Stop-and-Wait protocol, Go-Back-N protocol, and Selective-Repeat protocol. To describe the idea of bidirectional communication at the transport layer using the piggybacking method. TCP/IP Protocol Suite

Chapter Outline 13.1 Transport-Layer Services 13.2 Transport-Layer Protocols TCP/IP Protocol Suite

13-1 TRANSPORT-LAYER SERVICES As we discussed in Chapter 2, the transport layer is located between the network layer and the application layer. The transport layer is responsible for providing services to the application layer; it receives services from the network layer. In this section, we discuss the services that can be provided by a transport layer; in the next section, we discuss the principle beyond several transport layer protocols. TCP/IP Protocol Suite

Topics Discussed in the Section Process-to-Process Communication Addressing: Port Numbers Encapsulation and Decapsulation Multiplexing and Demultiplexing Flow Control Error Control Congestion Control Connectionless and Connection-Oriented Services TCP/IP Protocol Suite

进程到进程的通信 传输层的首要任务是提供进程到进程的通信 进程是指使用了传输层服务的一个应用层实体(正在运行的程序,即进程) 网络层提供主机到主机的通信 TCP/IP Protocol Suite

Figure 13.1 Network layer versus transport layer TCP/IP Protocol Suite

端口号 区别进程的标志:端口号,16bits 区别主机的标志:IP地址,32bits TCP/IP Protocol Suite

Figure 13.2 Port numbers TCP/IP Protocol Suite

Figure 13.3 IP addresses versus port numbers TCP/IP Protocol Suite

端口范围段 周知端口:0-1023 注册端口:1024-49151 动态端口:49152-65535 TCP/IP Protocol Suite

Figure 13.4 ICANN ranges TCP/IP Protocol Suite

The well-known port numbers are less than 1,024. Note The well-known port numbers are less than 1,024. TCP/IP Protocol Suite

Example 13.1 In UNIX, the well-known ports are stored in a file called /etc/services. Each line in this file gives the name of the server and the well-known port number. We can use the grep utility to extract the line corresponding to the desired application. The following shows the port for TFTP. Note that TFTP can use port 69 on either UDP or TCP. SNMP (see Chapter 24) uses two port numbers (161 and 162), each for a different purpose. TCP/IP Protocol Suite

套接字地址 TCP协议在建立连接时,需要在连接的两端同时使用IP地址和端口号 套接字地址:IP地址和端口号的组合 TCP/IP Protocol Suite

Figure 13.5 Socket address TCP/IP Protocol Suite

封装和解封 传输层协议需要对应用层报文进行封装(发送时)和解封(接收时) TCP/IP Protocol Suite

Figure 13.6 Encapsulation and decapsulation TCP/IP Protocol Suite

Figure 13.7 Multiplexing and demultiplexing TCP/IP Protocol Suite

流量控制 当一个实体产生数据而另一个实体消耗这些数据时,数据的产生速度和消耗速度之间应当达到某种平衡 产生数据速度大于消耗速度,消耗方来不及处理 产生数据速度小于消耗速度,消耗方需要等待 TCP/IP Protocol Suite

Figure 13.8 Pushing or pulling TCP/IP Protocol Suite

传输层流量控制 涉及发送方进程、发送方传输层、接收方传输层、接收方进程 TCP/IP Protocol Suite

Figure 13.9 Flow control at the transport layer TCP/IP Protocol Suite

缓存 流量控制需要使用两个缓存 一个位于发送方的传输层 一个位于接收方的传输层 TCP/IP Protocol Suite

Example 13.2 The above discussion requires that the consumers communicate with the producers in two occasions: when the buffer is full and when there are vacancies. If the two parties use a buffer of only one slot, the communication can be easier. Assume that each transport layer uses one single memory location to hold a packet. When this single slot in the sending transport layer is empty, the sending transport layer sends a note to the application layer to send its next chunk; when this single slot in the receiving transport layer is empty, it sends an acknowledgment to the sending transport layer to send its next packet. As we will see later, this type of flow control, using a single-slot buffer at the sender and the receiver, is inefficient. TCP/IP Protocol Suite

差错控制 检测并丢弃损坏的分组 跟踪丢失和丢弃的分组并重传它们 识别重复的分组并丢弃它们 保存失序到达的分组,直至缺失的分组全部抵达 TCP/IP Protocol Suite

Figure 13.10 Error control at the transport layer Packets Error Control TCP/IP Protocol Suite

序号 差错控制需要重传机制 序号(sequence number)用于区别分组被重复发送 TCP/IP Protocol Suite

Note For error control, the sequence numbers are modulo 2m, where m is the size of the sequence number field in bits. TCP/IP Protocol Suite

确认 正面确认(ACK) 负面确认(NAK) 接收方收到正确的分组,回送ACK TCP/IP Protocol Suite

Figure 13.11 Sliding window in circular format TCP/IP Protocol Suite

Figure 13.12 Sliding window in linear format TCP/IP Protocol Suite

Figure 13.13 Connectionless service TCP/IP Protocol Suite

Figure 13.14 Connection-oriented service TCP/IP Protocol Suite

Figure 13.15 Connectionless and connection-oriented services as FSMs TCP/IP Protocol Suite

13-2 TRANSPORT-LAYER PROTOCOLS We can create a transport-layer protocol by combining a set of services described in the previous sections. To better understand the behavior of these protocols, we start with the simplest one and gradually add more complexity. The TCP/IP protocol uses a transport layer protocol that is either a modification or a combination of some of these protocols. TCP/IP Protocol Suite

Topics Discussed in the Section Simple Protocol Stop-and-Wait Protocol Go-Back-N Protocol Selective-Repeat Protocol Bidirectional Protocols: Piggybacking TCP/IP Protocol Suite

Figure 13.16 Simple protocol TCP/IP Protocol Suite

Figure 13.17 FSMs for simple protocol TCP/IP Protocol Suite

The simple protocol is a connectionless protocol that provides neither Note The simple protocol is a connectionless protocol that provides neither flow nor error control. TCP/IP Protocol Suite

Example 13.3 Figure 13.18 shows an example of communication using this protocol. It is very simple. The sender sends packets one after another without even thinking about the receiver. TCP/IP Protocol Suite

Figure 13.18 Example 13.3 TCP/IP Protocol Suite

Figure 13.19 Stop-and-wait protocol TCP/IP Protocol Suite

In Stop-and-Wait protocol, flow Note In Stop-and-Wait protocol, flow control is achieved by forcing the sender to wait for an acknowledgment, and error control is achieved by discarding corrupted packets and letting the sender resend unacknowledged packets when the timer expires. TCP/IP Protocol Suite

Note In the Stop-and-Wait protocol, we can use a 1-bit field to number the packets. The sequence numbers are based on modulo-2 arithmetic. TCP/IP Protocol Suite

Note In the Stop-and-Wait protocol, the acknowledgment number always announces in modulo-2 arithmetic the sequence number of the next packet expected. TCP/IP Protocol Suite

All calculation in the Stop-and-Wait protocol is in modulo 2. Note All calculation in the Stop-and-Wait protocol is in modulo 2. TCP/IP Protocol Suite

Figure 13.20 FSMs for stop-and-wait protocol TCP/IP Protocol Suite

Example 13.4 Figure 13.21 shows an example of Stop-and-Wait protocol. Packet 0 is sent and acknowledged. Packet 1 is lost and resent after the time-out. The resent packet 1 is acknowledged and the timer stops. Packet 0 is sent and acknowledged, but the acknowledgment is lost. The sender has no idea if the packet or the acknowledgment is lost, so after the time-out, it resends packet 0, which is acknowledged. TCP/IP Protocol Suite

Figure 13.21 Example 13.4 TCP/IP Protocol Suite

Example 13.5 Assume that, in a Stop-and-Wait system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 milliseconds to make a round trip. What is the bandwidth-delay product? If the system data packets are 1,000 bits in length, what is the utilization percentage of the link? Solution The bandwidth-delay product is (1 × 106) × (20 × 10−3) = 20,000 bits. The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and the acknowledgment to come back. However, the system sends only 1,000 bits. We can say that the link utilization is only 1,000/20,000, or 5 percent. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait wastes the capacity of the link. TCP/IP Protocol Suite

Example 13.6 What is the utilization percentage of the link in Example 13.5 if we have a protocol that can send up to 15 packets before stopping and worrying about the acknowledgments? Solution The bandwidth-delay product is still 20,000 bits. The system can send up to 15 packets or 15,000 bits during a round trip. This means the utilization is 15,000/20,000, or 75 percent. Of course, if there are damaged packets, the utilization percentage is much less because packets have to be resent. TCP/IP Protocol Suite

Figure 13.22 Go-Back-N protocol TCP/IP Protocol Suite

Note In the Go-Back-N Protocol, the sequence numbers are modulo 2m, where m is the size of the sequence number field in bits. TCP/IP Protocol Suite

Note In the Go-Back-N protocol, the acknowledgment number is cumulative and defines the sequence number of the next packet expected to arrive. TCP/IP Protocol Suite

Figure 13.23 Send window for Go-Back-N TCP/IP Protocol Suite

size = 2m − 1 with three variables: Sf, Sn, and Ssize. Note The send window is an abstract concept defining an imaginary box of maximum size = 2m − 1 with three variables: Sf, Sn, and Ssize. TCP/IP Protocol Suite

Note The send window can slide one or more slots when an error-free ACK with ackNo between Sf and Sn (in modular arithmetic) arrives. TCP/IP Protocol Suite

Figure 13.24 Sliding the send window TCP/IP Protocol Suite

Figure 13.25 Receive window for Go-Back-N TCP/IP Protocol Suite

The receive window is an abstract concept defining an imaginary Note The receive window is an abstract concept defining an imaginary box of size 1 with one single variable Rn. The window slides when a correct packet has arrived; sliding occurs one slot at a time. TCP/IP Protocol Suite

Figure 13.26 FSMs for Go-Back-N TCP/IP Protocol Suite

Figure 13.27 Send window size for Go-Back-N TCP/IP Protocol Suite

the size of the receive window is always 1. Note In the Go-Back-N protocol, the size of the send window must be less than 2m; the size of the receive window is always 1. TCP/IP Protocol Suite

Example 13.7 Figure 13.28 shows an example of Go-Back-N. This is an example of a case where the forward channel is reliable, but the reverse is not. No data packets are lost, but some ACKs are delayed and one is lost. The example also shows how cumulative acknowledgments can help if acknowledgments are delayed or lost. TCP/IP Protocol Suite

Figure 13.28 Example 13.7 TCP/IP Protocol Suite

Example 13.8 Figure 13.29 shows what happens when a packet is lost. Packets 0, 1, 2, and 3 are sent. However, packet 1 is lost. The receiver receives packets 2 and 3, but they are discarded because they are received out of order (packet 1 is expected). When the receiver receives packets 2 and 3, it sends ACK1 to show that it expects to receive packet 1. However, these ACKs are not useful for the sender because the ackNo is equal Sf , not greater that Sf . So the sender discards them. When the time-out occurs, the sender resends packets 1, 2, and 3, which are acknowledged.. TCP/IP Protocol Suite

Figure 13.29 Example 13.8 TCP/IP Protocol Suite

Figure 13.30 Outline of Selective-Repeat TCP/IP Protocol Suite

Figure 13.31 Send window for Selective-Repeat protocol TCP/IP Protocol Suite

Figure 13.32 Receive window for Selective-Repeat protocol TCP/IP Protocol Suite

In the Selective-Repeat protocol, an acknowledgment number defines Note In the Selective-Repeat protocol, an acknowledgment number defines the sequence number of the error-free packet received. TCP/IP Protocol Suite

Example 13.9 Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and 5. The sender receives an ACK with ackNo = 3. What is the interpretation if the system is using GBN or SR? Solution If the system is using GBN, it means that packets 0, 1, and 2 have been received uncorrupted and the receiver is expecting packet 3. If the system is using SR, it means that packet 3 has been received uncorrupted; the ACK does not say anything about other packets. TCP/IP Protocol Suite

Figure 13.33 FSMs for SR protocol TCP/IP Protocol Suite

Example 13.10 This example is similar to Example 3.8 (Figure 13.29) in which packet 1 is lost. We show how Selective-Repeat behaves in this case. Figure 13.34 shows the situation. At the sender, packet 0 is transmitted and acknowledged. Packet 1 is lost. Packets 2 and 3 arrive out of order and are acknowledged. When the timer times out, packet 1 (the only unacknowledged packet) is resent and is acknowledged. The send window then slides. TCP/IP Protocol Suite

Figure 13.34 Example 13.10 TCP/IP Protocol Suite

Figure 13.35 Selective-Repeat window size TCP/IP Protocol Suite

In Selective-Repeat, the size of the sender and receiver window Note In Selective-Repeat, the size of the sender and receiver window can be at most one-half of 2m. TCP/IP Protocol Suite

Figure 13.36 Design of piggybacking for Go-Back-N TCP/IP Protocol Suite