The OSI Reference Model

International organization for standardization(ISO) developed a reference model for open system interconnection(OSI). The OSI reference model partitioned the communication process into seven layers and provide a framework for talking about the overall communications process. 

概览:

201623_c81Y_1777336.png

记忆:“All People Seem To Need Data Processing

具体:

Layer 1: physical layer

  • it defines the electrical and physical specifications of the data connection. It defines the relationship between a device and a physical transmission medium (e.g., a copper or fiber optical cable). This includes the layout of pins, voltages, line impedance, cable specifications, signal timing, hubs, repeaters, network adapters, host bus adapters (HBA used in storage area networks) and more.

  • it defines the protocol to establish and terminate a connection between two directly connected nodes over a communications medium.

  • it may define the protocol for flow control.

  • it defines transmission mode i.e. simplex,half,full duplex

  • it defines topology

  • it defines a protocol for the provision of a (not necessarily reliable) connection between two directly connected nodes, and the modulation or conversion between the representation of digital data in user equipment and the corresponding signals transmitted over the physical communications channel. This channel can involve physical cabling (such as copper and optical fiber) or a wireless radio link.


Layer 2: data link layer

The data link layer provides a reliable link between two directly connected nodes, by detecting and possibly correcting errors that may occur in the physical layer. The data link layer is divided into two sublayers:

  • Media Access Control (MAC) layer - responsible for controlling how computers in the network gain access to data and permission to transmit it.(coordinate the transmission from the machines into the medium )

  • Logical Link Control (LLC) layer - control error checking and packet synchronization.

The Point-to-Point Protocol (PPP) is an example of a data link layer in the TCP/IP protocol stack.


Layer 3: network layer

The network layer provides the functional and procedural means of transferring variable length data sequences (called datagrams/packets) from one node to another connected to the same network. A network is a medium to which many nodes can be connected, on whichevery node has an address and which permits nodes connected to it to transfer messages to other nodes(hierarchical addressing scheme:分级寻址系统) connected to it by merely providing the content of a message and the address of the destination node and letting the network find the way to deliver ("route")the message to the destination node. In addition to message routing, the network may (or may not) implement message delivery by splitting the message into several fragments, delivering each fragment by a separate route and reassembling the fragments, report delivery errors(dealing with congestion that occur from time to time due to temporary surges in packets traffic), etc.

Datagram delivery at the network layer is not guaranteed to be reliable.

204134_lP6o_1777336.jpg( packet-switching network using a uniform routing procedure)


Layer 4: transport layer

The transport layer provides the functional and procedural means of transferring variable-length data sequences from a  process in the source to a process in the destination host via one or more networks, while maintaining the quality of service functions.

An example of a transport-layer protocol in the standard Internet stack is Transmission Control Protocol (TCP), usually built on top of the Internet Protocol (IP).

The transport layer controls the reliability of a given link through sequence,flow control,segmentation/desegmentation,and error control(error detection and recovery). It can provide both connection-oriented service that involves the error-free transfer of a sequence of bytes or messages and an unconfirmed connectionless service that involves the transfer of individual messages. The transport layer also provides the acknowledgement of the successful data transmissionand sends the next data if no errors occurred. The transport layer creates packets out of the message received from the application layer. Packetizing is a process of dividing the long message into smaller messages.

To optimize the use of network sevice, the transport layer may multiplexing several transport layer connections on to a single network layer connection. Or the transport layer may use splitting to supoort its connection over several network layer connection.  

215133_bsgH_1777336.png

210733_1Ah1_1777336.png

(segmentation)  (multiplexing)


Note that the top four layers are end to end and involve the interaction of peer process across the network. In contrast the lower two layers involve interaction of peer-to-peer process across a single hop.


Layer 5: session layer

The session layer controls the dialogues (connections) between computers. It establishes, manages and terminates the connections between the local and remote application. It provides for full-duplexhalf-duplex, or simplex operation, and establishes checkpointing, adjournment, termination, and restart procedures. The OSI model made this layer responsible for graceful close of sessions, which is a property of the Transmission Control Protocol, and also for session checkpointing and recovery, which is not usually used in the Internet Protocol Suite. The session layer is commonly implemented explicitly in application environments that use remote procedure calls.


Layer 6: presentation layer

The presentation layer establishes context between application-layer entities, in which the application-layer entities may use different syntax and semantics if the presentation service provides a big mapping between them. If a mapping is available, presentation service data units are encapsulated into session protocol data units, and passed down the protocol stack.

This layer provides independence from data representation (e.g., encryption) by translating between application and network formats. The presentation layer transforms data into the form that the application accepts. This layer formats and encrypts data to be sent across a network. It is sometimes called the syntax layer.[5]

The original presentation structure used the Basic Encoding Rules of Abstract Syntax Notation One (ASN.1), with capabilities such as converting an EBCDIC-coded textfile to an ASCII-coded file, or serialization of objects and other data structures from and to XML.


Layer 7: application layer

The application layer is the OSI layer closest to the end user, which means both the OSI application layer and the user interact directly with the software application. This layer interacts with software applications that implement a communicating component. Such application programs fall outside the scope of the OSI model. Application-layer functions typically include identifying communication partners, determining resource availability, and synchronizing communication. When identifying communication partners, the application layer determines the identity and availability of communication partners for an application with data to transmit. When determining resource availability, the application layer must decide whether sufficient network or the requested communication exists. In synchronizing communication, all communication between applications requires cooperation that is managed by the application layer. 


我自己的理解:物理层会将信息用比特流传输,规定了交换信息所需的物理接口信息等,然后可以控制物理连接的开断。然后往上一层是数据链路层,它分为MAC层和LLC层,首先可以给比特流封装成数据帧,并加入了长度,地址,检测帧等等,特别是MAC层控制了媒介与机器的交流(物理层是媒介的交流)。然后到了网络层,数据进一步被封装为数据包,主要控制着信息如何在网络中传输(nodes to nodes --->nodes in network),这样就又比数据链路层高了一个层次,这样也就会涉及到寻址,路由,将数据拆分不同路径发送重组等等。网络层之前虽然在链路层和网络层都有一些error control,但是在这之前的数据传输是不一定可靠的,而且没有出现连接型与非连接型的区别。 到了传输层,数据进一步封装成数据段,到了这一层专门为数据传输的层,当然就得加上更多的关于数据传输的协议,比如错误检测,重传,给数据包编上序号,流量控制,ACK反馈等等,而且此时也讲传输层的服务大致分为连接型的和非连接型的。这一层也有将数据拆分重组的功能,也有multiplexing的概念出现【update错误:应该是data link layer,network layer ,transport layer都有multiplexing的理念出现,比如data link layer 中共用data link(ethernet,ppp),network layer中共用一个路由,transport layer共用公共端口】。到这里会发现分层的好处了,每一层的功能专一,而且上层完全包含了下层的服务,所以在开发各层服务的时候,只要保证给上一层提供的服务一致就行了,具体的细节便可以被忽略,使得整个网络系统就变得极其有层次,也能在保证网络结构稳定的同时开发各式各样的服务。


In general, each layer adds a header, and possibly a trailer, to the block of information it accepts from other layer above.

222353_zskz_1777336.gif


总结:OSI参考模型并没有提供一个可以实现的方法,而是描述了一些概念,用来协调进程间通信标准的制定。即OSI参考模型并不是一个标准,而是一个在制定标准时所使用的概念性框架。

实际使用的主要是 TCP/IP Protocol


update:multiplexing概念理解错误

转载于:https://my.oschina.net/smartman/blog/323007

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值