Mobile Agent Communication Software Agent yupingnju edu cn
Mobile Agent Communication Software Agent 余萍 yuping@nju. edu. cn
Outline �Agent协作 �通信框架 �层次式通信框架 �通信再思考 9/15/2020 Institute of Computer Software, Nanjing University 2
移动Agent通信框架 �分层多模式通信框架 移动agent KQML/XML 间接访问模式 直接访问模式 Operating System通信层 9 9/15/2020 Institute of Computer Software, Nanjing University 9
移动Agent通信框架 �间接访问层设计需求 名设计 透明寻址 可靠通信 12 9/15/2020 Institute of Computer Software, Nanjing University 12
寻址 �Home-communicator通信模型 home Mobile agent Server communicator 本地/外来agent 9/15/2020 Institute of Computer Software, Nanjing University 16 16
寻址 �Communicator: 记录当前Host上的所有agent的信息 ▪ Agent迁移时应该register & unregister ▪ 例: mogent. Manager. Register(mogent); mogent. Manager. un. Register(mogent); 18 9/15/2020 Institute of Computer Software, Nanjing University 18
寻址 �寻址示例: Agent A B:send(B,M) A、B同在一个节点:本地通信 ▪ A的名:A: 202. 119. 36. 170/10022: 202. 119. 36. 131 ▪ B的名:B: 202. 119. 36. 136/10027: 202. 119. 36. 131 A、B不在一个节点:远程通信 ▪ A的名:A: 202. 119. 36. 170/10022: 202. 119. 36. 130 ▪ B的名:B: 202. 119. 36. 136/10027: 202. 119. 36. 135 19 9/15/2020 Institute of Computer Software, Nanjing University 19
寻址 A: 202. 119. 36. 170/100232: 202. 119. 36. 131 B: 202. 119. 36. 136/100247: 202. 119. 36. 131 A Agent列表: A: 202. 119. 36. 170/100232: 202. 119. 36. 131 B: 202. 119. 36. 136/100247: 202. 119. 36. 131 9/15/2020 Institute of Computer Software, Nanjing University A: send(B, M) B 得到B,M 查B在本节点 将M交给B 20 20
寻址 A的名:A: 202. 119. 36. 170/100232: 202. 119. 36. 130 B的名:B: 202. 119. 36. 136/100247: 202. 119. 36. 135 A 202. 119. 36. 130 A: send(B, M) 202. 119. 36. 136 0: 截获通信请求 1: 发现B不在本地 2: 向B的出生地 136请求B的当前位置 3: 136上的communicator接受请求,向 Home查询,得到B的位置为 135 4: 向 130上的communicator回复: 135 M M 202. 119. 36. 135 9/15/2020 Institute of Computer Software, Nanjing University B 21 21
可靠通信 �通信可靠性研究: 通信失效现象: A A: send(B, M) 202. 119. 36. 136 M M B 23 9/15/2020 Institute of Computer Software, Nanjing University 23
可靠通信 �现象 本地通信失效 B A 27 9/15/2020 Institute of Computer Software, Nanjing University 27
可靠通信 �异地通信失效 A A: send(B, M) M M B 28 9/15/2020 Institute of Computer Software, Nanjing University 28
层次式通信框架 -通信失效解决方案 �刻画agent状态的数据结构设计 增添mogent状态值:迁移态、静止态 Home将维护mogent状态值的变化 36 9/15/2020 Institute of Computer Software, Nanjing University 36
层次式通信框架 -通信失效解决方案 移动态 静止态 Home Go H 2 38 9/15/2020 Institute of Computer Software, Nanjing University 38
层次式通信框架 A A: send(B, M) 红线表示的时间段内B不得迁移 M M B 41 9/15/2020 Institute of Computer Software, Nanjing University 41
层次式通信框架 A 在途信件数加 1 A: send(B, M) M M B 42 9/15/2020 Institute of Computer Software, Nanjing University 42
Mobile agent通信再思考 到底有哪些因素 可以帮助我们开 展对mobile agent的可靠通 信研究? 46 9/15/2020 Institute of Computer Software, Nanjing University 46
通用通信框架 Receiver MB MAP Sender MAP MB: mailbox MAP: Mobile Agent Platform 50 9/15/2020 Institute of Computer Software, Nanjing University 50
基础框架:定义 �Patha(A): 节点的有序列表 (ha 0, ha 1, …, han) 表示agent A 曾经访问过的节点序列 Sa={hai | hai is on Patha(A)} �Pathm(A): 节点的有序列表 (hm 0, hm 1, …, hmn) 表示agent A的信箱访问过的节点序列 Sm={hmi | hmi is on Pathm(A)} �f: Sa Sm, 对于任意的 hai Sa, 52 9/15/2020 Institute of Computer Software, Nanjing University 52
基础框架:三维模型 �信箱中信件到agent的发送方式: Push(PS):信箱 agent Pull(PL):agent 信箱 �信箱迁移频率: 无迁移 (NM): Sm = {hm 0} 全迁移 (FM): Sm = Sa 跳跃迁移 (JM): | Sm| > 1 and Sm Sa 54 9/15/2020 Institute of Computer Software, Nanjing University 54
基础框架:三维模型 Y (Delivery Mode) PS PL NS SHM (SMA) NM JM FM X (Migration Frequency) FS Z (Synchronization) 9/15/2020 Ø模型三维是正交的 Ø协议: XX-YY-ZZ Institute of Computer Software, Nanjing University 56 56
基础框架:协议组合 �基于Home服务器的协议 NM-PS-NS: Mobile IP NM-PS-SMA: Mobile IP + Sync信箱消息转发和 Agent 迁移的同步机制 NM-PL-NS: 移动Agent 每次从位于Home的信箱 中Pull消息 57 9/15/2020 Institute of Computer Software, Nanjing University 57
Mobile IP Solution MAP-Home Reg MAP 58 9/15/2020 Institute of Computer Software, Nanjing University 58
Mobile IP + Synchronization MAP-Home Dereg ACK MAP 9/15/2020 Reg MAP Institute of Computer Software, Nanjing University 59 59
Mobile IP + Synchronization MAP-Home Dereg ACK MAP 9/15/2020 Reg MAP Institute of Computer Software, Nanjing University 60 60
Mobile IP + Synchronization MAP-Home Dereg ACK MAP 9/15/2020 MAP Institute of Computer Software, Nanjing University 61 61
基础框架:协议组合 �基于分布式地址注册的协议 FM-*-SHM (Distributed Home Scheme) JM-PS-FS JM-PL-SHM (ARP:Adaptive and Reliable Protocol) 64 9/15/2020 Institute of Computer Software, Nanjing University 64
Distributed Home Scheme MAP-1 MAP-2 MAP-3 MAP-5 MAP-4 65 9/15/2020 Institute of Computer Software, Nanjing University 65
Distributed Home Scheme MAP-1 MAP-2 MAP-3 MAP-5 MAP-4 66 9/15/2020 Institute of Computer Software, Nanjing University 66
Distributed Home Scheme MAP-1 MAP-2 MAP-3 MAP-5 MAP-4 67 9/15/2020 Institute of Computer Software, Nanjing University 67
Distributed Home Scheme �优点 位置透明,可靠 对Agent Home的依赖减少 没有三角路由问题 �缺点 迁移代价大 迁移延迟大 68 9/15/2020 Institute of Computer Software, Nanjing University 68
ARP (Adaptive and Reliable Protocol) 协议 �基本思路 �协议性质 �分析 MB MAP MAP 69 9/15/2020 Institute of Computer Software, Nanjing University 69
The ARP Protocol �位置更新 Pathm(A) 上的每个节点设置地址表,维护agent A的信箱物理 地址和状态 ▪ Patha(R)={home, h 1, h 2, h 3, h 4} ▪ Pathm(R)={home, h 1, h 3} Agent: R MB Home R Agent: R MB H 2 H 1 MB Receiver R H 4 H 3 9/15/2020 Agent: R Institute of Computer Software, Nanjing University 70 70
位置更新 R MB Home R H 1 MB R H 2 Receiver R MB H 3 R H 4 9/15/2020 R H 5 Institute of Computer Software, Nanjing University 72
位置更新 ACK deregister R MB Home 9/15/2020 Receiver h 1 MB Receiver h 2 h 3 Receiver h 4 h 5 Institute of Computer Software, Nanjing University MB 74
位置更新 update ACK deregister R MB Home Receiver h 1 MB Receiver h 2 h 3 MB register 9/15/2020 Receiver h 4 h 5 Institute of Computer Software, Nanjing University MB 76
The ARP Protocol – Basic Idea 更新接受者信 存有接受者信 箱地址H 1 箱地址H 2 Sender MAP Receiver’s MB MAP H 1 得知接受者 信箱地址H 2 9/15/2020 Institute of Computer Software, Nanjing University Receiver’s MB MAP H 2 79 79
比较 83 9/15/2020 Institute of Computer Software, Nanjing University 83
References � Jiannong Cao, Xinyu Feng, Jian Lu, Sajal K. Das: Mailbox-Based Scheme for Designing Mobile Agent Communication Protocols. IEEE Computer 35(9): 54 -60 (2002) � Jiannong Cao, Xinyu Feng, Jian Lü, Henry C. B. Chan, Sajal K. Das: Reliable Message Delivery for Mobile Agents: Push or Pull. ICPADS 2002: 314 -320 � Jiannong Cao, Xinyu Feng, Jian Lu, Henry C. B. Chan, Sajal K. Das: Reliable message delivery for mobile agents: push or pull? IEEE Transactions on Systems, Man, and Cybernetics, Part A 34(5): 577 -587 (2004) 85 9/15/2020 Institute of Computer Software, Nanjing University 85
- Slides: 85