目录
正在加载目录…
正在阅读专栏 分布式共识系统专栏 第 36 篇 · 共 59 篇 · 61%

论文:Secure Untrusted Data Repository(SUNDR)

发布于 2026-09-21 10:07 · 最后编辑于 2026-09-21 18:15 · 版本 v2 · 字数 39,145 · 预计阅读 79 分钟 👁 21 次阅读

本篇按 MIT 6.5840 / 6.824 课程资料引用的论文《Secure Untrusted Data Repository (SUNDR)》整理。每一页保留原始 PDF 页面图;页面图是原文排版、Figure、公式、脚注、benchmark 图表和参考文献的原始副本,下面按原页顺序给出中文译文与必要术语说明。

论文:Secure Untrusted Data Repository(SUNDR)

相关文章:6.5840:Lecture 19 SUNDR · 论文:The Google File System(GFS) · 论文:Spanner:Google’s Globally-Distributed Database

TL;DR

  • 问题:存储 server 可能被攻陷或由恶意 operator 管理,传统上把安全寄托在 server perimeter 上;SUNDR 把写入 authority 放入 user public key,使 client 能检测 server 篡改。
  • 核心保证:SUNDR 提供 fork consistency。恶意 server 可以把不同 user 分叉到不同 file-system history,但只要 user 之后看到彼此的 operation,就能检测攻击。
  • 协议演进:从使用全局 lock、完整 operation history 的 straw-man system,发展到用 i-handle、hash tree 和 version vector 的 Serialized SUNDR,再到允许非冲突 operation 并发的 Concurrent SUNDR。
  • 数据结构:file content 由 SHA-1 hash 连接;user/group i-table 形成 hash tree,根为 i-handle;version structure 用 digital signature 和 version vector 绑定各 principal 的最新状态。
  • 实现:client 使用 whole-file cache;consistency server 管理 VSL/PVL 与 update certificate;block store bstor 负责 hash-addressed block、temporary log、permanent log、snapshot 和 recovery。
  • 边界:SUNDR 主要检测 integrity / consistency attack,不负责自动修复 fork;它也不提供 read protection / confidentiality,且 freshness 弱于依赖多数 honest replica 的系统。

名词解释

名词含义本文对应物
Untrusted server可能恶意、被攻陷或不值得完全信任的 storage serverSUNDR 的 threat model
Fetch获取 file content,或验证 local cached copyclient 读路径
Modify让新的 file-system state 对其他 user 可见client 写路径
Fetch-modify consistencyhonest server 时,fetch 反映此前发生的 authorized modification强于 fork consistency
Fork consistencyserver 只能把 user 分到不同 history;跨 fork 的后续可见 operation 会暴露攻击SUNDR 的核心 guarantee
i-handleuser/group i-table 的 hash-tree root聚合可写 file state
i-hashinode 的 hashi-table 中的 file pointer
Version structuresigned user state,包含 i-handle 与 version vectorVSL/PVL 的基本记录
VSLversion structure list,当前已提交的 version structure 集合一致性 server 的 committed state
PVLpending version list,尚未反映进 VSL 的 updateConcurrent SUNDR 的并发信息
Update certificateuser 预先签署的下一次 operation 声明UPDATE RPC 的输入

目录

章节内容
版本与来源固定 PDF、作者、页数和附件处理
原文页面与逐段翻译按 16 个 PDF 页面保留原页并翻译全文
机制索引fork consistency、hash tree、version vector 和实现路径
本篇验收页数、图片、协议和格式检查

版本与来源

  • 论文标题:Secure Untrusted Data Repository (SUNDR)。
  • 作者与机构:Jinyuan Li、Maxwell Krohn、David Mazières、Dennis Shasha,NYU Department of Computer Science。
  • 官方来源:MIT 6.5840 / 6.824 SUNDR paper PDF;本地固定文件为 source/li-sundr.pdf。
  • PDF 固定信息:16 页,每页 612×792 points;SHA-256:b72c3e0b251a0a632fc823138a924e5cde76ff7dcba9b6eaf47480a675e1644d。
  • 附件处理:每页渲染为 1224×1584 PNG,存放于 assets/35 SUNDR/,正文以 600 宽度嵌入。Figure 1–13、协议图、公式、脚注和 References 由原页图保留。
  • 翻译边界:双栏 PDF 的物理换行不视为语义断句;以标题、段落、列表、协议步骤、公式、图注和表格为最小翻译单元。SUNDR、fork consistency、i-handle、i-table、VSL、PVL、update certificate、hash、signature 等术语保留 English 或中英并列。

原文页面与逐段翻译

第 1 页:Abstract 与 Introduction

sundr p01

Secure Untrusted Data Repository (SUNDR)

《Secure Untrusted Data Repository(安全的不可信数据仓库)》;作者为 Jinyuan Li、Maxwell Krohn、David Mazières 和 Dennis Shasha,NYU Department of Computer Science。

Abstract

SUNDR 是一种 network file system,旨在把 data 安全地存储在 untrusted server 上。SUNDR 让 client 能够检测 malicious server operator 或 user 试图进行的 unauthorized file modification。

SUNDR protocol 实现了称为 fork consistency 的 property:只要 client 能看到彼此的 file modification,就能检测任何 integrity 或 consistency failure。论文还描述了一个 implementation:在 example software-development workload 和 microbenchmark 中,它的 performance 与 NFS 相当(有时更好,有时更差),同时提供明显更强的 security。

1 Introduction

SUNDR 是一种 network file system,解决 data integrity 与 accessibility 之间长期存在的 tension。保护 data 往往被视为给 storage server 建造更好的 fence:限制 access 人数、禁用可被远程利用的多余 software,并及时安装 security patch。

这种方法有两个缺点。第一,经验表明,人们经常建不起足够高的 fence,或者把 fence 托付给并不完全 trustworthy 的 administrator。第二,也是更重要的一点,高 fence 很不方便:它限制人们访问、更新和管理 data 的方式。

这种 tension 在 free software source-code repository 中尤其明显。Free software project 往往涉及 geographically dispersed developer,他们从整个 Internet 提交 source change,因此很难用 firewall 防住攻击者。托管 code repository 还需要 CVS [4]、SSH [35] 等一组 tool,而其中许多曾经出现过可远程利用的 bug。

更糟的是,许多 project 依赖 third-party hosting service,把大量原本独立的 code repository 的 responsibility 集中起来。例如 sourceforge.net 托管超过 20,000 个 software package 的 CVS repository。这些 package 中有许多会被打包进 operating-system distribution,且通常没有 meaningful audit。因此,攻击者一旦 compromise sourceforge,就可能把 subtle vulnerability 引入最终运行在数千乃至数百万台 machine 上的软件。

这类担忧绝非 academic exercise。2003 年 Debian GNU/Linux development cluster 被 compromise [2]:未经授权的 attacker 利用 sniffed password 和 kernel vulnerability,获得 Debian primary CVS 与 Web server 的 superuser access。管理员发现入侵后,不得不暂停 development 数日,同时用手工和 ad-hoc sanity check 评估 damage 范围。Apache [1]、Gnome [32] 和其他 popular project 也遭遇过类似 attack。

我们没有寄希望于 invulnerable server,而是开发 SUNDR:一种从根本上减少对 storage server 信任需求的 network file system。SUNDR 用 cryptography 保护全部 file-system content,使 client 能检测任何 unauthorized change。不同于此前的 Byzantine-fault-tolerant file system [6, 27](它们分散 trust,但假设 server 中有超过阈值比例的 honest server),SUNDR 把写入 file 的 authority 完全放在 user public key 上。即使恶意 user 获得 SUNDR server 的完整 administrative control,也无法让 client 接受他没有 permission 写入的 file 的 altered content。

