URLs, DNS and bit streaming · URL、DNS 与比特流
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| Domain Name System/dəˈmeɪn neɪm ˈsɪstəm/ | 域名系统 | yù míng xì tǒng |
| Uniform Resource Locator/ˈjuːnɪfɔːm rɪˈzɔːs ləʊˈkeɪtə/ | 统一资源定位符 | tǒng yī zī yuán dìng wèi fú |
| protocol/ˈprəʊtəkɒl/ | 协议 | xié yì |
| domain name/dəˈmeɪn neɪm/ | 域名 | yù míng |
| resolver/rɪˈzɒlvə/ | 解析器 | jiě xī qì |
| bit streaming/bɪt ˈstriːmɪŋ/ | 流式传输 | liú shì chuán shū |
| real-time/rɪəl taɪm/ | 实时 | shí shí |
| on-demand/ɒn dɪˈmænd/ | 点播 | diǎn bō |
| buffer/ˈbʌfə/ | 缓冲 | huǎn chōng |
| bit rate/bɪt reɪt/ | 比特率 | bǐ tè lǜ |
| lossy/ˈlɒsi/ | 有损 | yǒu sǔn |
| compression/kəmˈpreʃn/ | 压缩 | yā suō |
The phone book that ran the internet
- Until 1983 every computer on the internet found the others by downloading one text file, HOSTS.TXT, from a single machine at Stanford. Every time a new computer joined, the file grew and everyone fetched it again.
- Paul Mockapetris replaced the file with a distributed system of servers, each answering for its own part of the name space. He called it the Domain Name System.
- It is why you type a name and not twelve digits, and why a website can move house without telling you.
- This lesson is the address you type, the system that looks it up, and how a video reaches you before it has finished arriving.
曾经运行整个互联网的电话簿
- 直到 1983 年,互联网上的每台计算机都靠从斯坦福的一台机器下载同一个文本文件 HOSTS.TXT 来找到其他计算机。每加入一台新计算机,文件就变长,所有人都要再取一次。
- Paul Mockapetris 用一个分布式的服务器系统取代了这个文件,每台服务器负责名字空间中自己的那一部分。他把它叫做域名系统。
- 这就是你输入名字而不是十二位数字的原因,也是网站可以搬家而不用通知你的原因。
- 这一课讲你输入的地址、查找它的系统,以及一段视频怎样在还没传完之前就到达你面前。
The URL
- A Uniform Resource Locator 统一资源定位符 (URL) locates one resource on the web:
https://www.example.com/about/contact.html. - The protocol 协议,
https, says how to fetch it. The domain name 域名,www.example.com, names the server in a form people can read. The path,/about/contact.html, names the file on that server. - A URL may also carry a port number and a query string after
?, but protocol, domain and path are the three the exam asks for.
URL
- 统一资源定位符(Uniform Resource Locator,URL)定位万维网上的一个资源:
https://www.example.com/about/contact.html。 - 协议(protocol),
https,说明怎样获取它。域名(domain name),www.example.com,用人能读的形式给服务器命名。路径,/about/contact.html,给那台服务器上的文件命名。 - URL 还可能带端口号和
?后面的查询字符串,但协议、域名和路径是考试要问的三个部分。
In https://www.example.com/about/contact.html, what is https? · 在 https://www.example.com/about/contact.html 中,https 是什么?
https is the protocol; www.example.com is the domain name; /about/contact.html is the path. · https 是协议;www.example.com 是域名;/about/contact.html 是路径。
Match each part of https://www.example.com/about/contact.html to its name. · 把 https://www.example.com/about/contact.html 的每个部分与它的名字配对。
A URL is protocol + domain name + path — the protocol says how, the domain says which server, the path says which resource. · 一个 URL 是协议 + 域名 + 路径——协议说如何,域名说哪个服务器,路径说哪个资源。
The Domain Name System
- Computers deliver to IP addresses, not names. The Domain Name System 域名系统 (DNS) is a distributed set of servers that translates a domain name into an IP address.
- The browser asks a resolver 解析器. If the resolver has not cached the answer, it asks a root server, which points it to the top-level domain server for
.com, which points it to the authoritative server forexample.com, which returns the IP address. - The browser then connects to that IP address and requests the path. The whole lookup takes milliseconds and is cached so it rarely repeats.
Resolver, root, top-level domain, authoritative: then the browser connects
域名系统
- 计算机把数据投递到 IP 地址,而不是名字。域名系统(Domain Name System,DNS)是一组分布式服务器,把域名翻译成 IP 地址。
- 浏览器向一个解析器(resolver)提问。如果解析器没有缓存答案,它问一台根服务器,根服务器指向
.com的顶级域服务器,后者指向example.com的权威服务器,权威服务器返回 IP 地址。 - 然后浏览器连接到那个 IP 地址并请求路径。整个查找只需几毫秒,而且会被缓存,所以很少重复。

