1, the basis of network programming:
What is network programming: the transmission between computers and computers, data and computers, computers, and data on the network.
From a large aspect is the transmission of information to receive, intermediate transfer for the role of physical lines
2, the basis of network programming:
Network programming is divided into reference classes and Web classes
b/S architecture is also a C/s architecture,
C/S Architecture: typically client and server-side architectures
b/S Architecture: Simple browser port and server port architecture, Advantage unifies all application's entrance
3,mac the difference between address and IP address
MAC address is what: all the network card after the production of fixed code, each hardware network card has a fixed MAC address, the basic format of 12-bit indefinite encoding
What the IP address is: After all the computers connected to the network, the gateway gives a network landmark that is easy to connect to the Internet, similar to an identity card.
The IP address represents a location of the computer in the network, a decimal four-digit point.
Range is 0.0.0.0--255.255.255.255
4, Nic
Switch: Switching between machines in the same LAN
Routers: Inter-LAN communication with hardware
Gateway IP: Connecting network world through gateway IP communication
5, Subnet mask
Subnet mask network address IP and subnet mask IP do bitwise AND operation if the result is the same That means 192.168.12.6211000000.10101000.00001011.0011111011111111.11111111.11111111.0000000011000000.10101000.00001011 in the same network segment. .00000000 = = 192.168.0.0255.255.0.0192.168.11.94255.255.0.011000000.10101000.00001011.0101111011111111.11111111.11111111.00000000 = = 192.168.0.0
6, the concept of port:
At the same time, each port can only serve a running program, only the network transport in the port is allocated to match the network port, for the transfer work.
The range of ports is 0-65535 ports, which is enough for common 9000-10000 ports to be written.
1,ip+ Port concept, the use of IP plus port can be accurate to find another computer (in the case can not hide the IP), 255**4 is the total amount of IP, 4.2 billion addresses, has enough of the world's computer network port use
2, so the port is an essential step in the network transmission.
7.TCP and UDP protocols:
The TCP and UDP protocols are all two-way protocols in the network transmission, the protocol is a general rule,
TCP protocol is mainly used for transmitting large amount of data, reliable, connection-oriented protocol (eg: telephone), low transmission efficiency full duplex communication (send cache & receive cache), byte stream oriented.
Applications that use TCP: Web browsers, e-mail, file transfer programs
UDP protocol is mainly used for short information I/O, unreliable, non-connected services, high transmission efficiency (before sending are chosen adequately), a pair of one or one-to-many, many-to-one, many-to-many, message-oriented, to do their best to serve, no congestion control.
Applications using UDP: Domain Name System (DNS), video streaming, voice over IP (VoIP)
8.osi five-layer model:
Application layer, Transport layer, network layer, data link layer, physical layer
Python Network programming