SUNDR 的 security property 还带来了 data management 的新选择。组织可以使用 SUNDR,把 storage management outsource 出去而不担心 server operator 篡改 data。SUNDR 也支持新的 backup/recovery 方式:发生 disaster 后,SUNDR server 可以从 untrusted client 的 file cache 恢复 file-system data。由于 client 总会 cryptographically verify file-system state,它们并不在意 data 是从 untrusted client 恢复的,还是一直存放在 untrusted server 上。

本文详细介绍 SUNDR file system 的 design 和 implementation。首先说明 SUNDR security protocol,然后展示 prototype implementation;其 performance 在 example workload 与 microbenchmark 下通常与 popular NFS file system 相当。

第 2 页:Setting、Architecture 与 Protocol 引入

sundr p02

SUNDR 为 remote storage 提供 file-system interface,与 NFS [29] 和其他 network file system 类似。例如,要保护 source-code repository,project member 可以把 remote SUNDR file system mount 到 /sundr,并使用 /sundr/cvsroot 作为 CVS repository。之后所有 checkout 和 commit 都经由 SUNDR,保证 user 能检测 hosting site 试图篡改 repository content 的行为。

Figure 1:Basic SUNDR architecture

Application 的 system call 进入 client;client 内部把它们转换成一系列 fetch 和 modify operation。Fetch 表示获取 file content 或验证 local cached copy;modify 表示让新的 file-system state 对其他 user 可见。二者又由 client 与 server 之间的 SUNDR protocol RPC 实现。Server 由 consistency server、block store 和 RPC 层组成;Figure 1 原图保留完整结构。

建立 SUNDR server 时,在联网 machine 上运行 server software,并为它准备 dedicated SUNDR disk 或 partition。Server 可以托管一个或多个 file system。创建 file system 时,生成 public/private superuser signature key pair,把 public key 交给 server,同时保持 private key secret。

Private key 对 file-system root directory 提供 exclusive write access,也直接或间接允许访问 root 以下的任意 file,但 privilege 只局限于该 file system。因此,当一个 SUNDR server 托管多个由不同 superuser 管理的 file system 时,没有任何一个人对全部 file 拥有 write access。

SUNDR file system 的每个 user 也有 signature key。建立 account 时,user 与 superuser 交换 public key。Superuser 通过 root directory 中两个由 superuser 拥有的 file 管理 account:.sundr.users 列出 user public key 和 numeric ID;.sundr.group 指定 group 及其 membership。

Mount file system 时,client 必须把 superuser public key 作为 command-line argument,并且必须能访问 private key。(SUNDR 也可以用更灵活的 certificate scheme 管理 key 和 group;系统只需要一种让 user 验证彼此 key 与 group membership 的方式。)

本文用 user 表示拥有 signature key private half、且该 key 映射到 .sundr.users 某个 user ID 的 entity。根据上下文,它可以是 private key 的 owner,也可以是代表 user 使用该 key 的 client。不过,SUNDR 假设 user 知道自己最近执行的 last operation。Implementation 中,client 记住自己代表每个 user 执行的 last operation。要在 client 之间移动,user 需要 private key 和代表其执行的 last operation(简洁地由 version number 指定)。

SUNDR architecture 区分 server administration 与 file-system administration。管理 server 不需要 private superuser key。为了获得最佳 security,应在独立、trusted machine 上生成 key pair,private key 甚至不应驻留在 server memory 中。Superuser key 等重要 key 在不使用时应 offline 保存,例如存放在用 passphrase 加密的 floppy disk 上。

3 The SUNDR protocol

SUNDR protocol 让 client 能检测 unauthorized file modification,即使 attacker 已控制 server。当 server 行为正确时,fetch 恰好反映此前发生的 authorized modification;这一 property 称为 fetch-modify consistency。脚注中的形式化定义用 happens-before partial order 保持 non-concurrent operation 的 temporal order、同一 client operation 的 order,以及 modification 与同一 file 上其他 operation 的关系。

如果 server dishonest,client 强制执行稍弱的 fork consistency,下一页继续说明。

第 3 页:Fork Consistency 与 Straw-Man File System

sundr p03

在 fork consistency 下,dishonest server 可以让 user A 的 fetch 漏掉 user B 的 modify。但只要任一 user 随后看到另一个 user 的 operation,就会检测到 attack。因此,要持续欺骗,server 必须把两个 user 对 file system 的 view fork 开来。

换一种等价说法:如果 A 的 client 接受了 B 的某个 modification,那么至少直到 B 执行该 modification 之前,两个 user 都拥有 identical、fetch-modify-consistent 的 file-system view。

作者已经形式化指定 fork consistency [16],并证明在 digital signature 与 collision-resistant hash function 的假设下,SUNDR protocol 实现了该 property [17]。因此,fork-consistency violation 意味着 underlying cryptography 被 break、implementation 偏离 protocol,或者从 high-level Unix system call 到 low-level fetch/modify operation 的映射存在 flaw。

为了讨论 fork consistency 的含义并描述 SUNDR,先从一个简单的 straw-man file system 开始。它以极低效率实现 fork consistency(Section 3.1);随后提出 bandwidth 更合理的 Serialized SUNDR(Section 3.3);最后放松 serialization requirement,得到真正构建的 Concurrent SUNDR(Section 3.4)。

3.1 A straw-man file system

在 SUNDR 的最粗略近似——straw-man file system——中,我们禁止 concurrent operation,并允许 system 消耗不合理的 bandwidth 和 computation。Server 维护一个针对 file system 的 single、untrusted global lock。User 要 fetch 或 modify file 时,先 acquire lock,执行 operation,再 release lock。只要 server honest,operation 就会 total order,且每个 operation 在下一个开始前完成。

Straw-man file server 保存每个 fetch 或 modify operation 的完整、有序 list。每个 operation 还包含执行该 operation 的 user 的 digital signature;签名不只覆盖 operation,还覆盖此前全部 operation 的完整 history。

在 fetch 或 modify file 时,client acquire global lock,下载整个 file-system history,并验证每个 user 的 latest signature。Client 还检查自己的 user 的 previous operation 是否在 downloaded history 中(除非这是 user 在 file system 上的第一个 operation)。

随后 client 遍历 operation history,构建 local file-system copy。对每个 modify,client 还用 user/group file 检查 operation 是否确实被允许:根据 file owner 或 group 验证 signing user。如果全部检查成功,client 把 new operation append 到 list,签署 new history,发送给 server,并释放 global lock。如果 operation 是 modification,append record 包含一个或多个 file/directory 的 new content。

Forking attack

Malicious server 若想让 client 相信某个 file modification,就必须发送 signed history。假设 server 不知道 user key 且不能 forge signature,client 接受的任何 modification 必须确实由 authorized user 签署。然而 server 仍可以隐瞒其他 user 的 previous operation,诱使 user 签署不合适的 history。

例如,在前述 history 的最后一个 operation 中,如果 server 没有向 user B 展示对 f2 的最新 modification,A 与 B 会签署彼此不兼容的 history。由于 client 总会检查自己的 previous operation,从此以后 A 只会签署第一条 history 的 extension,B 只会签署第二条 history 的 extension;在 attack 之前两者享有 fetch-modify consistency,attack 之后 users 就被 fork。

即使 server 与 malicious user collude,或者获得 compromised user 的 key,只要把分析限制在 honest user 签署的 history 上,也能得到类似 fork property。两个 honest user 一旦签署 incompatible history,之后就无法在不检测问题的情况下看到彼此的 operation。当然,server 可以 extension 并签署 compromised user 的 history,因此可以改变 compromised user 有 permission 写入的任何 file;剩余 file 只能在 honest user history 中修改,因此仍保持 fork consistency。

第 4 页:Fork Consistency 的含义与 Serialized SUNDR

sundr p04

3.2 Implications of fork consistency

没有 online trusted party 时,fork consistency 是可能达到的最强 integrity notion。假设 user A online、modify 一个 file 后 offline;之后 B online 并读取该 file。如果 B 不知道 A 是否访问过 file system,就无法检测 server 简单丢弃 A change 的 attack。Fork consistency 意味着:这就是 server 对 file integrity 或 consistency 能实施的唯一不可检测 attack 类型;如果 A 与 B 之后通信,或看到彼此 future file-system operation,就能发现 attack。

