1. Huawei routing and switching technology basics _ Network

  • OSI Reference Model

    

1. The application layer

2. Presentation Layer

3. The session layer

4. Transport Layer

The network layer

  

Network layer device:

Logical address

routing

 

6. The data link layer

MAC address

Scope only MAC addresses among a LAN (Local Area Network)

Below, A and B in a LAN, C in another LAN.

In the same LAN, A communicates with B, A to know the IP address and MAC address B

In various LAN, A is in communication with C, A to know the IP address of the host A and C of the gateway router MAC address of LAN interface

The data link layer device :: same time, all devices are occupied bandwidth

 7. The physical layer

 

Physical layer device: the same time only one device can be occupied bandwidth

 

 

The OSI reference model during data transmission:

Network architecture:

A: The client, an IP address, a gateway B: a server, an IP address, a gateway

 

A terminal sends a message:

:: A top-level interaction in the process of B in the process of interacting using the HTTP protocol

The application layer, presentation layer, session layer: generating charge interaction (data content to be transmitted) via a presentation layer

PS: Processing session layer (application layer, presentation layer, session layer can be viewed as one layer)

Transport Layer: Layer down on the package will be combined with an "envelope" (including a source port number, destination port number, and other fields)

Network layer: the transport layer packet down again with a "envelope" (including source IP address, destination IP address, and other fields)

Data Link Layer: down network layer packet is added amassing a "envelope" (including a source MAC address, destination MAC address)

PS: As stated before in the same LAN, the destination MAC address is the MAC address of the target terminal itself, not in the same LAN is the next gateway MAC address of the source terminal is located

 

Message Routing:

At this time, the packet structure: <MAC address <IP address <port number <data content> /> /> />

From outside to inside, respectively corresponding to: Layer 2, Layer 3, Layer 4

路由器接收到数据包:"拆信封"(第2层:数据链路层)得到MAC地址,发现目的MAC地址就是路由器所属的,然后继续"拆信封"(第3层:网络层)得到IP地址,发现目的IP地址写的是终端B的IP地址,然后包装已经拆过的数据包,给它重新加上新的"信封"(终端B所在的IP地址),再加上新的"信封"(加上B所在LAN的网关MAC地址)

 

终端B接收到消息:

先看第2层,发现目的MAC地址就是自己的MAC

再看第3层,发现目的IP地址就是自己的IP

再看第4层,发现目的的端口号80,发现本机80端口是OPEN的,所以之后会把剩下的"信封"全部撕掉,把http的数据包交给协议的进程去处理

 

 

Guess you like

Origin www.cnblogs.com/NiBosS/p/12076584.html