day27 a network programming


network programming


A software development framework

# C / S architecture (Client / Server) 
c: Client 
s: server 
# b / S architecture (Browser / Server) 
b: browser 
s: server 
ps: bs architecture is the essence of architecture cs
end of the phone looks cs Schema Compare fire, in fact, bs has been the rise of
micro-channel Alipay are doing one thing: a unified interface
after the end of the phone is certainly more fire bs

 


Server: 24-hour service
when you want to experience the service, went to the server favorite for service: client

learning network programming can develop a software architecture cs
software django concurrent database front-end architecture can be a bs

1.2 History of network programming

Any existing advanced technologies are derived from the earliest military 

# return to the past 
1 early telephone phone line.
 2 big ass Internet line.
 3 laptop wireless phone card. 

To achieve remote communication first need to have the conditions are: the physical connection medium

 

Common standards / protocols

People have to say in order to achieve barrier-free exchange of common language >>> English
 # in order to achieve remote communication between the computer and the computer in addition to the physical connection medium than needed

 


Two OSI protocol
OSI seven layer protocol

Application Layer \ presentation layer \ session layer 
transport layer \ network layer 
a data link layer \ physical connection layer 

# correspondence table will pass network number thereof

 


Five-layer OSI protocol

Application Layer \ transporting layer \ network layer \ data link layer \ physical connection layer

 



2.1 Physical connection layer

# Electrical signal based on the binary data transmission 010 101 001 010

 


2.2 Data Link Layer

# Electrical signals 1. The provisions of grouping 
# 2 specifies any Internet-connected computer must have a network card 
for each card above is engraved with a unique world number 
12 hexadecimal 
ago 6 is Manufacturer number 
after number 6 is the assembly line 
as we used to call this number 12 mac address 
ps: two points above are collectively referred to " Ethernet protocol "

2.2.1 Switch

Ethernet-based communication protocol 
can not communicate across the LAN 

Internet N is formed between a plurality of LANs connected to each other

 

2.3 Network Layer

IP protocol 
provides for as long as the computer connected to the Internet must have an IP address 
ip address Features: dotted decimal 
ip address minimum: 0.0.0.0 
ip address maximum: 255.255.255.255 
ip address is currently available in two versions: IPV4 IPV6 (due IPV4 indicates that the computer has enough existing launch the so IPV6 version) 

IP address is dynamically allocated

 



2.4 Transport Layer

IP protocol 
provides for as long as the computer connected to the Internet must have an IP address 
ip address Features: dotted decimal 
ip address minimum: 0.0.0.0 
ip address maximum: 255.255.255.255 
ip address is currently available in two versions: IPV4 IPV6 (due IPV4 indicates that the computer has enough existing launch the so IPV6 version) 

IP address is dynamically allocated

 

2.4.1  summary

ip地址:用来唯一标识接入互联网的一台计算机
port端口:用来唯一标识一台计算机上的某个应用程序

ip+port:唯一标识接入互联网一台计算机上的某个应用程序

 


2.5 应用层

HTTP协议
FTP协议

 


TCP协议
流式协议,可靠协议
基于TCP协议通信 必选先建立双向通道


TCP协议传输数据之所以可靠的原因就在于有双向通道???



三次握手四次挥手


三次握手建连接    

四次挥手断连接

星轨
明星出轨

 







Guess you like

Origin www.cnblogs.com/Ryan-Yuan/p/11311189.html