有了 fork consistency,可以利用任何 online trusted party 获得更强的 consistency,甚至 fetch-modify consistency。例如 Section 5 将介绍,SUNDR server 由 block store 与只保存极少 state 的 consistency server 两个 program 构成。把 consistency server 移到 trusted machine 上,就能直接保证 fetch-modify consistency;问题是 trusted machine 的 connectivity 或 availability 可能比 untrusted machine 更差。

如果不想把 trusted machine 放在 critical path 上,可以用一个拥有写单个 file 权限的 “time stamp box” 限制 inconsistency window。它可以每 5 秒通过 SUNDR 更新一次该 file。所有看到 box update 的 user 都知道彼此最多只在过去 5 秒内 partition。为了 Byzantine fault tolerance,可以复制多个这样的 box,每个 replica 更新一个 file。

也可以利用 direct client-client communication 增强 consistency。User 可以把带当前 network address 的 login/logout record 写入 file,从而互相发现,并持续交换 latest operation。如果 malicious server 无法破坏 client 间 network communication,那么一旦 online client 互相知道,server 就无法继续 fork file-system state。认为 malicious network partition 足以值得在 client failure 时牺牲 service delay 的 user,可以在 communication outage 期间保守地暂停 file access。

3.3 Serialized SUNDR

Straw-man file system 不实用有两个原因:第一,它必须记录并传输完整 file-system operation history,需要巨大 bandwidth 和 storage;第二,通过 global lock serialize operation 不适合 multi-user network file system。本节解决第一个问题,仍使用 global lock;Section 3.4 再解释如何让 non-conflicting operation 并发执行。

SUNDR 不再像 straw-man system 那样签署 operation history,而是有效地签署 file-system snapshot。粗略地说,user 签署把所有 file 的 complete state 绑定在一起的 message,使用两个机制:第一,利用 hash tree [18] 把某个 user 或 group 可写的所有 file 高效聚合成一个 hash value,称为 i-handle;第二,利用 version vector [23] 把每个 i-handle 绑定到其他 i-handle 的 latest version。

3.3.1 Data structures

SUNDR 像若干近期 file system [9, 20] 一样,使用 cryptographic handle 命名全部 on-disk data structure。Block store 使用 20-byte SHA-1 hash 对大部分 persistent data structure 建 index,因此 server 类似一个 large、high-performance hash table。人们认为找到两个具有相同 SHA-1 hash 的不同 data block 在 computation 上不可行。Client 请求某个 hash 的 block 时,可以通过重新 hash response 检查 integrity。Hash-based storage 的附带好处是:多个 file 共有的 block 只需存储一次。

SUNDR 还保存 user 签署的 message。这些 message 以 public key hash 加 index number 建 index,以区分同一 key 签署的多个 message。

每个 file 由 <principal, i-number> pair 标识;principal 是允许写 file 的 user 或 group,i-number 是 per-principal inode number。Directory entry 把 file name 映射到 <principal, i-number> pair。每个 principal 有一个名为 i-table 的 data structure,把使用中的 i-number 映射到对应 inode。

User i-table 把 i-number 映射到 inode hash,即 file 的 i-hash。Group i-table 多一层 indirection,把 group i-number 映射到 user i-number;这使同一 user 可以对 group-owned file 连续写多次,而不必更新 group 的 i-handle。Inode 自身包含 file data block 与 indirect block 的 SHA-1 hash。

第 5 页:i-handle、Version Structure 与 Serialized Protocol

sundr p05

每个 i-table 都存储为 B+-tree,internal node 包含 child 的 SHA-1 hash,因而形成 hash tree。B+-tree root 的 hash 就是 i-handle。由于 block store 支持按 SHA-1 hash 请求 block,client 只要拥有 user i-handle,就能递归请求适当的 intermediary block,fetch 并验证该 user i-table 中任意 file 的任意 block。

剩下的问题是:如何取得并验证 user 的 latest i-handle?

3.3.2 Protocol

i-handle 存在 digitally-signed message 中,这种 message 称为 version structure。每个 version structure 由特定 user 签署,必须包含该 user 的 i-handle;此外可以选填 user 所属 group 的一个或多个 i-handle。Version structure 最后包含一个 version vector,为 system 中每个 user 与 group 保存一个 version number。

User u 执行 file-system operation 时,client acquire global lock,并下载每个 user 与 group 的 latest version structure。这个集合称为 version structure list(VSL)。如果自上次 operation 以来只有少数 user/group 改变 version structure,VSL 的大部分传输可以省略。

Client 随后计算新的 version structure z:可能更新 i-handle,并设置 z 中的 version number,使其反映当前 file-system state。Fetch 时,client 直接把 u 的 previous i-handle copy 到 z,因为 state 没有变化;modify 时,client 为 u 以及其正在修改 i-table 的所有 group 计算并包含新的 i-handle。

随后 client 设置 z 的 version vector。对任意 version structure z 和 principal p,令 z[p] 表示 z version vector 中 p 的 version number;如果 z 没有 p entry,则为 0。对每个 principal p,若 y_p 是 VSL 中 p 的 entry(即包含 p latest i-handle 的 version structure),则设置 z[p] ← y_p[p]。

最后,client bump version number 以反映 z 中的 i-handle:因为 z 总包含 u 的 i-handle,所以设置 z[u] ← z[u] + 1;对于 z 包含其 i-handle 的每个 group g,设置 z[g] ← z[g] + 1。

Client 接着检查 VSL consistency。对两个 version structure x 和 y,定义:

x ≤ y 当且仅当对所有 p,x[p] ≤ y[p]。

Consistency check 包括:VSL 包含 u 的 previous version structure;VSL 中全部 entry 与 z 合在一起后,按 ≤ 构成 total order。如果满足,user 就签署 new version structure,通过 COMMIT RPC 发送给 server。Server 把 new structure 加入 VSL,并 retire 与 updated i-handle 对应的 old entry,之后 client release file-system lock。

Figure 4:Signed version structures with a forking attack

Figure 4 重新展示 Section 3.1 末尾的 forking attack,说明 version vector 如何演进。每个 user 签署 version structure 时,都会反映从其他 user 看到的最高 version number,并增加自己的 version number 以反映 latest i-handle。

Consistency violation 会让 user 签署 incompatible version structure,即存在 x ≰ y 且 y ≰ x 的 x、y。图中 server 在 step 3 后实施 fork attack:User A 在 step 4 将 i-handle 从 h_A 更新为 h'_A,但 step 5 中 B 不知道该 change,于是 step 4 与 step 5 签署的 version structure incompatible。

与 straw-man file system 一样,两个 user 一旦签署 incompatible version structure,就不会再签署 compatible version;因此不可能在不检测 attack 的情况下再次看到彼此的 operation。

一个重要 optimization 是,SUNDR 会在多个 operation 之间 amortize hash-tree recomputation cost。Figure 5 中,i-handle 不仅包含 hash-tree root,还包含一个记录 i-table change 的 small log。Change log 还避免了 client 在重新验证一个自上次计算 hash-tree root 后未变化的 cached file 时,fetch 其他 i-table block。

第 6 页:Concurrent SUNDR 与 Update Certificate

sundr p06

3.4 Concurrent SUNDR

Version structure 能检测 inconsistency,但 Serialized SUNDR 禁止得过于保守。每个 client 都必须等待 previous client 的 version vector,才能计算并签署自己的 version vector,以反映适当的 version number。理想情况下,大多数 operation 应并发进行;唯一需要等待的情况,是一个 client 读取另一个 client 正在写的 file。

3.4.1 Update certificates

