type
status
date
slug
summary
tags
category
icon
password
传输服务和协议
前情提要
传输层提供的服务是:进程与进程之间的逻辑交流
A transport-layer protocol provides for logical communication between application processes running on different hosts.
网络层提供的服务是:主机与主机之间的逻辑交流
使用传输层的logic communication(逻辑的通讯服务)来实现进程与进程间的交流
Application processes use the logical communication provided by the transport layer to send messages to each other, free from the worry of the details of the physical infra-structure used to carry these messages.
报文段(segment) 传输层的PDU
报文(message) 应用层的PDU
the transport layer converts the application-layer messages it receives from a sending application process into transport-layer packets, known as transport-layer segments in Internet terminology.
报文段和段头
This is done by (possibly) breaking the application messages into smaller chunks and adding a transport-layer header to each chunk to create the transport-layer segment.
传输层两大协议:TCP和UDP
More than one transport-layer protocol may be available to network applications.For example, the Internet has two protocols—TCP and UDP. Each of these protocols provides a different set of transport-layer services to the invoking application.
At the very least, the transport layer has to provide a multiplexing/demultiplexing service in order to pass data between the network layer and the correct application-level process.
- 为运行在不同主机的应用进程提供逻辑通信
- 传输协议运行在端系统
- 发送方:
- 接收方:
将应用层的报文分成报文段,然后传递给网络层
将报文段重组成报文,然后传递给应用层
- 有多个传输层协议可供应用层选择
- Internet:TCP和UDP
Relationship Between Transport and Network Layers
传输层的服务依赖于网络层的服务,并对网络层的服务进行加强
用例子来类比传输层和网络层的关系
住东边的给住西边的写信,ann和bill负责统计和分发信件,邮局负责送信
- In this example, the postal service provides logical communication between the two houses—the postal service moves mail from house to house, not from person to person.
On the other hand, Ann and Bill provide logical communication among the cousins—Ann and Bill pick up mail from, and deliver mail to, their brothers and sisters.
- 对应关系
application messages = letters in envelopes
processes = cousins
hosts (also called end systems) = houses
transport-layer protocol = Ann and Bill
network-layer protocol = postal service (including mail carriers)
- 在端系统中,一个传输层协议将信息从应用进程搬运到网络边缘
the network edge(that is, the network layer)
换了一对年轻的兄妹来替代ann和bill,这两人取信和寄信频率更低且偶尔丢信,因此两人无法提供与ann-bill组合相同的服务
- a computer network may make available multiple transport protocols, with each protocol offering a different service model to applications.
- 传输层协议提供的服务是由底层的网络层协议的服务模型驱动的
If the network-layer protocol cannot provide delay or bandwidth guarantees for transport layer segments sent between hosts, then the transport-layer protocol cannot provide delay or bandwidth guarantees for application messages sent between processes.
- 然而,有的传输层协议服务可以在网络层没有对应服务的情况下实现
Overview of the Transport Layer in the Internet
关于segment和datagram
We mention, however, that the Internet literature (for example, the RFCs) also refers to the transport-layer packet for TCP as a segment but often refers to the packet for UDP as a datagram. However, this same Internet literature also uses the term datagram for the network-layer packet!
For an introductory book on computer networking such as this, we believe that it is less confusing to refer to both TCP and UDP packets as segments, and reserve the term datagram for the network-layer packet
关于网络层和IP service model的简单介绍
- IP——Internet Protocol
The Internet’s network-layer protocol has a name—IP, for Internet Protocol. IP provides logical communication between hosts.
- IP是一个unreliable protocol
IP makes its “best effort” to deliver segments between communicating hosts, but it makes no guarantees.
IP不保证segment delivery的有序性、完整性
- IP address——主机网络层的地址
every host has at least one network-layer address, a so-called IP address.
UDP和TCP提供的service model
UDP和TCP提供的服务
- 扩展IP’s service: 两个端系统之间的传递服务在两个端系统上运行的两个进程之间的传递服务
The most fundamental responsibility of UDP and TCP is to extend IP’s delivery service between two end systems to a delivery service between two processes running on the end systems
- 主机到主机之间的传递进程到进程之间的传递
Extending host-to-host delivery to process-to-process delivery is called transport-layer multiplexing and demultiplexing.
多路复用解复用
- 提供数据完整性检查
UDP and TCP also provide integrity checking by including error detection fields in their segments’ headers.
process-to-process data delivery和error checking就是UDP可以提供的全部服务
like IP, UDP is an unreliable service—it does not guarantee that data sent by one process will arrive intact (or at all!) to the destination process.
只有TCP可以提供的服务
- reliable data transfer
TCP ensures that data is delivered from sending process to receiving process, correctly and in order.
TCP将IP提供的在end system之间不可靠的服务转变为在进程间可靠的服务
- congestion control 拥塞控制
TCP拥塞控制可以防止任何一个TCP连接使通信主机之间的链路和路由器陷入过多的流量
TCP strives to give each connection traversing a congested link an equal share of the link bandwidth. This is done by regulating the rate at which the sending sides of TCP connections can send traffic into the network.(调节TCP连接发送端向网络发送流量的速率)
UDP traffic, on the other hand, is unregulated. An application using UDP transport can send at any rate it pleases, for as long as it pleases.
- 流量控制
- 建立连接
传输层加强网络层的服务
- 加强网络层服务的可靠性
- IP提供的服务由TCP或UDP来加强
- 数据丢失、顺序混乱、加密
- 提升带宽
- 复用解复用
- Author:orangec
- URL:orange’s blog | welcome to my blog (clovy.top)/46d65040657443a4afed23f1aa25512b
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts