Python | Network Communication Principles and Communication Methods

Principles of Network Communication

DHCP: used to assign IP
Hosts are searched by IP address in the network
DNS: Domain name IP address

network communication

direct communication


If the two computers are connected through a network cable, they can communicate directly, but they need to set the IP address and network mask in advance.
And the ip address needs to be controlled within the same network segment, for example, if one is and the other is, it can communicate

Communicate using a hub


When polymorphic computers need to form a network, they can be linked together through a hub (Hub)
In general, the hub has fewer interfaces
The hub has a disadvantage. It sends any data by broadcasting, that is, if the hub receives data from computer A, it wants to forward it to computer B. If it is also connected to two other computers C and D at this time, then it This data will be sent to each computer, so it will cause network congestion

Communicate using the switch


Overcome the shortcomings of the hub to send data by broadcast. When broadcast is required, broadcast is sent, and when unicast is required, it can be sent in unicast mode.
It has replaced the previous hub
In enterprises, switches are used to complete the linking of polymorphic computer equipment into a network.
Use a router to connect multiple networks

complex communication process


When entering a URL in the browser, it needs to be parsed out of the IP address first.
After getting the IP address, the browser handshakes 3 times to connect to the server by means of tcp
Send the request data of the http protocol to the server in the form of tcp
The server responds to the response data of the http protocol by means of tcp to the browser
MAC address: used to mark the sender and receiver (serial number of the network card) during data communication between the device and the device
IP address: logically marks a computer to guide the sending and receiving direction of data packets (equivalent to the serial number of the computer)
Netmask: The network number and host number used to distinguish the IP address
Default gateway: When the destination ip of the data packet to be sent is not in this network segment, it will be sent to a default computer and become the gateway
Hub: outdated, used to connect polymorphic computers, disadvantage: broadcast every time data is sent and received, the network will become congested
Switch: An upgraded version of the hub, with a learning function to know which device to send to, and unicast and broadcast as needed
Router: Connect multiple different network segments, so that they can send and receive data between them. After each data is received, the ip will remain unchanged, but the MAC address will change.
DNS: used to resolve IP (similar to phone book)
http server: provides data that the browser can access

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us