解析器、根、顶级域、权威:然后浏览器连接
How DNS finds a website · DNS 如何找到一个网站
Step through a DNS lookup. The network routes by IP, not by name — so before anything loads, DNS must turn the domain name into an IP address. · 一步步走过一次 DNS 查找。网络按 IP 而不是按名字路由——所以在任何东西加载之前,DNS 必须把域名变成一个 IP 地址。
The Domain Name System (DNS) mainly: · 域名系统(DNS)主要:
DNS resolves human-readable domain names to the numeric IP addresses the network actually uses. · DNS 把人类可读的域名解析成网络实际使用的数字 IP 地址。
Worked example: from typed address to loaded page
- The user types the URL. The browser separates the protocol, the domain name and the path.
- The browser sends the domain name to the DNS resolver, which queries the DNS hierarchy until an authoritative server returns the server's IP address.
- The browser opens a connection to that IP address and sends an HTTP request for the path.
- The server returns the page, and the browser renders it. Four steps, and the DNS step is the one most often missed.
例题:从输入地址到加载页面
- 用户输入 URL。浏览器把协议、域名和路径分开。
- 浏览器把域名发给 DNS 解析器,解析器沿 DNS 层级查询,直到权威服务器返回服务器的 IP 地址。
- 浏览器打开到该 IP 地址的连接,并为该路径发送 HTTP 请求。
- 服务器返回页面,浏览器渲染它。四步,而 DNS 这一步最常被漏掉。
Put a DNS lookup in order, from typing the address to loading the page. · 把一次 DNS 查找按顺序排列,从输入地址到加载页面。
The resolver walks the hierarchy (root → TLD → authoritative) until it gets the IP, then the browser connects. · 解析器走过层级(根 → 顶级域 → 权威)直到它得到 IP,然后浏览器连接。
Why DNS exists
- People remember names; routers deliver to numbers. DNS lets both be true at once.
- A site can move to a new server, or spread across many, by changing its DNS record. Users type the same name.
- The system is distributed, so no single server holds every name, and it is cached at every level, so the load is spread.
DNS 为什么存在
- 人记名字;路由器按数字投递。DNS 让两件事同时成立。
- 网站可以通过修改 DNS 记录搬到新服务器,或分布到许多台上。用户输入的名字不变。
- 这个系统是分布式的,没有一台服务器保存所有名字;每一级都有缓存,所以负载被分散。
Why does the web use DNS rather than having users type IP addresses? Select all · 所有 that apply. · 为什么万维网使用 DNS 而不是让用户输入 IP 地址?选出所有适用的。
DNS is about names, flexibility and distribution. The lookup adds a few milliseconds; it does not speed up the page itself. · DNS 关乎名字、灵活性和分布。查找会增加几毫秒;它并不会让页面本身更快。
Bit streaming
- Bit streaming 流式传输 sends multimedia as a continuous stream that the receiver plays as it arrives, instead of downloading the whole file first.
- Real-time 实时 streaming is captured and sent as it happens, live sport or a video call. You cannot rewind, and low latency is vital.
- On-demand 点播 streaming plays a file already stored on a server. You can pause and rewind, and the server can send ahead.
The buffer sits between the network and the player
比特流
- 比特流(bit streaming)把多媒体作为连续的流发送,接收方边到边播,而不是先下载整个文件。
- 实时(real-time)流在事件发生时捕获并发送——现场体育赛事或视频通话。你不能回放,低延迟至关重要。
- 点播(on-demand)流播放已经存在服务器上的文件。你可以暂停和回放,服务器可以提前发送。