SUNDR 用 update certificate 解决 concurrent update:User 在从 server 收到 VSL 之前,预先声明 fetch 或 modify operation。Update certificate 是 signed message。如果 y_u 是 u 当前的 VSL entry,则 u 下一次 operation 的 certificate 包含:

  • u 的 next version number,即 y_u[u] + 1(除非 u 正在 pipeline multiple update);
  • u VSL entry 的 hash H(y_u);
  • 要执行的 modification list,可以为空。

每个 modification(delta)有四种类型:

  • 把 <user, i#> 设为 i-hash h;
  • 把 <group, i#> 设为 <user, i#>;
  • 在 <user/group, i#> 目录中 set/delete entry name;
  • 预分配一段 group i-number,把它们指向尚未分配的 user i-number。

Client 通过 UPDATE RPC 把 update certificate 发给 server。Server 返回 VSL,以及所有尚未反映在 VSL 中的 pending operation list,称为 pending version list(PVL)。

Fetch 和 modify 都需要 UPDATE RPC,尽管 fetch 不包含 delta。(RPC 名称指更新 VSL,而不是更新 file content。)此外,rename 等 complex system call 的单个 UPDATE RPC 可以包含影响多个 file 和 directory、甚至不同 i-table 的 delta。

Honest server 按 UPDATE RPC 到达顺序为 operation total order。如果 operation O1 反映在 O2 的 UPDATE RPC 返回的 VSL 或 PVL 中,就说 O1 happened before O2;反之,如果 O2 反映在 O1 返回的 VSL/PVL 中,就说 O2 happened before O1。如果二者都没有 happened-before,server 就实施了 forking attack。

Client 签署 update certificate 时无法预测 next version structure 的 version vector,因为 vector 可能取决于其他 client 的 concurrent operation。不过,server 知道即将到来的 version structure 必须反映哪些 operation。因此,对每个 update certificate,server 计算 forthcoming version structure(i-handle 除外)。该 unsigned version structure 与 update certificate 成对放入 PVL,所以 PVL 实际是 <update certificate, unsigned version structure> pair 的 list。

计算 new version structure z 的 algorithm 先像 Serialized SUNDR 一样:对每个 principal p,设置 z[p] ← y_p[p],其中 y_p 是 p 在 VSL 中的 entry。然后增加 z version vector,以反映 PVL 中的 pending update,包括 u 自身的 update。

对 user version number 很简单:对 user u 签署的每个 update certificate,设置 z[u] ← z[u] + 1。Group 情况更复杂,因为 slow/fast client 更新同一 i-table 时,operation 可能 out of order commit。

对更新 group g i-table 的 PVL entry,只有当该 entry happened after y_g 时,才希望增加 z[g](因为之前已用 y_g[g] 初始化 z[g])。通过比较 y_g 与 PVL entry 的 unsigned version vector ℓ 判断:如果 ℓ ≰ y_g,就设置 z[g] ← z[g] + 1。得到的 version vector 与 Serialized SUNDR 等待所有 previous version structure 后得到的结果相同。

收到 VSL 与 PVL 后,client 确保 VSL、PVL 中 unsigned version structure 以及自己的 new version structure 按 total order 排列,并检查 conflict。如果 PVL 中没有 operation 修改 client 当前正在 fetch 的 file 或正在修改的 group i-table,client 就签署 new version structure,并发送给 server,加入 VSL。

第 7 页:Update Conflicts 与 PVL 处理

sundr p07

3.4.2 Update conflicts

如果 client 正在 fetch 一个 file,而 PVL 包含对该 file 的 modification,这就是 read-after-write conflict。Client 仍按正常方式 commit version structure,但随后等待 fetched file 被 commit 到 VSL 后,才向 application 返回。(FETCHPENDING RPC 让 client 能在特定 version structure 到达 server 后立即请求它。)

更棘手的情况是:PVL 包含对某个 group i-handle 的 modification,而 client 也想修改它,这代表 write-after-write conflict。若 client u 正在修改 group g 的 i-table t_g,而 PVL 中的其他 operation 也会影响 t_g,那么它如何重新计算 g 的 i-handle h_g?

由于 PVL 中每个 operation 都 happened before u 的 new version structure z,z 中的 h_g 必须反映 PVL 对 t_g 的全部 operation。另一方面,如果 server 行为错误,对应 PVL entry 的一个或多个 forthcoming version structure 可能与 z incompatible;此时,不能让 z 以某种方式“launder”本应提醒 user server misbehavior 的 operation。

Client 已经会检查 PVL 中的 read-after-write conflict。当看到 PVL 中的 conflicting modification 时,即使 u 已经把它并入 h_g,也会等待对应的 VSL entry。但仍有问题:malicious server 可能过早从 PVL 删除 entry,导致 client 错误地 fetch 已经被 t_g 反映、却从未正确 commit 的 modification。

解决方法是:u 把 PVL 中尚未反映在 y_g 的所有 t_g modification 纳入,并把当前 PVL content 记录到 new version structure 的新字段中。这样,当其他 client 在 u 的 version structure 中看到对 entry 的引用时,就能检测缺失的 PVL entry。

不必包含完整 PVL(它可能很大),u 只需对每个 PVL entry 记录:执行 operation 的 user、该 user 对应 operation 的 version number,以及省略 i-handle 后的 expected version structure hash。

u 应用 PVL change 时,通常只需把 change append 到 g i-handle 的 change log,这比重新 hash i-table 高效得多,也常常使 u 不必 fetch 未 cache 的 i-table 部分。

第 8 页:Concurrent Update Example 与 Discussion

sundr p08

3.4.3 Example

Figure 6 展示 group g 中的两个 user u1、u2 如何并发修改同一目录。u1 在 /sundr/tmp/ 创建 file X,u2 创建 Y;directory 可由 group 写入,而 file 不可由 group 写入。假设没有其他 pending update。

设 /sundr/tmp/ 映射到 group g 的 i-number 4。User u1 先计算 file X 的 i-hash h_X,分配自己的 i-number 7;再分配 i-number 8 保存 modified directory 的 content。最后,u1 向 server 发送 update certificate,声明三个 delta:把 <u1,7> 映射到 h_X;向 directory 添加 ("X" → <u1,7>);把 g 的 i-number 4 remap 到 <u1,8>。

u2 同样发送创建 file Y 的 update certificate。如果 server 把 u1 update 排在 u2 前面,它向 u1 返回只包含 u1 update 的 VSL/PVL,而给 u2 的 PVL 反映两个 update。因此 u2 在计算 g i-handle 前,会先应用 u1 对 directory 的 modification,把 u1 的 directory entry X 纳入。

正常情况下,u2 也会纳入 u1 对 directory <g,4> → <u1,8> 的 remap;但由于 u2 自己对同一 directory 的 remap,u2 的 remap supersede u1 的 remap。

协议中如 Figure 7 所示的 subtlety 是:u2 version structure 包含 u1 forthcoming version structure(省略 i-handle)的 hash。这样,如果 server 在 u1 commit 前暗中从 PVL 删除 u1 update certificate,那么看到错误 PVL 的 user 就会同时与 u1 和 u2 fork。

4 Discussion

SUNDR 只检测 attack,不解决 attack。Server compromise 后,两个 user 可能分别 cache 同一 directory tree 的 divergent copy。Optimistic file-system replication [13, 22] 研究过如何 resolve 差异,但其中一些 conflict 必须由 application-specific reconciliation 解决;对 CVS,user 可以使用 CVS 自带的 merge facility 解决 fork。

SUNDR protocol 还有大量 compression 与 optimization 机会。Version structure signature 必须覆盖包含所有 user/group 的 version vector,但 RPC 无需传输完整 vector:按从 most-recently updated 到 least-recently updated 排序后,除了 client 第一次 UPDATE RPC,尾部 idle principal 可以省略。

此外,如果对 version vector hash 签名,并从 oldest 到 newest 计算 hash,client 可以预先 hash idle principal 的 version number,加速 version-vector signature。PVL 中大多数 unsigned version structure 的 content 又可由 PVL order implicit 推导,因此可以省略;server 按收到 UPDATE RPC 的 order deterministic 地计算它们。这些 optimization 当时尚未实现。

