Network development framework
C / S architecture:
Client: Client
Server: server
For example: client WeChat, QQ client and so on ...
Advantages:
- the use of stable software
- saving network resources
Cons:
- install the trouble, poor user experience
- every software update, users need to download or later
B / S architecture:
Browser (in essence is a client): Browser
Server: server
For example: enter a URL in the browser
Advantages:
- Easy to use software
- no need to follow the updated software to download
Cons:
- If the network is unstable, unstable software
# Popular: B / S architecture, high user experience.
The client and server:
server: 24-hour service.
Client: When customers want to find services, go to access the server.
After learning paths:
- learning network programming, concurrent programming, database ---- "to develop a software architecture C S /.
- Learning the front end (html / css / js), web frameworks (Django) ---- "can develop a software architecture B S /.
Communication between the computer and the computer:
- Language is the medium of communication between people!
- protocol is communication between the computer and the computer media!
网络编程
- 所有最新最牛的技术,都源自于军事:
- 可以远程实时获取数据,实现远程通信
- 如何实现远程通信: ----》 物理连接介质
- 电话: ---> 电话线
- 纯屏电脑(大屁股电脑): ---> 网线
- 笔记本电脑: ---> 网线、网卡
- 电脑与电脑通信: ----> “互联网协议”
让所有产商的电脑都遵循这套协议,实现所有电脑之间无障碍通信。
“互联网协议” 是计算机界的 中文、英文。
互联网协议(OSI七层协议):
- OSI七层协议:
- 应用层
- 会话层
- 表示层
- 传输层
- 网络层
- 数据链路层
- 物理层
- 此时需要关注的是5层: 由下到上记
- 应用层
- 传输层
- 网络层
- 数据链路层
- 物理层
1)物理层:
- 获取到对象计算机的电信号数据
0101010111
010: 你
1011: 爱
101: 我
问题: 无法获取具体数据内容,将电信号数据扔给数据链路层
2)数据链路层:
- 我要知道数据是什么?
- 我要知道数据是给谁的?
- “以太网协议”:
1)规定一套分组的方式:
获取电信号真实数据。
电信号是一个数据包。
head: 18个字节
- 6: 发送者
- 6: 接收者
- 6: 数据类型
data:
- 电信号具体的数据
2) 每一台电脑必须要有一个网卡(电脑插入网线的地方):
- 每一块网卡都会有一串世界上独一无二的数字:
- 12位16进制的数字,称之为 "mac地址" :
- 前6位: 产商号
- 后6位: 流水号
mac地址作用(*******):
标识全世界上一台独一无二的计算机。
“以太网协议”:
- 工作的方式:
- 单播:
- 广播:
缺点:
- 广播风暴
- 只能在局域网内实现通信, 无法跨局域实现通信
总结:
- mac地址: 标识全世界上一台独一无二的计算机。
3) 网络层:
- 实现全世界某一台计算之间的通信
- ip地址(ip协议):
- 点分十进制的数字组成
- 180.101.49.11
- 最小范围: 0.0.0.0
- 最小范围: 255.255.255.255
- ip的版本: IPV4地址已用完,IPV6是IPV4的扩展
- IPV4:
- IPV6:
- ip的作用:(*******)
用于表示全世界某一台计算机的位置,局域网的位置。
总结:
ip地址 + mac地址:(*******)
标识全世界某一个局域网内的,某一台计算机。
4) 传输层:
tcp与udp都是基于 “端口” 实现通信的。
- TCP协议:
- UDP协议:
主要是软件与软件之间进行通信。
- port端口:
用于标识计算机中某一个独一无二软件。
总结:
mac地址 + ip地址 + port端口:
标识的是全世界范围内某一个局域网内某一台计算机上的某一个软件。
5) 应用层:
- 大佬们定制好的一套牛X的协议
- http协议
- ftp协议
- 自定义的协议