Chapter1 Introduction of Operating System

第一章 导论!

Posted by LvKouKou on March 20, 2023

1. 操作系统的功能 What is an Operating System?

1.1 用户视角

  • A program that acts as an intermediary between a userof a computer and the computer hardware.

  • Operating system goals:
    • Execute user programs and make solving userproblems easier.
    • Make the computer system convenient to use.
  • Use the computer hardware in an efficient manner

什么是操作系统?

  • 充当计算机用户和计算机硬件之间的中介的程序。

  • 操作系统目标:
    • 执行用户程序并更容易解决用户问题。
    • 使电脑系统方便使用。
  • 有效地使用计算机硬件

1.2 系统视角

  • OS is a resource allocator
    • Manages all resources
    • Decides between conflicting requests for efficient and fair resource use
  • OS is a control program
    • Controls execution of programs to prevent errors and improper use of the computer
  • 操作系统是资源分配器
    • 管理所有资源
    • 在有效和公平地使用资源的请求之间做出决定
  • 操作系统是一个控制程序
    • 控制程序的执行,以防止错误和计算机使用不当

1.3 操作系统的定义 Operating System Definition

  • No universally accepted definition

  • “Everything a vendor ships when you order an operating system” is good approximation
    • But varies wildly
  • “The one program running at all times on the computer” is the kernel. Everything else is either a system program (ships with the operating system) or an application program

  • 没有普遍接受的定义

  • “供应商在您订购操作系统时提供的所有东西”是很好的大概描述
    • 但变化很大
  • “计算机上始终运行的一个程序”是内核。其他所有内容要么是系统程序(随操作系统一起提供)要么是应用程序

2. 计算机系统的组成 Computer System Organization

2.1 计算机系统的运行

Computer-system operation

  • One or more CPUs, device controllers connect through common bus providing access to shared memory
  • Concurrent execution of CPUs and devices competing for memory cycles

计算机系统操作

  • 一个或多个CPU,设备控制器通过公共总线连接,提供对共享内存的访问
  • CPU 和设备并发执行,竞争访问内存

image-20230320224128902

==区分并发和并行的区别:==

  • 并发(concurrency):把任务在不同的时间点交给处理器进行处理(相同时间间隔但不是同时)。在同一时间点,任务并不会同时运行。
  • 并行(parallelism):把每一个任务分配给每一个处理器独立完成。在同一时间点,任务一定是同时运行。

2.1.1 Computer Start up

bootstrap program is loaded at power-up or reboot

  • Typically stored in ROM or EPROM, generally known as firmware
  • Initializates all aspects of system
  • Loads operating system kernel and starts execution

引导程序在上电或重新启动时加载

  • 通常存储在ROM或EPROM中,通常称为固件
  • 初始化系统的所有方面
  • 加载操作系统内核并开始执行

计算机电源开启后,开始运行引导程序(一般位于ROM),初始化系统的各个组件(CPU寄存器、PC,内存)。引导程序必须知道如何加载如何加载操作系统并开始执行操作系统,为了完成这一目标,它必须定位操作系统的内核并加载到内存。内核加载到内存并执行,除此,系统程序也会加载为系统进程或系统后台程序(system daemon),此时系统完全启动等待事件发生。

事件发生通常通过硬件或软件的中断(interrupt)来通知。硬件可以随时通过系统总线发送信号到CPU,以触发中断。软件也可通过执行特别操作即系统调用(system call)(也称为监督程序调用(monitor call))以触发中断。

2.1.2 Common Functions of Interrupts

  • Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines.
  • Interrupt architecture must save the address of the interrupted instruction.
  • Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt.
  • A trap is a software-generated interrupt caused either by an error or a user request.
  • An operating system is interrupt driven.

  • 中断通常通过中断向量将控制权转移到中断服务例程,该向量包含所有服务例程的地址(中断服务程序的地址)。
  • 中断体系结构必须保存中断指令的地址。
  • 在处理另一个中断时禁用传入中断,以防止中断丢失。
  • 陷阱是由错误或用户请求引起的软件生成的中断。
  • 操作系统由中断驱动。

2.1.3 Interrupt Handling

  • The operating system preserves the state of the CPU by storing registers and the program counter.
  • Determines which type of interrupt has occurred:
    • polling
    • vectored interrupt system
  • Separate segments of code determine what action should be taken for each type of interrupt

  • 操作系统通过存储寄存器和程序计数器来保留 CPU 的状态。

  • 确定发生的中断类型:

    • 轮询

    • 矢量中断系统

  • 单独的代码段确定应为每种类型的中断采取什么操作