第 9 页:SUNDR Semantics 与 File-system Implementation

sundr p09

SUNDR semantics 与 traditional Unix 不同。Client 修改 file 时自己提供 file modification time 和 inode change time,因此可以写入 Unix 可能禁止的 value。系统没有 last-access time;directory 没有 sticky bit。

SUNDR 中的 group-writable file 不归某个 user 所有(Unix 中通常如此),而是归 group 所有;该 file 的 owner field 表示最近写入它的 user。与向 group-writable file 的其他 user write 收取 owner quota 的 Unix disk quota 不同,如果 SUNDR block store 实施 quota,它会准确按每个 user 写入的 block 向该 user 收费。

SUNDR 不能改变 file owner。不过,得益于 hash-based storage,SUNDR 可以只通过少量 pointer manipulation 复制任意大的 file。因此,SUNDR 通过创建一个由新 user 或 group 所有的 file copy,并把 directory entry 更新为指向新 copy,来实现 chown。这需要对 directory 有 write permission,并改变 hard link semantics,因为 chown 只影响一个 link。

另一个 Unix 差异是:directory owner 可以删除 directory 中任意 entry,包括自己没有 write permission 的 non-empty subdirectory。由于 Unix 已经允许 user 把这样的 directory rename 到别处,再额外允许 delete 并不会明显影响 security。类似地,user 可以为 directory 创建多个 hard link,这可能让某些 Unix software 困惑,也可能在某些场景有用。其他 malformed directory structure 会被解释为某个合法结构的等价物,例如两个 duplicate directory entry 中只有第一个生效。

SUNDR 尚不提供 read protection 或 confidentiality。Confidentiality 可以通过 encrypted storage 获得,这是一个被广泛研究的问题 [5, 10, 12, 34]。

在 network latency 方面,SUNDR 与其他 polling network file system 相当。SUNDR 在 application system call 返回前等待 UPDATE RPC 完成。如果 system call 只造成 modify,或所有 fetched data 都命中 cache,那么这就是唯一需要的 synchronous round trip;COMMIT 可以在 background 发送(fsync 除外)。这与 NFS3 等系统类似:NFS3 在每次 open 执行 ACCESS RPC,并在每次 close 将 data 写回 server。

Callback 或 lease-based file system 在 server 承诺通知 client cache invalidation 时,实际上可以做到 zero round trip。

5 File system implementation

SUNDR client 在 user level 实现:在略作修改的 FreeBSD kernel 上,使用来自 ARLA file system [33] 的 modified xfs device driver。Server functionality 分为两个 program:consistency server 处理 update certificate 和 version structure;block store 实际把 data、update certificate 和 version structure 写入 disk。

本文实验中,block server 与 consistency server 运行在同一台 machine,通过 Unix-domain socket 通信;也可以配置为运行在不同 machine 上,通过 authenticated TCP connection 通信。

5.1 File system client

SUNDR 使用的 xfs device driver 为 whole-file caching 设计。File open 时,xfs 向 SUNDR client 发起 upcall,请求 file data;client 返回一个拥有 cached data copy 的 local file 的 identity。所有 read/write 都在 cached copy 上执行,不再涉及 SUNDR。File close(或 fsync flush)时,如果 file 被修改,xfs 再发起 upcall,请 client 把 data 写回 server。其他 upcall 支持 xfs lookup directory name、request file attribute、create/delete file 和 change metadata。

xfs 原始 interface 给 SUNDR 带来两个问题。第一,xfs cache local file binding 等 information,使部分 request 可以在没有 upcall 的情况下完成;但在 SUNDR 中,这些 request 的 security property 需要与 consistency server interaction。因此我们修改 xfs:在获取或写回 cached data 后立即 invalidate cache token,确保 protocol 需要 UPDATE RPC 时 user-level client 获得 control;同时也改掉 kernel name cache。

第二,一些本来只需与 SUNDR consistency server 交互一次的 system call,会产生多个 kernel vnode operation 和 xfs upcall。例如 stat("a/b/c", &sb) 会产生三个 xfs GETNODE upcall(directory lookup)和一个 GETATTR,但整个 system call 只应需要一个 UPDATE RPC。如果 user-level client 不知道这四个 upcall 属于同一 system call,就必须用四个 UPDATE RPC 分别检查 i-handle freshness。

为了消除不必要的 RPC,我们修改 FreeBSD kernel,让它统计可能需要与 consistency server 交互的 system-call invocation 数量。在每个带 pathname 参数的 system call(如 stat、open、readlink、chdir)开始时增加 counter。SUNDR client memory-map 这个 counter,并记录上次见到的 value。如果 xfs 发起的 upcall 不改变 file-system state,且 counter 没有变化,client 就能使用全部 i-handle 的 cached copy。

第 10 页:Signature Optimization、Consistency Server 与 Block Store

sundr p10

5.2 Signature optimization

SUNDR critical path 上 digital signature 的成本很高,因此 implementation 使用 ESIGN signature scheme [21],它比 RSA 等 popular scheme 快一个数量级以上。本文实验使用 2,048-bit public key;借助已知 technique,其破解工作因子远大于 1,024-bit RSA。

为了把 verification 移出 critical path,consistency server 先处理并回复 UPDATE RPC,再验证 update certificate 的 signature;回复之后、接受其他 user RPC 之前完成验证。如果 signature 验证失败,server 从 PVL 删除 update certificate,并断开 forge client 的 TCP connection。因为只有 faulty client 才会发送 invalid signature,这种行为是可接受的。

该 optimization 让 consistency server 验证一个 signature 的同时,client 计算下一条 signature。Client 也会 overlap computation 与 network latency:ESIGN signature 约一半成本来自不依赖 message content 的 computation,因此在等待 UPDATE RPC reply 时,client 会预计算 next signature。

5.3 Consistency server

Consistency server 按 Section 3 的描述为 SUNDR client order operation,并维护 VSL 与 PVL。此外,它负责 police client operation、拒绝 invalid RPC,防止 malicious user 让 honest server failure。

为进行 crash recovery,consistency server 必须在响应 client RPC 前,把 VSL 与 PVL 存入 persistent storage。当前 implementation 把它们存入 block server。由于 VSL/PVL 相对于整个 file system 很小,也可以使用 NVRAM。

6 Block store implementation

称为 bstor 的 block-storage daemon 负责 SUNDR 的全部 disk storage。Client 直接与 bstor 交互,通过 SHA-1 hash store/retrieve block;consistency server 使用 bstor 保存 signed update 和 version structure。

由于 SUNDR server 没有 signature key,它没有 permission 在 crash 后 repair file system。因此,bstor 必须在向 client 返回前同步把所有 data 写入 disk,这带来 performance challenge;bstor 因此高度优化 synchronous write performance。

bstor 的基本思路是先把 incoming data block 写入 temporary log,再批量把 block 移到 Venti-like storage。Venti [24] 是 archival block store:它把 variable-size block append 到 large、append-only IDE log disk,并在一个或多个高速 SCSI disk 上按 SHA-1 hash 建 index。

bstor 的 temporary log 放松了 Venti 的 archival semantics,允许在 block 创建后的小窗口内删除 short-lived block;同时通过 periodic file-system snapshot 保留 archival flavor。

Temporary log 使 bstor 在 synchronous write 上获得低 latency;Venti 需要 index lookup 来确保 block 不重复。bstor 还让 temporary-log 中的所有 block sector-align,暂时平均浪费半个 sector,以避免多次写同一 sector(每次至少需要一次 disk rotation)。把 block 大批量转移到 permanent log 还能让 bstor 排序 index disk access,从而在 sustained load 下提高 write throughput。

bstor 维护 large in-memory cache,尤其缓存 temporary log 的全部 block,避免从 temporary-log disk 读取。bstor 当时不使用 special hardware,但论文后文说明,若有少量 NVRAM 存放 update certificate,performance 还可提升。

