I. C/S architecture
C is client s for server/C/s architecture, which is the clients/server architecture.
This architecture of software development requires the development of client software and server-side software,
Generally speaking, the client software runs on the client host, the server software is installed on the server host,
How will the two hosts communicate?
First, the physical line between the two hosts must be connected
Second, the operating system as a bridge between the application software and the network card
Finally, the application system through the operating system interface for information interaction
Second, the Internet Protocol
Host network connection between the media we collectively known as the network, two hosts to communicate through the network, it must follow certain standards, and this standard we currently use the most called the Internet Protocol,
What we're going to talk about today is the OSI seven-layer interconnect model and the five-layer interconnect model.
1. OSI seven-layer interconnect model
Application layer, presentation layer, session layer, Transport layer, network layer, data link layer and physical layer total seven layers
Why do you want to layer it? In order to facilitate understanding (complex problem simplification) and independent layers of modules, each layer is responsible for the function of the non-functional, but also with other layers of contact with each other
2, the following from the bottom to the above in order to introduce:
A, Physical layer: is to send some 0101110 of the binary code by high and low level, set the line standard and so on
B, Data link layer: These 01010111 code how do we know what meaning, that is, we need to think of character encoding to give it a corresponding, that is, the bit stream assembly, we now commonly used data Link layer protocol is the Ethernet protocol, which specifies the frame header and data, as follows:
In the Ethernet protocol, there is the target Mac, the source Mac, and the MAC address can uniquely identify a host of a network card, so that the MAC address can be found
A network card, and the way to find a Mac is broadcast, that is, the purpose of the MAC in your broadcast range, to the source Mac reply,
Although theoretically can communicate through the MAC address, but in the real network environment, this is unrealistic, we can not put the broadcast in all the network environment, so there is the concept of network layer
C, Network layer: The network layer used by the protocol for the IP protocol, that is, the use of IP address to identify a host, the current commonly used IP address is IPv4 address, IPv6 use has not been promoted, know the IP address, we can find the IP address through various devices on the network path,
And through the ARP Address Resolution Protocol, sent to the corresponding network card,
Theoretically, by IP address, we can find any Internet host in the world
D, the Transport layer: Although the host can be found, but our goal is to communicate with the application on the host, how to find this application, this is used to the port, the port range is 0-65534, 1-1024 for the system reservation, after the port application can be used,
Theoretically, with IP addresses and ports, we can find applications on any Internet host in the world
E, Session layer, presentation layer and application layer here we collectively referred to as the application layer, which is the level of concern of the programmer, in this layer users can define their own application header format and Data section, the Common Application layer standard has HTTP, FTP, etc.
python--Network Programming-----C/S architecture