Skip to content

Commit

Permalink
Merge pull request #8 from snowme34/docs
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
snowme34 committed Jan 20, 2019
2 parents b400741 + 2892a29 commit 9b0941c
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
dist: trusty
language: minimal
branches:
except:
- master
- legacy
- experimental
install:
- rm -rf ./node_modules
- nvm install node
Expand Down
6 changes: 5 additions & 1 deletion cspell_dict_bash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -466,4 +466,8 @@ createtime
centos
rndc
checkconf
checkzone
checkzone

wifi
connectionless
Datagram
6 changes: 6 additions & 0 deletions docs/source/reference/devops/bind-dns-server-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

To setup a basic master DNS server.

This passage may contain some outdated information.

Always read the latest official document first.

Debian, for example, [Bind9 - Debian Wiki](https://wiki.debian.org/Bind9).

## BIND

The most popular DNS server software.
Expand Down
1 change: 1 addition & 0 deletions docs/source/reference/network/OSI.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile modified="2019-01-20T02:12:41.959Z" host="www.draw.io" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" etag="JZxor987QkA2KhUviI9F" version="10.1.2"><diagram id="jQmkH2FhyFji6strA6tn" name="Page-1">7V3BcqM4EP0aH70FCLA5xs5kZ6pmtlLj2Z0zMQqmgpEX5DjJ168wYBtaiZ1sQnei5JDCDQh4T2q9JyN5wKbLuz/zcLX4ISKeDhwruhuw84HjBJan/peB+yrg2W4ViPMkqkL2PjBLHngdtOroOol40TpQCpHKZNUOzkWW8blsxcI8F5v2YdcibV91FcYcBGbzMIXR30kkF1V07Fn7+FeexIvmyrZV71mGzcF1oFiEkdgchNiXAZvmQshqa3k35WmJXYNLdd7FI3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b/yMCuWiYR57IRGlPMieQivtgeUFXxV3vj2UbzJwDt/VvNJwyueTsL5TbxtNE0zHDjsevv3VPupV9+s72Swq+2HNeiJ2vtoaxtaf3jWmLU4a9as/J91qp1H/c754vq64G9SBUbaF/NTRYlMRAY473tCiet1mhr26psjOORyqaq9ehyigGEvxdlc7ACwGVc5nyBW6EtyjuEoxTYfr0Qu6aGFvTjnGA4f/MXlRuQ39LDCXqRzDF199Ua39T3J6OGFvmDnGBruy8V9USoVemBpZln2C9YJc7/fu+Yf+Uek+qmav1sQMA9vrfmhgPnJ57xExgCBX1VVDIE/bCv8YX8SP4AK7CIPlxxOF38R4Wspiup3Euxn8V+oHJlk8S+hMuT50C2HW9Jk9c/g1cZGvOaF593YCAN5stdJPQEULJS8lk/NawVQtJDyWgAwbK8VQNVCxWt1sUL3WgEcvafjtQBa2F4rgCOFVLwWwArbawVwCJyS1+rihe61AmgfyHgtABa21wqgfNeu/PPBpJzfkXKafKhbgOnNpJxtQS3XfGUSJbctLvx/1+WPak1KSoY1qGelialw3e3ff9FSlaNQzZrYpfJJvKS52qXu+XDvQXh78df8woZunejIe6cZD8SS97YF9eqMx0teQupclH1ArHzXR6elWQz4iVf/bN2Kci/gRX3c/2BdZZf3v/rHvvwH</diagram></mxfile>
Binary file added docs/source/reference/network/osi-data.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
190 changes: 190 additions & 0 deletions docs/source/reference/network/osi-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# OSI Model

Open Systems Interconnection (OSI) Model

[Wikipedia](https://en.wikipedia.org/wiki/OSI_model)

Use 7 layers to define basic functions of Internet.

Published by ISO in 1984.

The basic model for today's Internet.

OSI is just a model, not any implementation.

The most popular TCP/IP protocol is designed based on OSI model, or,
an implementation of several layers of OSI.

(Why include links? Repeating is meaningless. Here is just a summary)

## Why

* Reduces complexity
* Standardizes interfaces
* Facilitates modular engineering
* Ensures interoperable technology
* Accelerates evolution
* Simplifies teaching and learning

It defines standardized interfaces between different layers.
So that all layers can be independent and can have different implementations.

## Layers

From bottom to top.

```markdown
7 Application
6 Presentation
5 Session
4 Transport
3 Network
2 Data Link
1 Physical
```

## 1 Physical Layer

Bits

The most basic physical transmission.

"Is the wifi working?"

Binary raw bit transmission.

* electrical, mechanical, procedural, and functional specifications of the physical link

From wikipedia:

> The physical layer is responsible for the transmission and reception of unstructured
> raw data between a device and a physical transmission medium.
> It converts the digital bits into electrical, radio, or optical signals.
[Wikipedia](https://en.wikipedia.org/wiki/Physical_layer)

## 2 Data Link Layer

Frames

Defines basic format of data, how they are transmitted and denoted via the wires.

2 sub-layers: logical link control (LLC) and media access control (MAC).

* functional and procedural data transmission
* error detection and correction

[Wikipedia](https://en.wikipedia.org/wiki/Data_link_layer)

## 3 Network Layer

Packets

Addressing and Routing

1. Connectionless communication
2. Host addressing (IP address)
3. Message forwarding

Data Delivery

[Wikipedia](https://en.wikipedia.org/wiki/Network_layer)

## 4 Transport Layer

* TCP: segment
* UDP: datagram

host-to-host communication

TCP/UDP

How to transport data between 2 hosts reliably and effectively

* connection-oriented communication
* Same order delivery
* reliability
* flow control
* Congestion avoidance
* multiplexing

* transportation issues handling
* virtual circuits

[Wikipedia](https://en.wikipedia.org/wiki/Transport_layer)

## 5 Session Layer

Basically, the top 3 layers, application presentation and session layers,
can be regarded as the "Application" since they are all controlled by applications.

Session layers manages different sessions between application processes between end-users

> Establishes, manages, and terminates sessions between applications
[Wikipedia](https://en.wikipedia.org/wiki/Session_layer)

## 6 Presentation Layer

data translation

Also called "syntax layer".

* Data conversion
* Character code translation
* Compression
* Encryption and Decryption

[Wikipedia](https://en.wikipedia.org/wiki/Presentation_layer)

## 7 Application

Different definitions for OSI and TCP/IP (actually same name, different layers).

The applications are responsible for 5,6,7 three layers.
Some applications might be simple, will only implement functionality of 7th layer.

Network Processes to Application

> defines user interface responsible for displaying received information to the user
[Wikipedia](https://en.wikipedia.org/wiki/Application_layer)

## Data Encapsulation

applications generate data

Data begin with 7th layer, the application layer.
They will be transmitted from top to bottom.
Each layer will include a HDR (header) to the data.
Each layer stores its information in HDR.

The process of "data going throughout 7 layers from top to lowermost one"
in which each layer concatenates its header (or footer or both)
is called data encapsulation.

![osi-data-encapsulation](https://i.imgur.com/7vJObbO.png)

Upon receiving, data will be "de-encapsulated".

Each layer will check the information it is responsible for.

From lowermost level to topmost layer.

At the end only the original data will be transmitted to application.

## TCP/IP Stack

Now everyone uses TCP/IP. It is an implementation of OSI model.

It has 4 layers.

![TCP/IP-OSI](https://i.imgur.com/P1UaRNu.png)

The most "important" ones are 3rd and 4th layer.

## Summary

For networking, it usually refers to the 4 low layers.

For software engineering, people care the top 3 layers more.
Binary file added docs/source/reference/network/tcp-ip-osi.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9b0941c

Please sign in to comment.