第 11 页:bstor Interface、Index 与 Data Management

sundr p11

6.1 Interface

bstor 向 SUNDR client 暴露以下 RPC:

text
STORE (header, block)
RETRIEVE (hash)
VSTORE (header, pubkey, n, block)
VRETRIEVE (pubkey, n, [time])
DECREF (hash)
SNAPSHOT ()

STORE:如果 bstor 尚未拥有该 block,就把 block 与 header 写入 stable storage。Header 包含 block owner、creation time,以及 encoding/compression 可能使用的 field。

RETRIEVE:按 SHA-1 hash 获取 block,同时返回该 block 第一次被 STORE 时使用的 header。

VSTORE 与 VRETRIEVE 类似,但针对 signed block;signed block 以 public key 和 small index number n 建 index。VRETRIEVE 默认获取 signed block 的 latest version;提供可选 timestamp 时,返回该时间之前写入的 newest block。

DECREF(decrement reference count 的缩写):通知 store,某个 SHA-1 hash 的 block 可以被 discard。SUNDR client 用它丢弃 temporary file 和 short-lived metadata。

bstor 的 deletion semantics 很保守。首次存储 block 时,bstor 建立一个 short deletion window(默认一分钟)。如果 client 在此 window 内 STORE 后又 DECREF block,bstor 把 block 标为 garbage,不永久存储;如果两个 client 在 dereference window 内存储同一 block,该 block 就标为 permanent。

Administrator 应周期性执行 SNAPSHOT RPC,创建 coherent file-system image,便于 accidental data disruption 后 rollback。收到该 RPC 后,bstor 让所有 newly-stored block 免受后续 DECREF 影响,并标记为写入 permanent log。SNAPSHOT 和 VRETRIEVE 的 time argument 设计上支持浏览历史 file-system state,但当时 client 尚未实现这个功能。

6.2 Index

bstor index system 根据 SHA-1 hash 在 permanent log 中定位 block。理想 index 是一个 in-memory hash table,把 20-byte hash 映射到 8-byte log-disk offset。若 system 平均 block size 为 8 KB,index capacity 大约需要是 log disk 的 1/128。虽然 commodity component 当前可以达到这种 disk/memory ratio,作者不确定未来 memory 是否能跟上 hard disk 增长。

因此,bstor 使用 Venti strategy:把 disk-resident hash table stripe 到多个 high-speed SCSI disk。它把 20-byte SHA-1 hash hash 成 <index-disk-id, index-disk-offset> pair。Disk offset 指向 sector-sized on-disk data structure,即 bucket;每个 bucket 含 15 个按 SHA-1 hash 排序的 index-entry。Index-entry 把 SHA-1 hash 映射到 permanent data log offset。每当 index-entry 从 disk read/write,bstor 也把它放入 in-memory LRU cache。

当 block cache miss、bstor 处理 RETRIEVE 时,它像 Venti 一样访问 index system。把 data 从 temporary log 移到 permanent log 时,每 block 可能需要访问 index 两次:一次检查 block 是否 duplicate,一次在 block commit 到 permanent log 后写 new index entry。两种情况下,bstor 都会排序 disk access,使 index disk 用一次 disk-arm sweep 服务一批 request。

尽管有这些 optimization,bstor 仍按 block 到达顺序写 permanent log;随机重排会损害 large file 的 sequential read performance。

6.3 Data management

Crash 或 unclean shutdown 后,system 从 latest known checkpoint 开始,先根据 permanent log 重建一致的 index。因为 server 在把 block 写入 permanent log 后会 lazy update index,所以必须恢复 index。随后 bstor 处理 temporary log,把全部 fresh block 存到 permanent log,并适当更新 index。

Venti 作者认为 archival storage 可行,因为 IDE disk capacity 增长快于 user 产生 data;但不适合该模型的 user 可以把 bstor 修改为 mark-and-sweep garbage collection。基本方法是把全部 reachable block copy 到 new log disk,再 recycle old disk;拥有两块 disk 时,garbage collection 期间 bstor 仍可响应 RPC。

第 12 页:Performance 与 bstor Microbenchmarks

sundr p12

7 Performance

测试 SUNDR 的主要目标,是确认相比 existing file system,security benefit 不会带来过高代价。本节把 SUNDR overall performance 与 NFS 比较;通过 microbenchmark 解释 application-level result,并验证 block server 在本文场景中优于 Venti-like architecture。

7.1 Experimental setup

实验在运行 FreeBSD 4.9 的 3 GHz Pentium IV cluster 上进行。所有 machine 通过 fast Ethernet 连接,ping time 为 110 μs。Block server microbenchmark 还使用 gigabit Ethernet 连接 block server 和 client。运行 bstor 的 machine 有 3 GB RAM 与 disk array:四块 15,000 RPM 的 Seagate Cheetah 18 GB SCSI disk 用于 index;两块 7200 RPM 的 Western Digital Caviar 180 GB EIDE disk 用于 permanent 和 temporary log。

7.2 Microbenchmarks
7.2.1 bstor

评估 bstor 的目标是测量 raw performance,并说明相对 Venti 的 design improvement。实验中四块 SCSI disk 各使用 4 GB 做 index。为了保持良好 index performance(并避免 bucket overflow),index 应少于 half full;按该配置(8 GB usable index、32-byte index entry),bstor 可容纳最多 2 TB permanent data。

为了 flow control 和 fairness,bstor 允许 client 最多有 40 个 outstanding RPC。Microbenchmark 禁用 block cache,但启用最多 100,000 entry 的 index cache;720 MB circular temporary log 在实验中从未填满。

实验存储并 fetch 20,000 个 unique、8 KB block。Figure 8 是 20 次 run 的平均 result,所有情况下 standard deviation 小于 average 的 5%。前两项表明,bstor 能以接近 fast Ethernet 两倍的速率吸收 8 KB block burst;但 sustained throughput 受限于 bstor 把 block 从 temporary log shuffle 到 permanent log 的能力,即 11.9 MB/s。

把 block STORE 到 temporary log 的 bottleneck 当前是 CPU;未来可以消除不必要的 memcpy 以获得更高 throughput。另一方面,bstor 处理 temporary log 的速度受 index disk read 限制,除非 disk 更快或增加 index disk,否则改进空间很小。

作为 Venti-like system 的对照,作者实现了 Venti-like store:VENTI STORE 先在 index 中检查 block 是否存在,只有不存在时才写 permanent log,因此每个 VENTI STORE 都要访问 index disk。结果显示,VENTI STORE 只能达到 STORE burst throughput 的 27%,以及 sustained throughput 的 43%。

如果 client 按写入顺序读 block,即 sequential read,bstor 不必在 permanent log disk 上 seek;此时性能受 index disk 定位 hash 的 per-block cost 限制,warm index cache 下可达到 25.5 MB/s。Random read 即使 warm index cache 也很差,因为 bstor 必须在 permanent log 上 seek;在 SUNDR 中,只要 client 积极 cache block 并顺序读取 large file,slow random RETRIEVE 不应影响整体 performance。

bstor RPC latency 主要是 seek time 的函数。STORE 不需要 seek,返回时间 1.6 ms;VENTI STORE 在 index disk seek(约 4.4 ms)后返回,耗时 6.7 ms。命中和未命中 index cache 的 sequential RETRIEVE 分别耗时 1.9 ms 和 6.3 ms。Log disk seek 约需 6.1 ms,因此命中和未命中 index cache 的 random RETRIEVE 分别耗时 8.0 ms 和 12.4 ms。

Figure 8:bstor throughput measurements

OperationMB/s
STORE(burst)18.4
STORE(sustained)11.9
VENTI STORE5.1
RETRIEVE(random + cold index cache)1.2
RETRIEVE(sequential + cold index cache)9.1
RETRIEVE(sequential + warm index cache)25.5

第 13 页:Cryptographic Overhead 与 End-to-End Evaluation

