OSI 模型 - 表示层和会话层的用途是什么?

发布于 2024-07-07 04:30:38 字数 238 浏览 16 评论 0原文

所以我觉得我非常了解应用程序层以及传输层以下(包括)的所有内容。

不过,会话层和表示层我并不完全理解。 我已经阅读了维基百科中的简单描述,但它没有示例说明为什么分离这些层是有用的。

那么:

  • 什么是会话层? 它有什么作用,在什么情况下拥有会话层比简单地通过应用程序与传输进行对话更好?
  • 什么是表示层? (与上面相同的问题)

-亚当

So I feel I pretty well understand the application layer, and everything below (and including) the transport layer.

The session and presentation layers, though, I don't fully understand. I've read the simplistic descriptions in Wikipedia, but it doesn't have an example of why separating out those layers is useful.

So:

  • What is the session layer? What does it do, and under what circumstances is it better to have a session layer than simply talk to the transport with your app?
  • What is the presentation layer? (same questions as above)

-Adam

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

情绪操控生活 2024-07-14 04:30:38

会话层旨在存储两个连接之间的状态,就像我们在进行 Web 编程时使用 cookie 一样。

表示层的目的是在不同格式之间进行转换。 当唯一担心的格式是字符编码(即 ASCII 和 EBCDIC)时,这会更简单。 当您考虑我们今天拥有的所有不同格式(Quicktime、Flash、Pdf)时,集中这一层是不可能的。

TCP/IP 不会对这些层进行任何分配,因为它们确实超出了网络协议的范围。 由应用程序利用堆栈来实现这些。

The session layer is meant to store states between two connections, like what we use cookies for when working with web programming.

The presentation layer is meant to convert between different formats. This was simpler when the only format that was worried about was character encoding, ie ASCII and EBCDIC. When you consider all of the different formats that we have today(Quicktime, Flash, Pdf) centralizing this layer is out of the question.

TCP/IP doesn't make any allocation to these layers, since they are really out of the scope of a networking protocol. It's up to the applications that take advantage of the stack to implement these.

挽清梦 2024-07-14 04:30:38

维基百科上没有任何示例的原因是没有大量 OSI 网络模型的示例。

OSI 再次创建了一个无人使用的标准,因此没有人真正知道应该如何使用它。

The reasons there aren't any examples on wikipedia is that there aren't a whole lot of examples of the OSI network model, period.

OSI has once again created a standard nobody uses, so nobody really know how one should use it.

寂寞美少年 2024-07-14 04:30:38

第 5-6 层在当今的 Web 应用程序中并不常用,因此您很少听说它们。 TCP/IP 堆栈与纯 OSI 模型略有不同。

Layers 5-6 are not commonly used in today's web applications, so you don't hear much about them. The TCP/IP stack is slightly different than a pure OSI Model.

ゃ人海孤独症 2024-07-14 04:30:38

今天使用 TCP/IP 而不是 OSI 的原因之一是它过于臃肿和理论化,会话层和表示层实际上并不需要作为单独的层。

One of the reasons TCP/IP is used today instead of OSI is it was too bloated and theoretical, the session and presentation layer aren't really needed as separate layers as it turned out.

谜兔 2024-07-14 04:30:38

我认为表示层协议定义了数据的格式。 这意味着 XML 或 ASN.1 等协议。 您可能会说视频/音频编解码器是表示层的一部分,尽管这可能正在走向应用层。

我无法帮助你处理会话层。 这一直让我困惑。

说实话,传输层之上的一切边界都非常模糊。 这是因为它通常由单个软件应用程序处理。 此外,这些层并不直接与从 A 到 B 的数据传输相关。第 4 层及以下各层在移动数据方面都有非常具体的目的,例如交换、路由、确保数据完整性等。这使得更容易区分这些层。

I think that presentation layer protocols define the format of data. This means protocols like XML or ASN.1. You could argue that video/audio codecs are part of the presentation layer Although this is probably heading towards the application layer.

I can't help you with the session layer. That has always baffled me.

To be honest, there are very vague boundaries in everything above the transport layer. This is because it is usually handled by a single software application. Also, these layers are not directly associated with transporting data from A to B. Layers 4 and below each have a very specific purpose in moving the data e.g. switching, routing, ensuring data integrity etc. This makes it easier to distinguish between these layers.

花伊自在美 2024-07-14 04:30:38

表示层
表示层代表独立于应用层数据表示的区域——一般来说,它代表应用程序格式到网络格式,或者从网络格式化到应用程序格式的准备或转换。 换句话说,该层为应用程序或网络“呈现”数据。 一个很好的例子是用于安全传输的数据加密和解密 - 这发生在第 6 层。

会话层
当两个设备、计算机或服务器需要相互“通话”时,需要创建一个会话,这是在会话层完成的。 这一层的功能涉及会话每一端的应用程序之间的设置、协调(例如,系统应等待响应多长时间)和终止。

来源

Presentation Layer
The Presentation Layer represents the area that is independent of data representation at the application layer - in general, it represents the preparation or translation of application format to network format, or from network formatting to application format. In other words, the layer “presents” data for the application or the network. A good example of this is encryption and decryption of data for secure transmission - this happens at Layer 6.

Session Layer
When two devices, computers or servers need to “speak” with one another, a session needs to be created, and this is done at the Session Layer. Functions at this layer involve setup, coordination (how long should a system wait for a response, for example) and termination between the applications at each end of the session.

Source

风为裳 2024-07-14 04:30:38

对于表示层:因为大多数通信是在异构系统(操作系统、编程语言、CPU 架构)之间完成的,所以我们需要使用统一的独立规范,例如 ANS1 和 BRE。

For the presentation layer :because most of communication done between heterogeneous systems (Operating Systems,programing langages,cpu architectures)we need to use a unified idepedent specification .like ANS1 ans BRE.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文