Article directory
- OSI Reference Model (Open System Interconnection Reference Model) -- OSI/RM
-
- Application layer---Provide various application services and convert abstract language into code
- Presentation layer --- code conversion into binary
- Session layer --- maintains a session connection between the web application and the web server
- Transport layer --- realize end-to-end transmission through port numbers to distinguish different services
- Network layer --- logical addressing by IP address
- Data link layer --- physical addressing through MAC address
- Physical layer --- processing and transmission of electrical signals
- TCP/IP Reference Model --- Protocol Cluster
- PUD --- protocol data unit
- Encapsulation and Decapsulation
OSI Reference Model (Open Systems Interconnection Reference Model) – OSI/RM
- The core idea of the OSI reference model - layering
Application layer—Provides various application services and converts abstract language into code
Presentation layer - encoding converted to binary
Session layer — maintains a session connection between the web application and the web server
Transport layer - use port numbers to realize end-to-end transmission to distinguish different services
The port number (0-65535) is divided into:
1. Static port number (1-1023):
A port number represents a service and has a permanent binding relationship
http: 80 8080
https:443
2. Dynamic port number (1024-65535):
A port number represents a service, and has a temporary binding relationship
0 - special port number - reserved port number (used in network programming to represent all port numbers)
Transfer Protocol
-
reliable transmission
Reliable Mechanism: Determine Retransmission Sorting Flow Control
-
TCP - Transmission Control Protocol
Connection-oriented reliable transport protocol
-
UDP - User Datagram Protocol
Non-connection-oriented unreliable transport protocol
Connection-oriented - three-way handshake, four-way wave
three handshake
[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-2mxkoTfC-1685546442017) (C:\Users\Lin\AppData\Roaming\Typora\typora-user-images\ image-20230123160200110.png)]
waved four times
[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-USQjRVi6-1685546442018) (C:\Users\Lin\AppData\Roaming\Typora\typora-user-images\ image-20230123160230007.png)]
FIN – request to disconnect
ACK – acknowledgment
Network layer - logical addressing by IP address
IP address is a logical address
IPV4 address
IPV6 address
The method of obtaining the target IP address:
1. Directly know the IP address of the other party
2. Obtain IP address through domain name
3. Direct access through the app
4. Broadcasting
Data Link Layer—Physical addressing through MAC addresses
The MAC address consists of 48 binary bits. The serial numbers programmed into all chips when they leave the factory.
MAC address features:
1. Unique in the world
2. Unified format
The method of obtaining the target MAC address - ARP protocol - Address Resolution Protocol - Obtaining another address through one address
ARP
working principle:
First, the host sends an ARP request packet in the form of broadcast. Request MAC address by IP address. Because it is a broadcast frame, all devices in the broadcast domain can receive this request. After receiving it, the device first records the correspondence between the source IP and the source MAC address in the data packet in the local ARP cache table, and then looks at the requested IP address. If the request is not its own local IP address, it will be directly discarded; if the request is its own local MAC address, it will respond with ARP. Afterwards, when sending data, it will first check the local ARP cache table, if there is a record in the table, it will directly send according to the record. If there is no record, then send an ARP request to obtain the MAC address.
Classification:
Forward ARP: Obtain MAC address through IP address
Reverse ARP: Obtain IP address through MAC address.
Free ARP: 1, detect address conflict; 2, self-introduction
Physical layer - processing and transmission of electrical signals
TCP/IP Reference Model - Protocol Suite
TCP/IP Reference Model
[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-tTlWH4d3-1685546442019) (C:\Users\Lin\AppData\Roaming\Typora\typora-user-images\ image-20230124172943311.png)]
TCP/IP Standard Model
[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-x2Kb6LPp-1685546442019) (C:\Users\Lin\AppData\Roaming\Typora\typora-user-images\ image-20230124173025766.png)]
PUD — Protocol Data Unit
- Application Layer – Datagrams
- Transport Layer – Data Segment
- Network Layer – Packets
- Data Link Layer – Data Frame
- Physical layer – bitstream
Encapsulation and Decapsulation
Encapsulation – the process of adding data at each layer in order to achieve the purpose of that layer
- Application Layer – Encapsulation at the application layer depends on the protocols working at the application layer
- Transport layer – encapsulation port number (TCP, UDP)
- Network layer – encapsulates IP address (IP protocol)
- Data Link Layer – Encapsulating MAC Address (Ethernet Protocol)
- physical layer
[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-Qz2ACLcT-1685546442019) (C:\Users\Lin\AppData\Roaming\Typora\typora-user-images\ image-20230124173859387.png)]
cross-layer encapsulation
TCP/IP can support cross-layer encapsulation, OSI does not support it (cross-layer encapsulation occurs only when directly connected devices are transmitted in close distance)
- Encapsulation Across Four Layers – OSPF – 89
- Encapsulation across three and four layers – STP (IEEE 802.3)
Transferring external link pictures...(img-Qz2ACLcT-1685546442019)]
cross-layer encapsulation
TCP/IP can support cross-layer encapsulation, OSI does not support it (cross-layer encapsulation occurs only when directly connected devices are transmitted in close distance)
- Encapsulation Across Four Layers – OSPF – 89
- Encapsulation across three and four layers – STP (IEEE 802.3)