为什么我们说 TCP/IP 套件中的 IP 协议是无连接的? [英] Why do we say the IP protocol in TCP/IP suite is connectionless?

查看:88
本文介绍了为什么我们说 TCP/IP 套件中的 IP 协议是无连接的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么IP被称为无连接协议?如果是,那么面向连接的协议是什么?

Why is the IP called a connectionless protocol? If so, what is the connection-oriented protocol then?

谢谢.

更新 - 1 - 20:21 2010/12/26

Update - 1 - 20:21 2010/12/26

我认为,为了更好地回答我的问题,最好从物理上和逻辑上解释连接"的实际含义.

I think, to better answer my question, it would be better to explain what "connection" actually means, both physically and logically.

更新 - 2013 年 2 月 1 日上午 2 点 - 9:59

Update - 2 - 9:59 AM 2/1/2013

基于以下所有答案,我觉得这里提到的联系"应该被视为一组行动/安排/纪律.因此,它更像是一个抽象的概念,而不是一个具体的对象.

Based on all the answers below, I come to the feeling that the 'connection' mentioned here should be considered as a set of actions/arrangements/disciplines. Thus it's more an abstract concept rather than a concrete object.

更新 - 2015 年 6 月 18 日上午 3 点 - 11:35

Update - 3 - 11:35 AM 6/18/2015

这里有一个更物理的解释:

Here's a more physical explanation:

  • IP协议是无连接的,因为IP网络中的所有数据包都是独立路由的,它们不一定要经过相同的路由,而在面向连接的虚电路网络中,所有数据包都经过相同的路由.这条单一路线就是虚拟电路"的意思.

  • IP protocol is connectionless in that all packets in IP network are routed independently, they may not necessarily go through the same route, while in a virtual circuit network which is connection oriented, all packets go through the same route. This single route is what 'virtual circuit' means.

在有连接的情况下,因为只有1个路由,所有的数据包都会按照发送出去的顺序到达.

With connection, because there's only 1 route, all data packets will arrive in the same order as they are sent out.

没有连接,不保证所有数据包都会到达发送顺序与发送顺序相同.

Without connection, it is not guaranteed all data packets will arrive in the same order as they are sent out.

更新 - 2016/1/20/星期三上午 4 点 - 9:55

Update - 4 - 9:55 AM 2016/1/20/Wed

面向连接的特点之一是数据包顺序被保留.TCP 使用序列号来实现这一点,但 IP 没有这样的功能.因此,TCP 是面向连接的,而 IP 是无连接的.

One of the characteristics of connection-oriented is that the packet order is preserved. TCP use a sequence number to achieve that but IP has no such facility. Thus TCP is connection-oriented while IP is connection-less.

推荐答案

基本思想非常简单:使用 IP(单独使用——没有 TCP、UDP 等)你只是发送一个数据包.您只需将一些数据发送到带有目标地址的网络上,仅此而已.就其本身而言,IP 提供:

The basic idea is pretty simple: with IP (on its own -- no TCP, UDP, etc.) you're just sending a packet of data. You simply send some data onto the net with a destination address, but that's it. By itself, IP gives:

  1. 不保证会送达
  2. 没有办法知道是不是
  3. 没有让目的地知道等待数据包的信息
  4. 还有很多其他的

它所做的只是指定一个最小的数据包格式,这样您就可以从一个点到另一个点获取一些数据(例如,路由器知道数据包格式,因此它们可以查看目的地并在下一跳发送数据包).

All it does is specify a minimal packet format so you can get some data from one point to another (e.g., routers know the packet format, so they can look at the destination and send the packet on its next hop).

TCP 是面向连接的.建立连接意味着在 TCP 对话开始时,它会进行三次握手",因此(特别是)目标知道与源的连接已经建立.它在内部跟踪该地址,因此它可以/将/确实期望来自它的更多数据包,并且能够发送回复以(例如)确认它收到的每个数据包.源和目的地还合作为确认方案对所有数据包进行序列号,因此每一端都知道它发送的数据包是否在另一端被接收.这在物理上并不涉及太多,但从逻辑上讲,它涉及在两端分配一些内存.这包括用于元数据的内存,例如要使用的下一个数据包序列号,以及在对方确认收到该数据包之前可能重新传输的有效负载数据.

TCP is connection oriented. Establishing a connection means that at the beginning of a TCP conversation, it does a "three way handshake" so (in particular) the destination knows that a connection with the source has been established. It keeps track of that address internally, so it can/will/does expect more packets from it, and be able to send replies to (for example) acknowledge each packet it receives. The source and destination also cooperate to serial number all the packets for the acknowledgment scheme, so each end knows whether packets it sent were received at the other end. This doesn't involve much physically, but logically it involves allocating some memory on both ends. That includes memory for metadata like the next packet serial number to use, as well as payload data for possible re-transmission until the other side acknowledges receipt of that packet.

这篇关于为什么我们说 TCP/IP 套件中的 IP 协议是无连接的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