image-20230320224905012

2.2 Storage Structure

  • Main memory – only large storage media that the CPU can access directly.
  • Secondary storage – extension of main memory that provides large nonvolatile storage capacity.
  • Magnetic disks – rigid metal or glass platters covered with magnetic recording material
    • Disk surface is logically divided into tracks, which are subdivided into sectors.
    • The disk controller determines the logical interaction between the device and the computer
  • 主内存 – 只有 CPU 可以直接访问的大型存储介质。
  • 辅助存储 – 主存储器的扩展,提供大的非易失性存储容量。
  • 磁盘 – 覆盖有磁性记录材料的刚性金属或玻璃盘片
    • 磁盘表面在逻辑上分为磁道,磁道又细分为扇区。
    • 磁盘控制器确定设备和计算机之间的逻辑交互

2.2.1 Storage Hierarchy

  • Storage systems organized in hierarchy.
    • Speed
    • Cost
    • Volatility
  • Caching – copying information into faster storage system; main memory can be viewed as a last cache for secondary storage

  • 按层次结构组织的存储系统。
    • 速度
    • 成本
    • 挥发性
  • 缓存 – 将信息复制到更快的存储系统中;主内存可以被视为辅助存储的最后一个缓存

image-20230320230653155

2.3 I/O Structure

  • I/O devices and the CPU can execute concurrently.
  • Each device controller is in charge of a particular device type.
  • Each device controller has a local buffer.
  • CPU moves data from/to main memory to/from local buffers
  • I/O is from the device to local buffer of controller.
  • Device controller informs CPU that it has finished its operation by causing an interrupt.

  • I/O 设备和 CPU 可以同时执行。
  • 每个设备控制器负责特定的设备类型。
  • 每个设备控制器都有一个本地缓冲区
  • CPU 将数据移入/移出主存储器,移入/移出本地缓冲区
  • I/O 是从设备到控制器的本地缓冲区。
  • 设备控制器通过引起中断来通知 CPU 它已完成操作。

  • 同步:After I/O starts, control returns to user program only upon I/O completion.
    • Wait instruction idles the CPU until the next interrupt
    • Wait loop (contention for memory access).
    • At most one I/O request is outstanding at a time, no simultaneous I/O processing.
  • 异步:After I/O starts, control returns to user program without waiting for I/O completion.
    • System call – request to the operating system to allow user to wait for I/O completion.
    • Device-status table contains entry for each I/O device indicating its type, address, and state.
    • Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt.
  • 同步:I/O 启动后,只有在 I/O 完成后,控制权才会返回到用户程序。
    • 等待指令使CPU空闲,直到下一个中断
    • 等待循环(内存访问争用)。
    • 一次最多有一个 I/O 请求未完成,没有同时处理 I/O 处理。
  • 异步:I/O 启动后,控制权将返回到用户程序,而无需等待 I/O 完成。
    • 系统调用 – 请求操作系统允许用户等待 I/O 完成。
    • 设备状态表包含每个 I/O 设备的条目,指示其类型、地址和状态。
    • 操作系统索引到 I/O 设备表中,以确定 改表条目以包含中断。

image-20230320225838098

image-20230320230156586

2.3.1 直接内存访问 (DMA)Direct Memory Access Structure

这种I/O中断驱动适合移动少量数据,但是对于大量数据的移动,如磁盘I/O,就会带来很高的开销。为了解决这个问题,可以采用直接内存访问(Diret Memory Access, DMA)。在为这种 I/O 设备设置好缓冲、指针和计数器之后,设备控制器可在本地缓冲和内存之间传送整块的数据,而无需 CPU 的干预。每块只产生一个中断,来告知设备驱动程序操作已完成,而不是像低速设备那样每个字节产生一个中断。当设备控制器执行这些操作时,CPU可以进行其他工作。

  • Used for high-speed I/O devices able to transmit information at close to memory speeds.
  • Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.
  • Only one interrupt is generated per block, rather than the one interrupt per byte.

  • 用于能够以接近内存速度传输信息的高速I/O设备。
  • 设备控制器将数据块从缓冲存储直接传输到主存储器,无需CPU介入。
  • ==每个块只生成一个中断,而不是每个字节生成一个中断。DMA最大作用)==

