当前位置:网站首页>Network model and protocol
Network model and protocol
2022-07-26 03:24:00 【Pigs who love coriander】
A network model
One 、OSI Seven layer model
OSI Open System Interconnect Open Systems Interconnection model
effect : Reduce the complexity of network data communication , Easy troubleshooting
application layer
Providing applications / Software , The interface between people and the network
Provide data
The presentation layer
Responsible for data format conversion , Like compression / decompression 、 encryption 、 Decrypt
The session layer
Establish a conversation 、 Maintain conversation 、 Disconnect session
conversation : Identify the login identity of the client ( Log in )
Transport layer
Provide end-to-end communication , Identify different applications
Port number 1--65535
effect : Identify different programs
windows View the command of the port > netstat -an
The network layer
Typical equipment : Router
Provide network to network communication , The Internet --- Network segment
Provide routing , according to IP Address for routing
Data link layer
Typical equipment : Switch
Provide point-to-point communication
rely on MAC Address , Physical address
windows see MAC Address : ipconfig /all
Linux see MAC Address : ifconfig, ip addr show
The physical layer
Provide physical links
Two 、TCP/IP Five layer model
application layer 、 Transport layer 、 The network layer 、 Data link layer 、 The physical layer
3、 ... and 、 Typical protocol
application layer
1、http
Realization web The data transfer , Plaintext transmission
2、https
Realization web The data transfer , Ciphertext transmission
3、ftp
File transfer protocol , Implement data sharing
4、DNS
Realization IP Address 、 Host name resolution
5、ntp
Network time protocol , Time synchronization
6、snmp
Simple network management protocol , Implementation monitoring
7、ssh
Device remote connection , Ciphertext transmission ; Suitable for connecting to the server
8、telnet
Device remote connection , Plaintext transmission ; It is suitable for connecting network devices in LAN
Transport layer
One 、TCP Transmission control protocol
1、 Connection oriented protocol
Before sending data between hosts , Need to establish TCP Connect , After the connection is completed, the real data will be sent , After the data is sent , The connection between hosts will be disconnected
TCP The connection is two-way
Three handshakes , Establishing a connection
(a) host A Host computer B Send with SYN Logo data , Indicates a request to establish a connection
(b) host B Host computer A Send with ACK, SYN Logo data , Agree to establish a connection 、 towards A Send a connection request
(c) host A Host computer B Send with ACK Logo data , Consent and B Establishing a connection
2、 A reliable agreement
(a) Retransmission timer
(b) Sliding window mechanism , flow control , Avoid network congestion
Two 、UDP User datagram protocol
1、 No connection protocol
2、 An unreliable agreement
see TCP Protocol related ports
[[email protected] ~]# netstat -antp
see UDP Protocol related ports
[[email protected] ~]# netstat -anup
The network layer
One 、IP Internet Protocol Internet Protocol
Two 、ICMP agreement
Internet control message protocol , Test network connectivity ;
ping Tools
ping Tool use :
-c Appoint ping The number of times
-s Appoint ping Packet size
[[email protected] ~]# ping -s 4000 -c 5 192.168.65.1
3、 ... and 、IGMP agreement
Implement multicast
Four 、ARP agreement
Address resolution protocol
effect : according to IP The address for MAC Address
Four 、 Data encapsulation
application layer : Generate data
Transport layer : TCP/UDP Headlines
Source port , For requesting data , It's usually >1024 The random port of
Destination port
The network layer : IP Headlines
Source IP Address
Purpose IP Address
Data link layer : MAC Frame head
Source MAC Address
Purpose MAC Address
5、 ... and 、 Static routing
Add route
route add -net Destination segment gw Next hop address
[[email protected] ~]# route add -net 192.168.2.0/24 gw 192.168.3.2
[[email protected] ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
192.168.2.0 192.168.3.2 255.255.255.0 UG 0 0 0 ens37
192.168.3.0 0.0.0.0 255.255.255.0 U 100 0 0 ens37
Enable routing and forwarding
[[email protected] ~]# echo 1 > /proc/sys/net/ipv4/ip_forward
[[email protected] ~]# cat /proc/sys/net/ipv4/ip_forward
1
Set up Linux The host starts in character mode by default
[[email protected] ~]# systemctl set-default multi-user.target
边栏推荐
- JSD-2204-酷鲨商城(管理商品模块)-Day02
- Canvas -- drawing of rectangle -- making of histogram
- Managing databases in a hybrid cloud: eight key considerations
- 图解LeetCode——5. 最长回文子串(难度:中等)
- URDF 语法详解
- tf.truncated_ Normal() usage
- ELS message loop
- 78. 子集
- canvas——绘制曲线——挂钟,饼图,五角星
- ELS register window class, create window class, display window
猜你喜欢

LoRa和NB-IOT可用用在哪些地方

Pit trodden when copying list: shallow copy and deep copy

Leetcode · daily question · sword finger offer | | 115. reconstruction sequence · topological sorting

班级里有一群学生考试结果出来了,考了语文和数学两门,请筛选出总分是第一的同学

Leetcode · daily question · 919. complete binary tree inserter · hierarchy traversal · BFS

URDF 语法详解

Leetcode · 83 biweekly match · 6128. best poker hand · simulation

Hurry in!!! Write a number guessing game with dozens of lines of code based on the basic knowledge of C language

LeetCode·每日一题·剑指 Offer || 115.重建序列·拓扑排序

6-40v input fixed 5V 3.3V output 1.1a current 23-5 package
随机推荐
tensorflow中tf.Variable()函数的用法
LeetCode·
els 初始化窗口类
ELS callback function, exit message
B2B2C多商户系统功能丰富,极易二开
DDD landing is called an advanced
【尤里复裂人】带你轻松理解——深拷贝和浅拷贝
URDF 语法详解
YOLOv3: An Incremental Improvement
YOLOv3: An Incremental Improvement
Where can Lora and nb-iot be used
称霸薪酬榜!什么行业大有“钱”途?
赶紧进来!!!用c语言基础知识几十行代码写一个猜数字小游戏
Tf.constant usage
Day 7 hcip notes sorting (OSPF configuration)
线性回归原理推导
Configuration and use of virtualservice, gateway and destinationrule of istio III
LeetCode·
Classic interview questions -- three characteristics of OOP language
What is the difference between heap memory and stack memory?