OSI - Network Layer
OSI - Network Layer
--------------
| Application | Network Process to Applications
--------------
|
--------------
| Persentation | Data Representation
--------------
|
--------------
| Session | Interhost Communication
--------------
|
--------------
| Tansport | End-to-End Connections
--------------
|
--------------
| Network | Data Delivery
--------------
|
--------------
| Data Link |
--------------
|
--------------
| Physical |
--------------
We know that the second layer of OSI, the data link layer, uses MAC addresses for addressing, and MAC addresses are a flat addressing scheme. The reason why it is called a flat addressing scheme is because it does not have a hierarchical design, which brings some problems:Because of these problems, we need to divide our network. After the division, different strategies can be used for different networks, and the network can be managed hierarchically. With hierarchical management, it will be much easier for us to locate a host.
Then the question arises, if to achieve it? Yes, it is the IP protocol.
IP Address Classes
We know that IP address is divided into two parts network part and host part. So how many bits do the network part and the host part occupy?
Traditional IP address classification divides IP addresses into Class A, Class B, Class C, Class D, and Class E. Among them, class A, class B, and class C are used normally, class D is used for multicast, and class E is reserved for use.
--------- ----- ----- -----
A | 0******* | . | Host | . | Host | . | Host |
--------- ----- ----- -----
0 ~ 126
127 (01111111) A , loopback testing , network 。
--------- -------- ----- -----
B | 10****** | . | NetWork | . | Host | . | Host |
--------- -------- ----- -----
128 ~ 191
--------- -------- -------- -----
C | 110***** | . | NetWork | . | NetWork | . | Host |
--------- -------- -------- -----
192 ~ 223
Reserved Address
You must remember that when we calculate how many hosts a network has, we use 2n-2 to calculate how many hosts the network can hold. Why subtract 2?
Where the host part is all
0
is the network address. For example, 192.168.1.0
This is a class C address, the last 8 bits are the host part, and the last 8 bits are all 0, indicating that 192.168.1.0
represents a network.Any data sent to the broadcast address needs to be processed by all devices.
The broadcast address is further divided into: direct broadcast and restricted broadcast
For example,
172.16.0.0/16
The direct broadcast address for this network is �172.16.255.255
, while the restricted broadcast address is: 255.255.255.255
.direct broadcast
A host part that is all
1
is a direct broadcast.Direct broadcasts can be forwarded by routing and sent to all hosts on the target network. For example, a host with an IP address of 192.168.2.1 can also send broadcasts to the network 192.168.1.0. Of course not all routers, fool routers block direct broadcasts by default.
restricted broadcast
Routers do not forward restricted broadcast packets, but all hosts on the same subnet receive restricted broadcast packets. The network field and host field of the IP address are all 1s, which is the restricted broadcast address 255.255.255.255
Private IP Addresses
Class
Private Address Range
A
10.0.0.0 ~ 10.255.255.255
B
172.16.0.0 ~ 172.31.255.255
C
192.168.0.0 ~ 192.168.255.255
Generally speaking, the private ip address is used in the internal network, and the public ip address is used in the external network. In this case, in order to be able to communicate at the egress, it is necessary to do address translation (NAT).
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.