3. 计算机系统的体系结构 Computer System Structure

Computer system can be divided into four components

  • Hardware – provides basic computing resources
    • CPU, memory, I/O devices
  • Operating system
    • Controls and coordinates use of hardware among various applications and users
  • Application programs – define the ways in which the system resources are used to solve the computing problems of the users
    • Word processors, compilers, web browsers, database systems, video games
  • Users
    • People, machines, other computers

计算机系统可分为四个组成部分

  • 硬件——提供基本的计算资源

    • CPU、内存、I/O设备
  • 操作系统

    • 控制和协调各种应用程序和用户之间的硬件使用
  • 应用程序——定义系统资源用于解决用户计算问题的方式

    • 文字处理器、编译器、网络浏览器、数据库系统、视频游戏
  • 用户

    • 人、机器、其他计算机

image-20230320155908925

4. 操作系统的结构 Operating System Structure

  • Multiprogramming needed for efficiency
    • Single user cannot keep CPU and I/O devices busy at all times
    • Multiprogramming organizes jobs (code and data) so CPU always has one to execute
    • A subset of total jobs in system is kept in memory
    • One job selected and run via job scheduling(任务调度)
    • When it has to wait (for I/O for example), OS switches to another job
  • Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing
    • Response time should be < 1 second
    • Each user has at least one program executing in memory process
    • If several jobs ready to run at the same time CPU scheduling
    • If processes don’t fit in memory, swapping moves them in and out to run
    • Virtual memory allows execution of processes not completely in memory

操作系统在内存中同时保存多个任务(图 1-9)。由于主存太小不能容纳所有作业,因此这些作业首先保存在磁盘的作业池 (job pool) 上。该作业池包括磁盘上的等待分配内存的所有进程。内存的作业集为作业池的作业集的一个子集。从内存的作业集中,操作系统可以选择执行一个作业。

image-20230325110630588

  • 提高效率所需的多道程序处理
    • 单个用户无法始终保持 CPU 和 I/O 设备繁忙
    • 进程并发组织作业(代码和数据),因此CPU始终有一个要执行
    • 系统中总作业的子集保存在内存中
    • 选择一个作业并通过作业调度运行
    • 当它必须等待(例如 I/O)时,操作系统切换到另一个作业
  • 分时(多任务)是一种逻辑扩展,其中 CPU 如此频繁地切换作业,以至于用户可以在每个作业运行时与其进行交互,从而创建交互式计算
    • 响应时间应小于 1 秒
    • 每个用户至少有一个程序在内存进程中执行
    • 如果多个作业准备同时运行 CPU 调度
    • 如果进程不适合内存,交换将它们移入和移出以运行
    • 虚拟内存允许不完全在内存中执行进程

image-20230320231834924

5. 操作系统的执行 Operating-System Operations

现代操作系统是中断驱动 (interrupt driven)的。如果没有进程需要执行没有 I/O 设备需要服务,而且没有用户需要响应,那么操作系统会静静地等待某个事件的发生。事件总是由中断或陷阱引起的。陷阱(trap)(或异常(exception))是一种软件生成的中断,或源于出错(如除数为零或无效存储访问),或源于用户程序的特定请求(执行操作系统的某个服务)。这种操作系统的中断特性规定了系统的通用结构。对于每种中断,操作系统有不同代码段来处理。中断服务程序用于处理中断。

  • Interrupt driven by hardware
  • Software error or request creates exception or trap
    • Division by zero, request for operating system service
  • Other process problems include infinite loop, processes modifying each other or the operating system
  • Dual-mode operation allows OS to protect itself and other system components
    • User mode and kernel mode(最高权限)
    • Mode bit provided by hardware
      • Provides ability to distinguish when system is running user code or kernel code
      • Some instructions designated as privileged, only executable in kernel mode
      • System call changes mode to kernel, return from call resets
  • 由硬件驱动的中断
  • 软件错误或请求产生异常或陷阱
    • 除以零,请求操作系统服务
  • 其他进程问题包括无限循环、进程相互修改或操作系统
  • 双模式操作允许操作系统保护自身和其他系统组件
    • 用户模式和内核模式(最高权限)
    • 硬件提供的模式位
      • 提供区分系统何时运行用户代码或内核代码的功能
      • 一些指令被指定为特权,仅在内核模式下可执行
      • 系统调用模式更改为内核,从调用重置返回

