如果TCP是面向连接的,为什么数据包遵循不同的路径? [英] If TCP is connection oriented why do packets follow different paths?

查看:1186
本文介绍了如果TCP是面向连接的,为什么数据包遵循不同的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的知识,如果必须设计互联网应用程序,我们应该使用面向连接的服务或无连接服务,但不能同时使用这两种服务。

According to my knowledge if an internet application has to be designed, we should use either a connection-oriented service or connection-less service, but not both.

Internet的面向连接的服务是TCP,无连接服务是UDP,它们都驻留在Internet协议栈的传输层中。

Internet's connection oriented service is TCP and connection-less service is UDP, and both resides in the transport layer of Internet Protocol stack.

Internet唯一的网络层是IP,这是无连接服务。所以它意味着我们设计的任何应用程序最终都使用IP来传输数据包。

Internet's only network layer is IP, which is a connection-less service. So it means whatever application we design it eventually uses IP to transmit the packets.

面向连接的服务使用相同的路径传输所有数据包,无连接服务不是。

Connection-oriented services use the same path to transmit all the packets, and connection-less does not.

因此我的问题是

如果设计了面向连接的应用程序,它应该传输数据包使用相同的路径。但IP通过使用不同的路由打破了这一规则。那么TCP和IP如何在这个意义上协同工作?这完全让我感到困惑。

if a connection oriented application has been designed, it should transmit the packets using the same path. But IP breaks that rule by using different routes.So how do both TCP and IP work together in this sense? It totally confuses me.

推荐答案

你,我的朋友,混淆了两个不同层的功能。

You, my friend, are confusing the functionality of two different layers.

TCP是面向连接的,因为在两端之间存在连接建立,它们可以协商不同的东西,如拥塞控制机制等。

运输层协议的一般目的是提供进程到进程的交付,这意味着它对路由一无所知;您的数据包如何到达终端系统超出了他们的范围,他们只关心数据包在两个进程之间的传输方式。

TCP is connection oriented in the sense that there's a connection establishment, between the two ends where they may negotiate different things like congestion-control mechanism among other things.
The transport layer protocols' general purpose is to provide process-to-process delivery meaning that it doesn't know anything about routes; how your packets reach the end system is beyond their scope, they're only concerned with how packets are being transmitted between the two end PROCESSES.

IP,另一方面互联网的网络层协议,关注终端系统之间的数据传输,但它没有连接,它保持没有连接,所以每个数据包都独立于其他数据包处理。

离开你的系统,每个路由器将选择它认为适合EACH数据包的路径,并且此路径可能会根据可用性/拥塞情况而改变。

IP, on the other hand, the Network layer protocol for the Internet, is concerned with data-delivery between end-systems yet it's connection-less, it maintains no connection so each packet is handled independently of the other packets.
Leaving your system, each router will choose the path that it sees fit for EACH packet, and this path may change depending on availability/congestion.

如何回答您的问题?$
TCP将确保数据包到达另一个进程,它不会关心他们如何到达那里。另一方面,
IP如果到达另一个则无关心完全结束时,它将根据它看到的最适合特定数据包的内容简单地转发每个不同的数据包。

How does that answer your question?
TCP will make sure packets reach the other process, it won't care HOW they got there.
IP, on the other hand, will not care if they reach the other end at all, it'll simply forward each different packet according to what it sees most fit for a particular packet.

注意:


让我们假设IP是面向连接的,这是否意味着数据包将遵循相同的路径?
不一定,它取决于此层的连接一词意味着什么,如果它意味着协商某些与安全相关的选项,例如,您可能仍然通过Internet通过不同的路由转发所有数据包。


编辑:

不要混淆你,网络层及以下的大多数面向连接的服务意味着连接,建立后,还建立了所有数据包必须遵循的虚拟路径,以获取有关以下内容的更多信息:

虚拟电路帧中继网络

这篇关于如果TCP是面向连接的,为什么数据包遵循不同的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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