缓冲位于网络和播放器之间
Streaming media plays as it arrives, without first downloading the whole file. · 流式媒体在它到达时播放,而不先下载整个文件。
That is the defining feature of streaming — the receiver plays the stream as it comes in (with a small buffer), rather than waiting for a full download. · 那是流式传输的决定性特征——接收者在流进来时播放它(带一个小缓冲区),而不是等待一次完整的下载。
Compared with real-time (live) streaming, on-demand streaming: · 与实时(直播)流式传输相比,点播流式传输:
On-demand content is pre-recorded, so you can pause/rewind and the server can buffer well ahead. Live streaming can't be rewound and needs low latency. · 点播内容是预先录制的,所以你能暂停/倒带,服务器能提前很多缓冲。直播不能被倒带且需要低延迟。
Buffers and bit rate
- A buffer 缓冲 stores a few seconds of data before playback starts, so a brief dip in the network does not stop the picture. On-demand streams can buffer far ahead; a live stream can only buffer a little, or it stops being live.
- The bit rate 比特率 is the number of bits per second the stream needs. It must stay below the broadband speed, or data arrives slower than it is played and the playback stalls.
- Lossy 有损 compression 压缩 keeps the bit rate down: moving pictures hide small losses, and the stream must fit the bandwidth.
缓冲和比特率
- 缓冲(buffer)在播放开始前存储几秒的数据,这样网络的短暂下降不会让画面停下。点播流可以提前缓冲很多;直播流只能缓冲一点,否则就不再是"直播"。
- 比特率(bit rate)是流每秒需要的比特数。它必须保持低于宽带速度,否则数据到达比播放慢,播放就会卡住。
- 有损(lossy)压缩(compression)把比特率压下来:动态画面掩盖了小的损失,而流必须适合带宽。
Why does a streaming player use a buffer? · 为什么一个流式播放器使用一个缓冲区?
The buffer holds a few seconds ahead of what is playing, so short slow-downs in the network don't cause the playback to stall. · 缓冲区保存正在播放的内容之前的几秒,所以网络中短暂的减速不会导致播放停顿。
For a stream to play without stalling, its bit rate must stay ____ the broadband speed of the connection. · 要让流不卡顿地播放,它的比特率必须保持____连接的宽带速度。
If more bits per second are needed than the connection delivers, data arrives more slowly than it is played and the buffer empties. · 如果每秒需要的比特数超过连接能送达的,数据到达比播放慢,缓冲就会耗尽。
Worked example: why compress before streaming live?
- Explain why a video is compressed before it is streamed in real time.
- The uncompressed stream would need more bandwidth than the connection has, so frames would arrive late and playback would stall.
- Compression cuts the number of bits, so the bit rate stays below the broadband speed and the delay stays small.
- Less storage and cost are needed at both ends. A late packet in a live stream is simply dropped, because a live stream cannot wait for it.
例题:为什么直播前要压缩?
- 解释为什么视频在实时流传输前要被压缩。
- 未压缩的流需要的带宽会超过连接所有的,所以帧会迟到,播放会卡住。
- 压缩减少比特数,所以比特率保持在宽带速度以下,延迟保持很小。
- 两端需要的存储和成本更少。直播流里迟到的数据包会被直接丢弃,因为直播不能等它。
Worked example: the real-time pipeline
- Describe how a live event is streamed to viewers.
- The camera and microphone capture and sample the event. The data is encoded, using compression to shrink it.
- The stream is sent across the network as packets. The viewer's device buffers a little, then plays, dropping any packet that arrives too late.
- Compare on-demand: the file already exists, so the server can send ahead, the buffer can be large, and the viewer can pause and rewind.
例题:实时流水线
- 描述一场现场活动怎样流传输给观众。
- 摄像机和麦克风捕获并采样活动。数据被编码,用压缩缩小它。
- 流作为数据包发送过网络。观众的设备缓冲一点,然后播放,丢弃任何到得太晚的数据包。
- 对比点播:文件已经存在,所以服务器可以提前发送,缓冲可以很大,观众可以暂停和回放。
Put the stages of real-time streaming in order. · 把实时流传输的各阶段按顺序排列。
Capture, encode, send, play. The compression happens before sending, which is what keeps the bit rate inside the bandwidth. · 捕获、编码、发送、播放。压缩在发送之前进行,这正是让比特率保持在带宽之内的东西。
Marks that slip away
- DNS turns a name into an IP address, never the other way round in an exam answer, and it is not what carries the page.
- Real-time streaming can still use a buffer; it is just a small one. What it cannot do is rewind.
- Bit rate is compared with the connection's speed. If the bit rate is higher, the stream stalls; say which is which.
- The protocol part of a URL is
https, notwww.wwwis part of the domain name.
容易丢掉的分
- DNS 把名字变成 IP 地址,考试答案里绝不能反过来,而且它不是传送页面的东西。
- 实时流仍然可以用缓冲;只是很小。它做不到的是回放。
- 比特率要与连接速度比较。比特率更高时流会卡住;要说清哪个是哪个。
- URL 的协议部分是
https,不是www。www是域名的一部分。
In a real-time stream, a packet that arrives too late is held until it can be played in its proper place. · 在实时流中,到得太晚的数据包会被保留到能在正确位置播放时再播。
A live stream cannot wait: a late packet is dropped and playback continues. Only on-demand streaming can afford to wait, because it buffers far ahead. · 直播不能等:迟到的数据包被丢弃,播放继续。只有点播能等得起,因为它提前缓冲了很多。
You've got it
- a URL = protocol + domain name + path; DNS turns the domain name into an IP address through resolver → root → top-level → authoritative servers
- DNS exists so people use names, routers use numbers, and a site can move without changing its name
- bit streaming plays media as it arrives: real-time is live and cannot rewind, on-demand is stored and can
- a buffer covers network dips; the bit rate must stay below the broadband speed, which is why streams use lossy compression
你掌握了
- URL = 协议 + 域名 + 路径;DNS 通过解析器 → 根 → 顶级域 → 权威服务器把域名变成 IP 地址
- DNS 的存在让人用名字、路由器用数字,网站可以搬家而名字不变
- 比特流边到边播:实时是直播且不能回放,点播是已存储的且可以回放
- 缓冲抵消网络的波动;比特率必须低于宽带速度,这就是流使用有损压缩的原因