> For the complete documentation index, see [llms.txt](https://sliu583.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sliu583.gitbook.io/blog/networking/index/computer-networking-a-top-down-approach/stanford-cs144/chapter-1/1.6-layering-principle.md).

# 1.6 Layering Principle

### Layering&#x20;

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgXFIzD4HvLPn-WxIUu%2F-MgXG8vPVXlDtHKpgwoj%2Fimage.png?alt=media\&token=81c03f7a-5068-4d5a-bf89-f5e83abbc6ba)

* E.x. flights: google flights --> airlines (abstract the details of each airlines)&#x20;
* E.x. postal service&#x20;
  * Mail&#x20;
  * Postal service&#x20;
  * Medias&#x20;
  * Mailman&#x20;
* Can improve each layer independently over time (the interface is the same)
* E.x. computer system&#x20;
  * Breakdown into functional components, each with well-defined roles&#x20;
  * Clear separations of concerns&#x20;
  * Each can be improved, updated over time&#x20;

![E.x. computer system ](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgXFIzD4HvLPn-WxIUu%2F-MgXH4hzOQTm-UKaO60k%2Fimage.png?alt=media\&token=1299d356-b9e6-414b-b9f0-870cc5c556b7)

* Break the layers boundary only if needed&#x20;

### Reasons for layering&#x20;

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgXFIzD4HvLPn-WxIUu%2F-MgXIHbF26usHlWYDukn%2Fimage.png?alt=media\&token=9674a1ad-5e3c-4116-9820-1f58322b8bd0)

* p2p: specific to layered communication systems&#x20;
  * 4-layer: each layer communicate with its peer on the another system, using the delivery service provided by the layers below&#x20;
