ip port for network communication

  • The internet
    • 1.1 A network is a tool that connects two or more devices (computers, smartphones, ipads)
    • 1.2 The purpose of learning the network: The communication of software data between different computers can be completed through the network, that is, the data is transferred from one party to another, and the data sharing is completed.
  • ip address
    • 2.1 An ip address is a unique device that identifies a device in the network.
    • 2.2 The role of ip address: find the corresponding device through the ip address, and then send data to the device
    • 2.3 ip address version
      • 2.3.1 ipv4 and ipv6
  • IP address classification (understand):
    • 3.1 IP addresses are divided into five categories: A, B, C, D, and E
    • 3.2 The commonly used addresses of class C addresses are characterized as follows: The first three bits remain unchanged, the last bit changes, and the range is 2 to the 8th power, but 0 and 255 are special addresses that cannot be used, that is to say, each class C address can only be used. Allocate 254ip address
  • private ip
  • local ip address
    • 5.1 127.0.0.1 local ip address,
    • 5.2 If you can ping 127.0.0.1, it means there is no problem with the computer's network card
    • 5.3 Local domain name: localhost
  • ping&ifconfig
    • 6.1 ping: Check the network for problems
    • 6.2 ping 127.0.0.1 If the data can be obtained, it means that the local network card has no problem
    • 6.3 ping 192.168.109.72 If you can get the data, it means that there is no problem in the communication of data in the same local area network
    • 6.4 ping  www.baidu.com  If you can get data, it means that your computer can access the Internet
    • 6.5 (mac,linux)ifconfig: View network card information, use ipconfig for window
  • port:
    • 7.1 The port is the entrance for incoming or outgoing data, which can be understood as the door of the classroom in real life
    • 7.2 Port number: use a unique number to represent this port, such as the house number of the classroom
  • Classification of ports
    • 8.1 Well-known ports: also known as fixed ports, range 0-1023
    • 8.2 Dynamic port: the port that the program can set, the range is 1024-65535. Tip: If the programmer does not set the port, the system will find a free port in the dynamic port range to set the port for the program.
    • 8.3 netstat -an: View port usage
    • 8.4 lsof -i[tcp/udp]:7890: Check which application is in use according to the port number. If you want to check the program corresponding to the port number of the program started by other users, you need to add sudo, for example: sudo lsof -i:3306
    • 8.5 kill kills the specified process according to the process number, forcibly kills the process kill -9 process number (pid)

Guess you like

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