sundr p13

7.2.2 Cryptographic overhead

SUNDR client 使用 2,048-bit ESIGN key 签署并验证 version structure 与 update certificate。基于 GNU Multiprecision library 4.1.4 的 implementation,大约 150 μs 完成 signature,100 μs 完成 verification。预计算 signature 约需 80 μs,完成预计算 signature 约需 75 μs。在 Pentium IV 上,即使是受控良好的 microbenchmark,这些 measurement 也可能相差两倍。

作为比较,同一 hardware 上运行的 1,280-bit key 优化 Rabin signature scheme,计算 signature 需 3.1 ms,verification 需 27 μs。

7.3 End-to-end evaluation

End-to-end experiment 把 SUNDR 与同一 hardware 上运行的 NFS2、NFS3 server 比较。为了让 NFS 处于最有利位置,NFS 使用 SUNDR 的快速 SCSI index disk,而不是更慢但更大的 EIDE log disk。

加入 NFS2 是因为 NFS2 write-through semantics 更接近 SUNDR:NFS2 与 SUNDR 都会在 close system call 返回前把 modified file data 写入 disk;NFS3 不提供这个 guarantee。

SUNDR client 必须等待 consistency server 把少量 data(VSL 与 PVL)写到 stable storage;尤其 PVL store 位于 client critical path。论文分别给出 consistency server 开启和关闭 secondary-storage flush 的 result;关闭 flush 的 mode 模拟使用 NVRAM 的 consistency server。

所有 application result 是三次 run 的平均值;除非另有说明,relative standard deviation 小于 8%。

7.3.1 LFS small file benchmark

LFS small-file benchmark [28] 测试简单 file-system operation 的 performance:创建 1,000 个 1 KB file,读回,再删除。作者稍作修改,让 1 KB file 写入 random data;如果 1,000 次写入相同 file,会不公平地偏袒 SUNDR 的 hash-based block store。

单 client 情况下,create phase 的单个 file creation 包含 open、read、close system call。SUNDR/NVRAM 中,open 涉及两轮 serialized consistency protocol,每轮约 2 ms;write 是 no-op,因为 file change 会 buffer 到 close;close 涉及一轮 protocol 和一次同步 file-data write 到 block server,而后者可被 client overlap。因此整个 sequence 约 6 ms。没有 NVRAM 时,每轮 protocol 还要多 1~2 ms,因为 consistency server 必须等待 bstor flush。

NFS 创建新 file 至少要等待一次 disk seek,因为它会同步写 metadata;快速 SCSI disk 一次 seek 至少 4 ms。因此 NFS 每个 file creation 不可能快于 4 ms,实际处理 create stage 的三个 system call 约需 6 ms。

Read phase 中,SUNDR 在 open system call 执行一轮 consistency protocol;NFS3 client 仍通过 ACCESS RPC 访问 server,但此时 server 很可能在 buffer cache 中已有 data,不需要 seek;NFS2 在该 phase 不联系 server。

Unlink phase 中,每个 file 执行一个 unlink system call。SUNDR unlink 触发一轮 consistency protocol,以及一次把更新后的 i-table 和 directory block 写入 block server 的 asynchronous write。尤其在该阶段,SUNDR/NVRAM 可以超过 NFS,因为 NFS server 每次 unlink 仍需至少一次 synchronous disk seek。

多个 client 在不同 directory 并发运行 LFS benchmark 时,create phase 呈现类似趋势。令人意外的是,在有限实验中,SUNDR 随 client concurrency 增长的 scaling 实际好于 NFS:NFS 即使 single-client 也受 seek 限制,所需 seek 数随 concurrent client 线性增长;SUNDR 的单 client performance 受 consistency protocol latency 限制,但 client 并发时这些 latency 能 overlap。SUNDR disk access 也 scalable,因为它们是写入 bstor temporary log 的 sequential、sector-aligned write。

第 14 页:Group Contention、Real Workload 与 CVS

sundr p14

7.3.2 Group contention

当把其他 user 的 change fold 进 group i-table 或 directory 时,group protocol 会产生额外 overhead。为了刻画该机制成本,作者测量了对 group-owned directory 高度 contention 的 workload:两个 client 同时在同一 group-writable directory 创建 300 个 new file。每个 concurrent create 都需要 client 在 group i-table 中重新 map group i-number,并把 change 应用到 user 的 directory copy。

在 SUNDR/NVRAM 和 NFS3 上,client 平均分别耗时 4.60 s 和 4.26 s。在两个独立 directory 中并发运行时,SUNDR/NVRAM 平均 2.94 s,NFS3 平均 4.05 s。结果表明,contention 会带来明显成本,但即使在此情况下,SUNDR performance 也没有远离 NFS3。

7.3.3 Real workloads

Figure 11 展示 SUNDR 对 Emacs 20.7 distribution 执行 untar、configure、compile、install 和 clean 的 performance。实验期间,SUNDR client 向 block server 发送总共 42,550 个 block,合计 139.24 MB;bstor 丢弃的 duplicate block 占发送 data 的 29.5%。Client 成功 DECREF 10,747 个 block,节省 11.3% storage;最终有 25,740 个 block、合计 82.21 MB 进入 permanent storage。

SUNDR 在 Emacs build process 的多数 stage 比 NFS2 快,并与 NFS3 竞争。作者认为 install stage 的 sluggish performance 是 implementation artifact:为了简单而非 correctness,implementation serialize concurrent xfs upcall。Install command 操作 file attribute,会产生大量 concurrent xfs upcall。

Figure 12 展示 untar Emacs 时 client concurrency 增长的 performance,其他 build stage 具有类似趋势。这些 experiment 表明,SUNDR 在 LFS small-file benchmark 展现的 scalability 也延伸到真实 file-system workload。

7.3.4 CVS on SUNDR

作者通过在 SUNDR 上运行 CVS,评估 SUNDR 作为 source-code repository 的 performance。典型过程为:client A import source tree(测试使用 groff-1.17.2,共 717 个 file、6.79 MB);client A、B checkout 到 local disk;A commit groff-1.18(影响 549 个 file、6.06 MB);最后 B update local copy。

SUNDR 在 commit phase 表现很差,因为 CVS 会在短时间内反复 open、memory-map、unmap、close 每个 repository file。SUNDR 每次 open 都要执行一轮 consistency protocol;而 FreeBSD NFS3 apparently 会在一组紧邻的 open call 之后省略或 asynchronous 执行 ACCESS RPC。

此时 CVS 可以 cache memory-mapped file,因为单个 CVS client 持有 directory lock;这个小改动就能显著改善 benchmark 中 SUNDR 的 performance。

Figure 13:CVS experiment run time(seconds)

PhaseSUNDRSUNDR/NVRAMNFS3SSH
Import13.010.04.97.0
Checkout13.511.511.618.2
Commit38.932.815.711.5
Update19.115.913.311.5

第 15 页:Related Work、Conclusions 与 Acknowledgments

sundr p15

许多 non-networked file system 使用 cryptographic storage 保密 [5, 34] 或检查 integrity [31]。一些 network file system 提供不同程度的 integrity check,但会降低 read sharing 的 integrity [25],或者容易受到 consistency attack [10, 12, 19]。SUNDR 是第一个为 untrusted server 提供 well-defined consistency semantics 的 system。此前发表但未实现的 SUNDR protocol 版本 [16] 没有 group,因此无法处理 write-after-write conflict。

Byzantine fault-tolerant file system BFS [6] 通过 replication 保证 network file-system integrity。只要 server replica 中超过三分之二未被 compromise,file system 读出的任何 data 都由 legitimate user 写入。相反,SUNDR 不需要 replication,也不信任 user client 之外的 machine;但 SUNDR 的 freshness guarantee 弱于 BFS,因为如果 user 没有其他证据证明彼此 online,malicious SUNDR server 可能 fork file-system state。

