Superficial understanding of common knowledge points in network programming

1. Network: A tool that connects two or more devices (computers, smart phones, ipads)
1.1 The goal of learning the network: complete the transfer of data from one party to the other through the network, and complete the sharing of data
2. ip address: ip The address is the address of the device in the network, this address is the ip address, and the ip address is to identify the only device in the network
2.1 ip address classification: ipv4 and ipv6
2.2 The role of ip: find the corresponding device in the network through the ip address, and then Send data to the device 3. Private ip : The
ip address used in the local area network is the private ip, and the private ip cannot be used in the public network. . The ip address of the machine: 127.0.0.1 The domain name of the machine: localhost 5. A corresponding ip address can be resolved through the domain name, and the domain name is convenient for everyone to remember the ip address of a certain host. 6. ifconfig & ping  6.1 ifconfig: View network card information, mainly Get the ip address, use ipconfig on the window 6.2 ping : Check if the network is normal .com indicates that it can access the public network . 7. Port: The channel for incoming and outgoing data, such as the classroom door. 8. Port number: Identifies a unique port.











9. Network communication process: find the corresponding device through the ip address, then find the corresponding port through the port number, and transmit data to the application through the port
10. Classification of port numbers
10.1 Well-known port number: The port number used by the system is the well-known port number , range: 0-1023
10.2 Dynamic port number: the port number set by the programmer for the program, the range is 1024-65535, prompt: if the programmer does not set the port number for the program, the system will automatically find a free port within the range of the dynamic port number The port number is used to set the port number. If the programmer sets the port number for the program, the port number is used.
11. netstat -an : View the usage status of the port
12. lsof -i [tcp/udp]: Port number -> Find the corresponding application according to the port number, prompt: If the port number of other user applications needs to be added sudo, for example: sudo lsof -i: port number
13. kill -9 process number -> forcibly kill the specified process according to the process number
14. socket: translated into Chinese is socket, a tool for communication between processes, data transmission and receiving are done through socket, socket can be understood as a porter of data

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325660302&siteId=291194637