5.1 内核模式和用户模式 Transition from User to Kernel Mode

为了确保操作系统的正确运行,必须区分操作系统代码和用户代码的执行。大多数计算机系统采用硬件支持,以便区分各种执行模式。至少需要两种单独运行模式:

  • 用户模式(user mode)
  • 内核模式(kernelmode) (也称为监视模式(supervisor mode)、系统模式(system mode)或特权模式(privileged mode))。

计算机硬件可以通过一个模式位(mode bit)来表示当前模式:内核模式(0)和用户模式(1)有了模式位,就可区分为操作系统执行的任务和为用户执行的任务。当计算机系统执行用户应用时,系统处于用户模式。然而,当用户应用通过系统调用,请求操作系统服务时,系统必须从用户模式切换到内核模式,以满足请求

image-20230325114209634

  • Timer to prevent infinite loop / process hogging resources
    • Set interrupt after specific period
    • Operating system decrements counter
    • When counter zero generate an interrupt
    • Set up before scheduling process to regain control or terminate program that exceeds allotted time

image-20230320232519712

定时器可防止无限循环/进程占用资源(避免一个进程一直占用CPU时间,如果该进程是死循环,则其他进程无法执行)

  • 在特定时间段后设置中断
  • 操作系统递减计数器
  • 当计数器零产生中断时
  • 在调度过程之前进行设置,以重新获得控制权或终止超过分配时间的程序

6. 进程管理 Process Management

进程是系统的工作单元。系统由多个进程组成,其中有的是操作系统进程(执行系统代码),其他的是用户进程(执行用户代码)。所有这些进程都会并发执行,例如通过在单 CPU上采用多路复用来实现。(书1.6 P17)

操作系统负责进程管理的以下活动:

  • 在CPU上调度进程和线程
  • 创建和删除用户进程和系统进程
  • 挂起和重启进程
  • 提供进程同步机制
  • 提供进程通信机制

  • A process is a program in execution. It is a unit of work within the system.Program is a passive entity, process is an active entity.
  • Process needs resources to accomplish its task
    • CPU, memory, I/O, files
    • Initialization data
  • Process termination requires reclaim of any reusable resources
  • Single-threaded process has one program counter specifying location of next instruction to execute
    • Process executes instructions sequentially, one at a time, until completion
  • Multi-threaded process has one program counter per thread(每个线程一个程序计数器)
  • Typically system has many processes, some user, some operating system running concurrently on one or more CPUs
    • Concurrency by multiplexing the CPUs among the processes / threads
  • 进程是正在执行的程序。它是系统内的一个工作单元。程序是一个被动实体,进程是一个主动实体。(程序是放在硬盘中的二进制代码,只有被CPU加载进内存中才会变成进程)
  • 进程需要资源来完成它的任务
    • CPU、内存、I/O、文件
    • 初始化数据
  • 进程终止需要回收任何可重用资源
  • 单线程进程有一个程序计数器(PC)指定下一条要执行的指令的位置
    • 进程按顺序执行指令,一次一个,直到完成
  • ==多线程进程每个线程有一个程序计数器==
  • 通常系统有很多进程,一些用户,一些操作系统在一个或多个 CPU 上并发运行
    • 通过在进程/线程之间多路复用 CPU 实现并发

6.1 Process Management Activities

The operating system is responsible for the following activities in connection with process management:

  • Creating and deleting both user and system processes
  • Suspending and resuming processes
  • Providing mechanisms for process synchronization(同步)
  • Providing mechanisms for process communication
  • Providing mechanisms for deadlock handling (死锁处理)

操作系统负责以下与进程管理相关的活动:

  • 创建和删除用户和系统进程
  • 暂停和恢复进程
  • 提供进程同步机制
  • 提供进程通信机制
  • 提供死锁处理机制

7. 内存管理 Memory Management

  • All data in memory before and after processing
  • All instructions in memory in order to execute
  • Memory management determines what is in memory when
    • Optimizing CPU utilization and computer response to users
  • Memory management activities
    • Keeping track of which parts of memory are currently being used and by whom
    • Deciding which processes (or parts thereof) and data to move into and out of memory
    • Allocating and deallocating memory space as needed
  • 处理前后内存中的所有数据
  • 内存中的所有指令以执行
  • 内存管理确定内存中的内容,当
    • 优化 CPU 利用率和计算机对用户的响应
  • 操作系统内存管理活动
    • 跟踪内存的哪些部分当前正在使用以及由谁使用
    • 决定将哪些进程(或其部分)和数据移入和移出内存
    • 根据需要分配和解除分配内存空间