一些 project 研究把 file system 存储在由 potentially untrusted node 组成的 peer-to-peer storage system 上。Farsite [3] 把 file system 分散到不可靠 desktop machine;CFS [7] 是 secure read-only file P2P system;Ivy [20] 是 CFS 的 read/write 版本,但 server 可以诱导它重新排序 client 已经看到的 operation;Pond [27] 依赖 trusted inner core,以 BFS-like 方式分散 trust。

SUNDR 使用 [18] 引入的 hash tree,在不扫描整个 file system 的情况下验证 file block integrity。Duchamp [8]、BFS [6]、SFSRO [9] 和 TDB [14] 也使用 hash tree 比较 data 或检查大型 data collection 的部分 integrity。

SUNDR 使用 version vector 检测 consistency violation。Ficus [22] 用 version vector 检测 file-system replica 之间的 update conflict;其他工作 [26, 30] 也用它保护 partial order。SUNDR straw-man file system 有些类似 timeline entanglement [15],后者使用 hash chain 推理 system state 的 temporal order。

9 Conclusions

SUNDR 是一个 general-purpose、multi-user network file system,即使 server 已被 compromise,也不会向 application 呈现错误的 file-system state。SUNDR protocol 以可证明方式保证 fork consistency:server 要么正确行为,要么在 user 之间 communication 后暴露 failure。

无论如何,undetected server compromise 的后果仅限于:在某个 fork point 之后把 user 的 operation 隐瞒给其他 user;server 不能以其他方式 tamper、inject、re-order 或 suppress file write。

Implementation measurement 表明,SUNDR performance 通常接近、某些情况下优于 popular NFS。通过减少对 server 的 trust,SUNDR 为 data management 提供更多选择,并显著提高 file security。

Acknowledgments

感谢 Michael Freedman、Kevin Fu、Daniel Giffin、Frans Kaashoek、Jinyang Li、Robert Morris、anonymous reviewer 和 shepherd Jason Flinn。

本文工作受 National Science Foundation grant CCR-0093361 支持。Maxwell Krohn 部分受 NSF Graduate Fellowship 支持;David Mazières 受 Alfred P. Sloan research fellowship 支持;Dennis Shasha 受 NSF grants IIS-9988636、MCB-0209754 和 MCB-0115586 支持。

第 16 页:References

sundr p16

References

原始参考文献的完整作者、标题、会议、年份、URL、页码和排版由第 15~16 页原图保留。以下按原始编号给出标题中文释义:

  1. Apache.org compromise report:Apache.org compromise report。
  2. Debian investigation report after server compromises:服务器 compromise 后的 Debian investigation report。
  3. FARSITE: Federated, available, and reliable storage for an incompletely trusted environment:面向不完全可信环境的 federated、available、reliable storage。
  4. CVS II: Parallelizing software development:并行化 software development。
  5. A cryptographic file system for Unix:Unix 的 cryptographic file system。
  6. Practical Byzantine fault tolerance:实用 Byzantine fault tolerance。
  7. Wide-area cooperative storage with CFS:使用 CFS 的 wide-area cooperative storage。
  8. A toolkit approach to partially disconnected operation:partial disconnected operation 的 toolkit 方法。
  9. Fast and secure distributed read-only file system:快速且安全的 distributed read-only file system。
  10. SiRiUS: Securing Remote Untrusted Storage:保护 remote untrusted storage 的 SiRiUS。
  11. Linearizability: a correctness condition for concurrent objects:Linearizability:concurrent object 的 correctness condition。
  12. Plutus: Scalable secure file sharing on untrusted storage:untrusted storage 上的 scalable secure file sharing。
  13. Disconnected operation in the Coda file system:Coda file system 中的 disconnected operation。
  14. How to build a trusted database system on untrusted storage:如何在 untrusted storage 上构建 trusted database system。
  15. Secure history preservation through timeline entanglement:通过 timeline entanglement 安全保存 history。
  16. Building secure file systems out of Byzantine storage:从 Byzantine storage 构建 secure file system。
  17. Building secure file systems out of Byzantine storage:同题 technical report 版本。
  18. A digital signature based on a conventional encryption function:基于 conventional encryption function 的 digital signature。
  19. Strong security for distributed file systems:distributed file system 的 strong security。
  20. Ivy: A read/write peer-to-peer file system:read/write peer-to-peer file system Ivy。
  21. Almost uniform density of power residues and the provable security of ESIGN:power residue 的近似 uniform density 与 ESIGN 的 provable security。
  22. Perspectives on optimistically replicated peer-to-peer filing:optimistically replicated peer-to-peer filing 的 perspectives。
  23. Detection of mutual inconsistency in distributed systems:检测 distributed system 中的 mutual inconsistency。
  24. Venti: a new approach to archival storage:archival storage 的新方法 Venti。
  25. Swallow: A distributed data storage system for a local network:local network 的 distributed data storage system Swallow。
  26. Securing causal relationships in distributed systems:保护 distributed system 中的 causal relationship。
  27. Pond: The OceanStore prototype:OceanStore prototype Pond。
  28. The design and implementation of a log-structured file system:log-structured file system 的设计与实现。
  29. Design and implementation of the Sun network file system:Sun network file system 的设计与实现。
  30. Securing causal relationships in distributed systems / partial order time:partial-order time 的 security 与 privacy。
  31. Unifying file system protection:统一 file-system protection。
  32. Intrusion on www.gnome.org:www.gnome.org 入侵报告。
  33. Arla—a free AFS client:免费 AFS client Arla。
  34. NCryptfs: A secure and convenient cryptographic file system:安全便捷的 cryptographic file system NCryptfs。
  35. SSH – secure login connections over the Internet:Internet 上的 secure login connection SSH。

机制索引

机制论文位置与本专栏其他笔记的连接
Fetch-modify consistencySections 2–3honest server 下的强一致语义
Fork consistencySection 3server 只能把 user history fork;跨 fork 可见 operation 会暴露攻击
Straw-man global historySection 3.1完整 signed history 换取简单但极高 bandwidth cost
i-handle / hash treeSections 3.3.1、Figure 2用 root hash 聚合 user/group 可写 state
Version vectorSections 3.3.2、Figure 3–4检测 incompatible history 与 consistency violation
Serialized SUNDRSection 3.3global lock + signed version structure
Concurrent SUNDRSection 3.4update certificate + PVL,允许 non-conflicting operation 并发
Consistency serverSection 5.3VSL/PVL ordering 与 RPC policing
bstorSection 6SHA-1 block store、temporary/permanent log、snapshot、index
F1 / CVS benchmarkSection 7安全性成本与真实 workload 的关系

本篇验收

  • [x] 官方 PDF 已固定:16 页,每页 612×792 points。
  • [x] SHA-256 已记录:b72c3e0b251a0a632fc823138a924e5cde76ff7dcba9b6eaf47480a675e1644d。
  • [x] 16 个原始页面均渲染为 1224×1584 PNG,并按 600 宽度嵌入。
  • [x] Abstract、Sections 1–9、Figure 1–13、协议步骤、VSL/PVL、update conflict、bstor RPC、microbenchmark、CVS workload、Acknowledgments 和 35 条 References 均按原页顺序完成译注或由原页图保留。
  • [x] fork consistency、hash tree、i-handle、version vector、update certificate、VSL、PVL、Concurrent SUNDR、consistency server 和 block store 均已覆盖。
  • [x] 术语如 fetch、modify、principal、i-number、i-table、i-hash、VSL、PVL、UPDATE、COMMIT、bstor、SHA-1 和 ESIGN 保留 English 或中英并列。
  • [x] 原页图已逐页生成、尺寸校验并抽检;翻译层按 16 页原始顺序对应。
← 返回列表
← 上一篇 论文:Spanner:Google’s Globally-Distributed Database 下一篇 → 论文:Practical Byzantine Fault Tolerance(PBFT)

评论 (0)

暂无评论,来留下第一条吧。
登录 或 注册 后才能发表评论