Comp211-Introduction
Textbook: Computer Networking: A Top-Down Approach, 8th Edition
教材:Computer Networking: A Top-Down Approach(《计算机网络:自顶向下方法》),第8版
Authors: Jim Kurose, Keith Ross
作者:Jim Kurose 和 Keith Ross
Publisher: Pearson, 2020
出版社:Pearson,2020年出版
Chapter 1: introduction P2 (第一章:引言)
Chapter goal:(章节目标)
- Get “feel,” “big picture,” introduction to terminology
-
获得对计算机网络的“感觉”和“整体图景”,并初步了解计算机网络的专业术语。
- More depth, detail later in course
在后续的课程中,逐步深入学习更详细的内容。
- More depth, detail later in course
-
Approach: Internet as example
- A top-down approach using the Internet as an example.
通过互联网作为例子,采用“自顶向下”的方式来学习网络原理。
- A top-down approach using the Internet as an example.
Overview / Roadmap (概览与学习路线图)
-
What is the Internet? What is a protocol?
互联网是什么?什么是协议?
-
Network edge: hosts, access network, physical media
网络边缘:终端、接入网络、物理介质
-
Network core: packet/circuit switching, Internet structure
网络核心:分组交换、互联网结构
-
Performance: loss, delay, throughput
性能:数据丢失、延迟、吞吐量
-
Protocol layers, service models
协议分层与服务模型
-
Security
安全性
-
History
历史
The Internet: a “nuts and bolts” view P3(互联网:一个“具体实物”的视角)
- Billions of connected computing devices:
- > 数十亿台互联的计算设备:
- Hosts = end systems
> 主机 = 终端系统
- Running network apps at Internet’s “edge”
> 在互联网“边缘”运行网络应用程序
- Packet switches: forward packets (chunks of data)
-
分组交换设备:转发数据包(数据块)
- Routers, switches
路由器、交换机
- Routers, switches
-
Communication links
-
通信链路
- Fiber, copper, radio, satellite
光纤、电缆、无线电、卫星
- Transmission rate: bandwidth
传输速率:带宽
- Fiber, copper, radio, satellite
-
Networks
-
网络
- Collection of devices, routers, links: managed by an organization
由设备、路由器、链路组成的集合,由某个组织管理
- Collection of devices, routers, links: managed by an organization
“Fun” Internet-connected devices P4(“有趣的”联网设备)
- Web-enabled toaster + weather forecaster
支持网页的烤面包机 + 天气预报功能 - Internet phones 互联网电话 - Slingbox: remote control cable TV Slingbox:远程控制有线电视 - Security Camera 安全摄像头 - IP picture frame IP相框 - Internet refrigerator 联网冰箱 - Tweet-a-watt: monitor energy use Tweet-a-watt:监控能耗 - Sensorized bed mattress 传感床垫 - Amazon Echo 亚马逊Echo - Gaming devices 游戏设备 - Cars 汽车 - Scooters 滑板车 - Bikes 自行车 - Pacemaker & Monitor 心脏起搏器和监测器 - AR devices 增强现实(AR)设备 - Fitbit Fitbit(健身追踪设备) - Diapers 智能尿布 - Others? 其他?
The Internet: a "nuts and bolts" view P5 - P6
互联网:"细节深入"视图
- Internet: "network of networks"
- > 互联网:"网络之网络"
- Interconnected ISPs
> 互联的因特网服务提供商(ISPs)
- Protocols are everywhere
-
协议无处不在
- Control sending, receiving of messages
-
控制消息的发送和接收
- e.g., HTTP (Web), streaming video, Skype, TCP, IP, WiFi, 4/5G, Ethernet
-
例如:HTTP(网页)、流媒体视频、Skype、TCP、IP、WiFi、4/5G、以太网
-
Internet standards
-
互联网标准
- RFC: Request for Comments
-
RFC:请求评议标准
- IETF: Internet Engineering Task Force
-
IETF:互联网工程任务组
-
Infrastructure that provides services to applications:
-
为应用程序提供服务的基础设施:
- Web, streaming video, multimedia teleconferencing, email, games, e-commerce, social media, inter-connected appliances, ...
-
网页、流媒体视频、多媒体电视会议、电子邮件、游戏、电子商务、社交媒体、互联设备等...
-
Provides programming interface to distributed applications:
-
为分布式应用程序提供编程接口:
- "hooks" allowing sending/receiving apps to "connect" to, use Internet transport service
-
"钩子"允许发送/接收应用程序"连接"并使用互联网传输服务
- provides service options, analogous to postal service
-
提供类似邮政服务的服务选项
2.What's a protocol? P7
什么是协议?
- Human protocols:
-
人类协议:
- "what's the time?"
-
"现在几点了?"
- "I have a question"
-
"我有个问题"
- introductions
-
介绍
Rules for:
- > 规则用于:
- ... specific messages sent
- > ... 发送特定消息
- ... specific actions taken when message received, or other events
- > ... 收到消息或其他事件时采取的特定行动
- Network protocols:
-
网络协议:
- computers (devices) rather than humans
-
计算机(设备)而不是人类
- all communication activity in Internet governed by protocols
-
互联网中的所有通信活动都由协议管理
-
Protocol Definition (in box):
-
协议定义(方框中):
- Protocols define the format, order of messages sent and received among network entities, and actions taken on message transmission, receipt
-
协议定义了网络实体之间发送和接收消息的格式、顺序,以及在消息传输、接收时采取的行动
What’s a protocol? P8
什么是协议?
- A human protocol and a computer network protocol:
-
人类协议和计算机网络协议:
- Q: other human protocols?
-
问:还有其他的人类协议吗?
Note: The image shows a side-by-side comparison of human communication protocol and computer network protocol, illustrating how both follow structured patterns of message exchange.
注:图片展示了人类通信协议和计算机网络协议的并列对比,说明两者都遵循结构化的消息交换模式。
3.Network edge: hosts, access network, physical media P9 - P12
网络边缘:主机、接入网、物理介质
- A closer look at Internet structure
-
仔细观察互联网结构
- Network edge:
-
网络边缘:
- hosts: clients and servers
-
主机:客户端和服务器
- servers often in data centers
-
服务器通常位于数据中心
-
Access networks, physical media:
-
接入网络、物理介质:
- wired, wireless communication links
-
有线、无线通信链路
-Network core: - > 网络核心: -interconnected routers - > 互联路由器 - network of networks - > 网络中的网络
Access networks and physical media P13
接入网络和物理媒介
-
Q: How to connect end systems to edge router?
问:如何将终端系统连接到边缘路由器?
-
Three main types of access networks:
-
三种主要的接入网络类型:
- Residential access nets
-
- 住宅接入网络
For home users
用于家庭用户
- 住宅接入网络
-
- Institutional access networks (school, company)
-
- 机构接入网络(学校、公司)
For organizations
用于组织机构
- 机构接入网络(学校、公司)
-
- Mobile access networks (WiFi, 4G/5G)
-
- 移动接入网络(WiFi、4G/5G)
For mobile users
用于移动用户
- 移动接入网络(WiFi、4G/5G)
Access networks: cable-based access P14 - P15
接入网络:基于电缆的接入:
- frequency division multiplexing (FDM): different channels transmitted in different frequency bands - > 分复用 (FDM): 不同的信道在不同的频段上进行传输。
- HFC: hybrid fiber coax
-
HFC:混合光纤同轴电缆
- Asymmetric transmission rates:
-
非对称传输速率:
-
Network of cable, fiber attaches homes to ISP router
-
电缆和光纤网络将住宅连接到ISP路由器
- Homes share access network to cable headend
-
住宅共享通向电缆前端的接入网络
Access networks: digital subscriber line (DSL) P16
接入网络:数字用户线路(DSL)
- use existing telephone line to central office DSLAM
- > 使用现有电话线连接到中心局的DSLAM
- data over DSL phone line goes to Internet
- > 数据通过DSL电话线连接到互联网
- voice over DSL phone line goes to telephone net
- > 语音通过DSL电话线连接到电话网络
- 24-52 Mbps dedicated downstream transmission rate
- > 下行传输速率:24-52 Mbps 专用
- 3.5-16 Mbps dedicated upstream transmission rate
- > 上行传输速率:3.5-16 Mbps 专用
Access networks: home networks P17
接入网络:家庭网络
Wireless access networks P18
无线接入网络
- Shared wireless access network connects end system to router via base station aka "access point"
-
共享无线接入网络通过基站(即"接入点")将终端系统连接到路由器
-
Wireless local area networks (WLANs)
-
无线局域网(WLAN)
- typically within or around building (~30m)
-
通常在建筑物内部或周围(约30米)
- 802.11b/g/n/ac (WiFi): 11, 54, 450, 1300 Mbps transmission rate
-
802.11b/g/n/ac (WiFi):11、54、450、1300 Mbps的传输速率
- Wide-area cellular access networks
- > 广域蜂窝接入网络
- provided by mobile, cellular network operator (10's km)
- > 由移动蜂窝网络运营商提供(数十公里)
- 4G: 150/300 Mbps (15km)
- > 4G: 150/300 Mbps (15公里)
- 5G: 10Gbps (300m)
- > 5G: 10Gbps (300米)
Access networks: enterprise networks P19
接入网络:企业网络
- companies, universities, etc.
- > 公司、大学等
- mix of wired, wireless link technologies, connecting a mix of switches and routers (we'll cover differences shortly)
- > 混合有线和无线链路技术,连接各种交换机和路由器(我们稍后会介绍它们的区别)
- Ethernet: wired access at 100Mbps, 1Gbps, 10Gbps
- > 以太网:有线接入速度为100Mbps、1Gbps、10Gbps
- WiFi: wireless access points at 11, 54, 450 Mbps
- > WiFi:无线接入点速度为11、54、450 Mbps
Access networks: data center networks P20
接入网:数据中心网络
- high-bandwidth links (10s to 100s Gbps) connect hundreds to thousands of servers together, and to Internet
-
高带宽链路(10到100gbps)将数百到数千台服务器连接在一起,并连接到互联网
Host:
主机:发送数据包
Host sending function:
主机发送功能:
- takes application message
-
接收应用程序消息
- breaks into smaller chunks, known as packets, of length L bits
-
分解成称为数据包的较小块,每个长度为L位
- transmits packet into access network at transmission rate R
-
以传输速率R将数据包传输到接入网络
- link transmission rate, aka link capacity, aka link bandwidth
-
链路传输速率,也称为链路容量或链路带宽
Links: physical media P22 - P24
链路:物理媒介
- bit: propagates between transmitter/receiver pairs
比特:在发送器/接收器对之间传播
- physical link: what lies between transmitter & receiver
物理链路:发送器和接收器之间的媒介
- Guided media:
-
导向媒介:
- signals propagate in solid media: copper, fiber, coax
信号在固体媒介中传播:铜缆、光纤、同轴电缆
- signals propagate in solid media: copper, fiber, coax
- Unguided media:
-
非导向媒介:
- signals propagate freely, e.g., radio
-
信号自由传播,例如无线电
-
Twisted Pair (TP)
-
双绞线
- two insulated copper wires
-
两根绝缘铜线
- Category 5: 100 Mbps, 1 Gbps Ethernet
-
5类:100 Mbps、1 Gbps以太网
-
Category 6: 10Gbps Ethernet
-
6类:10Gbps以太网
-
Coaxial cable:
-
同轴电缆:
- two concentric copper conductors
两个同心铜导体
- bidirectional
双向传输
- broadband:
-
宽带:
- multiple frequency channels on cable
电缆上的多个频率通道
- 100's Mbps per channel
每个通道数百Mbps
- multiple frequency channels on cable
- two concentric copper conductors
- Fiber optic cable:
-
光纤电缆:
- glass fiber carrying light pulses, each pulse a bit
玻璃纤维传输光脉冲,每个脉冲代表一个比特
- high-speed operation:
-
高速运行:
- high-speed point-to-point transmission (10's-100's Gbps)
高速点对点传输(数十到数百Gbps)
- high-speed point-to-point transmission (10's-100's Gbps)
- low error rate:
-
低错误率:
- repeaters spaced far apart
中继器间隔较远
- immune to electromagnetic noise
对电磁噪声免疫
- repeaters spaced far apart
- glass fiber carrying light pulses, each pulse a bit
Wireless radio
无线电 - signal carried in various “bands” in electromagnetic spectrum - > 信号在电磁频谱的各种“频段”中传输 - no physical “wire” - > 无物理“线” - broadcast, “half-duplex” (sender to receiver) - > 广播,“半双工”(发送方到接收方) - propagation environment effects: - > 传播环境影响: - reflection - > 反射 - obstruction by objects - > 物体阻挡 - Interference/noise - > 干扰/噪音
Radio link types:
无线电链接类型: - Wireless LAN (WiFi) - > 无线局域网(WiFi) - 10-100’s Mbps; 10’s of meters - > 10-100 Mbps;几十米 - wide-area (e.g., 4G/5G cellular) - > 广域(例如,4G/5G蜂窝网络) - 10’s Mbps (4G) over ~10 Km - > 10 Mbps(4G)覆盖约10公里 - Bluetooth: cable replacement - > 蓝牙:电缆替代 - short distances, limited rates - > 短距离,有限速率 - terrestrial microwave - > 地面微波 - point-to-point; 45 Mbps channels - > 点对点;45 Mbps通道 - satellite - > 卫星 - up to < 100 Mbps (Starlink) downlink - > 下行速率高达<100 Mbps(Starlink) - 270 msec end-end delay (geostationary) - > 270毫秒端到端延迟(地球同步轨道)
Network core: packet/circuit switching, internet structure
网络核心:分组/电路交换,互联网结构
The network core P26
网络核心 - mesh of interconnected routers - > 由互联路由器组成的网状结构 - packet-switching: hosts break application-layer messages into packets - > 分组交换:主机将应用层消息分解为数据包 - network forwards packets from one router to the next, across links on path from source to destination - > 网络将数据包从一个路由器转发到下一个路由器,跨越从源到目的地的链路
Two key network-core functions P27 - P29
两个关键的网络核心功能
Packet-switching: store-and-forward P30
分组交换:存储转发
- packet transmission delay: takes L/R seconds to transmit (push out) L-bit packet into link at R bps
- > 分组传输延迟:传输(推出)L位分组到R bps的链路需要L/R秒
- store and forward: entire packet must arrive at router before it can be transmitted on next link
- > 存储转发:整个分组必须到达路由器后才能在下一个链路上传输
- In example: end-end delay = 2L/R (assuming zero propagation delay)
- > 例如:端到端延迟 = 2L/R(假设传播延迟为零)
Packet-switching: queueing P31 - P32
分组交换:排队
- Queueing occurs when work arrives faster than it can be serviced:
-
当工作到达速度超过处理速度时,会发生排队:
- Packet queuing and loss: if arrival rate (in bps) to link exceeds transmission rate (bps) of link for some period of time:
-
分组排队和丢失:如果一段时间内到达链路的速率(bps)超过链路的传输速率(bps):
- packets will queue, waiting to be transmitted on output link
-
分组将排队,等待在输出链路上传输
- packets can be dropped (lost) if memory (buffer) in router fills up
-
如果路由器中的内存(缓冲区)填满,分组可能会被丢弃(丢失)
Alternative to packet switching: circuit switching P33
分组交换的替代方案:电路交换 - end-end resources allocated to, reserved for “call” between source and destination - > 端到端资源分配给“呼叫”,在源和目的地之间保留 - in diagram, each link has four circuits. - > 在图中,每条链路有四个电路。 - call gets 2nd circuit in top link and 1st circuit in right link. - > 呼叫在顶链路中获得第2个电路,在右链路中获得第1个电路。 - dedicated resources: no sharing - > 专用资源:不共享 - circuit-like (guaranteed) performance - > 类似电路(有保证)的性能 - circuit segment idle if not used by call (no sharing) - > 如果呼叫未使用电路段,则空闲(不共享) - commonly used in traditional telephone networks - > 常用于传统电话网络
Circuit switching: FDM and TDM P34
电路交换:频分复用(FDM)和时分复用(TDM)
- Frequency Division Multiplexing (FDM)
-
频分复用(FDM)
- optical, electromagnetic frequencies divided into (narrow) frequency bands
-
光学、电磁频率划分为(狭窄的)频率带
- Time Division Multiplexing (TDM)
-
时分复用(TDM)
- time divided into slots
-
时间划分为时隙
- each call allocated its own band, can transmit at max rate of that narrow band
-
每个呼叫分配其自身的频带,可以在该狭窄频带的最大速率下传输
- each call allocated periodic slot(s), can transmit at maximum rate of (wider) frequency band (only) during its time slot(s)
-
每个呼叫分配周期性时隙,只能在其时隙期间以(更宽)频带的最大速率传输
Packet switching versus circuit switching P35 - P36
分组交换与电路交换 example: - > 分组交换与电路交换示例: - 1 Gb/s link - > 1 Gb/s 链路 - each user: - > 每个用户: - 100 Mb/s when “active” - > 活动时为 100 Mb/s - active 10% of time - > 活动时间占 10%
Q: how many users can use this network under circuit-switching and packet switching?
- > 问:在电路交换和分组交换下有多少用户可以使用这个网络?
- circuit-switching: 10 users
-
电路交换:10个用户
- packet switching: with 35 users, probability > 10 active at same time is less than .0004
-
分组交换:在35个用户的情况下,同一时间超过10个活动用户的概率小于0.0004
Q: how did we get value 0.0004? A: HW problem (for those who like probability) - > 问:我们是如何得到0.0004这个值的?答:硬件问题(对于喜欢概率的人来说)
Is packet switching a “slam dunk winner”? - > 分组交换是一个“绝对赢家”吗? - great for “bursty” data – sometimes has data to send, but at other times not - > 非常适合“突发”数据——有时有数据发送,但在其他时候没有 - resource sharing - > 资源共享 - simpler, no call setup - > 更简单,无需呼叫设置 - excessive congestion possible: packet delay and loss due to buffer overflow - > 可能会出现过度拥塞:由于缓冲区溢出导致分组延迟和丢失 - protocols needed for reliable data transfer, congestion control - > 需要可靠的数据传输协议,拥塞控制 - Q: How to provide circuit-like behavior with packet-switching? - > 问:如何通过分组交换提供类似电路的行为? - “It’s complicated.” We’ll study various techniques that try to make packet switching as “circuit-like” as possible. - > “这很复杂。”我们将研究各种技术,试图使分组交换尽可能“像电路”。 Q: human analogies of reserved resources (circuit switching) versus on-demand allocation (packet switching)? - > 问:保留资源(电路交换)与按需分配(分组交换)的类比?
Internet structure: a “network of networks” P37 - p45
互联网结构:一个“网络的网络” - hosts connect to Internet via access Internet Service Providers (ISPs) - > 主机通过接入互联网服务提供商(ISP)连接到互联网 - access ISPs in turn must be interconnected - > 接入ISP必须相互连接 - so that any two hosts (anywhere!) can send packets to each other - > 这样任何两个主机(无论在哪里!)都可以互相发送数据包 - resulting network of networks is very complex - > 由此产生的网络非常复杂 - evolution driven by economics, national policies - > 其演变受经济和国家政策驱动 Let’s take a stepwise approach to describe current Internet structure - > 让我们采取逐步的方法来描述当前的互联网结构 Question: given millions of access ISPs, how to connect them together? - >问题:考虑到数以百万计的互联网服务提供商,如何将它们连接在一起?
Question: given millions of access ISPs, how to connect them together?
问题:考虑到数以百万计的互联网服务提供商,如何将它们连接在一起?
Option: connect each access ISP to one global transit ISP?
选项:将每个接入ISP连接到一个全局传输ISP? Customer and provider ISPs have economic agreement. 客户和供应商isp有经济协议
But if one global ISP is viable business, there will be competitors ….
But if one global ISP is viable business, there will be competitors …. who will want to be connected
但如果一个全球性的ISP是可行的业务,就会有竞争对手....谁会想要被连接
… and regional networks may arise to connect access nets to ISPs
…和区域网络可能会出现将接入网连接到isp
… and content provider networks (e.g., Google, Microsoft, Akamai) may run their own network, to bring services, content close to end users
……以及内容提供商网络(例如,Google、Microsoft、Akamai)可能 运营自己的网络,把服务、内容带给终端用户
At “center”: small # of well-connected large networks - > 在“中心”:少数连接良好的大型网络 - “tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coverage - > “一级”商业ISP(如Level 3、Sprint、AT&T、NTT),覆盖全国及国际 - content provider networks (e.g., Google, Facebook): private network that connects its data centers to Internet, often bypassing tier-1, regional ISPs - > 内容提供商网络(如Google、Facebook):连接其数据中心到互联网的私有网络,通常绕过一级、区域ISP
Performance: loss, delay, throughput P46
性能:丢失、延迟、吞吐量
How do packet delay and loss occur? P47
数据包延迟和丢失是如何发生的? - packets queue in router buffers, waiting for turn for transmission - > 数据包在路由器缓冲区中排队,等待轮到传输 - queue length grows when arrival rate to link (temporarily) exceeds output link capacity - > 当到达链路的速率(暂时)超过输出链路时,队列长度增长 能力 - packet loss occurs when memory to hold queued packets fills up - > 当存储排队数据包的内存被填满时,就会发生数据包丢失
Packet delay: four sources P48 - P49
数据包延迟:四个来源
dproc: nodal processing
dproc:节点处理 - check bit errors - 检查比特错误 - determine output link - 确定输出链路 - typically < microsecs - 通常 < 微秒
dqueue: queueing delay
dqueue:排队延迟 - time waiting at output link for transmission - 在输出链路上等待传输的时间 - depends on congestion level of router - 取决于路由器的拥塞水平
Caravan analogy P50 - P51
大篷车类比
- car ~ bit; caravan ~ packet; toll service ~ link transmission
汽车 ~ 位;大篷车 ~ 数据包;过路服务 ~ 链路传输 - toll booth takes 12 sec to service car (bit transmission time) 收费站服务一辆车需要12秒(位传输时间) - “propagate” at 100 km/hr 以100公里/小时传播 - time to “push” entire caravan through toll booth onto highway = 1210 = 120 sec 将整个大篷车通过收费站推上高速公路的时间 = 1210 = 120秒 - time for last car to propagate from 1st to 2nd toll both: 100km/(100km/hr) = 1 hr 最后一辆车从第一个收费站传播到第二个收费站的时间:100公里/(100公里/小时) = 1小时 - Q: How long until caravan is lined up before 2nd toll booth? 问:大篷车在第二个收费站前排队需要多长时间? - A: 62 minutes 答:62分钟
- suppose cars now “propagate” at 1000 km/hr
假设汽车现在以1000公里/小时的速度“行驶”
- and suppose toll booth now takes one min to service a car
假设收费站现在需要一分钟来为一辆车服务
- Q: Will cars arrive to 2nd booth before all cars serviced at first booth?
问:车辆是否会在第一个展台前到达第二个展台?
- A: Yes! after 7 min, first car arrives at second booth; three cars still at
first booth
答:是的!7分钟后,第一辆车到达第二个展位;三辆车还在第一个摊位