8. 存储管理 Storage Management

  • OS provides uniform, logical view of information storage
    • Abstracts physical properties to logical storage unit - file
    • Each medium is controlled by device (i.e., disk drive, tape drive)
      • Varying properties include access speed, capacity, data-transfer rate,access method (sequential or random)
  • 操作系统提供统一的、逻辑的信息存储视图
    • 将物理属性抽象到逻辑存储单元 - 文件
    • 每种介质都由设备控制(即磁盘驱动器、磁带驱动器)
      • 不同的属性包括访问速度、容量、数据传输速率、访问方法(顺序或随机)

8.1 文件系统管理 File-System management

  • Files usually organized into directories
  • Access control on most systems to determine who can access what
  • OS activities include
    • Creating and deleting files and directories
    • Primitives to manipulate files and dirs
    • Mapping files onto secondary storage
    • Backup files onto stable (non-volatile) storage media
  • 文件系统管理
    • 通常将文件组织到目录中
    • 大多数系统的访问控制以确定谁可以访问什么
    • 操作系统活动包括
      • 创建和删除文件和目录
      • 操作文件和目录的原语
      • 将文件映射到辅助存储
      • 将文件备份到稳定(非易失性)存储介质上

8.2 大容量存储器管理 Mass-Storage Management

  • Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time.
  • Proper management is of central importance
  • Entire speed of computer operation hinges on disk subsystem and its algorithms
  • OS activities
    • Free-space management
    • Storage allocation
    • Disk scheduling(硬盘的调度)
  • Some storage need not be fast
    • Tertiary storage includes optical storage, magnetic tape
    • Still must be managed
    • Varies between WORM (write-once, read-many-times) and RW (readwrite)
  • 通常用于存储不适合主内存的数据或必须保留“长时间”的数据的磁盘。
  • 适当的管理至关重要
  • 计算机运行的整体速度取决于磁盘子系统及其算法
  • 操作系统负责有关硬盘管理的以下活动
    • 空闲空间管理
    • 存储空间分配
    • 硬盘调度
  • 有些存储不需要很快
    • 三级存储包括光存储、磁带
    • 仍然必须管理
    • 在 WORM(一次写入、多次读取)和 RW(读写)之间变化

8.3 高速缓存 Caching

  • Important principle, performed at many levels in a computer (in hardware, operating system, software)
  • Information in use copied from slower to faster storage temporarily
  • Faster storage (cache) checked first to determine if information is there
    • If it is, information used directly from the cache (fast)
    • If not, data copied to cache and used there
  • Cache smaller than storage being cached
    • Cache management important design problem
    • Cache size and replacement policy
  • 重要原理,在计算机中的许多级别(硬件,操作系统,软件)中执行
  • 使用中的信息从较慢的存储临时复制到较快的存储
  • 首先检查更快的存储(缓存)以确定信息是否存在
    • 如果是,则直接从缓存中使用的信息(快速)
    • 如果没有,数据复制到缓存并在那里使用
  • 缓存小于外存(内存可以看作外存的高速缓存)
    • 缓存管理重要设计问题
    • 缓存大小和替换策略

Performance of Various Levels of Storage

Movement between levels of storage hierarchy can be explicit or implicit

image-20230320231040142

Migration of Integer A from Disk to Register

  • Multitasking environments must be careful to use most recent value, no matter where it is stored in the storage hierarchy

image-20230320231208486

  • Multiprocessor environment must provide cache coherency in hardware such that all CPUs have the most recent value in their cache
  • Distributed environment situation even more complex
    • Several copies of a datum can exist
    • Various solutions covered in Chapter 17

缓存同一性问题可以用写回法或写直达法解决

  • 多任务环境必须小心使用最新的值,无论它存储在存储层次结构中的哪个位置
  • 多处理器环境必须在硬件中提供缓存一致性,以便所有 CPU 的缓存中都具有最新的值

  • 分布式环境情况更加复杂
    • 可以存在多个基准面副本
    • 第17章涵盖的各种解决方案

