一、区分互联网、因特网和万维网
- 范围:互联网 > 因特网 > 万维网
- 互联网(internet):凡是由能彼此通信的设备组成的网络就叫互联网,即使仅有两台机器(计算机、手机等),不论用何种技术使其彼此通信,都叫互联网,所以,互联网有广域网、城域网及局域网之分。国际标准的互联网写法是 internet,字母 i 要小写。
- 因特网(Internet):因特网是互联网中的一种,两台机器无法组成因特网,因特网是由上千万台设备组成的网络,具备一定的规模。因特网使用 TCP/IP 协议让不同的设备可以彼此通信,但使用 TCP/IP 协议的网络并不一定是因特网,一个局域网也可以使用 TCP/IP 协议。判断自己是否接入的是因特网,首先是看自己电脑是否安装了 TCP/IP 协议,其次看是否拥有一个公网地址。
- 万维网(WWW):由许多互相链接的超文本组成的系统,是文件、图片、多媒体和其他资源的集合,并使用统一资源标志符( URL )标识。万维网也称为 Web ,是因特网中的一项服务( web 服务),除了万维网,因特网还包括了许多其他服务,例如:电子邮件服务, FTP , Telnet 等等
二、万维网的组成
- 组成:WWW = URL + HTTP + HTML
- URL:统一资源定位符,俗称网页地址,简称网址,是因特网上标准的资源定位地址。
- HTTP:超文件传输协议,是一种用于分布式、协作式和超媒体信息系统的应用层协议,HTTP 是万维网数据通信的基础。
- HTML:超文本标记语言,是一种用于创建网页的标准标记语言。HTML 是一种基础技术,常与 CSS、JavaScript 一起被众多网站用于设计网页、网页应用程序以及移动应用程序的用户界面。网页浏览器可以读取 HTML 文件,并将其渲染成可视化网页,HTML 是构建网站的基石。
三、URL 的组成
- 组成:URL = 协议 + IP 地址或者域名 + 端口 + 路径 + 查询字符串 + 锚点
- IP 地址(英语:IP Address,全称Internet Protocol Address):是IP 协议的一个功能,又译为网际协议地址、互联网协议地址,是网际协议中用于标识发送或接收数据报设备的一串数字,IP地址的两个主要功能分别为标识设备或网络和寻址。其中,公网 IP 可理解为广域网,私网 IP 可理解为城域网、局域网。
- 域名/网域(英语:Domain Name,简称:Domain):是由一串用点分隔的字符组成的互联网上某一台计算机或计算机组的名称,用于在数据传输时标识计算机的电子方位。域名分为顶级域名、二级域名、三级域名等。
- 域名系统(英语:Domain Name System,缩写:DNS):是互联网的一项服务,是域名和IP地址相互映射的一个分布式数据库。
- 端口:可以认为是设备与外界通讯交流的出口,端口可分为虚拟端口和物理端口。其中,虚拟端口依照互联网传输层的TCP/IP协议通信,不同的协议都对应不同的端口,当前虚拟端口共有 65535 个。
四、ping 命令、nslookup 命令、curl -v 命令
- ping 命令、nslookup 命令:查询域名对应的 IP
C:\Users\吴廣彬>ping baidu.com
正在 Ping baidu.com [220.181.38.251] 具有 32 字节的数据:
来自 220.181.38.251 的回复: 字节=32 时间=57ms TTL=52
来自 220.181.38.251 的回复: 字节=32 时间=57ms TTL=52
来自 220.181.38.251 的回复: 字节=32 时间=57ms TTL=52
来自 220.181.38.251 的回复: 字节=32 时间=57ms TTL=52
220.181.38.251 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 57ms,最长 = 57ms,平均 = 57ms
C:\Users\吴廣彬>nslookup baidu.com
服务器: UnKnown
Address: 192.168.43.1
非权威应答:
名称: baidu.com
Addresses: 220.181.38.251
220.181.38.148
C:\Users\吴廣彬>curl -v https://baidu.com
* Rebuilt URL to: https://baidu.com/
* Trying 220.181.38.148...
* TCP_NODELAY set
* Connected to baidu.com (220.181.38.148) port 443 (#0)
* schannel: SSL/TLS connection with baidu.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 180 bytes...
* schannel: sent initial handshake data: sent 180 bytes
* schannel: SSL/TLS connection with baidu.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with baidu.com port 443 (step 2/3)
* schannel: encrypted data got 3480
* schannel: encrypted data buffer: offset 3480 length 4096
* schannel: sending next handshake data: sending 126 bytes...
* schannel: SSL/TLS connection with baidu.com port 443 (step 2/3)
* schannel: encrypted data got 242
* schannel: encrypted data buffer: offset 242 length 4096
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with baidu.com port 443 (step 3/3)
* schannel: stored credential handle in session cache
> GET / HTTP/1.1
> Host: baidu.com
> User-Agent: curl/7.55.1
> Accept: */*
>
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 386
* schannel: encrypted data buffer: offset 386 length 103424
* schannel: decrypted data length: 357
* schannel: decrypted data added: 357
* schannel: decrypted data cached: offset 357 length 102400
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 357 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 357
* schannel: decrypted data buffer: offset 0 length 102400
< HTTP/1.1 302 Moved Temporarily
< Server: bfe/1.0.8.18
< Date: Thu, 18 Nov 2021 06:24:33 GMT
< Content-Type: text/html
< Content-Length: 161
< Connection: keep-alive
< Location: http://www.baidu.com/
<
<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>bfe/1.0.8.18</center>
</body>
</html>
* Connection