Layering

原创 2004年08月06日 09:55:00

Layering is one of the most common techniques that software designers use to break apart a complicated software system. You see it in machine architectures, where layers descend from a programming language with operating system calls into device drivers and CPU instruction sets, and into logic gates inside chips. Networking has FTP layered on top of TCP, which is on top of IP, which is on top of ethernet.

When thinking of a system in terms of layers, you imagine the principal subsystems in the software arranged in some form of layer cake, where each layer rests on a lower layer. In this scheme the higher layer uses various services defined by the lower layer, but the lower layer is unaware of the higher layer. Furthermore, each layer usually hides its lower layers from the layers above, so layer 4 uses the services of layer 3, which uses the services of layer 2, but layer 4 is unaware of layer 2. (Not all layering architectures are opaque like this, but most are梠r rather most are mostly opaque.

Breaking down a system into layers has a number of important benefits.

  • You can understand a single layer as a coherent whole without knowing much about the other layers. You can understand how to build an FTP service on top of TCP without knowing the details of how ethernet works.

  • You can substitute layers with alternative implementations of the same basic services. An FTP service can run without change over ethernet, PPP, or whatever a cable company uses.

  • You minimize dependencies between layers. If the cable company changes its physical transmission system, providing they make IP work, we don't have to alter our FTP service.

  • Layers make good places for standardization. TCP and IP are standards because they define how their layers should operate.

  • Once you have a layer built, you can use it for many higher-level services. Thus, TCP/IP is used by FTP, telnet, SSH, and HTTP. Otherwise, all of these higher-level protocols would have to write their own lower-level protocols.

Layering is an important technique, but there are downsides.

  • Layers encapsulate some, but not all, things well. As a result you sometimes get cascading changes. The classic example of this in a layered enterprise application is adding a field that needs to display on the UI, must be in the database, and thus must be added to every layer in between.

  • Extra layers can harm performance. At every layer things typically need to be transformed from one representation to another. However, the encapsulation of an underlying function often gives you efficiency gains that more than compensate. A layer that controls transactions can be optimized and will then make everything faster.

But the hardest part of a layered architecture is deciding what layers to have and what the responsibility of each layer should be.

Protocol Layers and Their Service Models

1.主机和端系统之间有什么区别,列举不同的端系统。WEB服务器是端系统吗?除非你不想上网,否则主机和端系统之间就没有什么具体的区别。host、endsystem。一个host可以是一个台式PC、UNI...
  • boatting
  • boatting
  • 2006-03-27 15:43:00
  • 2375

kubeapps离线安装

安装kubeapps 执行以下命令安装 sudo curl -L https://github.com/kubeapps/installer/releases/download/v0.0.2/...
  • wenwenxiong
  • wenwenxiong
  • 2018-01-15 17:51:16
  • 226

4 Layers of the TCP/IP Model

The Internet Protocol Suite, TCP/IP, is a suite of protocols used for communication over the interne...
  • lianliange85
  • lianliange85
  • 2013-10-09 14:43:05
  • 1134

向下转型与layering技术

 1,从一个base class指针转为一个derived class指针叫做downcast.因为是从继承体系的上方移到下方。   据说downcast很丑陋,而由dynamic_cast实现的sa...
  • qiuyoujie
  • qiuyoujie
  • 2009-09-22 13:14:00
  • 382

ceph(存储之块设备、文件系统、对象存储)

1、Ceph 存储介绍Ceph 是一个开源的分布式存储系统,包括对象存储、块设备、文件系统。它可靠性高、管理方便、伸缩性强,能够轻松应对PB、EB级别数据。Ceph 存储体系中,核心为 RADOS,它...
  • fuyinggui
  • fuyinggui
  • 2018-03-02 16:48:19
  • 38

McCanne’s Low-Complexity Video Coding for Receiver-Driven Layered Multicast

  • 2014年05月02日 11:55
  • 366KB
  • 下载

rdb map出错rbd sysfs write failed

创建了一个rbd镜像$ rbd create --size 4096 docker_test然后,在Ceph client端将该rbd镜像映射为本地设备时出错。$ rbd map docker_tes...
  • styshoo
  • styshoo
  • 2017-03-08 07:05:31
  • 1495

[Kubernetes] Kubernetes 集成 Ceph 后端存储教程

1.  背景         本篇博客是继完成 Kubernetes 1.7.6 基本功能部署之后,关于 ceph rbd 后端存储集成的补充部署说明         注意:网络环境基于 weave ...
  • shida_csdn
  • shida_csdn
  • 2017-11-20 14:27:40
  • 679

WCDMA 双载波配置手册

  • 2011年08月11日 22:32
  • 3.66MB
  • 下载

Combining Images with Photoshop Elements: Selecting, Layering, Masking, and Compositing

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。http://blog.csdn.net/topmvp - topmvpCreate yo...
  • topmvp
  • topmvp
  • 2008-11-13 20:35:00
  • 317
收藏助手
不良信息举报
您举报文章: Layering
举报原因:
原因补充:

(最多只允许输入30个字)