美文网首页
TCP/IP Illustrated, Volume 1 笔记

TCP/IP Illustrated, Volume 1 笔记

作者: 半步江南 | 来源:发表于2018-12-10 15:09 被阅读24次

    Each layer has a different responsibility.

    The link layer, sometimes called the data-link layer or network interface layer, normally includes the
    device driver in the operating system and the corresponding network interface card in the computer.
    Together they handle all the hardware details of physically interfacing with the cable (or whatever
    type of media is being used).
    链路层,有时称为数据链路层或网络接口层,通常包括操作系统中的设备驱动程序和计算机中相应的网络接口卡。
    它们一起处理与电缆(或正在使用的任何类型的媒体)物理接口的所有硬件细节。

    The network layer (sometimes called the internet layer) handles the movement of packets around the
    network. Routing of packets, for example, takes place here. IP (Internet Protocol), ICMP (Internet
    Control Message Protocol), and IGMP (Internet Group Management Protocol) provide the network
    layer in the TCP/IP protocol suite.
    网络层(有时称为internet层)处理数据包在网络中的移动。例如,数据包的转发就发生在这里。IP (Internet协议)、
    ICMP ((Internet Control Message Protocol)和IGMP (Internet Group Management Protocol)提供TCP/IP协议套件中的网络层

    The transport layer provides a flow of data between two hosts, for the application layer above. In the
    TCP/IP protocol suite there are two vastly different transport protocols: TCP (Transmission Control
    Protocol) and UDP (User Datagram Protocol).
    传输层为上面的应用层提供两个主机之间的数据流。TCP/IP协议套件有两种完全不同的传输协议:TCP(Transmission Control
    Protocol)和UDP(User Datagram Protocol)。
    TCP provides a reliable flow of data between two hosts. It is concerned with things such as dividing
    the data passed to it from the application into appropriately sized chunks for the network layer below,
    acknowledging received packets, setting timeouts to make certain the other end acknowledges packets
    that are sent, and so on. Because this reliable flow of data is provided by the transport layer, the application
    layer can ignore all these details.
    TCP在两台主机之间提供了可靠的数据流。它可以将由应用程序传递给它的数据划分为适当大小的块,用于下面的网络层,确认接收到的数据包,设置超时以确保另一端确认发送的数据包,等等。因为这种可靠的数据流是由传输层提供的,所以应用层可以忽略所有这些细节
    UDP, on the other hand, provides a much simpler service to the application layer. It just sends packets
    of data called datagrams from one host to the other, but there is no guarantee that the datagrams reach
    the other end. Any desired reliability must be added by the application layer.
    另一方面,UDP为应用层提供了更简单的服务。它只是将称为数据报的数据包从一个主机发送到另一个主机,但不能保证数据报到达另一端。任何期望的可靠性都必须由应用层添加。
    There is a use for each type of transport protocol, which we'll see when we look at the different
    applications that use TCP and UDP.
    每种类型的传输协议都有其用途,我们将在研究使用TCP和UDP的不同应用程序时看到这一点

    The application layer handles the details of the particular application. There are many common
    TCP/IP applications that almost every implementation provides:
    应用层处理特定应用程序的细节。有很多常见的TCP/IP应用程序,例如:
    ❍ Telnet for remote login,
    ❍ FTP, the File Transfer Protocol,
    ❍ SMTP, the Simple Mail Transfer protocol, for electronic mail,
    ❍ SNMP, the Simple Network Management Protocol,
    and many more, some of which we cover in later chapters.
    On the right side of Figure 1.2 we have noted that normally the application layer is a user process while the lower three layers are usually implemented in the kernel (the operating system). Although this isn't a requirement, it's typical and this is the way it's done under Unix.

    Figure 1.2. Two hosts on a LAN running FTP.png

    We have labeled one application box the FTP client and the other the FTP server. Most network applications are designed so that one end is the client and the other side the server. The server provides some type of service to clients, in this case access to files on the server host. In the remote login application, Telnet, the service provided to the client is the ability to login to the server's host.
    我们已经将一个应用程序框标记为FTP客户机,另一个标记为FTP服务器。大多数网络应用程序被设计成一端是客户端,另一端是服务器。服务器向客户机提供某种类型的服务,在本例中是访问服务器主机上的文件。在远程登录应用程序Telnet中,提供给客户机的服务是登录到服务器主机的能力
    Each layer has one or more protocols for communicating with its peer at the same layer. One protocol, for example, allows the two TCP layers to communicate, and another protocol lets the two IP layers communicate.
    每个层都有一个或多个协议,用于与同一层的对等方通信。例如,一个协议允许两个TCP层通信,另一个协议允许两个IP层通信。

    On the right side of Figure 1.2 we have noted that normally the application layer is a user process while the lower three layers are usually implemented in the kernel (the operating system). Although this isn't a requirement, it's typical and this is the way it's done under Unix.
    在图1.2的右侧,我们注意到通常应用层是一个用户进程,而较低的三层通常在内核(操作系统)中实现。虽然这不是必需的,但它是典型的,而且在Unix下也是这样做的。

    There is another critical difference between the top layer in [Figure 1.2]and the lower three layers. The application layer is concerned with the details of the application and not with the movement of data across the network. The lower three layers know nothing about the application but handle all the communication details
    在[图1.2]的顶层和较低的三层之间还有另一个关键的区别。应用层关注的是应用程序的细节,而不是跨网络的数据移动。下面三层对应用程序一无所知,但是处理所有通信细节

    We show four protocols in Figure 1.2, each at a different layer. FTP is an application layer protocol, TCP is a transport layer protocol, IP is a network layer protocol, and the Ethernet protocols operate at the link layer. The TCP/IP protocol suite is a combination of many protocols. Although the commonly used name for the entire protocol suite is TCP/IP, TCP and IP are only two of the protocols. (An alternative name is the Internet Protocol Suite.)
    我们在[图1.2]中显示了4个协议,每个协议位于不同的层。FTP是应用层协议,TCP是传输层协议,IP是网络层协议,以太网协议在链路层操作。TCP/IP 协议套件是许多协议的组合。虽然整个协议套件的常用名称是TCP/IP,但TCP和IP只是其中的两个协议。(另一个名称是*Internet Protocol Suite。)

    The purpose of the network interface layer and the application layer are obvious— the former handles the details of the communication media (Ethernet, token ring, etc.) while the latter handles one specific user application (FTP, Telnet, etc.). But on first glance the difference between the network layer and the transport layer is somewhat hazy. Why is there a distinction between the two? To understand the reason, we have to expand our perspective from a single network to a collection of networks.

    网络接口层和应用层的用途很明显——前者处理通信媒体(以太网、令牌环等)的细节,而后者处理一个特定的用户应用程序(FTP、Telnet等)。但是乍一看,网络层和传输层之间的区别有些模糊。为什么两者之间有区别?为了理解原因,我们必须将视角从单个网络扩展到多个网络。

    One of the reasons for the phenomenal growth in networking during the 1980s was the realization that an island consisting of a stand-alone computer made little sense. A few stand-alone systems were collected together into a network. While this was progress, during the 1990s we have come to realize that this new, bigger island consisting of a single network doesn't make sense either. People are combining multiple networks together into an internetwork, or an internet. An internet is a collection of networks that all use the same protocol suite.

    1980年代网络发展迅速的原因之一是人们认识到由一台独立的计算机组成的小岛没有什么意义。一些独立的系统被收集到一个网络中。虽然这是一个进步,但在20世纪90年代,我们已经意识到,这个由单一网络组成的更大的新岛屿也没有任何意义。人们将多个网络组合在一起形成一个互连网,或称internet。internet是使用相同协议套件的网络集合。

    The easiest way to build an internet is to connect two or more networks with a router. This is often a special-purpose hardware box for connecting networks. The nice thing about routers is that they provide connections to many different types of physical networks: Ethernet, token ring, point-to-point links, FDDI (Fiber Distributed Data Interface), and so on.

    建立互联网最简单的方法是用路由器连接两个或更多的网络。这通常是连接网络的专用硬件盒。路由器的优点是它们提供到许多不同类型的物理网络的连接:以太网、令牌环、点到点链接、FDDI(光纤分布式数据接口)等等。
    These boxes are also called IP routers, but we'll use the term router.

    Historically these boxes were called gateways, and this term is used throughout much of the TCP/IP literature. Today the term gateway is used for an application gateway: a process that connects two different protocol suites (say, TCP/IP and IBM's SNA) for one particular application (often electronic mail or file transfer).

    这些盒子也被称为IP路由器,但我们将使用术语路由器。
    在历史上,这些盒子被称为网关,这个术语在TCP/IP文献中被广泛使用。今天,术语网关用于应用程序网关:对于一个特定的应用程序(通常是电子邮件或文件传输),连接两个不同协议套件(例如TCP/IP和IBM的SNA)的进程。

    Figure 1.3. Two networks connected with a router..png

    [Figure 1.3] shows an internet consisting of two networks: an Ethernet and a token ring, connected with a router. Although we show only two hosts communicating, with the router connecting the two networks, any host on the Ethernet can communicate with any host on the token ring.

    在图1.3中,我们可以区分终端系统(两边的主机)和中间系统(中间的路由器)。应用层和传输层使用端到端协议。在我们的图中,这两个层只在终端系统中需要。然而,网络层提供了一个逐跳协议,并在两个终端系统和每个中间系统上使用。

    In the TCP/IP protocol suite the network layer, IP, provides an unreliable service. That is, it does its best job of moving a packet from its source to its final destination, but there are no guarantees. TCP, on the other hand, provides a reliable transport layer using the unreliable service of IP. To provide this service, TCP performs timeout and retransmission, sends and receives end-to-end acknowledgments, and so on. The transport layer and the network layer have distinct responsibilities.

    在TCP/IP协议套件中,网络层IP提供了一个不可靠的服务。也就是说,它尽可能努力地将包从源移动到最终目的地,但却不保证数据的完整。另一方面,TCP使用不可靠的IP服务提供了可靠的传输层。为了提供此服务,TCP执行超时和重传、发送和接收端到端确认,等等。传输层和网络层有不同的职责。

    A router, by definition, has two or more network interface layers (since it connects two or more networks). Any system with multiple interfaces is called multihomed. A host can also be multihomed but unless it specifically forwards packets from one interface to another, it is not called a router. Also, routers need not be special hardware boxes that only move packets around an internet. Most TCP/IP implementations allow a multihomed host to act as a router also, but the host needs to be specifically configured for this to happen. In this case we can call the system either a host (when an application such as FTP or Telnet is being used) or a router (when it's forwarding packets from one network to another). We'll use whichever term makes sense given the context.

    路由器,根据定义,有两个或更多的网络接口层(因为它连接两个或更多的网络)。任何具有多个接口的系统都称为多宿主系统。主机也可以是多宿主的,但是除非它专门将数据包从一个接口转发到另一个接口,否则它就不叫路由器。此外,路由器不只是只在互联网上移动数据包的特殊硬件盒。大多数TCP/IP实现也允许多主机充当路由器,但是需要专门配置主机来实现这一点。我们可以调用主机(当使用FTP或Telnet等应用程序时)或路由器(当它将数据包从一个网络转发到另一个网络时)。

    One of the goals of an internet is to hide all the details of the physical layout of the internet from the applications. Although this isn't obvious from our two-network internet in [Figure 1.3] the application layers can't care (and don't care) that one host is on an Ethernet, the other on a token ring, with a router between. There could be 20 routers between, with additional types of physical interconnections, and the applications would run the same. This hiding of the details is what makes the concept of an internet so powerful and useful.

    internet的目标之一是对应用程序隐藏internet物理布局的所有细节。虽然这在[图1.3]中的双网络internet中并不明显,但是应用程序层不能关心(也不关心)一个主机在以太网上,另一个主机在令牌环上,中间有路由器。尽管它们之间可能有20个路由器,以及其他类型的物理互连,而无论如何应用程序将用同一种方式运行。正是这种对细节的隐藏使得互联网的概念如此强大和有用。

    Another way to connect networks is with a bridge. These connect networks at the link layer, while routers connect networks at the network layer. Bridges makes multiple LANs appear to the upper layers as a single LAN.
    另一种连接网络的方法是用桥接。这些连接网络在链路层,而路由器连接网络在网络层。网桥使多个局域网作为一个局域网出现在上层。

    Figure 1.4Various protocols at the different layers.png

    TCP and UDP are the two predominant transport layer protocols. Both use IP as the network layer.

    TCP provides a reliable transport layer, even though the service it uses (IP) is unreliable. Chapters 17 through 22 provide a detailed look at the operation of TCP. We then look at some TCP applications: Telnet and Rlogin in [Chapter 26] FTP in [Chapter 27], and SMTP in Chapter 28. The applications are normally user processes.
    TCP和UDP是两种主要的传输层协议。两者都使用IP作为网络层。
    TCP提供了一个可靠的传输层,即使它使用的服务(IP)是不可靠的。第17到22章提供了TCP操作的详细介绍。然后我们看一些TCP应用程序:[26章]FTP中的Telnet和Rlogin[27章],以及[28章中的SMTP。应用程序通常是用户进程。

    UDP sends and receives datagrams for applications. A datagram is a unit of information (i.e., a certain number of bytes of information that is specified by the sender) that travels from the sender to the receiver. Unlike TCP, however, UDP is unreliable. There is no guarantee that the datagram ever gets to its final destination. [Chapter 11]looks at UDP, and then [Chapter 14](the Domain Name System), [Chapter 15] (the Trivial File Transfer Protocol), and [Chapter 16] (the Bootstrap Protocol) look at some applications that use UDP. SNMP (the Simple Network Management Protocol) also uses UDP, but since it deals with many of the other protocols, we save a discussion of it until [Chapter 25].
    UDP发送和接收应用程序的数据报。数据报是一种信息单位(即,由发送方指定的一定数量的信息字节),从发送方传送到接收方。然而,与TCP不同,UDP是不可靠的。不能保证数据报能够到达它的最终目的地。[11章]介绍了UDP,然后14章15章16章介绍了一些使用UDP的应用程序。SNMP(简单网络管理协议)也使用UDP,但由于它处理许多其他协议,我们将对它的讨论留到[25章]。

    IP is the main protocol at the network layer. It is used by both TCP and UDP. Every piece of TCP and UDP data that gets transferred around an internet goes through the IP layer at both end systems and at every intermediate router. In Figure 1.4 we also show an application accessing IP directly. This is rare, but possible. (Some older routing protocols were implemented this way. Also, it is possible to experiment with new transport layer protocols using this feature.) Chapter 3 looks at IP, but we save some of the details for later chapters where their discussion makes more sense. Chapters 9 and 10 look at how IP performs routing.
    IP是网络层的主要协议。TCP和UDP都使用它。在internet上传输的TCP和UDP数据的每一部分都要经过终端系统和每个中间路由器的IP层。在[图1.4]中,我们还显示了一个直接访问IP的应用程序。这很少见,但却是可能的。(一些旧的路由协议就是这样实现的)
    此外,还可以使用这个特性来试验新的传输层协议)[第3章]介绍了IP,但是我们将一些细节保留到后面的章节中,在那里他们的讨论更有意义。[第9章]和[10]介绍了IP如何执行路由。

    ICMP is an adjunct to IP. It is used by the IP layer to exchange error messages and other vital information with the IP layer in another host or router. Chapter 6 looks at ICMP in more detail. Although ICMP is used primarily by IP, it is possible for an application to also access it. Indeed we'll see that two popular diagnostic tools, Ping and Traceroute (Chapters 7 and 8), both use ICMP.
    ICMP是IP的附件。IP层使用它与另一台主机或路由器中的IP层交换错误消息和其他重要信息。[第6章]更详细地介绍了ICMP。虽然ICMP主要由IP使用,但是应用程序也可以访问它。实际上,我们将看到两个流行的诊断工具Ping和Traceroute([第7章]和[8]都使用ICMP。

    IGMP is the Internet Group Management Protocol. It is used with multicasting: sending a UDP datagram to multiple hosts. We describe the general properties of broadcasting (sending a UDP datagram to every host on a specified network) and multicasting in Chapter 12, and then describe IGMP itself in Chapter 13.
    IGMP是Internet组管理协议。它与多播一起使用:将UDP数据报发送到多个主机。我们将在[第12章]中描述广播(向指定网络上的每个主机发送UDP数据报)和多播的一般属性,然后在[13章]中描述IGMP本身。

    ARP (Address Resolution Protocol) and RARP (Reverse Address Resolution Protocol) are specialized protocols used only with certain types of network interfaces (such as Ethernet and token ring) to convert between the addresses used by the IP layer and the addresses used by the network interface. We examine these protocols in Chapters 4 and 5, respectively.
    ARP(地址解析协议)和RARP(反向地址解析协议)是专门的协议,它们仅与特定类型的网络接口(如以太网和令牌环)一起使用,用于在IP层使用的地址和网络接口使用的地址之间进行转换。我们分别在[第4章]和[5]中研究这些协议

    相关文章

      网友评论

          本文标题:TCP/IP Illustrated, Volume 1 笔记

          本文链接:https://www.haomeiwen.com/subject/ssmrhqtx.html