Skip to content

Networks

A-Level Computer Science Topic 2 23:47 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
You tap send. 你按下发送。
In less than a second, your message leaps out of your phone, races across your city, dives under an ocean through a cable, and surfaces on another continent — landing in exactly the right hand, out of billions. 不到一秒钟,你的消息就从手机里跳出来,飞驰过你的城市, 顺着一根电缆潜入海底,又在另一块大陆浮出水面——精准地落到那唯一正确的人手里, 从亿万人之中找到了他。
It passed through dozens of machines, each one asking the same question: where does this go next? 它穿过了几十台机器,每一台都在问同一个问题:这该往哪儿送?
That coordination, at the scale of a planet, is what a network is. 这种在整个星球尺度上的协同,就是网络。
A network is just computers talking. 网络,不过就是计算机在互相交谈。
Today: local and wide networks, how they are wired, the switches and routers that steer the traffic, IP addresses and DNS, and how video streams to you live. 今天:局域网与广域网、它们如何连线、 引导流量的交换机和路由器、IP 地址与 DNS,以及视频如何实时流到你面前。
Let's begin. 让我们开始吧。
So what exactly is a network? 那么,网络到底是什么?
It is a set of computing devices connected together so they can communicate and share resources. 它是一组连接在一起的计算设备,让它们能够互相通信、共享资源。
Why bother? 为什么要联网呢?
Five reasons. 五个理由。
Sharing resources: one printer, one file server and one internet line serve everybody, which is far cheaper than equipping every machine. 共享资源:一台打印机、一台文件服务器、一条网络线路服务所有人, 比给每台机器都单独配一套便宜得多。
Sharing data: many users open the same files instead of passing copies around. 共享数据:许多用户打开同一批文件,而不用来回传副本。
Central management: software, user accounts and backups are handled once, on a server. 集中管理:软件、用户账户和备份,都只在服务器上做一次。
Communication: email, video calls and messaging. 通信:电子邮件、视频通话和即时消息。
And remote access: you can work from anywhere. 以及远程访问:你可以在任何地方工作。
Every idea in this topic exists to serve one of those five. 这个专题里的每一个想法,都是为这五件事之一服务的。
The smallest networks are local — a LAN — covering one home, office or school, fast and owned by you. 最小的网络是局域的——局域网——只覆盖一个家、一间办公室或一所学校,速度快,归你自己所有。
Link many LANs across cities or the whole planet, and you have a wide-area network, a WAN. 把许多局域网跨越城市、甚至整个星球连起来,你就有了广域网。
The internet is the biggest WAN of all. 互联网就是最大的广域网。
And within them, two ways to organise: client-server, where powerful servers hold everything and clients ask for it; or peer-to-peer, where every machine is an equal, sharing directly, with no central server to fail. 而在它们内部,有两种组织方式:客户端-服务器,由强大的服务器保存一切,客户端向它索取; 或者对等网络,其中每一台机器都是平等的,直接共享,没有会宕掉的中央服务器。
Now be precise, because examiners are. 现在要说得精确一些,因为考官就是这么要求的。
A local area network covers a small area: one home, one office, one school site. 局域网覆盖一小片区域:一个家、一间办公室、一个校区。
The organisation owns the cabling, so data rates are high and latency — the delay before data starts arriving — is low. 线缆归这个组织自己所有,所以数据速率高,而延迟——数据开始到达之前的那点等待——很低。
A wide area network covers a large area: a city, a country, the whole planet. 广域网覆盖一大片区域:一座城市、一个国家、整个星球。
You do not own the links between sites; you rent them from a telecommunications company. That means the public switched telephone network, a leased line, or fibre. 站点之间的链路不归你所有, 你要向电信公司租用它们,也就是公共交换电话网、专线,或者光纤。
Longer distances and shared links mean lower data rates and higher latency. 距离更远、链路又是共享的,所以数据速率更低,延迟更高。
And remember which contains which: a WAN joins LANs together. 还要记住谁包含谁:广域网把局域网连起来。
Look closer at client-server. 再仔细看看客户端-服务器。
A few powerful machines act as servers, and each one provides a service: a file server stores documents, a web server sends pages, a mail server carries email. 少数几台强大的机器充当服务器,每一台提供一种服务: 文件服务器保存文档,网页服务器发送网页,邮件服务器负责电子邮件。
Every other machine is a client, and a client simply requests a service and waits for the reply. 其他每一台机器都是客户端,客户端只做一件事:请求一项服务,然后等待回复。
The pay-off is control: software, user accounts, permissions and backups all live in one place, so one administrator can look after hundreds of machines. 好处是可控:软件、用户账户、权限和备份全都集中在一个地方, 所以一个管理员就能照看几百台机器。
The price is that the server is a single point of failure. 代价是服务器成了单点故障。
If it stops, nobody works — which is why real servers are backed up and duplicated. 它一停,所有人都没法工作——所以真实的服务器都要做备份和冗余。
When a question says choose a model and justify it, the scheme wants the trade-off both ways. 当题目要你「选择一种模型并说明理由」时,评分标准要的是两边的权衡。
Client-server suits a school or a business: files are stored and backed up centrally, a user logs in with one account from any machine, software and security are managed once, and the server can be a powerful machine. 客户端—服务器模式适合学校或者企业: 文件集中存储和备份,用户用一个账户就能在任何一台机器上登录, 软件和安全只需要管理一次,而且服务器可以是一台性能很强的机器。
Its drawbacks are the cost of the server and of a technician, and that the server is a single point of failure. 它的缺点是服务器和技术人员的成本,以及服务器是单点故障。
Peer-to-peer turns that upside down. 对等网络把这一切颠倒过来。
There is no server. 这里没有服务器。
Every machine is an equal peer, and each peer is both client and server at once: it asks its neighbours for files and hands out its own. 每台机器都是平等的对等节点, 而每个节点同时既是客户端又是服务器:它向邻居索取文件,也把自己的文件分享出去。
The resources are spread across the peers, so nothing sits at the centre. 资源分散在各个节点上,中心处什么也没有。
Lose one peer and the network carries on — that is the strength. 少了一个节点,网络照样运转——这就是它的强项。
The weakness comes from the same fact. With no central point, security and consistency are hard: nobody enforces a password policy, there is no single backup, and two peers can end up holding different versions of the same file. 它的弱点来自同一个事实:没有中心点,安全和一致性就很难保证: 没有人强制执行密码策略,没有统一的备份,两个节点还可能各自保存着同一个文件的不同版本。
And the drawbacks the scheme lists for peer-to-peer: files are spread across many machines, so they are hard to back up and a file is simply unavailable when its owner's machine is off; each machine must be secured separately; and a peer that is serving the others slows down. 评分标准列出的对等网络的缺点是: 文件分散在很多台机器上,所以很难备份,而且文件所属的那台机器关机时就直接用不了; 每台机器都要单独做安全防护; 而且正在为别人提供服务的那个节点自己会变慢。
One more the examiner likes: an online game played through a web browser is client-server, not peer-to-peer — the browser is the client, and the game and its shared world run on the company's server, which is what keeps every player's view consistent. 还有一个考官偏爱的点:通过浏览器玩的网络游戏是客户端—服务器,不是对等网络—— 浏览器是客户端,游戏和它的共享世界运行在公司的服务器上, 正是这一点让每个玩家看到的画面保持一致。
Clients come in two kinds. 客户端分两种。
A thin client does little processing locally: it shows a screen and sends your key presses to a powerful server, which does the real work. 瘦客户端几乎不做本地处理:它只显示画面,把你的按键送到一台强大的服务器, 由服务器完成真正的工作。
A web terminal or a remote desktop is a thin client. 网页终端或远程桌面就是瘦客户端。
A thick client has strong local processing and storage and runs full applications itself; an ordinary desktop computer is a thick client. 胖客户端有很强的本地处理能力和存储,自己就能运行完整的应用程序; 一台普通的台式电脑就是胖客户端。
Four rows separate them. 用四行就能把它们分开。
Local processing: minimal on thin, substantial on thick. 本地处理:瘦客户端很少,胖客户端很多。
Local storage: the same pattern. 本地存储:同样的规律。
Reliance on the network: high for thin, lower for thick. 对网络的依赖:瘦客户端高,胖客户端较低。
Server load: high for thin, lower for thick. 服务器负载:瘦客户端高,胖客户端较低。
Unplug the network and a thin client is a blank screen. 把网线一拔,瘦客户端就只剩一块空白屏幕。
How do we wire the machines together? 我们怎么把这些机器连到一起呢?
In a bus, they all share one cable — cheap, but if the cable breaks, everything stops. 在总线型里,它们全都共用一根电缆——便宜, 但只要电缆一断,一切就停摆。
In a star, every device connects to a central switch — one machine failing does not hurt the rest, which is why it is the most common today. 在星形里,每台设备都连到一个中央交换机—— 一台机器坏了不影响其他,这就是它今天最常见的原因。
In a mesh, every device links to many others, so if one path fails, traffic simply reroutes — very reliable, but a lot of cable. 在网状型里,每台设备都连向许多其他设备, 所以万一某条路径失效,流量就自动改道——非常可靠,但要用很多电缆。
Real buildings rarely use one pure shape. 真实的建筑里很少用某一种纯粹的形状。
A hybrid topology mixes them: a star inside each office, and links between the offices, so one broken link never isolates a whole building. 混合拓扑把它们混着用:每间办公室内部是星形, 办公室之间再用链路相连,这样断掉一条线,也不会把整栋楼孤立起来。
Now line up the trade-offs, because that is what the question asks. 现在把各自的取舍排好,因为考题问的就是这个。
Bus is the cheapest to install, but the whole network dies if the shared cable breaks, and performance falls as more devices share the same bandwidth. 总线安装最便宜, 但共用的那根电缆一断,整个网络就死了;而且设备越多、共享同一份带宽,性能就越差。
In a star, one failed device or cable affects only that device — but if the central switch fails, everything stops. 在星形里,一台设备或一条线缆坏了,只影响那一台——但中央交换机一坏,一切都停。
A mesh has many paths, so traffic reroutes and it is genuinely fault tolerant, at the cost of a great deal of cable. 网状有很多条路径,流量可以改道,真正做到容错,代价是要用大量线缆。
Wired or wireless? 用有线还是无线?
Wired means Ethernet, running over twisted-pair copper for short distances, or fibre-optic cable for long, fast runs. 有线指的就是以太网,短距离跑在双绞线铜缆上,长距离、高速则用光纤。
It gives higher speed, lower latency, fewer errors and better security, because to tap a cable you must physically reach it. 它带来更高的速度、更低的延迟、更少的错误,也更安全,因为要窃听一根电缆,你必须先能碰到它。
Wireless means Wi-Fi, Bluetooth or a cellular network: nothing to plug in, and devices are free to move, which is exactly why your phone uses it. 无线指的是 Wi-Fi、蓝牙或蜂窝网络:什么都不用插,设备可以自由移动, 这正是你的手机用它的原因。
But radio is shared and open, so it is slower, it suffers interference from walls and other devices, and it is exposed to eavesdropping. 但无线电是共享而开放的,所以它更慢, 会受到墙壁和其他设备的干扰,也容易被窃听。
For the same generation of technology, wired wins on speed and reliability; wireless wins on convenience. 在同一代技术之下, 有线胜在速度和可靠性,无线胜在方便。
What is actually in the cupboard? 机柜里到底装了些什么?
Every device needs a network interface card, or NIC, to send and receive on the network. 每台设备都需要一张网络接口卡,也就是网卡,才能在网络上收发数据。
Each card is made with a unique MAC address burned into it: forty-eight bits of hardware address. 每张网卡出厂时就烧进了一个唯一的 MAC 地址:四十八位的硬件地址。
A wireless device uses a wireless network interface card, a WNIC. 无线设备用的是无线网络接口卡。
Next, the switch, which forwards each Ethernet frame out of only the one port that leads to the destination MAC address. 接下来是交换机, 它把每一个以太网帧只从通向目标 MAC 地址的那一个端口送出去。
Its ancestor, the hub, copied every frame to every port — wasteful, insecure and now obsolete. 它的前辈集线器则是把每一帧复制到所有端口——既浪费又不安全,现在已经淘汰了。
A wireless access point lets wireless clients join a wired LAN. 无线接入点让无线客户端接入有线局域网。
And the cabling: twisted-pair for short runs, fibre-optic for long, fast ones. 还有线缆:短距离用双绞线,长距离、高速用光纤。
Two more devices the syllabus names. 考纲还点名了另外两个设备。
A bridge joins two LAN segments into one network, passing traffic between them. 网桥把两个局域网网段连成一个网络,在它们之间传递流量。
A repeater receives a weakened signal and retransmits it at full strength, to extend a cable's reach — it does not decide anything about where the data goes, it only makes the signal strong again. 中继器接收已经衰减的信号,再以全强度重新发出去,用来延长线缆能到达的距离—— 它不对数据往哪里去做任何判断,只是把信号重新变强。
Two devices do the steering. 有两个设备负责引导。
A switch works inside one network: it reads each frame's MAC address — the hardware address burned into every network card — and sends it out only the right port. 交换机在一个网络内部工作:它读取每一帧的 MAC 地址—— 也就是烧录在每一块网卡里的硬件地址——只把它从正确的端口送出去。
A router works between networks, at the edge of your LAN: it reads each packet's IP address, and forwards it toward its destination, hopping router to router across the internet. 路由器在不同网络之间工作, 就在你局域网的边界上:它读取每一个数据包的 IP 地址,把它转发向目的地, 在互联网上一个路由器接一个路由器地跳。
Switch by MAC, within; router by IP, between. 交换机按 MAC,在内部;路由器按 IP,在网络之间。
The box on your wall does four jobs at once, and all four are examinable. 你墙上那个盒子同时做四件事,而这四件都可能考。
One: forwarding. 第一,转发。
It reads each packet's destination IP address, looks that address up in its routing table, and sends the packet out of the port that leads closest to the destination. 它读取每个数据包的目的 IP 地址,在自己的路由表里查这个地址, 然后把数据包从最接近目的地的那个端口送出去。
Two: network address translation, or NAT. 第二,网络地址转换,也就是 NAT。
Many private addresses inside your LAN share one public address on the internet, and the router remembers which reply belongs to which device. 你局域网内部的许多私有地址共用一个公网地址,而路由器记住哪一条回复属于哪一台设备。
Three: DHCP, which hands out private IP addresses automatically as devices join, so nobody types one in. 第三,DHCP,它在设备接入时自动分配私有 IP 地址,谁都不用手工输入。
Four: a firewall, which blocks unwanted incoming traffic before it reaches your machines. 第四,防火墙,它在不受欢迎的入站流量到达你的机器之前就把它拦下来。
Ethernet is the main wired LAN technology, and on an old shared cable it had a problem: if two devices sent at the same instant, the signals overlapped and both messages were ruined. 以太网是主要的有线局域网技术,而在早期的共享电缆上它有个麻烦: 如果两台设备在同一瞬间发送,信号就会叠在一起,两条消息都被毁掉。
That is a collision. 这就是冲突。
The rule that handles it is CSMA/CD — carrier sense multiple access with collision detection. 处理它的规则叫 CSMA/CD——带冲突检测的载波侦听多路访问。
Carrier sense: listen to the cable first, and wait if somebody else is sending. 载波侦听:先听一听电缆,如果别人正在发送就等着。
Multiple access: many devices share the one medium. 多路访问:许多设备共用这一条介质。
Collision detection: keep listening while you send, because an overlapping signal means a clash. 冲突检测:一边发送一边继续听,因为信号叠加就说明撞上了。
Then both senders stop, send a short jam signal so everyone knows, and wait a random backoff time before trying again — random, so they do not simply collide a second time. 然后两个发送方都停下来,发出一段短短的阻塞信号让所有人知道, 再等一个随机的退避时间才重试——之所以随机,就是为了不再撞第二次。
Modern switched Ethernet gives every device its own full-duplex link, so collisions no longer happen. 现代交换式以太网给每台设备一条自己的全双工链路,所以冲突不再发生。
Two words that people use as if they mean the same thing. They do not. 有两个词,人们把它们当成一回事来用,其实并不是。
The internet is the infrastructure: a global network of networks, all agreeing to speak one common protocol suite called TCP/IP. 互联网是基础设施: 一个由网络组成的全球性网络,所有网络都同意讲同一套协议,叫 TCP/IP。
The World Wide Web is one service that runs on top of it: hyperlinked documents, each identified by a URL, fetched by a browser using HTTP or its secure version, HTTPS. 万维网只是跑在它上面的一项服务:由超链接连起来的文档,每一份都用一个 URL 标识, 由浏览器通过 HTTP 或它的安全版本 HTTPS 取回。
Here is the test. Email and file transfer also travel over the internet, but they are not part of the Web. 判断的方法是这样: 电子邮件和文件传输也走互联网,但它们不属于万维网。
So the Web needs the internet; the internet does not need the Web. 所以万维网需要互联网,互联网却不需要万维网。
Three ways a machine actually reaches the internet, and the syllabus names all three. 一台机器真正接入互联网有三条路,考纲三条都点名了。
A modem converts the computer's digital signal into an analogue signal for a telephone line, and back again at the other end — modulation and demodulation, which is where the name comes from — carrying data over the P S T N, the public telephone network of exchanges and lines. 调制解调器把计算机的数字信号转换成适合电话线的模拟信号,在另一端再转回来—— 调制和解调,名字就是这么来的——数据由此走公共交换电话网, 也就是由交换机和线路组成的公共电话网络。
A dedicated line is a leased line between an organisation and its I S P: always on, with a fixed bandwidth that is not shared, so faster and more reliable, but expensive. 专线是组织和它的网络服务商之间租用的线路: 一直在线,带宽固定且不与他人共享,所以更快也更可靠,但是贵。
And on a cell phone network the phone sends data by radio to the nearest cell tower; the towers are linked to the phone company's network, which routes it to the internet, and as the phone moves it is handed over from one cell to the next. 而在蜂窝网络上,手机通过无线电把数据发给最近的基站; 基站连到电话公司的网络,再由它把数据送上互联网, 手机移动时会从一个蜂窝小区切换到下一个。
Once services travel over the internet, you no longer have to own the machine that runs them. 一旦服务可以经由互联网送达,你就不必再拥有运行它们的那台机器。
That is cloud computing: servers, storage and software delivered over the internet and hosted by a third party in their data centre. 这就是云计算:服务器、存储和软件通过互联网交付,由第三方托管在他们的数据中心里。
Scalability comes first: you rent what you need this month and give it back next month, so a small company can survive a sudden rush. 首先是可扩展性:这个月租你需要的量,下个月再退掉,所以一家小公司也能扛过突然涌来的访问。
Costs are lower, because there is no hardware to buy and no server room to cool. 成本更低,因为不用买硬件,也不用给机房降温。
You can reach it from anywhere, on any device, and big data centres keep redundant copies of your data. 你可以在任何地方、用任何设备访问它, 而大型数据中心会为你的数据保留冗余副本。
The drawbacks are just as real: no internet means no service, your data sits with somebody else, and moving to another provider later can be painful — vendor lock-in. 坏处同样实实在在: 没有网络就没有服务;你的数据放在别人那里;以后想换一家供应商还可能很痛苦——这叫供应商锁定。
Learn the one-mark definition word for word: cloud computing is on-demand computing services — storage, processing, software — provided over the internet by a third party. 一分的定义要一字不差地背下来: 云计算,是由第三方通过互联网提供的按需计算服务——存储、处理、软件。
A public cloud is owned by a provider and shared by many customers; a private cloud is dedicated to one organisation, on its own hardware or hosted for it alone. 公有云由服务商拥有,多个客户共用; 私有云专供一个组织使用,跑在它自己的硬件上,或者由别人单独为它托管。
Every device needs an address: an IP address. 每台设备都需要一个地址:一个 IP 地址。
The old version, IP version four, has about four billion of them — and we ran out. 旧的版本,IP 第四版,大约有四十亿个——而我们用光了。
So IP version six gives us billions of billions more. 于是 IP 第六版给了我们多得多的地址,多到亿亿计。
But nobody memorises numbers. 但没有人会去背数字。
So when you type a web address, the Domain Name System steps in — a giant directory that turns a name, like example dot com, into its IP address. 所以当你输入一个网址时,域名系统就登场了——一个巨大的目录, 把一个名字,比如 example 点 com,变成它的 IP 地址。
Only then can your browser connect. 只有到这时,你的浏览器才能连上去。
One large network is hard to run, so we split it into subnets. 一个大网络很难管理,所以我们把它切成子网。
Every IP address is really two parts joined together: a network part, saying which network you are on, and a host part, saying which machine you are on that network. 每一个 IP 地址其实都是两部分拼在一起: 网络部分,说明你在哪个网络上;主机部分,说明你是那个网络上的哪一台机器。
What decides where the split falls is the subnet mask. 决定这一刀切在哪里的,是子网掩码。
A mask of two five five, two five five, two five five, zero makes the first twenty-four bits the network part, leaving the last eight for the host. 掩码 255.255.255.0 让前二十四位成为网络部分, 余下的八位留给主机。
Why bother? 为什么要这么做?
Three reasons: each department is easier to manage, broadcast traffic stays inside its own subnet instead of flooding everything, and you can put security rules between subnets. 三个理由:每个部门更好管理; 广播流量留在自己的子网里,不会淹没整个网络;而且你可以在子网之间加上安全规则。
Now a full worked example. 现在做一道完整的例题。
A host has the address one nine two, one six eight, ten, one hundred and thirty, and the subnet mask two five five, two five five, two five five, one hundred and ninety-two. 一台主机的地址是 192.168.10.130,子网掩码是 255.255.255.192。
Which network is it on? 它在哪个网络上?
Start with the mask, always. 永远先从掩码入手。
Its last octet is one hundred and ninety-two, which in binary is two ones followed by six zeros. 掩码的最后一段是 192,二进制里是两个一后面跟六个零。
So twenty-six bits are the network part, and the last six bits address the host. 所以二十六位是网络部分,最后六位用来标识主机。
Next, the block size: two hundred and fifty-six minus one hundred and ninety-two is sixty-four. 接下来算块大小: 256 减去 192 等于 64。
So the subnets step in blocks of sixty-four: zero, sixty-four, one hundred and twenty-eight, one hundred and ninety-two. 所以子网以 64 为步长:0、64、128、192。
One hundred and thirty falls inside the block that begins at one hundred and twenty-eight. 130 落在从 128 开始的那一块里。
So our host is on the network ending one hundred and twenty-eight, slash twenty-six — that is 192.168.10.128/26. 所以这台主机在以 128 结尾的那个 /26 网络上。
Finish the question. 把题目做完。
Inside that block, the usable host addresses run from one hundred and twenty-nine up to one hundred and ninety, because the last address in the block, one hundred and ninety-one, is the subnet's broadcast address. 在那一块里,可用的主机地址从 129 一直到 190, 因为这一块的最后一个地址 191 是该子网的广播地址。
Now the second half: is the address ending two hundred on the same network? 现在是第二半问题: 以 200 结尾的那个地址在同一个网络上吗?
Check the blocks again. 再看一遍这些块。
Two hundred is past one hundred and ninety-one, so it sits in the next block, the one beginning at one hundred and ninety-two. 200 已经过了 191, 所以它落在下一块里,也就是从 192 开始的那一块。
Different subnet. 这是不同的子网。
Traffic between those two hosts must pass through a router; a switch cannot do it, because a switch never looks at IP addresses. 这两台主机之间的流量必须经过路由器;交换机做不到,因为交换机从不看 IP 地址。
The lesson: take the block size from the mask first. 教训是:先从掩码算出块大小。
Guessing from the first three octets is what makes these go wrong. 凭前三段去猜,正是这类题目做错的原因。
Two more distinctions, and both are one-mark answers. 还有两组区分,都是一分的答案。
First, public against private. 第一,公有与私有。
A private address is used inside a LAN and is not routable on the internet — the one nine two, one six eight range is the one you have seen on your own router. 私有地址在局域网内部使用, 在互联网上不可路由——你在自己路由器上见过的 192.168 段就是它。
A public address is globally unique and routable, and your ISP — internet service provider — assigns it. 公有地址在全球唯一、可以路由,由你的互联网服务提供商分配。
Because your devices sit behind NAT with private addresses, nothing on the internet can reach them directly, which gives you some protection for free. 因为你的设备带着私有地址躲在 NAT 后面,互联网上的东西无法直接找到它们, 这就白送给你一层保护。
Second, static against dynamic. 第二,静态与动态。
A static address is fixed, and servers need that, because clients must find them at a known address. 静态地址是固定的,服务器需要这一点, 因为客户端必须在一个已知的地址上找到它们。
A dynamic address is handed out by DHCP and may change, which suits client devices and uses a limited pool of addresses efficiently. 动态地址由 DHCP 分配,还可能变化, 这适合客户端设备,也能更有效地使用有限的地址池。
Say the two formats precisely, because a "is this a valid address" question turns on them. 这两种格式要说准,因为「这是不是一个有效地址」的题目就靠它们判断。
I P version four is four groups of denary numbers separated by dots, and each group is an eight-bit number, so it runs from 0 to 255. IPv4 是四组十进制数字,用点分隔,每一组是一个八位数,所以范围是 0 到 255。
I P version six is eight groups of four hexadecimal digits separated by colons, and a run of zero groups can be shortened to a double colon. IPv6 是八组、每组四个十六进制数字,用冒号分隔, 连续为零的若干组可以缩写成两个冒号。
So 192.168.3.2 is not I P version six: four groups, not eight, separated by dots rather than colons, and denary rather than hexadecimal. 所以 192.168.3.2 不是 IPv6:它是四组不是八组,用点不是冒号,而且是十进制不是十六进制。
And 256.0.0.A is neither: an I P version four group cannot exceed 255 and cannot be a letter. 而 256.0.0.A 两种都不是:IPv4 的每一组不能超过 255,也不能是字母。
Take one web address apart. 把一个网址拆开看。
Before the colon, HTTPS is the protocol — the rules the browser and the server will use. 冒号之前的 HTTPS 是协议——浏览器和服务器要用的规则。
Then comes the domain name, the readable address of the server. 接下来是域名,也就是服务器那个便于阅读的地址。
Everything after that is the path: which folder and which file on that server. 再往后的全部内容是路径: 那台服务器上的哪个文件夹、哪个文件。
Now watch what happens when you press Enter. 现在看看你按下回车之后发生了什么。
Your browser cannot use a name, only a number, so it asks a DNS resolver: what is the IP address for this domain? 浏览器不会用名字,只会用数字,于是它去问一台 DNS 解析器:这个域名的 IP 地址是什么?
If the resolver does not know, it asks a root server, which points it to the top-level server for dot com, which points it to the authoritative server holding the real answer. 如果解析器不知道,它就去问根服务器,根服务器把它指向 dot com 的顶级域服务器, 顶级域服务器再把它指向持有真正答案的权威服务器。
The address comes back down the chain, and only then does your browser connect and ask for the path. 地址顺着这条链回传下来, 只有到这时,你的浏览器才连上去并请求那条路径。
Two gifts from DNS: nobody memorises numbers, and a site can move to a new server without changing its name. DNS 送了两份礼物: 没有人需要背数字;而且网站可以换到新的服务器,名字不用变。
Finally, how does video reach you without downloading the whole file first? 最后,视频是怎么在不先下载整个文件的情况下到达你这里的呢?
Bit streaming. 靠流式传输。
The server sends the media as a continuous stream of packets, and you play it as it arrives. 服务器把媒体作为一连串连续的数据包发过来,你就边到边播。
But networks are bumpy, so the player keeps a buffer — a small reserve that fills ahead, smoothing out the gaps. 但网络是坑坑洼洼的, 所以播放器会保留一个缓冲区——一小份提前填好的储备,把这些空隙抹平。
Live streams, by dropping any packet that arrives late, keep pace; on-demand ones can buffer further ahead, so you can pause and rewind. 直播流会丢掉任何来得太晚的数据包;点播流则可以缓冲得更靠前,所以你能暂停和回退。
How is a live stream actually made? 一场直播到底是怎么做出来的?
Four steps, in order. 四个步骤,按顺序来。
One: capture and sample the source — a camera and a microphone turn light and sound into numbers, many times a second. 第一,采集并采样信号源—— 摄像机和麦克风每秒许多次地把光和声音变成数字。
Two: encode it, using compression to shrink those numbers, because raw video is far too big for a home connection. 第二,编码,用压缩把这些数字缩小, 因为原始视频对家庭宽带来说太大了。
Three: send it across the network as packets. 第三,作为数据包在网络上发送。
Four: the receiver buffers a little, plays it live, dropping any packet that arrives late, because a live stream cannot wait for a straggler. 第四,接收端只缓冲一点点就开始实时播放,并且把任何来得太晚的数据包直接丢掉, 因为直播等不了迟到的那一个。
The compression is lossy — some detail is gone for good. 这里的压缩是有损的——一部分细节永久消失。
That is acceptable, because moving pictures hide small losses, and it is necessary, because the stream must fit inside the available bandwidth. 这是可以接受的,因为运动的画面会掩盖细小的损失;这也是必须的, 因为这条流必须塞进可用的带宽里。
Before the big three, two traps that quietly cost marks. 在讲那三条大原则之前,先说两个悄悄扣分的坑。
Trap one: a topology question never wants the drawing, it wants the trade-off. 第一个坑: 拓扑题从来不是要你画图,而是要你说取舍。
Asked why a school chose a star, answer with fault isolation and easy maintenance, not with the shape. 问一所学校为什么选星形, 答案是故障隔离、维护方便,而不是它长什么样。
Asked for the drawback of a bus, say the shared cable and the shared bandwidth. 问总线的缺点,就说共用的电缆和共享的带宽。
Trap two: keep the address pairs straight. 第二个坑:把两组地址的对比记牢。
IPv4 is thirty-two bits and has run out; IPv6 is one hundred and twenty-eight bits and has not. IPv4 是三十二位,已经用光了; IPv6 是一百二十八位,还远远没有。
A private address works only inside a LAN, while a public address is unique across the whole internet. 私有地址只在局域网内部有效, 公有地址在整个互联网上唯一。
And read the question's wording: when it asks who owns and controls the resources, that is the client-server against peer-to-peer decision, while how far the network reaches, and who owns the links, is the LAN against WAN one. 还要读清题目的用词:问谁拥有并控制这些资源, 考的是客户端-服务器还是对等网络;而网络覆盖多远、线路归谁所有,考的才是局域网还是广域网。
Three marks to secure. 三个要拿稳的分。
First, a LAN is local and a WAN is wide; client-server centralises resources, peer-to-peer spreads them. 第一,局域网是局域的,广域网是广域的;客户端-服务器把资源集中, 对等网络把资源分散。
Second, a switch directs within a network by MAC address, a router routes between networks by IP address. 第二,交换机在一个网络内部按 MAC 地址引导, 路由器在网络之间按 IP 地址路由。
Third, DNS turns a web address into an IP, and streaming needs a buffer because data arrives at a different rate from playback. 第三,DNS 把网址变成 IP, 而流式传输需要缓冲区,因为数据到达的速率和播放的速率不一样。
Master these, and networks are yours. 掌握这些,网络就是你的了。
The fixed-wording definitions. 固定措辞的定义。
A LAN covers a small geographical area, usually one site, and its hardware is owned by the organisation. 局域网覆盖一小片地理区域,通常是一个场地,硬件由该组织自己拥有。
A WAN covers a large area, joining LANs through third-party links. 广域网覆盖大片区域,通过第三方链路把多个局域网连接起来。
Client-server: clients request services from a central, more powerful server that provides them. 客户端—服务器:客户端向一台更强的中央服务器请求服务,由它提供。
Peer-to-peer: every computer is equal and can act as both client and server, with no central server. 对等网络:每台计算机地位平等,既可以做客户端也可以做服务器,没有中央服务器。
A thin client does little processing or storage itself and depends on the server for both; a thick client does its own and can work without the server. 瘦客户端自身几乎不做处理和存储,两者都依赖服务器; 胖客户端自己处理和存储,脱离服务器也能工作。
A mesh topology connects each device directly to many others, giving more than one route between two devices. 网状拓扑把每台设备直接连到许多其他设备,使两台设备之间有不止一条路径。
Ethernet is the standard protocol for wired LANs, sending data in frames and using C S M A slash C D on a shared medium. 以太网是有线局域网的标准协议,以帧的形式发送数据,在共享介质上使用 CSMA/CD。
And the traps. 再说陷阱。
A switch forwards by MAC address inside the LAN; the router forwards by I P address between networks — saying a switch works by I P address is wrong. 交换机在局域网内按 MAC 地址转发;路由器在网络之间按 IP 地址转发—— 说交换机按 IP 地址工作是错的。
The internet and the World Wide Web are not the same: the web is one service running over the internet, and email and file transfer are others. 互联网和万维网不是一回事:万维网是运行在互联网之上的一项服务, 电子邮件和文件传输是另外的服务。
Do not answer a wired-versus-wireless comparison with "faster" alone — say faster and more reliable and more secure, and give the wireless side too. 有线与无线的比较不要只答「更快」—— 要说更快、更可靠、更安全,并且也要给出无线的一面。
D N S finds the I P address for a U R L, not the router. 是 DNS 为一个网址找到 IP 地址,不是路由器。
And every device in a star topology has its own line to the switch in the middle. 另外星形拓扑里,每台设备都有自己单独的一条线连到中间的交换机。

Log in or create account

IGCSE, A-Level & AP