8.4 I/O Subsystem

  • One purpose of OS is to hide peculiarities of hardware devices from the user
  • I/O subsystem responsible for
    • Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs)
    • General device-driver interface
    • Drivers for specific hardware devices
  • 操作系统的一个目的是向用户隐藏硬件设备的特性
  • 负责 I/O 的子系统包括以下几个组件:
    • I/O 的内存管理,包括缓冲(在传输数据时临时存储数据)、缓存(将部分数据存储在更快的存储中以提高性能)、假脱机(一个作业的输出与其他作业的输入重叠)
    • 通用设备驱动程序接口
    • 特定硬件设备的驱动程序

9. 保护与安全 Protection and Security

  • Protection – any mechanism for controlling access of processes or users to resources defined by the OS
  • Security – defense of the system against internal and external attacks
    • Huge range, including denial-of-service, worms, viruses, identity theft, theft of service
  • Systems generally first distinguish among users, to determine who can do what
    • User identities (user IDs, security IDs) include name and associated number, one per user
    • User ID then associated with all files, processes of that user to determine access control
    • Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file
    • Privilege escalation allows user to change to effective ID with more rights
  • 保护 – 用于控制进程或用户对操作系统定义的资源的访问的任何机制
  • 安全 – 防御系统免受内部和外部攻击
    • 范围广泛,包括拒绝服务、蠕虫、病毒、身份盗用、服务盗窃
  • 系统通常首先区分用户,以确定谁可以做什么
    • 用户身份(用户 ID、安全 ID)包括名称和关联号码,每个用户一个
    • 用户ID然后与该用户的所有文件,进程相关联,以确定访问控制
    • 组标识符(组ID)允许定义用户集并管理控件,然后还与每个进程,文件相关联
    • 权限提升允许用户更改为具有更多权限的有效ID

10. 计算环境 Computing Environments

10.1 传统计算

  • Traditional computer
    • Blurring over time
    • Office environment
      • PCs connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing
      • Now portals allowing networked and remote systems access to same resources
    • Home networks
    • Used to be single system, then modems
    • Now firewalled, networked

传统计算机

  • 随时间模糊
  • 办公环境
    • 连接到网络的PC,连接到大型机的终端或提供批量和分时功能的小型计算机
    • 现在门户允许网络和远程系统访问相同的资源
  • 家庭网络
  • 以前是单系统,然后是调制解调器
  • 现在有防火墙,联网

10.2 移动计算

10.3 分布式计算

10.4 客户机-服务器计算 Client-Server Computing

  • Client-Server Computing
    • Dumb terminals supplanted by smart PCs
    • Many systems now servers, responding to requests generated by clients
      • Compute-server provides an interface to client to request services (i.e. database)
      • File-server provides interface for clients to store and retrieve files

image-20230320233915489

客户端-服务器计算

  • 被智能PC取代的哑终端
  • 许多系统现在都是服务器,响应客户端生成的请求
    • 计算服务器为客户端提供请求服务(即数据库)的接口
    • 文件服务器为客户端提供存储和检索文件的接口

10.5 对等计算 Peer-to-Peer Computing

  • Another model of distributed system
  • P2P does not distinguish clients and servers
    • Instead all nodes are considered peers
    • May each act as client, server or both
    • Node must join P2P network
      • Registers its service with central lookup service on network, or
      • Broadcast request for service and respond to requests for service via discovery protocol
    • Examples include Napster and Gnutella
  • 分布式系统的另一种模型
  • P2P不区分客户端和服务器
    • 相反,所有节点都被视为对等节点
    • 可以分别充当客户端、服务器或两者
    • 节点必须加入P2P网络
      • 向网络上的中央查找服务注册其服务,或
      • 广播服务请求并通过发现协议响应服务请求
    • 例子包括Napster和Gnutella

10.6 Web-Based Computing

  • Web has become ubiquitous
  • PCs most prevalent devices
  • More devices becoming networked to allow web access
  • New category of devices to manage web traffic among similar servers: load balancers
  • Use of operating systems like Windows 95, client-side, have evolved into Linux and Windows XP, which can be clients and servers

  • 网络已经无处不在
  • 个人电脑最流行的设备
  • 更多设备联网以允许网络访问
  • 用于管理类似服务器之间网络流量的新设备类别:负载平衡器
  • 使用操作系统,如Windows 95,客户端,已经演变为Linux和Windows XP,可以是客户端和服务器