init
@@ -0,0 +1,77 @@
|
|||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# .env.example — committable template for the multi-agent-mux-* skills
|
||||||
|
#
|
||||||
|
# This file is tracked in git and contains NO secrets. To get a working local
|
||||||
|
# config, copy it to `.env` (which is git-ignored) and edit as needed:
|
||||||
|
#
|
||||||
|
# scripts/generate-env.sh # creates .env from this template if absent
|
||||||
|
# # or manually: cp .env.example .env
|
||||||
|
#
|
||||||
|
# Every variable below is OPTIONAL. The skills already resolve sane defaults
|
||||||
|
# (shown after each `#default:` line), so an unset/commented variable just keeps
|
||||||
|
# the built-in behaviour. Uncomment + edit only the ones you want to override.
|
||||||
|
#
|
||||||
|
# SECURITY: never put real secrets in this template. Secret-bearing vars use a
|
||||||
|
# `replace_me` placeholder — fill them in only in your local `.env`.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# Workspace / runtime paths
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Single source of truth for the agent session registry YAML.
|
||||||
|
#default: <workspace>/.mam/agent-sessions.yaml
|
||||||
|
# AGENT_SESSIONS_YAML=/path/to/workspace/.mam/agent-sessions.yaml
|
||||||
|
|
||||||
|
# Where the monitor (reconcile.sh) keeps its drift-state cache.
|
||||||
|
#default: <workspace>/.cache/multi-agent-mux-monitor
|
||||||
|
# AGENT_SESSIONS_STATE_DIR=/path/to/workspace/.cache/multi-agent-mux-monitor
|
||||||
|
|
||||||
|
# Root directory that holds Claude Code per-project conversation logs (*.jsonl).
|
||||||
|
#default: $HOME/.claude/projects
|
||||||
|
# CLAUDE_PROJECT_DIR=$HOME/.claude/projects
|
||||||
|
|
||||||
|
# Directory scanned for per-session launcher wrappers (~/.local/bin/<session>).
|
||||||
|
#default: $HOME/.local/bin
|
||||||
|
# LOCAL_BIN=$HOME/.local/bin
|
||||||
|
|
||||||
|
# tmux server socket name (`tmux -L <name>`). "default" = the normal tmux server
|
||||||
|
# (no -L). Set this to opt into an isolated server for all skill tmux calls.
|
||||||
|
#default: default
|
||||||
|
# TMUX_SERVER_NAME=default
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# delegate-job / MQTT broker
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# MQTT broker host the delegate-job publisher/subscriber connects to.
|
||||||
|
#default: broker.hivemq.com
|
||||||
|
# MQTT_BROKER=broker.hivemq.com
|
||||||
|
|
||||||
|
# Broker auth username. Leave unset for anonymous brokers.
|
||||||
|
#default: (unset → anonymous)
|
||||||
|
# MQTT_USERNAME=replace_me
|
||||||
|
|
||||||
|
# Broker auth password. SECRET — fill in only in your local .env, never commit.
|
||||||
|
#default: (unset → anonymous)
|
||||||
|
# MQTT_PASSWORD=replace_me
|
||||||
|
|
||||||
|
# Prefix for generated MQTT client ids (publisher/subscriber/monitor).
|
||||||
|
#default: hermes
|
||||||
|
# MQTT_CLIENT_ID_PREFIX=hermes
|
||||||
|
|
||||||
|
# Path to a CA bundle for TLS broker verification (set MQTT_TLS=1 to use TLS).
|
||||||
|
#default: (unset → no custom CA)
|
||||||
|
# MQTT_CA_CERTS=/path/to/ca.crt
|
||||||
|
|
||||||
|
# Client certificate for mutual-TLS brokers.
|
||||||
|
#default: (unset → no client cert)
|
||||||
|
# MQTT_CERTFILE=/path/to/client.crt
|
||||||
|
|
||||||
|
# Client private key for mutual-TLS brokers. SECRET — keep the key file private.
|
||||||
|
#default: (unset → no client key)
|
||||||
|
# MQTT_KEYFILE=/path/to/client.key
|
||||||
|
|
||||||
|
# Directory for delegate-job audit logs (sits beside .mam/jobs/).
|
||||||
|
#default: <cwd>/.mam/delegate_job_logs
|
||||||
|
# DELEGATE_JOB_LOGS_DIR=/path/to/workspace/.mam/delegate_job_logs
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.env
|
||||||
|
.venv/
|
||||||
|
.mam/*.db
|
||||||
|
.mam/*.db-wal
|
||||||
|
.mam/*.db-shm
|
||||||
|
.mam/*.bak
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
# AGENT.md
|
||||||
|
|
||||||
|
본 문서는 새로운 프로젝트에 **MQTT 메시징 백플레인 및 Tmux 기반 멀티 에이전트 오케스트레이션 워크플로우**를 도입하고, 협업하는 에이전트들이 일관된 규칙과 아키텍처에 따라 안전하고 견고하게 작업을 수행할 수 있도록 정의한 공통 지침 및 규약입니다.
|
||||||
|
|
||||||
|
새로운 프로젝트에서 작업하는 모든 에이전트는 작업을 시작하기 전 이 문서를 반드시 정독하고 규약을 준수해야 합니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 에이전트의 역할 정의 (Agent Roles)
|
||||||
|
|
||||||
|
역할군 간의 책임 및 권한을 명확히 분리하여 병목을 줄이고 작업의 완성도를 높입니다.
|
||||||
|
|
||||||
|
### 👤 Project Manager (PM / Orchestrator)
|
||||||
|
- **주요 책무**: 사용자 요구사항 접수, 상세 작업 계획 수립, 작업자 할당/지시, 전체 워크플로우 통제 및 최종 결과 보고.
|
||||||
|
- **모호성 제거**: 사용자의 요구사항에 모호한 부분이 있다면 작업을 추측하여 진행하지 말고, 즉시 사용자에게 질문하여 명확히 해야 합니다 (`/grill-me` 슬래시 명령어 권장).
|
||||||
|
- **피드백 루프 조정**: Reviewer들의 검증 의견을 분석하여 개선 방향을 의사결정합니다. 결정하기 까다로운 기술적 난제는 Worker 및 Reviewer들의 조사를 거쳐 PM 본인의 판단을 더한 최종 보고서를 작성해 사용자에게 제시하고 프로젝트의 방향을 결정합니다.
|
||||||
|
- **자가 치유 (Hermes Fallback Fix)**: Reviewer가 지적한 결함이 아주 경미하거나 단순 오탈자/설정 누락인 경우, Worker에게 재할당하지 않고 PM이 직접 소스코드를 수정하여 전체 왕복(Round-trip) 비용을 최소화합니다.
|
||||||
|
|
||||||
|
### 🛠️ Worker (Implementation Agent)
|
||||||
|
- **주요 책무**: PM으로부터 위임받은 구체적인 비즈니스 로직 설계 및 소스코드 구현.
|
||||||
|
- **협업 및 소통**: 할당받은 업무 범위에서 구현 방향이 모호하거나 인터페이스 설계 변경이 필요한 경우 PM에게 질문하여 합의를 이룬 후 수술적(Surgical) 변경을 적용합니다.
|
||||||
|
- **계약 준수**: PM이 전달한 단일 작업 지침(Brief) 및 고유 Job ID 규약을 준수하며, 작업 시작 시 `started`, 종료 시 `completed`/`error` 이벤트를 백플레인에 발행해야 합니다.
|
||||||
|
|
||||||
|
### 🔍 Reviewer (Verification Agent)
|
||||||
|
- **주요 책무**: Worker가 제출한 소스코드 변경 사항(Diff)과 구현 명세를 검증하고, 보안 결함 탐지, 성능 개선안 도출 및 설계 일관성을 심사하는 조력자.
|
||||||
|
- **구체적 대안 제시**: 단순한 반려(`NOT PASS`) 통보를 금지하며, 문제를 제기할 때는 **안정적이고 검증된 구체적인 코드 대안(Alternative Code)이나 해결 방안을 반드시 함께 제시**해야 합니다.
|
||||||
|
- **교차 검증의 상호보완성**: 에이전트의 모델 특성(예: Flash 계열은 의미론적 셸 결함 포착에 강하고, Opus/Sonnet 계열은 API 서명 및 논리 회귀 분석에 강함)을 살려 병렬로 상호보완적 심사를 수행합니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 메시징 백플레인 & 레지스트리 규약
|
||||||
|
|
||||||
|
에이전트 간의 비동기 소통과 상태 관리는 분산 이벤트 채널 및 파일/DB 레지스트리를 통해 제어됩니다.
|
||||||
|
|
||||||
|
### 📡 MQTT 백플레인 (MQTT Backplane)
|
||||||
|
- **이벤트 라이프사이클**:
|
||||||
|
- `started` (작업 개시) ➡️ `progress`/`permission_required` (진행 상황 공유) ➡️ `completed` (성공 종료) 또는 `error` (실패 종료)
|
||||||
|
- `completed` 및 `error`는 단 한 번만 발행되는 단말(Terminal) 이벤트입니다.
|
||||||
|
- **메시지 발행/구독 규칙**:
|
||||||
|
- MQTT는 영속 큐를 보장하지 않으므로, 에이전트 구동 전 **반드시 구독자(`job_subscriber.py`)가 먼저 백그라운드에서 대기**해야 합니다 (Subscribe-before-Publish 원칙).
|
||||||
|
- 단말 이벤트 발행 시 브로커에 `retain=True`로 영속화하여 늦게 합류한 구독자도 최종 상태를 읽을 수 있도록 조치합니다.
|
||||||
|
- 전송 데이터에는 비밀번호, 개인키 등의 중요 비밀 정보나 절대 경로가 포함되지 않도록 보편화(Generalised)해야 합니다.
|
||||||
|
|
||||||
|
### 🗃️ 레지스트리 및 상태 관리
|
||||||
|
- 본 아키텍처는 목적에 따라 두 가지 레지스트리를 분리하여 운영합니다:
|
||||||
|
- **잡 레지스트리 (Job Registry)**: 각 비동기 잡의 메타데이터와 생명주기는 개별 JSON 파일(`.mam/jobs/<id>.json`)로 기록되며, 다중 세션 간의 동시 청구(claiming) 경합은 파일 단위의 `fcntl` advisory lock(`registry_lock` via `registry.py`)을 통해 방어합니다.
|
||||||
|
- **세션 레지스트리 (Session Registry)**: TMUX 모니터링 상태 및 에이전트 구동 정보는 SQLite WAL 데이터베이스(`.mam/agent-sessions.db`)를 통해 단일 호스트 내에서 안정적인 동시 트랜잭션으로 일관되게 제어합니다. 단, SQLite WAL 모드는 NFS(네트워크 파일 시스템) 환경에서는 완전한 파일 락이 보장되지 않으므로 로컬 파일 시스템 사용을 권장합니다.
|
||||||
|
|
||||||
|
### 🛡️ 보안 프로토콜 (HMAC-SHA256)
|
||||||
|
- **무인증 PoC 모드**: 잡 레지스트리 생성 시 `auth_token`이 `null`로 지정된 경우(PoC 기본 모드), 별도의 서명 검증을 생략하고 모든 이벤트를 수용합니다 (`verify_hmac`이 항상 `True`를 반환).
|
||||||
|
- **인증 Production 모드**: 실배포 환경이나 인증이 필요한 연동 단계에서는 각 잡마다 고유 암호화 토큰(`auth_token`)을 발급합니다. 퍼블리셔는 이 토큰을 키로 삼아 `hmac_sig` 서명을 페이로드에 동반해야 하며, 수신단(`verify_hmac`)에서 서명이 없거나 일치하지 않는 메시지는 즉시 드랍하여 다운그레이드 공격을 원천 차단합니다.
|
||||||
|
- **롤아웃 전략**: 보안 스킴 갱신 시 송수신 노드 간 불일치로 인한 이벤트 드랍을 피하기 위해, 과도기적 하이브리드 포맷 전송(평문 유출 위험 있음)을 배제하고 **모든 노드를 일제히 업데이트하는 "동시 롤아웃(Simultaneous Rollout)"**을 채택해야 합니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 협업 워크플로우 실행 절차 (Workflow Loop)
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
autonumber
|
||||||
|
actor User as 사용자
|
||||||
|
participant PM as Project Manager
|
||||||
|
participant W as Worker
|
||||||
|
participant R as Reviewers
|
||||||
|
participant M as MQTT Backplane
|
||||||
|
|
||||||
|
User->>PM: 요구사항 전달
|
||||||
|
Note over PM: grill-me 및 계획 수립
|
||||||
|
PM->>M: Job 등록 및 Subscriber 구동
|
||||||
|
PM->>W: 작업 위임 (Job ID & Brief 전달)
|
||||||
|
W->>M: 'started' 이벤트 발행
|
||||||
|
Note over W: 코드 변경 및 구현
|
||||||
|
W->>M: 'completed' (혹은 'error') 발행
|
||||||
|
PM->>R: 병렬 리뷰 요청 (Diff 전달)
|
||||||
|
Note over R: 교차 분석 & 검증
|
||||||
|
alt 결함 발견
|
||||||
|
R->>PM: NOT PASS (대안 포함 피드백)
|
||||||
|
Note over PM: 경미한 결함은 PM이 직접 수정
|
||||||
|
PM->>W: 피드백 반영 및 재할당
|
||||||
|
else 검증 통과
|
||||||
|
R->>PM: PASS
|
||||||
|
end
|
||||||
|
PM->>User: 최종 검증 통과 보고 & 커밋
|
||||||
|
```
|
||||||
|
|
||||||
|
1. **계획 수립 및 할당**: PM은 사용자 요청을 구체화하고 의존성이 겹치지 않는 범위에서 잡을 정의합니다.
|
||||||
|
2. **작업 개시 및 통보**: PM은 구독자를 띄운 뒤 Worker 세션에 잡을 인가하며, Worker는 로직을 수행하고 단말 이벤트를 전송해 세션을 자동 종료합니다.
|
||||||
|
3. **교차 검수 반복 (Review Loop)**: PM은 작업 완료 후 변경분을 Reviewer 에이전트들에게 병렬 회람시킵니다. 리뷰어 전원이 `PASS` 의견을 낼 때까지 수정-반려 주기를 무한 반복(Loop)하여 코드 완성도를 보증합니다.
|
||||||
|
4. **릴리즈 및 정리**: 검증이 완료된 코드는 Git에 커밋하고, 임시 세션 리소스를 회수합니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 분석 인프라 패턴 & 실무 가이드 (Infra Patterns)
|
||||||
|
|
||||||
|
장기 실행 에이전트 분석 중 발생하는 유실 및 인프라적 장애를 예방하기 위한 중요 지침입니다.
|
||||||
|
|
||||||
|
### 📸 TUI 뷰포트 절단 방지 (Pane Snapshotting 3대 규칙)
|
||||||
|
TMUX 환경에서 실행되는 에이전트가 화면 스크롤 한계로 인해 이전 출력이나 장문의 디버깅 로그를 잃지 않도록 아래의 **스냅샷 패턴을 의무적으로 수행**합니다.
|
||||||
|
1. **Pre-brief Capture**: 작업 지침(Brief)을 전송한 직후, 즉시 해당 세션의 pane을 캡처(`capture-pane -S -200`)해두어 입력 기록의 시작점을 백업합니다.
|
||||||
|
2. **Loop Snapshot**: 장기 실행(5분 이상) 중인 에이전트 세션의 경우, 주기적으로(예: 30초마다) 뷰포트를 스캔하여 증분 데이터를 `/tmp/pane-snap.txt`에 계속 누적(append) 기록합니다.
|
||||||
|
3. **Post-job Capture**: 잡 완료/에러 반환 즉시 전체 pane 상태를 마지막으로 캡처하여 전체 작업 궤적을 보존합니다.
|
||||||
|
|
||||||
|
### 📄 장문 브리핑 전달 방식
|
||||||
|
- TMUX `send-keys`나 입력 버퍼를 통해 수백 줄의 장문 지시나 프롬프트를 직렬로 입력하면, 에이전트의 TUI가 이를 모두 온전히 소화하지 못하고 일부 문자나 문단이 탈취/누락될 수 있습니다.
|
||||||
|
- **해결 지침**: 지시 사항이 긴 경우, 반드시 `/tmp/brief-<job_id>.md` 등의 파일 경로로 지시문을 별도 작성해 전달하고, 에이전트에는 `"Read /tmp/brief-... and execute"` 라는 단순화된 실행 명령만 전달하십시오.
|
||||||
|
|
||||||
|
### ⏱️ 타임아웃 구성 및 정렬 규칙
|
||||||
|
- **잡 실행 제한 (`timeout_sec` & `idle_timeout_sec`)**: 각 잡은 전체 실행 만료 시간(`timeout_sec`, 기본 3600s)과 메세지 미수신 유휴 시간(`idle_timeout_sec`, 기본 120s)을 독립적으로 가집니다.
|
||||||
|
- **모니터 유휴 대기 (`SUB_IDLE_TIMEOUT`)**: 모니터 스크립트(`reconcile.sh`)의 유휴 대기 시간(`SUB_IDLE_TIMEOUT`) 기본값은 잡 최대 예산에 맞춰 `3600s`(1시간) 이상으로 항상 넉넉히 설정해야 합니다. 모니터가 작업 완료 전에 유휴 감지로 조기 자동 종료되어 백그라운드 태스크 관리를 소실하는 문제를 방지하기 위함입니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 새 프로젝트 적용 체크리스트 (Setup Checklist)
|
||||||
|
|
||||||
|
새 프로젝트에 이 에이전트 오케스트레이션 모델을 구축할 때의 체크리스트입니다.
|
||||||
|
|
||||||
|
- [ ] **가상환경 의존성**: `pyyaml`, `paho-mqtt` 등 필요한 Python 패키지가 `.venv` 또는 `requirements.txt`에 포함되었는가?
|
||||||
|
- [ ] **환경 설정 파일**: MQTT 브로커 주소 및 보안 Credential이 `.env` 파일에 안전하게 로드되고 공유되는가?
|
||||||
|
- [ ] **디렉토리 규약**: 레지스트리 경로(`.mam/jobs/`) 및 로깅 경로(`.mam/delegate_job_logs/`)가 `.gitignore`에 등록되었는가?
|
||||||
|
- [ ] **스크립트 구비**: `mqtt_common.py`, `publish_event.py`, `job_subscriber.py`, `registry.py` 등의 핵심 모듈이 배치되었는가?
|
||||||
|
- [ ] **HMAC 활성화**: 새로운 레지스트리 잡 발급 시 난수 기반의 `auth_token`이 정상적으로 주입되고, 서명 기반의 상호 인증이 활성화되는가?
|
||||||
|
- [ ] **운영 헌장 배치**: 본 규약 파일(`AGENT.md`)이 새 프로젝트의 **최상위 루트(Root) 디렉터리**에 배치되었는가? (협업을 수행하는 에이전트들이 온보딩 시 규칙을 가장 먼저 인지할 수 있도록 루트 경로 배치가 필수적입니다.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*본 가이드는 협업 효율성과 코드 보안의 엄격한 균형을 유지하기 위한 규범입니다. 변경 사항이 필요한 경우 PM 및 Reviewer의 전원 합의를 거쳐 본 문서를 업데이트해야 합니다.*
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
# AGENT.md
|
||||||
|
|
||||||
|
This document serves as the common guidelines and protocol for introducing the **MQTT messaging backplane and Tmux-based multi-agent orchestration workflow** to a new project. It defines the rules and architecture to ensure collaborating agents perform tasks safely, robustly, and consistently.
|
||||||
|
|
||||||
|
All agents working on a new project must read this document thoroughly and comply with the defined protocols before starting any tasks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Agent Roles Definition (Agent Roles)
|
||||||
|
|
||||||
|
We clearly separate responsibilities and permissions between roles to reduce bottlenecks and enhance the quality of execution.
|
||||||
|
|
||||||
|
### 👤 Project Manager (PM / Orchestrator)
|
||||||
|
- **Core Responsibility**: Receive user requirements, establish detailed task plans, assign and instruct workers, control the overall workflow, and report final results.
|
||||||
|
- **Ambiguity Resolution**: If a user's requirements contain ambiguous details, do not guess. Immediately ask the user for clarification (we recommend using the `/grill-me` slash command).
|
||||||
|
- **Feedback Loop Adjustment**: Analyze verification feedback from Reviewers to decide on improvement paths. For complex technical challenges, direct Workers and Reviewers to research options, add the PM's own assessment, and present a final report to the user to decide the project's direction.
|
||||||
|
- **Self-Healing (Hermes Fallback Fix)**: If a defect pointed out by a Reviewer is extremely minor or is a simple typo/configuration omission, the PM should directly fix the source code instead of reassigning it to the Worker, thereby minimizing the round-trip cost.
|
||||||
|
|
||||||
|
### 🛠️ Worker (Implementation Agent)
|
||||||
|
- **Core Responsibility**: Design business logic and implement source code as delegated by the PM.
|
||||||
|
- **Collaboration & Communication**: If the implementation path is ambiguous or interface design changes are required within the assigned scope, ask the PM for consensus before applying surgical changes.
|
||||||
|
- **Contract Adherence**: Comply with the single task instructions (Brief) and the unique Job ID convention provided by the PM. Workers must publish a `started` event when starting work, and a `completed` or `error` event to the backplane upon termination.
|
||||||
|
|
||||||
|
### 🔍 Reviewer (Verification Agent)
|
||||||
|
- **Core Responsibility**: Verify source code changes (Diff) and implementation specifications submitted by Workers. Reviewers act as facilitators by detecting security vulnerabilities, proposing performance improvements, and examining design consistency.
|
||||||
|
- **Provide Concrete Alternatives**: Simply rejecting changes (`NOT PASS`) is forbidden. When raising an issue, Reviewers must propose a **concrete, stable, and verified alternative code block or solution**.
|
||||||
|
- **Complementary Cross-Verification**: Leverage the unique characteristics of different agent models (e.g., Flash-class models are skilled at capturing semantic shell bugs, while Opus/Sonnet-class models excel at API signatures and logical regression analysis) to perform parallel and mutually-supportive reviews.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Messaging Backplane & Registry Protocol
|
||||||
|
|
||||||
|
Asynchronous communication and state management between agents are controlled via distributed event channels and file/DB registries.
|
||||||
|
|
||||||
|
### 📡 MQTT Backplane
|
||||||
|
- **Event Lifecycle**:
|
||||||
|
- `started` (Job execution starts) ➡️ `progress`/`permission_required` (Share intermediate progress) ➡️ `completed` (Successful termination) or `error` (Failed termination)
|
||||||
|
- `completed` and `error` are terminal events that are published exactly once.
|
||||||
|
- **Publish/Subscribe Rules**:
|
||||||
|
- Since MQTT does not guarantee persistent queues, the subscriber (`job_subscriber.py`) **must be running in the background before the agent starts** (the Subscribe-before-Publish principle).
|
||||||
|
- When publishing terminal events, publish with `retain=True` on the broker so that subscribers joining late can still read the final state.
|
||||||
|
- Generalize all transmitted data to ensure that sensitive secrets like passwords, private keys, or absolute system paths are not included.
|
||||||
|
|
||||||
|
### 🗃️ Registry & State Management
|
||||||
|
- This architecture maintains two distinct registries based on their purpose:
|
||||||
|
- **Job Registry**: The metadata and lifecycle of each asynchronous job are recorded in individual JSON files (`.mam/jobs/<id>.json`). Concurrency conflicts (claiming races) across multiple sessions are prevented via file-based `fcntl` advisory locks (`registry_lock` via `registry.py`).
|
||||||
|
- **Session Registry**: TMUX monitoring states and running agent metadata are consistently controlled using a SQLite WAL database (`.mam/agent-sessions.db`) to support reliable concurrent transactions on a single host. However, since SQLite WAL mode does not guarantee complete file locking in Network File System (NFS) environments, we recommend using a local file system.
|
||||||
|
|
||||||
|
### 🛡️ Security Protocol (HMAC-SHA256)
|
||||||
|
- **Unauthenticated PoC Mode**: If the `auth_token` in the job registry is set to `null` (the default PoC mode), signature verification is skipped and all events are accepted (`verify_hmac` always returns `True`).
|
||||||
|
- **Authenticated Production Mode**: In production environments or integrations requiring authentication, a unique cryptographic token (`auth_token`) is issued for each job. The publisher must include an `hmac_sig` signature in the payload keyed by this token, and the receiving end (`verify_hmac`) will immediately drop messages that lack a signature or have mismatching signatures to prevent downgrade attacks.
|
||||||
|
- **Rollout Strategy**: To avoid event drops caused by inconsistencies between publishing and receiving nodes when updating security schemes, hybrid transition formats (which risk leaking plaintext tokens) must not be used. Instead, adopt a **"Simultaneous Rollout"** where all nodes are updated at once.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Collaborative Workflow Execution Loop (Workflow Loop)
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
autonumber
|
||||||
|
actor User as User
|
||||||
|
participant PM as Project Manager
|
||||||
|
participant W as Worker
|
||||||
|
participant R as Reviewers
|
||||||
|
participant M as MQTT Backplane
|
||||||
|
|
||||||
|
User->>PM: Hand over requirements
|
||||||
|
Note over PM: Run grill-me & plan tasks
|
||||||
|
PM->>M: Register Job & start Subscriber
|
||||||
|
PM->>W: Delegate task (Provide Job ID & Brief)
|
||||||
|
W->>M: Publish 'started' event
|
||||||
|
Note over W: Modify code & implement
|
||||||
|
W->>M: Publish 'completed' (or 'error')
|
||||||
|
PM->>R: Request parallel review (Provide Diff)
|
||||||
|
Note over R: Cross-analysis & verification
|
||||||
|
alt Defect Found
|
||||||
|
R->>PM: NOT PASS (Feedback with alternatives)
|
||||||
|
Note over PM: PM directly fixes minor defects
|
||||||
|
PM->>W: Apply feedback & re-delegate
|
||||||
|
else Verification Pass
|
||||||
|
R->>PM: PASS
|
||||||
|
end
|
||||||
|
PM->>User: Report final pass & commit changes
|
||||||
|
```
|
||||||
|
|
||||||
|
1. **Planning and Allocation**: The PM defines requirements and outlines independent jobs to avoid conflicting dependencies.
|
||||||
|
2. **Execution and Notification**: The PM launches a subscriber, then assigns the job to a Worker session. The Worker performs the logic and sends a terminal event, automatically closing the session.
|
||||||
|
3. **Cross-Verification Iteration (Review Loop)**: Once the task is complete, the PM circulates the changes to the Reviewer agents in parallel. The modify-reject cycle repeats until all reviewers yield a `PASS`, ensuring high-quality code.
|
||||||
|
4. **Release and Cleanup**: Code that passes verification is committed to Git, and temporary session resources are reclaimed.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Analysis Infrastructure Patterns & Practical Guide (Infra Patterns)
|
||||||
|
|
||||||
|
These are critical instructions for preventing data loss and infrastructure-level failures during long-running agent analyses.
|
||||||
|
|
||||||
|
### 📸 Preventing TUI Viewport Truncation (The 3 Pane Snapshotting Rules)
|
||||||
|
To ensure that agents running in TMUX environments do not lose debug logs or previous outputs due to screen scrollback limits, the following **snapshotting pattern must be enforced**:
|
||||||
|
1. **Pre-brief Capture**: Capture the pane (`capture-pane -S -200`) immediately after sending the task instruction (Brief) to back up the starting point of the input history.
|
||||||
|
2. **Loop Snapshot**: For long-running agent sessions (5 minutes or more), periodically (e.g., every 30 seconds) scan the viewport and append the incremental data to `/tmp/pane-snap.txt`.
|
||||||
|
3. **Post-job Capture**: Capture the complete pane state one final time immediately after a job completes or returns an error to preserve the entire execution trajectory.
|
||||||
|
|
||||||
|
### 📄 Handling Long Briefing Instructions
|
||||||
|
- Sending long instructions or prompts (hundreds of lines) sequentially via TMUX `send-keys` or input buffers can overwhelm the agent's TUI, leading to lost characters or truncated paragraphs.
|
||||||
|
- **Resolution**: If instructions are long, write them separately to a file path (e.g., `/tmp/brief-<job_id>.md`) and send a simplified execution command to the agent: `"Read /tmp/brief-... and execute"`.
|
||||||
|
|
||||||
|
### ⏱️ Timeout Configuration & Alignment Rules
|
||||||
|
- **Job Execution Limits (`timeout_sec` & `idle_timeout_sec`)**: Each job independently manages its overall execution timeout (`timeout_sec`, default 3600s) and idle timeout without receiving messages (`idle_timeout_sec`, default 120s).
|
||||||
|
- **Monitor Idle Waiting (`SUB_IDLE_TIMEOUT`)**: The idle timeout for the monitor script (`reconcile.sh`), `SUB_IDLE_TIMEOUT`, must always be set generously to `3600s` (1 hour) or more to align with the maximum job budget. This prevents the monitor from terminating early due to idle detection, which would lose control over background tasks before they finish.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Setup Checklist for New Projects (Setup Checklist)
|
||||||
|
|
||||||
|
Use this checklist when deploying this agent orchestration model to a new project:
|
||||||
|
|
||||||
|
- [ ] **Virtualenv Dependencies**: Are required Python packages like `pyyaml` and `paho-mqtt` included in `.venv` or `requirements.txt`?
|
||||||
|
- [ ] **Configuration File**: Are the MQTT broker address and security credentials safely loaded and shared via the `.env` file?
|
||||||
|
- [ ] **Directory Convention**: Are the registry path (`.mam/jobs/`) and logging path (`.mam/delegate_job_logs/`) added to `.gitignore`?
|
||||||
|
- [ ] **Core Scripts**: Are the core scripts (`mqtt_common.py`, `publish_event.py`, `job_subscriber.py`, and `registry.py`) in place?
|
||||||
|
- [ ] **HMAC Enablement**: When a new registry job is created, is a random `auth_token` correctly injected, and is signature-based mutual authentication active?
|
||||||
|
- [ ] **Charter Placement**: Is this protocol file (`AGENT.md`) placed in the **top-level root directory** of the new project? (Placing it at the root is essential so that onboarding agents can recognize the rules immediately.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*This guide balances collaboration efficiency with strict code security. Any required changes must be discussed and agreed upon by the PM and all Reviewers before updating this document.*
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
# BOOTSTRAP.md
|
||||||
|
|
||||||
|
본 문서는 `tmux_agent_orchestration` 오케스트레이션 및 메시징 백플레인 워크플로우를 새로운 프로젝트에 도입하여 이식하고, 새로운 개발자/에이전트가 초기 가동을 시작할 때 수행해야 하는 환경 설정 및 구축 절차를 안내합니다.
|
||||||
|
|
||||||
|
새로운 에이전트는 이 안내서에 기술된 절차를 순차적으로 실행하여 초기 환경을 안정적으로 설정할 수 있습니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 프로젝트 구조 이해 (Scaffolding Overview)
|
||||||
|
|
||||||
|
본 프로젝트를 새로운 환경에 복제(Clone)한 후, 핵심 구성 요소들의 위치와 역할을 먼저 파악해야 합니다.
|
||||||
|
|
||||||
|
* `.agents/skills/`: 멀티 에이전트 구동 및 비동기 잡 처리를 수행하는 셸 스크립트 모음
|
||||||
|
* `lib.sh`: 오케스트레이션의 핵심 셸 함수 및 가상환경(venv) 자동 연동 라이브러리
|
||||||
|
* `multi-agent-mux-create/`: 격리된 tmux 에이전트 세션을 시작하는 스크립트
|
||||||
|
* `multi-agent-mux-stop/`: 세션을 정상적으로 중지하고 상태를 업데이트하는 스크립트
|
||||||
|
* `multi-agent-mux-resume/`: 중지된 에이전트 세션을 이전 대화 상태 그대로 복원하는 스크립트
|
||||||
|
* `multi-agent-mux-status/`: 전체 에이전트 세션의 현재 구동 상태를 조회하는 스크립트
|
||||||
|
* `multi-agent-mux-monitor/`: tmux 상태와 레지스트리 상태를 동기화하는 모니터 스크립트
|
||||||
|
* `multi-agent-mux-delegate-job/`: 비동기 잡 분할 실행 모듈
|
||||||
|
* `requirements.txt`: Python 의존성 목록 (paho-mqtt, pyyaml)
|
||||||
|
* `scripts/`: 핵심 비즈니스 로직을 구동하는 Python 스크립트 디렉터리
|
||||||
|
* `registry.py`: 잡의 등록, 클레임 및 원자적 파일 락 제어 (CLI 지원)
|
||||||
|
* `job_subscriber.py`: 백그라운드 이벤트 구독기 및 오디팅 로그 생성기
|
||||||
|
* `publish_event.py`: 실행 상태 및 에러 트랩 시 이벤트 퍼블리셔
|
||||||
|
* `mqtt_common.py`: 공통 MQTT 브로커 연결 유틸리티
|
||||||
|
* `AGENT.md`: 에이전트 간의 역할 분담(PM, Worker, Reviewer) 및 이벤트 발행 규약 정의
|
||||||
|
* `MESSAGING.md`: 에이전트 간 주고받는 MQTT 메시지 와이어 스킴 가이드라인
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 환경 설정 파일 생성 (.env)
|
||||||
|
|
||||||
|
메시징 브로커 설정 및 실행 경로를 설정하기 위해 로컬 환경 설정 파일(`.env`)을 생성하고 수정해야 합니다.
|
||||||
|
|
||||||
|
### 단계 2.1: 자동 생성 스크립트 실행
|
||||||
|
프로젝트 루트에서 제공되는 환경 설정 템플릿 복사 스크립트를 실행합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# .env.example를 .env로 자동 복제 (이미 존재하면 덮어쓰지 않고 보호됨)
|
||||||
|
./scripts/generate-env.sh
|
||||||
|
|
||||||
|
# 만약 강제로 덮어쓰고 백업을 생성하고 싶은 경우:
|
||||||
|
./scripts/generate-env.sh --force
|
||||||
|
```
|
||||||
|
|
||||||
|
### 단계 2.2: 환경 변수 수정 및 설정
|
||||||
|
생성된 `.env` 파일을 열어 설정을 필요에 따라 구성합니다.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> `generate-env.sh`로 생성된 기본 `.env` 파일은 모든 환경 변수 항목이 주석 처리되어 있습니다. 주석 처리된 상태로 둘 경우 로컬 프로젝트 루트를 기준으로 한 상대 경로(`.mam/` 등) 및 기본 공개 브로커 주소가 자동 지정되므로 그대로 사용하셔도 무방합니다.
|
||||||
|
|
||||||
|
1. **MQTT Broker 설정 (`MQTT_BROKER`)**:
|
||||||
|
* 기본값은 HiveMQ 공개 브로커(`broker.hivemq.com`)로 잡혀 있으나, 보안 및 프라이버시가 중요한 프로덕션 작업 시에는 개인/사설 브로커 주소로 변경할 것을 강력히 권장합니다.
|
||||||
|
2. **인증 정보 (`MQTT_USERNAME`, `MQTT_PASSWORD`)**:
|
||||||
|
* 보안 브로커를 사용하는 경우 `replace_me`로 명시된 곳을 실제 브로커 계정 정보로 변경해 주십시오.
|
||||||
|
3. **경로 관련 변수 (선택 사항)**:
|
||||||
|
* 특정 빌드 시스템이나 호스트 폴더 구조에 맞추어 `AGENT_SESSIONS_YAML` 및 `DELEGATE_JOB_LOGS_DIR` 등의 경로 값을 절대 경로로 오버라이드해야 하는 경우에만 주석을 풀고 기입하십시오.
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> **보안 모드 기본값 안내**:
|
||||||
|
> 시스템의 기본 설정은 **무인증 PoC 모드**입니다. 잡 등록 시 `auth_token`이 명시적으로 주입되지 않으면(또는 `null`인 경우) HMAC 서명 검증이 생략됩니다.
|
||||||
|
> 공개 브로커 사용 환경이나 실제 프로덕션 단계에서는 잡 등록 시 `auth_token`을 고유 난수값으로 생성 및 주입하여 HMAC 보안 서명을 활성화해야 합니다. (자세한 보안 규약은 [MESSAGING.md](./MESSAGING.md) 및 [AGENT.ko.md](./AGENT.ko.md)의 `2.3 보안 프로토콜` 섹션을 참조하십시오. 현재 CLI를 통한 자동 토큰 생성/주입 기능 지원은 향후 로드맵의 `FW-N6` 과제로 처리 예정입니다.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 의존성 및 가상환경 설정 (Venv Setup)
|
||||||
|
|
||||||
|
오케스트레이션 및 MQTT 메시징을 구동하기 위한 Python 3 의존성을 설정합니다.
|
||||||
|
|
||||||
|
### 단계 3.1: Python 가상환경 구축
|
||||||
|
프로젝트 루트에서 `.venv` 가상환경을 생성하고 활성화합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 가상환경 생성
|
||||||
|
python3 -m venv .venv
|
||||||
|
|
||||||
|
# 가상환경 활성화
|
||||||
|
source .venv/bin/activate
|
||||||
|
```
|
||||||
|
|
||||||
|
### 단계 3.2: 의존성 패키지 설치
|
||||||
|
`multi-agent-mux-delegate-job` 디렉터리에 기재된 `requirements.txt` 의존성 목록을 가상환경에 설치합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 의존성 패키지(pyyaml, paho-mqtt 등) 설치
|
||||||
|
pip install -r .agents/skills/multi-agent-mux-delegate-job/requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 디렉터리 준비 및 보안 감시 가이드
|
||||||
|
|
||||||
|
에이전트 제어 상태 및 잡 기록을 위해 로컬 레지스트리 디렉터리가 정상적으로 생성되었는지 확인합니다.
|
||||||
|
|
||||||
|
1. **필수 로컬 디렉터리 구조**:
|
||||||
|
* `.mam/jobs/`: 등록된 비동기 잡의 세부 메타데이터가 파일 형태로 저장되는 디렉터리
|
||||||
|
* `.mam/delegate_job_logs/`: 에이전트가 발행하는 모든 백플레인 이벤트 흐름이 기록되는 audit log (`events.ndjson`) 보존 디렉터리
|
||||||
|
2. **Git 커밋 제어 (.gitignore)**:
|
||||||
|
* 새 프로젝트 초기화 시 아래 파일들이 절대 리포지토리에 커밋되지 않도록 `.gitignore` 상태를 점검합니다. `!.env.example` 예외 처리가 유지되어야 템플릿이 보존됩니다:
|
||||||
|
```text
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
.mam/
|
||||||
|
.venv/
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 실행 환경 검증 및 부트스트랩 테스트
|
||||||
|
|
||||||
|
환경 구축이 오작동 없이 안전하게 완료되었는지 아래의 체크리스트를 실행해 검증합니다.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> 아래의 모든 검증 명령은 반드시 **프로젝트 루트 디렉터리**(`.mam/` 디렉터리가 직접 보이는 위치)에서 실행해야 합니다. 잡 레지스트리 디렉터리 기본 경로가 프로젝트 루트 하위의 `./.mam/jobs` 상대 경로를 기준으로 탐색되기 때문입니다.
|
||||||
|
|
||||||
|
### 검증 테스트 1: 잡 레지스트리 정상 구동 여부
|
||||||
|
Python 스크립트 및 venv 라이브러리가 올바르게 로드되는지 확인하기 위해 잡 목록을 조회합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 가상환경(.venv) 파이썬 인터프리터를 사용하여 실행
|
||||||
|
.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/registry.py list
|
||||||
|
```
|
||||||
|
* **출력 기대 결과**: 에러 메시지 없이 빈 JSON 배열 `[]` 또는 현재 등록된 pending/running 잡 목록이 성공적으로 출력되어야 합니다.
|
||||||
|
|
||||||
|
### 검증 테스트 2: MQTT 연결 브로커 핸드셰이크 테스트
|
||||||
|
브로커와의 송수신 통신망 상태를 확인하고, 이벤트 생명주기 및 멱등성이 온전히 작동하는지 실측 검증합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. 테스트용 임시 잡 등록 및 발급된 8자리 Hex 잡 ID 획득
|
||||||
|
JID=$(.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/registry.py register \
|
||||||
|
--agent "test-agent" \
|
||||||
|
--prompt "Bootstrap check command" \
|
||||||
|
--timeout 120)
|
||||||
|
echo "Generated Job ID: $JID"
|
||||||
|
|
||||||
|
# 2. 획득한 잡 ID에 대해 백그라운드 이벤트 구독기(Subscriber) 구동
|
||||||
|
.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/job_subscriber.py --job "$JID" &
|
||||||
|
|
||||||
|
# 3. 구독자의 MQTT Broker 소켓 연결 및 수신부 초기화 완료를 보장하기 위해 2초 대기
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# 4. 테스트 시작 이벤트 발행 (Subscribe-before-Publish 원칙 준수)
|
||||||
|
.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/publish_event.py \
|
||||||
|
--job "$JID" \
|
||||||
|
--event started \
|
||||||
|
--detail "Bootstrap MQTT verification connection check"
|
||||||
|
|
||||||
|
# 5. 이벤트 수신이 터미널(stdout) 및 .mam/delegate_job_logs/events.ndjson 로그 파일에 정상 기록되는지 확인
|
||||||
|
|
||||||
|
# 6. 검증 완료 후 백그라운드 프로세스 종료 및 테스트 잡 레코드 수동 정리
|
||||||
|
kill %1
|
||||||
|
rm -f ".mam/jobs/$JID.json" ".mam/jobs/$JID.lock"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 에이전트 온보딩 가이드 (New Agent Onboarding)
|
||||||
|
|
||||||
|
본 환경 구축을 무사히 마쳤다면, 협업하는 에이전트는 즉시 프로젝트 루트에 있는 **[AGENT.ko.md](./AGENT.ko.md)** 문서를 읽어야 합니다.
|
||||||
|
|
||||||
|
해당 문서에는 에이전트가 각 역할(PM, Worker, Reviewer)로 구동될 때 지켜야 할 **수술적 변경 규칙, 교차 검증 통과 규약, Tmux 뷰포트 유실 방지를 위한 스냅샷 패턴** 등이 서술되어 있어 안정적인 멀티 에이전트 워크플로우에 즉시 기여할 수 있도록 돕습니다.
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
# BOOTSTRAP.md
|
||||||
|
|
||||||
|
This document guides you through the setup and initialization procedures required to adopt the `tmux_agent_orchestration` orchestration and messaging backplane workflow in a new project, enabling a new developer or agent to get up and running quickly.
|
||||||
|
|
||||||
|
A new agent can follow the steps in this guide sequentially to establish a stable and reliable initial environment.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Scaffolding Overview (Project Structure)
|
||||||
|
|
||||||
|
Before cloning this project into a new environment, you must first understand the locations and roles of its core components:
|
||||||
|
|
||||||
|
* `.agents/skills/`: A collection of shell scripts that execute multi-agent coordination and asynchronous job processing.
|
||||||
|
* `lib.sh`: The core orchestration shell functions and virtual environment (venv) auto-loading library.
|
||||||
|
* `multi-agent-mux-create/`: Script to launch isolated tmux agent sessions.
|
||||||
|
* `multi-agent-mux-stop/`: Script to gracefully stop agent sessions and update states.
|
||||||
|
* `multi-agent-mux-resume/`: Script to restore stopped agent sessions back to their previous conversation state.
|
||||||
|
* `multi-agent-mux-status/`: Script to query the current running state of all agent sessions.
|
||||||
|
* `multi-agent-mux-monitor/`: Monitor script to sync tmux states with the registry.
|
||||||
|
* `multi-agent-mux-delegate-job/`: Asynchronous job splitting and delegation module.
|
||||||
|
* `requirements.txt`: Python dependency list (`paho-mqtt`, `pyyaml`).
|
||||||
|
* `scripts/`: Python scripts running the core business logic.
|
||||||
|
* `registry.py`: Job registration, claiming, and atomic file lock control (CLI supported).
|
||||||
|
* `job_subscriber.py`: Background event subscriber and audit log generator.
|
||||||
|
* `publish_event.py`: Event publisher for runtime states and error traps.
|
||||||
|
* `mqtt_common.py`: Common utility for connecting to the MQTT broker.
|
||||||
|
* `AGENT.md`: Definition of agent roles (PM, Worker, Reviewer) and event publication rules.
|
||||||
|
* `MESSAGING.md`: Messaging scheme and wire protocol guidelines for MQTT communication between agents.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Environment Configuration (.env)
|
||||||
|
|
||||||
|
To set up the messaging broker and execution paths, you must create and modify a local environment configuration file (`.env`).
|
||||||
|
|
||||||
|
### Step 2.1: Run the Generation Script
|
||||||
|
Run the environment template copy script provided in the project root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Automatically copy .env.example to .env (does not overwrite if it already exists)
|
||||||
|
./scripts/generate-env.sh
|
||||||
|
|
||||||
|
# To force overwrite and create a backup of the existing .env:
|
||||||
|
./scripts/generate-env.sh --force
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2.2: Modify Environment Variables
|
||||||
|
Open the generated `.env` file to configure settings as needed.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> The default `.env` file generated by `generate-env.sh` has all environment variables commented out. If left commented out, the system defaults to using relative paths (`.mam/`, etc.) relative to the local project root, and the public MQTT broker. You can use it as-is without uncommenting anything.
|
||||||
|
|
||||||
|
1. **MQTT Broker Setup (`MQTT_BROKER`)**:
|
||||||
|
* The default broker is HiveMQ's public sandbox broker (`broker.hivemq.com`). However, for production work where security and privacy are critical, we strongly recommend changing this to a private broker address.
|
||||||
|
2. **Authentication Credentials (`MQTT_USERNAME`, `MQTT_PASSWORD`)**:
|
||||||
|
* If using a secured broker, change the placeholders marked `replace_me` to your actual broker credentials.
|
||||||
|
3. **Path Variables (Optional)**:
|
||||||
|
* Uncomment and specify absolute paths for variables like `AGENT_SESSIONS_YAML` and `DELEGATE_JOB_LOGS_DIR` only if you need to override the default relative paths to align with specific build systems or host directories.
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> **Security Mode Default Warning**:
|
||||||
|
> The system's default setting is the **unauthenticated PoC mode**. If an `auth_token` is not explicitly provided (or is `null`) during job registration, HMAC signature verification is skipped.
|
||||||
|
> In a public broker environment or production phase, you must generate and inject a unique random `auth_token` during job registration to enable HMAC signature security. (For detailed security protocols, refer to section `2.3 Security Protocol` in [MESSAGING.md](./MESSAGING.md) and [AGENT.md](./AGENT.md). Automated token generation and injection via CLI is on the roadmap under task `FW-N6`.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Dependency and Virtualenv Setup
|
||||||
|
|
||||||
|
Set up the Python 3 dependencies required to run the orchestration and MQTT messaging backplane.
|
||||||
|
|
||||||
|
### Step 3.1: Build Python Virtual Environment
|
||||||
|
Create and activate a `.venv` virtual environment in the project root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create virtual environment
|
||||||
|
python3 -m venv .venv
|
||||||
|
|
||||||
|
# Activate virtual environment
|
||||||
|
source .venv/bin/activate
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3.2: Install Dependency Packages
|
||||||
|
Install the required packages listed in `requirements.txt` under `multi-agent-mux-delegate-job`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies (pyyaml, paho-mqtt, etc.)
|
||||||
|
pip install -r .agents/skills/multi-agent-mux-delegate-job/requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Directory Structure and Security Audit Guide
|
||||||
|
|
||||||
|
Ensure that the local registry directories required to track agent states and jobs are successfully created:
|
||||||
|
|
||||||
|
1. **Required Directory Structure**:
|
||||||
|
* `.mam/jobs/`: Holds detailed metadata files for registered asynchronous jobs.
|
||||||
|
* `.mam/delegate_job_logs/`: Holds the audit logs (`events.ndjson`) for all backplane events published by agents.
|
||||||
|
2. **Git Ignore Configuration (`.gitignore`)**:
|
||||||
|
* When initializing a new project, verify that the following entries are configured in `.gitignore` to prevent committing local runtimes to the repository. The exception `!.env.example` must be kept to preserve the template:
|
||||||
|
```text
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
.mam/
|
||||||
|
.venv/
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Execution Verification and Bootstrap Tests
|
||||||
|
|
||||||
|
To verify that the environment has been successfully built without runtime errors, run the following verification checklist.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> All verification commands below must be executed from the **project root directory** (where the `.mam/` directory is directly visible). This is because the default job registry path resolved by scripts is relative to the current working directory under `./.mam/jobs`.
|
||||||
|
|
||||||
|
### Verification Test 1: Registry Script Load Check
|
||||||
|
Verify that the Python scripts and virtual environment libraries load correctly by listing jobs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run using the python interpreter in the virtual environment
|
||||||
|
.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/registry.py list
|
||||||
|
```
|
||||||
|
* **Expected Output**: The command should exit successfully and print an empty JSON array `[]` (or a list of pending/running jobs if any exist) without any python traceback errors.
|
||||||
|
|
||||||
|
### Verification Test 2: MQTT Broker Connection Handshake Test
|
||||||
|
Test the end-to-end communication through the broker to verify that events are published and received correctly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Register a temporary test job and capture its 8-character Hex Job ID
|
||||||
|
JID=$(.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/registry.py register \
|
||||||
|
--agent "test-agent" \
|
||||||
|
--prompt "Bootstrap check command" \
|
||||||
|
--timeout 120)
|
||||||
|
echo "Generated Job ID: $JID"
|
||||||
|
|
||||||
|
# 2. Run the background event subscriber (Subscriber) for this Job ID
|
||||||
|
.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/job_subscriber.py --job "$JID" &
|
||||||
|
|
||||||
|
# 3. Wait 2 seconds to allow the Subscriber to establish its MQTT socket connection
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# 4. Publish a start event (adhering to the Subscribe-before-Publish rule)
|
||||||
|
.venv/bin/python3 .agents/skills/multi-agent-mux-delegate-job/scripts/publish_event.py \
|
||||||
|
--job "$JID" \
|
||||||
|
--event started \
|
||||||
|
--detail "Bootstrap MQTT verification connection check"
|
||||||
|
|
||||||
|
# 5. Verify that the event is printed to stdout and written to the audit log:
|
||||||
|
# .mam/delegate_job_logs/events.ndjson
|
||||||
|
|
||||||
|
# 6. Stop the background subscriber and clean up the test job records
|
||||||
|
kill %1
|
||||||
|
rm -f ".mam/jobs/$JID.json" ".mam/jobs/$JID.lock"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Onboarding Collaborating Agents (New Agent Onboarding)
|
||||||
|
|
||||||
|
Once the setup is verified, onboarding agents should immediately read the **[AGENT.md](./AGENT.md)** guidelines in the project root.
|
||||||
|
|
||||||
|
The guidelines describe essential workflows—such as **surgical change constraints, cross-verification review loops, and pane snapshotting to prevent viewport truncation**—allowing new agents to quickly and safely integrate with the multi-agent workflow.
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
||||||
|
|
||||||
|
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
||||||
|
|
||||||
|
## 1. Think Before Coding
|
||||||
|
|
||||||
|
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
||||||
|
|
||||||
|
Before implementing:
|
||||||
|
- State your assumptions explicitly. If uncertain, ask.
|
||||||
|
- If multiple interpretations exist, present them - don't pick silently.
|
||||||
|
- If a simpler approach exists, say so. Push back when warranted.
|
||||||
|
- If something is unclear, stop. Name what's confusing. Ask.
|
||||||
|
|
||||||
|
## 2. Simplicity First
|
||||||
|
|
||||||
|
**Minimum code that solves the problem. Nothing speculative.**
|
||||||
|
|
||||||
|
- No features beyond what was asked.
|
||||||
|
- No abstractions for single-use code.
|
||||||
|
- No "flexibility" or "configurability" that wasn't requested.
|
||||||
|
- No error handling for impossible scenarios.
|
||||||
|
- If you write 200 lines and it could be 50, rewrite it.
|
||||||
|
|
||||||
|
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
||||||
|
|
||||||
|
## 3. Surgical Changes
|
||||||
|
|
||||||
|
**Touch only what you must. Clean up only your own mess.**
|
||||||
|
|
||||||
|
When editing existing code:
|
||||||
|
- Don't "improve" adjacent code, comments, or formatting.
|
||||||
|
- Don't refactor things that aren't broken.
|
||||||
|
- Match existing style, even if you'd do it differently.
|
||||||
|
- If you notice unrelated dead code, mention it - don't delete it.
|
||||||
|
|
||||||
|
When your changes create orphans:
|
||||||
|
- Remove imports/variables/functions that YOUR changes made unused.
|
||||||
|
- Don't remove pre-existing dead code unless asked.
|
||||||
|
|
||||||
|
The test: Every changed line should trace directly to the user's request.
|
||||||
|
|
||||||
|
## 4. Goal-Driven Execution
|
||||||
|
|
||||||
|
**Define success criteria. Loop until verified.**
|
||||||
|
|
||||||
|
Transform tasks into verifiable goals:
|
||||||
|
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
||||||
|
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
||||||
|
- "Refactor X" → "Ensure tests pass before and after"
|
||||||
|
|
||||||
|
For multi-step tasks, state a brief plan:
|
||||||
|
```
|
||||||
|
1. [Step] → verify: [check]
|
||||||
|
2. [Step] → verify: [check]
|
||||||
|
3. [Step] → verify: [check]
|
||||||
|
```
|
||||||
|
|
||||||
|
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
||||||
|
|
||||||
|
Read AGENT.md first before working and follow the instructions for orchestration.
|
||||||
@@ -0,0 +1,364 @@
|
|||||||
|
# Messaging System Technical Analysis & Architecture Report
|
||||||
|
|
||||||
|
This report provides a comprehensive, deep-dive analysis of the messaging system implemented in the `multi-agent-mux-delegate-job` skill. It covers the MQTT broker architecture, event protocols, job lifecycles, codebase internals, cross-system integration, and a list of known limitations along with production recommendations.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. MQTT Broker Architecture: PoC vs. TLS Production
|
||||||
|
|
||||||
|
The messaging system is designed with a clear, decoupled transition pathway from a Proof of Concept (PoC) public broker setup to a secured, authenticated, and encrypted private production cluster. All configurations are resolved dynamically from the environment or overridden at the job level, requiring zero code modifications during deployment cut-over.
|
||||||
|
|
||||||
|
### 1.1 PoC Architecture (Public Sandbox)
|
||||||
|
In the initial development/testing phase, the system defaults to the public broker hosted by HiveMQ:
|
||||||
|
* **Host/IP**: `broker.hivemq.com`
|
||||||
|
* **Protocol/Port**: Plaintext MQTT over TCP on port `1883`.
|
||||||
|
* **Security & Auth**: None. No username, password, TLS encryption, or access control list (ACL) constraints are applied.
|
||||||
|
* **QoS Level**: QoS 1 (At Least Once) is requested for publishes and subscriptions, ensuring acknowledgement at the network layer.
|
||||||
|
|
||||||
|
#### Risks and Limitations of the PoC Setup:
|
||||||
|
1. **Zero Eavesdropping Protection**: Because the broker is public and unencrypted, any internet user can subscribe to the root topic (`python/mqtt/jobs/#`) and read the exact prompt, agent sessions, and intermediate progress events.
|
||||||
|
2. **Event Spoofing & Injection**: Anyone can publish messages to any job topic. An attacker could publish a malicious `completed` or `error` event, prematurely terminating a running subscriber or causing the delegator to execute unauthorized post-validation hooks.
|
||||||
|
3. **No Message Persistence**: Public brokers do not guarantee queue persistence or durable sessions for disconnected clients. If a subscriber briefly drops offline, QoS 1 messages published during the disconnect window may be discarded.
|
||||||
|
4. **Rate Limiting & Reliability**: Public sandboxes are subject to arbitrary rate limits, traffic spikes, and transient connection resets, leading to network-level timeouts.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 1.2 Production Architecture (Secure Private Broker)
|
||||||
|
For production deployments, the system is designed to run on a private, self-hosted MQTT 5.0 broker such as **Mosquitto** or **EMQX**.
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
subgraph "Secure Corporate Network"
|
||||||
|
Broker["Private MQTT Broker (Mosquitto/EMQX) <br> Ports: 8883 (TLS)"]
|
||||||
|
|
||||||
|
subgraph "Hermes (Delegator/Orchestrator)"
|
||||||
|
SubClient["job_subscriber.py <br> (Role: subscriber)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph "Tmux Workspace (Agent Host)"
|
||||||
|
PubClient["publish_event.py <br> (Role: publisher)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
SubClient -- "Subscribe (QoS 1) <br> Auth: hermes <br> ACL: Read jobs/+/events" --> Broker
|
||||||
|
PubClient -- "Publish (QoS 1 + Retain Terminal) <br> Auth: claude-worker <br> ACL: Write jobs/+/events" --> Broker
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Production Security & Hardening Controls:
|
||||||
|
1. **Transport Layer Security (TLS v1.3)**: Traffic is encrypted over port `8883` using a private Certification Authority (CA). The orchestrator validates the broker using `MQTT_CA_CERTS` (CA bundle path). Optionally, Mutual TLS (mTLS) is supported via client-side certificate keys (`MQTT_CERTFILE`/`MQTT_KEYFILE`) for cryptographic device identities.
|
||||||
|
2. **Strict Client Authentication**: All clients must supply credentials (`MQTT_USERNAME` / `MQTT_PASSWORD`) to establish a connection. Anonymous logins are explicitly disabled (`allow_anonymous false`).
|
||||||
|
3. **Role-Based Topic Access Control Lists (ACLs)**:
|
||||||
|
* **Orchestrator/Hermes (Subscriber)**: Authenticates as user `hermes` with read-only access to all event streams:
|
||||||
|
```conf
|
||||||
|
user hermes
|
||||||
|
topic read python/mqtt/jobs/+/events
|
||||||
|
```
|
||||||
|
* **Agent/Worker (Publisher)**: Authenticates as user `claude-worker` with write-only access restricted to the job event sub-topics:
|
||||||
|
```conf
|
||||||
|
user claude-worker
|
||||||
|
topic write python/mqtt/jobs/+/events
|
||||||
|
```
|
||||||
|
This prevents workers from eavesdropping on sister agents or intercepting commands on other jobs.
|
||||||
|
4. **Durable Message Queues & Session State**:
|
||||||
|
* The broker is configured with `persistence true` and a dedicated disk storage path.
|
||||||
|
* Subscribers connect with persistent session flags to ensure the broker buffers QoS 1 messages during temporary network drops.
|
||||||
|
5. **Retained Terminal Events**: Terminal events (`completed`/`error`) are published with the `retain=True` flag. This allows a late-joining or recovering subscriber to instantly retrieve the final job status without waiting for active transmissions.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 1.3 Production Mosquitto Configuration Reference
|
||||||
|
A hardened `/etc/mosquitto/mosquitto.conf` production configuration includes:
|
||||||
|
```conf
|
||||||
|
# Persistence settings
|
||||||
|
persistence true
|
||||||
|
persistence_location /var/lib/mosquitto/
|
||||||
|
|
||||||
|
# Authentication and Authorization
|
||||||
|
password_file /etc/mosquitto/auth/passwd
|
||||||
|
acl_file /etc/mosquitto/auth/acl
|
||||||
|
allow_anonymous false
|
||||||
|
|
||||||
|
# Listener and TLS Configuration
|
||||||
|
listener 8883
|
||||||
|
cafile /etc/mosquitto/certs/ca.crt
|
||||||
|
certfile /etc/mosquitto/certs/server.crt
|
||||||
|
keyfile /etc/mosquitto/certs/server.key
|
||||||
|
tls_version tlsv1.3
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Event Protocol Specification
|
||||||
|
|
||||||
|
The event protocol defines a strict, single-direction JSON wire schema. It acts as the contract between the worker agent (the publisher) and the delegator/orchestrator (the subscriber).
|
||||||
|
|
||||||
|
### 2.1 Wire Schema (JSON UTF-8, `schema_version = 1`)
|
||||||
|
Every event payload must adhere to the following schema structure:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"seq": 2,
|
||||||
|
"job_id": "918b0612",
|
||||||
|
"event": "progress",
|
||||||
|
"timestamp": "2026-06-20T14:48:58Z",
|
||||||
|
"detail": "Section 1: MQTT Broker Architecture completed",
|
||||||
|
"data": {
|
||||||
|
"auth_token": "URL-safe-base64-random-token-here",
|
||||||
|
"custom_metric": 42
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 Wire Schema Field Dictionary
|
||||||
|
|
||||||
|
| Field | Type | Required | Description & Validation Rules |
|
||||||
|
| :--- | :--- | :--- | :--- |
|
||||||
|
| `schema_version` | Integer | **Yes** | Must be exactly `1`. Subscribers discard payloads with mismatched version numbers to prevent parser crashes on schema drift. |
|
||||||
|
| `seq` | Integer | **Yes** | Monotonic sequence counter starting at `1` for the first publish. Incremented and stored in the job's registry file (`last_seq`) to survive agent pane crashes. |
|
||||||
|
| `job_id` | String | **Yes** | The 8-character hex string identifying the target job. Subscribers discard any messages whose `job_id` is unexpected or unrequested. |
|
||||||
|
| `event` | String | **Yes** | The event classification: `started`, `progress`, `permission_required`, `completed`, or `error`. |
|
||||||
|
| `timestamp` | String | **Yes** | ISO-8601 UTC timestamp with a trailing `Z` suffix. (Advisory only; never trusted for timeouts). |
|
||||||
|
| `detail` | String | **Yes** | Generalized, safe text description. Strict rules prohibit absolute paths, workspace paths, passwords, or raw environment variables. |
|
||||||
|
| `data` | Object | **Yes** | Metadata dictionary. Used in production to pass `auth_token` or structured execution metrics. |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2.3 Event Type Dictionary and Schemas
|
||||||
|
|
||||||
|
#### 1. `started`
|
||||||
|
* **Emit Trigger**: Emitted by the worker agent immediately upon boot inside the tmux session, indicating it has parsed the instructions and started execution.
|
||||||
|
* **Payload Constraints**: `seq` must be `1`. Status in registry is transitioned to `running`.
|
||||||
|
* **Example Detail**: `"Job 918b0612 started"`
|
||||||
|
|
||||||
|
#### 2. `progress`
|
||||||
|
* **Emit Trigger**: Optional. Emitted at major check-points, long loops, or sub-task boundaries.
|
||||||
|
* **Payload Constraints**: None.
|
||||||
|
* **Example Detail**: `"Section 1: MQTT Broker Architecture completed"`
|
||||||
|
|
||||||
|
#### 3. `permission_required`
|
||||||
|
* **Emit Trigger**: Emitted when the agent needs human confirmation (e.g. to run a destructive command or read/write critical system files).
|
||||||
|
* **Payload Constraints**: `detail` contains the resource/action requested.
|
||||||
|
* **Example Detail**: `"needs write permission to MESSAGING.md"`
|
||||||
|
|
||||||
|
#### 4. `completed` (Terminal)
|
||||||
|
* **Emit Trigger**: Successful job completion. The agent has generated all expected artifacts and verified correctness.
|
||||||
|
* **Payload Constraints**: Must be the final event. Published with `retain=True`.
|
||||||
|
* **Example Detail**: `"deep report written and committed to git"`
|
||||||
|
|
||||||
|
#### 5. `error` (Terminal)
|
||||||
|
* **Emit Trigger**: Terminal failure. Agent encountered an unhandled exception, syntax error, or validation script fail.
|
||||||
|
* **Payload Constraints**: Must be the final event. Published with `retain=True`.
|
||||||
|
* **Example Detail**: `"validation fail: missing files"`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2.4 Integrity and Authentication Verification (HMAC-SHA256 Signatures)
|
||||||
|
To prevent unauthorized users from hijacking or spoofing events on public brokers:
|
||||||
|
1. When a job is registered, a cryptographic token (`auth_token`) is generated (`secrets.token_urlsafe(32)`).
|
||||||
|
2. The publisher reads this token and signs the JSON payload. Specifically, the publisher calculates an HMAC-SHA256 signature using the `auth_token` as the secret key over the serialized payload (with the `hmac_sig` field excluded).
|
||||||
|
3. The signature is attached as `data.hmac_sig` on the wire.
|
||||||
|
4. The subscriber (`job_subscriber.py`) reads the expected `auth_token` from the local registry and verifies the HMAC signature. Any message with a missing, invalid, or mismatched signature is discarded immediately with an "HMAC verify failed" log.
|
||||||
|
5. To prevent event drops, all publishers and subscribers must be updated simultaneously during deployment rollout, since the plaintext `auth_token` is never transmitted on the wire to prevent token interception.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Job Lifecycle & State Transitions
|
||||||
|
|
||||||
|
The lifecycle of a delegated job progresses through a highly coordinated state machine, involving file-based registry claiming, asynchronous message subscription, and multi-faceted event publishing.
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
stateDiagram-v2
|
||||||
|
[*] --> pending : register_job()
|
||||||
|
pending --> running : pick_pending()
|
||||||
|
running --> completed : publish_event(--event completed)
|
||||||
|
running --> error : publish_event(--event error)
|
||||||
|
running --> cancelled : update_status(..., cancelled)
|
||||||
|
pending --> cancelled : update_status(..., cancelled)
|
||||||
|
completed --> [*]
|
||||||
|
error --> [*]
|
||||||
|
cancelled --> [*]
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.1 Step-by-Step Lifecycle Phase Details
|
||||||
|
|
||||||
|
#### Phase 1: Registration (`register`)
|
||||||
|
* **Trigger**: A delegator triggers `registry.py register` (or the `multi-agent-mux-delegate-job submit` command).
|
||||||
|
* **Registry State**: Flips from non-existent to `pending` inside `.mam/jobs/<job_id>.json`. A `last_seq` counter is initialized to `0`.
|
||||||
|
* **Locking**: Exclusive fcntl file lock acquired over `.lock` during write.
|
||||||
|
* **Durable Audit Log**: Writes `<logs>/<job_id>/meta.json`, sets status to `pending` in `status.json`, and appends a `registered` event line to `events.ndjson`.
|
||||||
|
|
||||||
|
#### Phase 2: Claiming (`pick_pending`)
|
||||||
|
* **Trigger**: An agent session starts up and calls `registry.py pick --agent-session <session_label>`.
|
||||||
|
* **Registry State**: Oldest matching `pending` record is scanned. Status is atomically updated to `running`. `updated_at` is stamped.
|
||||||
|
* **Locking**: Reads and writes occur inside the exclusive fcntl lock block.
|
||||||
|
* **Durable Audit Log**: Status is synced to `running` in `status.json` and a `status_changed` event is appended to `events.ndjson`.
|
||||||
|
|
||||||
|
#### Phase 3: Listening (`subscribe`)
|
||||||
|
* **Trigger**: The wrapper command launches `job_subscriber.py --job <job_id>` in the background **before** launching the agent.
|
||||||
|
* **Broker Connection**: Connects to the resolved host, issues a QoS 1 subscription to `python/mqtt/jobs/<job_id>/events`, and blocks on an event queue.
|
||||||
|
* **Timeout Initialization**: Dual timeouts (wall-clock budget and activity idle timer) are calculated and start ticking.
|
||||||
|
|
||||||
|
#### Phase 4: Execution & Progress Events (`publish`)
|
||||||
|
* **Trigger**: The agent executes prompts within tmux and runs `publish_event.py` at boot and checkpoint stages.
|
||||||
|
* **Network Handshake**: Publisher opens a fresh TCP/TLS socket to the broker, awaits CONNACK, publishes a single QoS 1 message, waits for PUBACK, and gracefully disconnects to avoid socket resource leaks.
|
||||||
|
* **State Updates**: Updates `last_seq` monotonically, updates `status` to `running` (if not already), and mirrors the published payload into the local audit logs (`events.ndjson`).
|
||||||
|
* **Subscriber Capture**: The subscriber captures the payload, performs bearer token checks, prints the formatted line to stdout, and resets its idle timer.
|
||||||
|
|
||||||
|
#### Phase 5: Terminal Finalization
|
||||||
|
* **Trigger**: Agent publishes `--event completed` or `--event error`.
|
||||||
|
* **Registry Transition**: State becomes `completed` or `error`.
|
||||||
|
* **Retained Messaging**: The terminal event is published with `retain=True` on the broker.
|
||||||
|
* **Subscriber Exit**: The subscriber processes the terminal event exactly once, terminates its background loops, and exits (code `0` for completed, `1` for error).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Code Internals Analysis
|
||||||
|
|
||||||
|
### 4.1 `registry.py` & `lib.sh` (Locking & Atomicity)
|
||||||
|
Two concurrency control schemes co-exist in this workspace to coordinate state modification:
|
||||||
|
|
||||||
|
1. **`lib.sh::atomic_dump_yaml()`**: Used for workspace-wide tmux session inventory (`agent-sessions.yaml`).
|
||||||
|
* **Locking**: Uses SQLite database transaction serialization via `BEGIN IMMEDIATE` on `agent-sessions.db`.
|
||||||
|
* **Safe Mutation**: The mutation source code is passed in an environment variable `AGENT_SESSIONS_MUTATION` and executed dynamically using `exec(compile(..., 'exec'), globals())`. This isolates the execution and avoids command-injection vectors.
|
||||||
|
* **Atomicity**: Updates the SQLite tables and then, if a session transitions to a finished state, writes to a temp file in the same directory using `tempfile.mkstemp()` and performs an `os.replace()` rename. POSIX guarantees the replacement is atomic, preventing half-written YAML reads. A `.bak` backup copy is also preserved.
|
||||||
|
2. **`registry.py::register_job() / pick_pending() / _atomic_write_record()`**: Used for job-level metadata JSON files (`<job_id>.json`).
|
||||||
|
* **Locking**: Wraps operations in a `registry_lock(registry_dir)` context manager, implementing an advisory exclusive lock on `.lock` via `fcntl.flock`.
|
||||||
|
* **Atomicity**: In `_atomic_write_record()`, it uses `tempfile.mkstemp` inside the parent registry folder, serializes the updated job record to the temp file, flushes it, triggers a physical disk sync via `os.fsync(fh.fileno())`, and executes `os.replace` to replace the main JSON record file. The file permission is restricted to `0o600` immediately.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4.2 `publish_event.py` (Retries and Handshakes)
|
||||||
|
The publisher script enforces robust error handling when sending status updates:
|
||||||
|
* **Fresh Connection Pattern**: Instead of maintaining a persistent socket connection (which is susceptible to socket timeouts or channel leaks), `publish_event.py` opens a fresh socket, completes the authentication/TLS handshake, publishes a single QoS 1 event, waits for `PUBACK`, and closes the connection.
|
||||||
|
* **Exponential Backoff**: Wrapped in the `with_retry()` decorator from `mqtt_common.py`. In case of socket errors (`OSError`, `TimeoutError`, `ConnectionError`), it retries up to 3 times (configurable via `--attempts`) with backoff:
|
||||||
|
$$\text{delay} = \min(\text{base\_delay} \times \text{factor}^{\text{attempt}-1}, \text{max\_delay})$$
|
||||||
|
Default parameters: `base_delay = 0.5s`, `factor = 2.0`, `max_delay = 8.0s`.
|
||||||
|
* **ACK Handshake Deadlines**:
|
||||||
|
* `CONNECT_ACK_TIMEOUT = 10s` (stops hangs during broker downtime).
|
||||||
|
* `PUBLISH_ACK_TIMEOUT = 5s` (guarantees QoS 1 message acknowledgment before marking as published).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4.3 `job_subscriber.py` (Timers and Queue Semantics)
|
||||||
|
The subscriber acts as the central execution watchdog:
|
||||||
|
* **Queue Serialization**: Uses a thread-safe `queue.Queue` internally. The Paho MQTT callback thread adds messages to the queue, and the main thread processes them sequentially. This separates network I/O from state machine validation.
|
||||||
|
* **State Machine Protection**: To safeguard against QoS 1 duplicate delivery or out-of-order broker retries, the subscriber runs a terminal state machine. It records job completion in an internal `terminal` dictionary. Once a job is marked `completed` or `error`, any subsequent events for that `job_id` are ignored:
|
||||||
|
```python
|
||||||
|
if event in TERMINAL_EVENTS:
|
||||||
|
if jid in terminal:
|
||||||
|
logger.info("ignoring duplicate terminal %s for %s", event, jid)
|
||||||
|
continue
|
||||||
|
terminal[jid] = event
|
||||||
|
pending.discard(jid)
|
||||||
|
```
|
||||||
|
* **Dual Timeout Semantics**:
|
||||||
|
1. **Wall-Clock Timeout**: Calculated relative to absolute startup time (`wall_deadline = start + wall_timeout`). It acts as a hard budget limit, guarding against an agent hanging indefinitely.
|
||||||
|
2. **Activity Idle Timeout**: Measured as the difference between the current monotonic time and the last packet arrival time (`idle_left = idle_timeout - (now - last_event)`). If the agent fails to print logs or publish progress updates for the duration of the idle window, the subscriber aborts and exits with code 2.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4.4 `mqtt_common.py` (Logging & Config Resolution)
|
||||||
|
* **Log Routing isolation**: Configured via `setup_logging()`. The root logger is bound to `sys.stderr`. This preserves the standard output stream (`stdout`) exclusively for clean JSON-lines payloads, enabling downstream bash tools to pipeline event feeds cleanly (e.g., `job_subscriber.py ... | jq`).
|
||||||
|
* **Broker Config Resolution**: Configured in `broker_config_from_job()`. Resolves credentials hierarchically:
|
||||||
|
1. Defaults to environment configurations (e.g. `MQTT_BROKER`, `MQTT_PORT`, `MQTT_TLS`, `MQTT_CA_CERTS`).
|
||||||
|
2. Overlays credentials specified inside the job record JSON block (`broker.*`). This allows the agent to fetch its dedicated target broker credentials on a per-job basis.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Cross-System Integration
|
||||||
|
|
||||||
|
The delegated messaging system functions as a critical control backplane, binding shell wrappers and monitoring loops across the orchestration stack.
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph LR
|
||||||
|
User["User/Cron Client"] -->|submit| Wrap["multi-agent-mux-delegate-job (Bash)"]
|
||||||
|
Wrap -->|registers| Reg["registry.py (Live Registry)"]
|
||||||
|
Wrap -->|spawns background| Sub["job_subscriber.py"]
|
||||||
|
Wrap -->|spawns tmux pane| Tmux["tmux Session (Agent Pane)"]
|
||||||
|
|
||||||
|
Tmux -->|executes agent| Agent["Claude / Codex Agent"]
|
||||||
|
Agent -->|publish_event.py| Broker["MQTT Broker"]
|
||||||
|
Broker -->|delivers events| Sub
|
||||||
|
Broker -->|delivers events| Mon["reconcile.sh (Monitor Loop)"]
|
||||||
|
|
||||||
|
Mon -->|updates| Inv["agent-sessions.yaml <br> (lib.sh::atomic_dump_yaml)"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5.1 Orchestration Wrappers (`multi-agent-mux-*`)
|
||||||
|
1. **`multi-agent-mux-delegate-job (submit)`**:
|
||||||
|
* Registers a job, spawns `job_subscriber.py` to capture standard output streams to `.mam/jobs/<job_id>.subscriber.out`, and sleeps for `1` second.
|
||||||
|
* Boots the agent pane in tmux:
|
||||||
|
```bash
|
||||||
|
tmux new-session -d -s "$sess" -c "$WORKDIR" \
|
||||||
|
"printf '%s' \"$instructions\" | $bin --dangerously-skip-permissions; echo; read"
|
||||||
|
```
|
||||||
|
* Pre-seeds agent instruction headers via stdin to enforce that the agent runs `publish_event.py` for its transitions.
|
||||||
|
* Blocks on `wait $sub_pid`, and finally prints the audit log directory.
|
||||||
|
2. **`multi-agent-mux-monitor` (`reconcile.sh`)**:
|
||||||
|
* **Wildcard Monitor Integration**: Runs a unified background subscriber loop (`reconcile.sh --subscribe`) to capture progress, verify security tokens (HMAC) and sequences, write audit logs, and automatically clean up tmux sessions upon terminal events.
|
||||||
|
* **Reconciliation loop**: Subscribes to the global job topic. On terminal events, it invokes `lib.sh::atomic_dump_yaml` to sync status drifts (e.g. setting tmux sessions to `terminated` in `agent-sessions.yaml` once the agent exits).
|
||||||
|
3. **`multi-agent-mux-create / stop / resume`**:
|
||||||
|
* Integrates the job life status into session metadata updates, ensuring standard tmux cleanup triggers state updates in the registry and audit logs.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Known Limitations & Recommendations
|
||||||
|
|
||||||
|
### 6.1 Limitations
|
||||||
|
|
||||||
|
1. **Single-Host File Locking Vulnerability**:
|
||||||
|
The advisory locking system previously relied heavily on `fcntl.flock`. While `agent-sessions.yaml` has been migrated to SQLite WAL to solve concurrent writes, the job metadata in `.mam/jobs/` still relies on `fcntl.flock` which may behave non-atomically on NFS.
|
||||||
|
2. **Bearer Token Leakage over Plaintext (Public Broker)**:
|
||||||
|
The `auth_token` mechanism is a simple plaintext bearer comparison. If the transport layer is unencrypted (e.g., using `broker.hivemq.com` on port `1883`), any eavesdropper on the network can steal the token and spoof legitimate events.
|
||||||
|
3. **Subscriber Network Drop Orphanage**:
|
||||||
|
`job_subscriber.py` does not implement automatic reconnection loops. If the subscriber loses connection to the broker, it exits, leaving the running tmux agent orphaned and without a validation/collection hook.
|
||||||
|
4. **Lack of Ordering Guarantees in QoS 1**:
|
||||||
|
QoS 1 guarantees delivery but not strict ordering. Under heavy backoff retries, a late-delivered progress event could land after a terminal event, causing state inconsistencies.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 6.2 Recommendations
|
||||||
|
|
||||||
|
1. **[Implemented] Migrate to SQLite WAL Backend**:
|
||||||
|
The `agent-sessions.yaml` locking mechanism in `lib.sh` has been upgraded to use a SQLite database (`agent-sessions.db`) configured with Write-Ahead Logging (`PRAGMA journal_mode=WAL`). The YAML file is now only updated as a finalized archive when a session reaches a terminal state (`stopped`, `terminated`, `archived`), eliminating `flock` contention during active session updates.
|
||||||
|
**Architecture Decision Note**: This means `agent-sessions.yaml` is **no longer a real-time view** of currently `running` sessions. We have explicitly accepted the trade-off of giving up real-time text readability of running sessions in favor of robust concurrency and solving NFS flock limits. Tooling and status checks must now query the SQLite DB to observe live `running` states.
|
||||||
|
2. **Implement Signature-Based Payload Verification**:
|
||||||
|
Rather than sending a plaintext token, utilize HMAC signatures. The delegator and worker share a secret key; the worker publishes a signature of the payload (e.g. `HMAC-SHA256(secret_key, payload_bytes)`). The subscriber validates the signature, preventing token interception.
|
||||||
|
3. **Enforce Mandatory Broker-Side TLS and ACLs**:
|
||||||
|
De-prioritize plaintext support. Enforce connection over port `8883` with verified TLS certificates. Implement client certificates (mTLS) for agent authentication.
|
||||||
|
4. **Build Auto-Reconnecting Subscriber Loops**:
|
||||||
|
Upgrade `job_subscriber.py` to handle disconnect callbacks. Maintain a persistent queue in memory and allow the client to reconnect with exponential backoff, preventing socket dropout from terminating the orchestration flow.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Glossary: Session States vs Job States
|
||||||
|
|
||||||
|
This project manages **two distinct state domains** that are often confused:
|
||||||
|
|
||||||
|
### Session States (YAML — `.mam/agent-sessions.yaml`)
|
||||||
|
Managed by `.agents/skills/lib.sh` and the 6 `multi-agent-mux-*` skills.
|
||||||
|
Valid values (see `lib.sh` valid-status set):
|
||||||
|
|
||||||
|
| State | Meaning | Set by |
|
||||||
|
|---|---|---|
|
||||||
|
| `running` | tmux session active, agent running | `create`, `resume` |
|
||||||
|
| `stopped` | deliberately stopped via `--capture-id`/`--reason`/`--graceful`; conversation preserved for resume | `stop` (STOP mode) |
|
||||||
|
| `terminated` | hard-killed via `--mode hard`; tmux session destroyed | `stop` (hard mode), `monitor` reconcile |
|
||||||
|
| `archived` | soft-stopped via `--mode soft`; tmux left alive, YAML-only update | `stop` (soft mode) |
|
||||||
|
|
||||||
|
### Job States (Registry — `.mam/jobs/<id>.json`)
|
||||||
|
Managed by `.agents/skills/multi-agent-mux-delegate-job/scripts/registry.py`.
|
||||||
|
Valid values:
|
||||||
|
|
||||||
|
| State | Meaning | Set by |
|
||||||
|
|---|---|---|
|
||||||
|
| `pending` | job registered, agent not yet started | `registry.py register` |
|
||||||
|
| `running` | agent picked up the job, publishing events | `publish_event.py --event started` |
|
||||||
|
| `completed` | terminal event — agent finished successfully | `publish_event.py --event completed` |
|
||||||
|
| `error` | terminal event — agent failed | `publish_event.py --event error` |
|
||||||
|
| `cancelled` | job cancelled by orchestrator | `registry.py cancel` |
|
||||||
|
|
||||||
|
**Key distinction**: Session states track the **tmux container lifecycle** (create→stop→resume).
|
||||||
|
Job states track the **delegated work lifecycle** (submit→run→complete/error).
|
||||||
|
A single session can host multiple sequential jobs; a job runs within exactly one session.
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# gRPC 기반 Multi-Agent 인터페이스 연구 사용사례
|
||||||
|
|
||||||
|
## 목적
|
||||||
|
이기종 환경에서 동작하는 Multi-agent 서비스를 위한 gRPC 기반 인터페이스 모듈 설계/개발 연구 논문 작성용.
|
||||||
|
- 연구의 필요성 및 연구 개발 내용의 방향을 설립하기 위함
|
||||||
|
|
||||||
|
## 요구사항
|
||||||
|
- agy와 claude 각각 1개의 agent를 생성함.
|
||||||
|
- 각 agent는 3개의 sub-agent를 spawn 함 (개발자, AI 에이전트 관리자, 자료분석가)
|
||||||
|
- 각 에이전트는 자료분석 sub-agent를 통해 현재 multi-agent 가 사용되는 사례, 각 에이전트 간 통신 기술의 background를 조사하고, 개발자와 AI 에이전트 관리자 sub-agent를 통해 각자의 입장에서 필요한 요구사항을 도출함.
|
||||||
|
- 도출된 요구사항을 만족시키기 위해 gRPC를 어떻게 활용할 수 있을지 깊이 생각한 후 보고서를 작성
|
||||||
|
- agy와 claude는 sub-agent를 통해 작성된 보고서를 최종 검토한 후 각자의 보고 내용을 서로 피드백함.
|
||||||
|
- agy가 claude에게 먼저 피드백 받은 후 claude는 자신의 보고서 내용을 반영한 수정방안을 agy에게 전달, agy가 최종 보고서를 작성한 후 claude가 한 번 더 검토를 거쳐 최종보고서를 작성함
|
||||||
|
- 작성된 보고서를 너가 다시 한 번 더 검토하여 A4 6장 분량의 보고서를 작성해줘.
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
---
|
||||||
|
title: 멀티 에이전트란
|
||||||
|
description: 멀티에이전트의 개념 설명, 장점, 실제 구축을 통한 경험 공유를 세미나에서 발표하기 위한 발표 스크립트 및 발표자료 작성용 문서입니다.
|
||||||
|
---
|
||||||
|
# AI Agent란?
|
||||||
|
|
||||||
|
## General
|
||||||
|
|
||||||
|
## AI Agent를 더욱 강력하게 만드는 Skills
|
||||||
|
|
||||||
|
## Skills 사례 소개
|
||||||
|
|
||||||
|
# Multi-Agent란
|
||||||
|
|
||||||
|
## General
|
||||||
|
|
||||||
|
[지시사항]
|
||||||
|
- multi agent에 대한 개념 설명 및 multi agent의 필요성 정리
|
||||||
|
|
||||||
|
## Multi Agent의 예시
|
||||||
|
[지시사항]
|
||||||
|
- 아래 목차 흐름에 맞춰 자료 조사 및 내용 작성을 수행해줘.
|
||||||
|
|
||||||
|
|
||||||
|
### Subagent란
|
||||||
|
|
||||||
|
|
||||||
|
### Team agent란
|
||||||
|
|
||||||
|
### Context Engineering (Lang Graph)란
|
||||||
|
|
||||||
|
### CrewAI, Satana AI 등 Multi agent orchestration을 지원하기 위한 소프트웨어
|
||||||
|
|
||||||
|
## Multi Agent 환경 구성을 위한 Protocols
|
||||||
|
|
||||||
|
### MCP/ACP
|
||||||
|
|
||||||
|
### A2A
|
||||||
|
|
||||||
|
# 실제 Multi Agent Orchestration을 구현하며 겪은 문제점들
|
||||||
|
- Agent들과 각 Agent들의 세션을 어떻게 관리할까?
|
||||||
|
- Agent들 끼리 서로 어떻게 탐색할 수 있도록 할까?
|
||||||
|
- 마스터 - slave 방식
|
||||||
|
- p2p and report 방식
|
||||||
|
- 실시간 메시징을 어떻게 관리할 수 있을까?
|
||||||
|
- A Agent에서 작업을 완료한 후 작업 완료 메시지를 전달하라고 했을 때 실시간 통신이 정상적으로 작동하지 않는 경우가 많았음
|
||||||
|
- 예를 들어 작업을 위임한 Agent가 갑자기 종료된 상황에서 작업이 완료되고 작업 완료 알림 메시지가 전송된 후 작업을 위임한 Agent가 다시 재시동된다면 알람을 받을 수 없음
|
||||||
|
- 작업을 위임받은 Agent가 특정 알람도 없이 종료된다면 작업을 위임한 Agent는 무한 대기 상태에 빠지게 됨. 이때 작업을 위임한 Agent가 subagent라면 Blocking 상태에 빠진 것을 확인하기 어러워 리소스만 소비하게 되는 결과로 이어짐
|
||||||
|
|
||||||
|
# Multi Agent Orchestration 의 장점
|
||||||
|
- 프롬프트의 간소화
|
||||||
|
- 다음과 같이 프롬프트 엔지니어링의 시대는 저물고 있음.
|
||||||
|
- "오픈AI 엔지니어 페터 슈타인베르거: 엑스(X)에 코딩 에이전트에 더 이상 프롬프트를 입력하지 말고 에이전트를 구동하는 루프를 설계해야 한다."
|
||||||
|
- 간단한 작업 지시와 질문 및 응답으로 부터 방향 설립 구체적인 작업 지시 내용 작성 등을 AI가 작성하는 시대가 됨. 이는 작업 지시 역할을 수행하는 에이전트와 실제 작업을 하는 에이전트, 그리고 검증을 수행하는 reviewer 등 다수의 에이전트가 각자의 역할에 맞는 역할을 수행할 때 최적의 작업 결과가 도출됨.
|
||||||
|
- Context 설명이 필요없음
|
||||||
|
- 각 에이전트가 서로의 작업을 공유하고, git과 같은 시스템으로 변경사항을 즉각적으로 확인할 수 있기 때문에 다수의 에이전트 간 작업 context를 다시 설명하며 시간을 허비할 필요가 없음
|
||||||
|
- 검증의 간소화 및 우수한 결과물
|
||||||
|
- 서로 다른 에이전트 (Claude, GPT, Gemini, GLM 등) 은 바라보는 시점이 달라 특정 작업을 수행했을 때 다른 에이전트에게 검토를 요청하고, 수정방향을 피드백 받음으로써 결과물의 품질이 급격히 상승함
|
||||||
|
- Gemini 모델로 작성한 코드나 글을 다른 Gemini 모델을 사용하는 Agent에게 review 받는 것 보다 Claude와 같은 다른 모델을 사용하는 Agent에게 검증받는 것이 더욱 좋은 결과를 보여줌
|
||||||
|
- 나아가 "루프 엔지니어링"과 같은 방식에서 필요한 검증 모델을 개발하기 위해 필요한 시간을 현저히 줄일 수 있음.
|
||||||
|
- 비용의 효율화
|
||||||
|
- AI 모델 별 서로 잘하는 분야가 다르듯 작업을 수행할 때 소모하는 Token의 양과 가격도 다름
|
||||||
|
- 작업의 우선순위, 작업 별 요구되는 정확도를 고려하여 비용효율적인 모델 선택, Agent에 작업을 위임할 수 있음.
|
||||||
|
- AI Agent Orchestration 기능을 접목하여 자동화가 가능함
|
||||||
|
|
||||||
|
# What we Needs?
|
||||||
|
- Agent 간 작업 환경 공유 (A2A의 Agent Card)
|
||||||
|
- 특정 Agent에게 작업을 위임하기 위해서는 어떤 Agent가 어떤 역할을 할 수 있는지에 대한 이해가 필요함
|
||||||
|
- Agent Working Infrastructure 구성
|
||||||
|
- Service Discovery 등을 통해 새로운 Agent가 작업을 수행함에 있어 사용할 수 있는 Service를 자동 탐색할 수 있어야 함
|
||||||
|
- Workflow 공유
|
||||||
|
- 새로 다른 Agent가 같은 작업을 수행할 때 같은 절차, 같은 방식 그리고 같은 결과를 출력하는 것이 매우 중요함
|
||||||
|
- 나아가 작업이 정상적으로 완료되지 못 한 경우 특정 작업에 대한 Tracking을 위한 공통된 인터페이스 규약이 필요함 (Issue Tracking)
|
||||||
|
- AI 모델 기반 작업은
|
||||||
|
- Messaging System 필요
|
||||||
|
- 정확한 작업 지시와 대량의 출력 데이터를 공유하기 위해서는 MQTT와 같은 저사양 단순 Messing Queueing System에는 한계가 있음.
|
||||||
|
- 기존 방법은 파일을 생성하고, 작업 완료, 권한 요청 등 다양한 이벤트에 대한 알람 메시지에 상세 정보를 나타내는 파일의 URL을 포함시킴으로써 이 문제를 해결하고 있지만 Issue Tracking의 효율화, 고성능 통신 지원 등을 위해서는 알람 메시지에 많은 정보를 포함할 필요가 있음.
|
||||||
|
- 또한 특정 작업을 요청할 때 다수의 파라미터를 함께 제공해야할 수 있음. 예를 들어 스마트 팜에서 방제를 위해 특정 작물의 상태를 검출하기 위한 작업에서는 작업 검출을 위한 지시사항과 함께 이미지 정보가 함께 전달되어야 함. 이러한 작업에서는 HTTP/3의 Push 와 같은 기능이 요구됨.
|
||||||
|
- Job Task 관리
|
||||||
|
- AI Agent는 사람과 유사하게 작업을 수행하지만 작업을 수행하는 방식에는 큰 차이가 있음. 기본적으로 1개의 작업을 작은 단위로 자르고, 각 스크럼을 subagent에게 전달하여 작업을 병렬적으로 수행함.
|
||||||
|
- 이때 각 subagent는 작업의 시작 부터 작업이 끝날 때 까지가 생명주기이며, 각 작업마다 다른 에이전트와 통신을 위한 messaing topic 또는 token이 필요함
|
||||||
|
- 나아가 subagent가 작업을 위임할 다른 에이전트를 찾을 때 가장 효율적으로 작업을 수행할 Agent를 발견하기 위한 Load Balancing 개념이 필요함.
|
||||||
|
|
||||||
|
## Why we need gRPC?
|
||||||
|
- A2A와의 호환성 향상
|
||||||
|
- 개발 인터페이스 모듈은 스마트 팜, 스마트 팩토리와 같은 AIoT 서비스를 주요 타겟으로 개발되고 있음
|
||||||
|
- 멀티 모달 지원
|
||||||
|
- AIoT 서비스에서는 텍스트 뿐 아니라 이미지, 소리, 주파수 등 다양한 멀티 모달 데이터가 사용되며, 각 데이터의 처리는 LLM 또는 LMM 모델에 국한되어 처리되는 것이 아니라 지도학습 모델, 비지도 학습 모델 등 다양한 모델에 의해 처리되어야 함
|
||||||
|
- HTTP/3 기반의 멀티 스트림 지원 및 Request/Response와 Pub/Sub 를 모두 지원하는 검증된 고성능 gRPC 인터페이스 모듈은 다양한 데이터 타입을 지원하기 위한 최적의 선택지임
|
||||||
|
- 나아가 gRPC는 Microservices 환경에서 주 인터페이스로 사용됨에 따라 보급/확산이 손쉬움
|
||||||
|
- Job Task 관리가 효율적임
|
||||||
|
- 효율적인 작업 분배를 위한 Load Balancing system들이 gRPC를 기반으로 작동하는 경우가 많음. 최소한의 수정으로 개발 모듈의 적용이 가능함.
|
||||||
|
- json과 같은 text 형식이 아닌 protobuf와 같은 구조적이면서 직렬화 방식의 메시징을 통해 다수의 에이전트와 각 에이전트의 subagent로 부터 쏟아지는 메시징을 효율적으로 처리하기 하여 성능 향상을 도모할 수 있음.
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
# 배경 연구 (Background)
|
||||||
|
|
||||||
|
> **연구 제목**: 엣지 AIoT 3-tier 환경에서 gRPC 기반 멀티 에이전트 통신 인터페이스 설계
|
||||||
|
> **문서 종류**: 논문 배경 연구 (Introduction + Related Work 수준)
|
||||||
|
> **작성일**: 2026-06-07
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 서론적 배경: 엣지 AIoT와 멀티 에이전트 시스템의 수렴
|
||||||
|
|
||||||
|
인공지능 기술의 급속한 발전과 IoT 디바이스의 대규모 배포가 교차하면서, **엣지 AIoT(Edge Artificial Intelligence of Things)** 라는 새로운 컴퓨팅 패러다임이 부상하고 있다. 이 패러다임은 단순히 클라우드 추론을 현장으로 이전하는 것을 넘어서, 클라우드·엣지·현장 디바이스를 아우르는 **3-tier 분산 지능 협력 체계**를 구축하는 것을 목표로 한다 [FINAL_REPORT §1].
|
||||||
|
|
||||||
|
2024년 기준으로, 전 세계 IoT 연결 디바이스 수는 약 170억 개에 달하며 2030년까지 290억 개를 상회할 것으로 전망된다 (IoT Analytics, 2024). 이 가운데 상당수는 공장 자동화, 스마트 빌딩, 자율주행차량, 의료 모니터링 등 **미션 크리티컬(mission-critical)** 용도로 배치되고 있으며, 단순한 데이터 수집을 넘어 **실시간 추론과 자율 의사결정**이 요구된다. 그러나 클라우드 중심의 단일 추론 구조는 네트워크 지연, 대역폭 비용, 개인정보 보호 규제 등의 제약으로 인해 이 요구를 충족하기 어렵다.
|
||||||
|
|
||||||
|
이에 대한 대응으로 등장한 엣지 컴퓨팅은 현장 부근에서 연산을 수행함으로써 지연을 줄이고 대역폭을 절감한다. NVIDIA Jetson, Rockchip RK3588, 산업용 PC 등 엣지 디바이스는 NPU(Neural Processing Unit)를 내장하여 현장 AI 추론을 가능케 한다. 그러나 엣지 컴퓨팅의 진정한 잠재력은 **단일 엣지 노드의 독립 추론**이 아니라, 클라우드·엣지·현장 디바이스가 **계층적으로 협력하는 멀티 에이전트 시스템(Multi-Agent System, MAS)** 을 통해 발현된다.
|
||||||
|
|
||||||
|
MAS 분야는 1960년대 Austin과 Searle의 **화행 이론(Speech Act Theory)** 에서 비롯하여, 1990년대 KQML(Knowledge Query and Manipulation Language)과 FIPA-ACL(Foundation for Intelligent Physical Agents - Agent Communication Language)로 이어지는 분산 인공지능(Distributed AI, DAI) 전통을 계승한다. 2020년대 대규모 언어 모델(LLM)의 등장은 이 전통에 새로운 활력을 불어넣었다. AutoGen [Wu et al., 2023], CrewAI, LangGraph, MetaGPT 등의 현대적 LLM 에이전트 프레임워크는 복잡한 태스크를 전문화된 에이전트들에게 분할하여 협력 해결하는 방식을 구현한다.
|
||||||
|
|
||||||
|
그러나 이 두 흐름—엣지 AIoT와 LLM 기반 MAS—의 **수렴**에서 해결되지 않은 근본적 문제가 드러난다. LLM 에이전트 프레임워크들은 데이터센터 내 동일 서버 또는 고성능 네트워크로 연결된 클러스터를 전제로 설계되었다. 그러나 현실의 엣지 AIoT 환경은 **3-tier의 이질적 하드웨어**, **불안정한 무선 네트워크**, **극도로 제한된 임베디드 자원**, **물리적으로 접근 가능한 현장 디바이스의 보안 위협**이라는 전혀 다른 제약 조건을 갖는다. 이 제약 조건을 무시한 채 설계된 에이전트 통신 인터페이스는 실제 엣지 AIoT 배포에서 동작하지 않는다.
|
||||||
|
|
||||||
|
본 연구는 이 간극을 메우기 위해 **엣지 AIoT 3-tier 물리적 분산 구조에 특화된 gRPC 기반 멀티 에이전트 통신 인터페이스 설계**를 목표로 한다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 문제 정의 (Problem Statement)
|
||||||
|
|
||||||
|
### 2.1 형식적 시스템 정의
|
||||||
|
|
||||||
|
엣지 AIoT 멀티 에이전트 시스템을 다음과 같이 형식화한다.
|
||||||
|
|
||||||
|
**정의 1 (3-tier 분산 에이전트 네트워크)**: 에이전트 집합 $\mathcal{A} = \mathcal{A}_{T1} \cup \mathcal{A}_{T2} \cup \mathcal{A}_{T3}$ 이 세 계층에 분산 배치된다.
|
||||||
|
|
||||||
|
| Tier | 디바이스 클래스 | 연산 자원 | 네트워크 특성 | 보안 경계 |
|
||||||
|
|------|----------------|-----------|--------------|-----------|
|
||||||
|
| **T1 클라우드** | x86/GPU 서버, k8s 컨테이너 | 무제한(수 TB RAM, GPU 클러스터) | 안정·고대역폭(1Gbps+)·상시 연결 | 데이터센터 내부, 논리적 방어 충분 |
|
||||||
|
| **T2 엣지** | Jetson Orin·RK3588·산업용 PC·5G MEC | 중간(4–32GB RAM, NPU) | 인터미턴트·광역무선혼합(4G/5G/광선로) | 현장·반노출, 물리적 접근 제한 |
|
||||||
|
| **T3 현장** | Cortex-M MCU·임베디드 Linux·AGV·센서·로봇 | 극히 제한(수 KB–수십 MB RAM) | 불안정·저대역폭·다중 홉(Wi-Fi/LoRa/5G/BLE) | 물리적 접근 가능, 변조 위험 |
|
||||||
|
|
||||||
|
**정의 2 (통신 경로 집합)**: 통신 경로 $\mathcal{L}$ 은 tier 간 쌍 $(T_i, T_j)$ 에 대한 네트워크 링크의 집합이며, 각 링크는 대역폭 $B$, 지연 $D$, 단절률 $P_{disc}$, 페이로드 크기 한계 $S_{max}$ 의 특성 벡터를 갖는다.
|
||||||
|
|
||||||
|
**정의 3 (문제 공간)**: 이 시스템에서 에이전트 $a_i \in \mathcal{A}$ 가 에이전트 $a_j \in \mathcal{A}$ 에게 태스크 $t$ 를 위임하거나 센서 스트림 $s$ 를 전달하는 통신 인터페이스 $\Phi: (\mathcal{A} \times \mathcal{A} \times \mathcal{M}) \rightarrow \mathcal{R}$ 을 설계하라. 단, $\mathcal{M}$ 은 메시지 공간, $\mathcal{R}$ 은 응답 공간이며, $\Phi$ 는 다음 제약 조건을 동시에 만족해야 한다:
|
||||||
|
|
||||||
|
1. **이종성 제약**: $T1, T2, T3$ 각 tier의 자원·프로토콜 이질성을 수용할 것
|
||||||
|
2. **연속성 제약**: 무선 단절 $P_{disc} > 0$ 이 발생해도 통신 상태를 보존할 것
|
||||||
|
3. **신원 보장 제약**: 물리적으로 접근 가능한 T3 디바이스의 신원을 암호학적으로 증명할 것
|
||||||
|
4. **시맨틱 제약**: 태스크 위임·역량 탐색 등 에이전트 수준의 추상화를 지원할 것
|
||||||
|
5. **관측성 제약**: 분산 3-tier에서 end-to-end 추적을 가능케 할 것
|
||||||
|
|
||||||
|
### 2.2 핵심 문제 5가지
|
||||||
|
|
||||||
|
위 형식화로부터 다음 다섯 가지 핵심 기술 문제가 도출된다.
|
||||||
|
|
||||||
|
**문제 P1 (프로토콜 이종성)**: 단일 프로토콜로는 T1의 고성능 스트리밍, T2의 간헐적 연결, T3의 초저자원 환경을 동시에 만족할 수 없다. 프로토콜 변환 게이트웨이 아키텍처가 필요하다.
|
||||||
|
|
||||||
|
**문제 P2 (단절 내성 스트리밍)**: 무선 핸드오버 또는 일시적 연결 단절 시 진행 중인 스트리밍 상태가 유실된다. 상태 보존을 위한 Resume Token 메커니즘이 필요하다.
|
||||||
|
|
||||||
|
**문제 P3 (T3 디바이스 신원 보장)**: 물리적으로 접근 가능한 T3 디바이스는 MAC 주소·IP 주소 위조가 가능하다. 하드웨어 기반 attestation(TPM/SE)이 필요하다.
|
||||||
|
|
||||||
|
**문제 P4 (에이전트 시맨틱 계층 부재)**: 원격 프로시저 호출(RPC) 수준의 통신 인터페이스는 태스크 위임, 역량 탐색, 아티팩트 교환 등 에이전트 수준의 추상화를 직접 표현하지 못한다. A2A/MCP와 같은 상위 시맨틱 레이어가 필요하다.
|
||||||
|
|
||||||
|
**문제 P5 (분산 관측성)**: 3-tier를 관통하는 에이전트 호출 체인은 단일 trace로 연결되어야 하나, T3 디바이스의 자원 제약으로 표준 OpenTelemetry 계측이 불가능하다. T2를 trace fan-out 지점으로 활용하는 경량 계측 패턴이 필요하다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 기존 접근법의 한계 분석
|
||||||
|
|
||||||
|
### 3.1 주요 통신 프로토콜 비교
|
||||||
|
|
||||||
|
엣지 AIoT 환경에서 사용되어 온 기존 통신 프로토콜들의 정량적 특성을 분석한다.
|
||||||
|
|
||||||
|
| 기술 스택 | T1↔T2 적합성 | T2↔T3 적합성 | 페이로드 오버헤드 | 스트리밍 지원 | 단절 내성 | 스키마 안전성 | 임베디드 가능성 |
|
||||||
|
| ------------------ | --------- | --------- | ------------------------- | ----------------------------- | -------------------- | ------------- | --------- |
|
||||||
|
| **REST/HTTP·JSON** | 보통 | 불가 | 매우 높음(헤더 수백 B + JSON 텍스트) | 단방향(폴링) | 없음 | 없음 | 불가 |
|
||||||
|
| **MQTT 5.0** | 과도한 복잡성 | 적합 | 낮음(헤더 2B~수십 B) | Pub/Sub QoS | QoS 1/2(세션 유지) | 없음 | 가능 |
|
||||||
|
| **CoAP** | 부적합 | 적합(저전력) | 매우 낮음(4B 헤더) | Observe(단방향) | Confirmable(제한적) | 없음 | 가능(수 KB) |
|
||||||
|
| **WebSocket** | 보통 | 불가 | 중간(HTTP 업그레이드) | 양방향 | 없음 | 없음 | 불가 |
|
||||||
|
| **gRPC/HTTP2** | 매우 적합 | 부분적 | 낮음(Protobuf 이진) | 4방향(Unary/Server/Client/Bidi) | Retry Policy(제한적) | 강함(Proto IDL) | 무거움(수 MB) |
|
||||||
|
| **QUIC/HTTP3** | 매우 적합 | 부분적 | 낮음 | 양방향 | connection migration | 없음(독립) | 무거움 |
|
||||||
|
|
||||||
|
### 3.2 REST/HTTP·JSON의 구조적 한계
|
||||||
|
|
||||||
|
REST는 웹 서비스 통합에서 지배적 패러다임이지만 엣지 AIoT에서 심각한 구조적 한계를 갖는다.
|
||||||
|
|
||||||
|
**페이로드 비효율성**: HTTP/1.1 요청의 헤더는 최소 수백 바이트에서 수 킬로바이트에 달한다. T3 디바이스가 10–200바이트의 센서 값을 전송할 때, 페이로드 대비 헤더 비율이 10:1 이상이 되어 무선 대역폭의 80% 이상이 프로토콜 오버헤드로 소비될 수 있다.
|
||||||
|
|
||||||
|
**단방향 폴링 문제**: REST는 근본적으로 요청-응답 모델이다. T1이 다수 T2/T3 에이전트의 상태를 실시간으로 수신하려면 폴링(polling) 또는 웹훅(webhook) 구성이 필요하며, 폴링은 불필요한 네트워크 트래픽을 유발하고 웹훅은 T3 MCU에서 HTTP 서버를 동작시켜야 하는 불가능한 요구 사항을 가진다.
|
||||||
|
|
||||||
|
**HTTP/1.1 HoL Blocking**: Head-of-Line Blocking으로 인해 T1↔T2 간 다수 에이전트의 동시 RPC가 직렬화되어 처리 지연이 누적된다. HTTP/2 기반인 gRPC는 이 문제를 단일 연결 내 스트림 다중화로 해결한다.
|
||||||
|
|
||||||
|
**스키마 부재**: JSON은 타입 안전성을 보장하지 않는다. T3 디바이스가 장기간 배포되면 T1과 T3의 메시지 스키마가 점진적으로 불일치해도 파싱 오류로 뒤늦게 발견된다.
|
||||||
|
|
||||||
|
### 3.3 MQTT/CoAP의 적용 범위 한계
|
||||||
|
|
||||||
|
MQTT와 CoAP는 T3 현장 디바이스에 매우 적합하지만, 3-tier 전체를 커버하는 에이전트 통신 인터페이스로서 한계를 갖는다.
|
||||||
|
|
||||||
|
**T1↔T2 부적합**: MQTT는 중앙 브로커 의존적 Pub/Sub 모델로, T1↔T2 사이의 다자간 실시간 에이전트 협의(bilateral RPC with response)에 구조적으로 부적합하다. 브로커가 단일 장애점(SPOF)이 되고, T1과 T2 간 요청-응답 상관관계 관리를 애플리케이션 계층에서 직접 구현해야 한다.
|
||||||
|
|
||||||
|
**스키마 검증 부재**: MQTT의 페이로드는 임의의 바이트열이다. MQTT 5.0에서 Content-Type 헤더가 추가되었으나, Protobuf 수준의 컴파일 타임 타입 안전성과 자동 코드 생성은 제공하지 않는다.
|
||||||
|
|
||||||
|
**에이전트 시맨틱 미지원**: 태스크 위임, 역량 광고(Agent Card), 아티팩트 교환 등 에이전트 수준의 추상화를 MQTT 토픽 계층만으로 표현하는 것은 표준화 불가능하다. 구현체마다 임의의 토픽 네이밍 규칙이 적용되어 상호운용성이 없다.
|
||||||
|
|
||||||
|
### 3.4 WebSocket의 운용 한계
|
||||||
|
|
||||||
|
WebSocket은 HTTP 업그레이드를 통해 전이중(full-duplex) 통신을 제공하지만, 엣지 AIoT 환경에서 다음과 같은 문제를 갖는다.
|
||||||
|
|
||||||
|
**Stateful 세션의 취약성**: WebSocket은 TCP 연결을 유지하는 Stateful 프로토콜이다. T2 엣지 노드가 이동 중이거나 Wi-Fi 핸드오버가 발생하면 TCP 연결이 끊어지고 WebSocket 세션 전체가 재설정되어야 한다. 이 과정에서 진행 중인 에이전트 태스크 상태가 유실된다.
|
||||||
|
|
||||||
|
**T3 구현 불가**: WebSocket 클라이언트는 HTTP 업그레이드 협상 로직과 프레이밍 레이어를 요구하여 T3 MCU의 수 KB RAM 환경에서 구현이 불가능하다.
|
||||||
|
|
||||||
|
### 3.5 gRPC 단독 사용의 한계
|
||||||
|
|
||||||
|
gRPC는 T1↔T2 백본으로서 가장 우수한 선택지이지만, 3-tier 전체에 단독 적용하는 것은 불가능하다.
|
||||||
|
|
||||||
|
**T3 자원 요구**: 표준 gRPC C++ 라이브러리는 최소 수 MB의 RAM과 수십 MB의 Flash 저장소를 요구한다. Cortex-M 기반 MCU의 일반적 사양(64–512KB RAM, 256KB–2MB Flash)과 크게 충돌한다. 경량 구현인 `nanopb`(Protobuf only)나 `grpc-lite`조차도 모든 T3 디바이스에 적용하기 어렵다.
|
||||||
|
|
||||||
|
**TCP 기반 핸드오버 취약성**: gRPC는 HTTP/2·TCP 위에서 동작하며, TCP는 IP 주소 변경 시 연결을 재설정해야 한다. V2X(차량-인프라 통신)나 모바일 헬스케어 웨어러블처럼 이동 중 지속적 스트리밍이 필요한 시나리오에서 TCP 기반 gRPC는 핸드오버마다 스트림이 중단된다.
|
||||||
|
|
||||||
|
**브라우저 진입점 부재**: gRPC는 브라우저에서 직접 사용 불가하며 gRPC-Web 프록시가 필요하다. T2 게이트웨이 관리 UI나 운영자 대시보드 통합 시 추가 인프라가 요구된다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 연구 격차 (Research Gap)
|
||||||
|
|
||||||
|
기존 연구와 기술이 다루지 못하는 공백을 다음 다섯 차원에서 식별한다.
|
||||||
|
|
||||||
|
### 4.1 프로토콜 하이브리드화의 표준 부재
|
||||||
|
|
||||||
|
현존하는 엣지 AIoT 통신 연구는 대부분 단일 프로토콜의 최적화에 집중한다. MQTT 5.0의 공유 구독 성능 [Banken et al., 2019], CoAP의 Observe 메커니즘 효율성 [Shelby et al., 2014], gRPC의 마이크로서비스 벤치마크 [Grohmann et al., 2019] 등이 대표적이다. 그러나 **T1↔T2에는 gRPC, T2↔T3에는 MQTT/CoAP를 혼용하고 T2에서 변환하는 하이브리드 아키텍처**를 체계적으로 설계하고 검증한 연구는 존재하지 않는다. 특히 변환 게이트웨이의 Resume Token 발급, 양방향 스키마 변환, trace context 전파를 통합적으로 다루는 설계 프레임워크가 없다.
|
||||||
|
|
||||||
|
### 4.2 단절 내성 에이전트 스트리밍의 미해결
|
||||||
|
|
||||||
|
QUIC RFC 9000 [Iyengar & Thomson, 2021]은 connection migration을 통해 IP 주소 변경에도 전송 연결을 유지하는 핸드오버 내성 전송을 제공한다. 그러나 QUIC는 전송 계층 프로토콜이며, 그 위에서 동작하는 **gRPC 스트리밍 세션의 에이전트 수준 Resume 시맨틱**을 정의하지 않는다. 에이전트 태스크 컨텍스트(어디까지 처리했는가, 어떤 아티팩트를 이미 전달했는가)를 보존하여 재연결 후 정확히 이어받는 Resume Token 프로토콜은 기존 연구에서 다루어지지 않았다.
|
||||||
|
|
||||||
|
### 4.3 T3 디바이스 하드웨어 Attestation의 에이전트 통합
|
||||||
|
|
||||||
|
SPIFFE/SPIRE [SPIFFE, 2024]는 제로 트러스트 워크로드 신원 프레임워크로서, 부팅 시 TPM/SE 기반 하드웨어 attestation을 통해 SPIFFE Verifiable Identity Document(SVID)를 발급한다. 그러나 기존 SPIFFE/SPIRE 적용 사례는 주로 쿠버네티스 클러스터 내 마이크로서비스 신원 관리에 집중되어 있다. **T3 임베디드 디바이스의 TPM/SE attestation을 T2 gRPC mTLS 핸드셰이크와 연계하고, T1까지 신원을 전파하는 end-to-end 신원 체인**을 MAS 에이전트 통신 인터페이스 수준에서 통합한 연구는 존재하지 않는다.
|
||||||
|
|
||||||
|
### 4.4 에이전트 시맨틱 계층과 전송 계층의 분리 설계
|
||||||
|
|
||||||
|
A2A 프로토콜 [Ray, 2024]은 에이전트 간 태스크 위임, Agent Card 기반 역량 탐색, 아티팩트 교환이라는 상위 시맨틱을 표준화한다. Anthropic MCP [Anthropic, 2024]는 단일 LLM이 도구와 데이터에 접근하는 방식을 정의한다. 그러나 두 표준 모두 **전송 계층을 명시적으로 정의하지 않으며**, "HTTP 위에서 동작한다"는 수준의 기술로 전송 계층을 추상화한다. 실제 엣지 AIoT 배포에서 T1↔T2 사이의 gRPC, T3↔T2 사이의 MQTT라는 이질적 전송 위에서 **A2A의 Task 시맨틱을 일관되게 매핑하는 인터페이스 계층**이 필요하지만, 이 설계 공백은 아직 연구되지 않았다.
|
||||||
|
|
||||||
|
### 4.5 3-tier 분산 추적의 경량 구현
|
||||||
|
|
||||||
|
OpenTelemetry [CNCF, 2024]는 분산 추적을 위한 사실상의 표준을 제공하며, gRPC Metadata를 통한 W3C traceparent/tracestate 전파가 표준화되어 있다. 그러나 T3 MCU에서 OTel SDK를 직접 실행하는 것은 자원 제약으로 불가능하다. **T2 게이트웨이를 trace fan-out 지점으로 활용하여 T3의 경량 trace segment를 수집·병합하고 Resume Token과 traceparent를 연계하는 패턴**은 기존 연구에서 제안된 바 없다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 연구 동기 (Motivation): 4대 사용 사례별 실제 요구
|
||||||
|
|
||||||
|
### 5.1 스마트 팩토리 (Industry 4.0)
|
||||||
|
|
||||||
|
스마트 팩토리는 3-tier MAS의 가장 복잡한 배치 환경이다. T1에는 생산 계획(PM), 품질 분석, 예지 정비 에이전트가 배치되고, T2에는 라인별 엣지 컨트롤러 에이전트가, T3에는 수천 개의 AGV(Automated Guided Vehicle), 협동 로봇, CCTV 카메라, 진동 센서가 배치된다.
|
||||||
|
|
||||||
|
| 통신 경로 | 핵심 요구 사항 | 현행 기술의 한계 |
|
||||||
|
|----------|-------------|---------------|
|
||||||
|
| T3 AGV ↔ T2 엣지 (충돌 회피) | p99 지연 < 10ms, 양방향 합의 | REST 폴링 불가, MQTT 단방향 한계 |
|
||||||
|
| T3 센서 → T2 (텔레메트리 팬인) | 동시 10,000 노드, 1Hz/노드 | 단일 gRPC 서버 과부하, TCP 소켓 고갈 |
|
||||||
|
| T2 ↔ T1 (분석·제어) | 배치 처리·실시간 알람 혼용 | REST 단방향, 스키마 비일관성 |
|
||||||
|
| T3 로봇 OTA 업데이트 | 단절 내성·청크 재개 | WebSocket 세션 유실, MQTT 페이로드 제한 |
|
||||||
|
|
||||||
|
특히 AGV 충돌 회피 시나리오는 에이전트 간 양방향 실시간 합의(gRPC Bidirectional Streaming)를 필요로 하며, 동시에 수천 개의 T3 센서에서 텔레메트리를 수신해야 하는 팬인(fan-in) 집계 문제와 T3 MCU의 gRPC 스택 미지원 문제를 동시에 해결해야 한다.
|
||||||
|
|
||||||
|
### 5.2 스마트 빌딩 / 에너지 관리
|
||||||
|
|
||||||
|
스마트 빌딩은 수만 개의 HVAC, 조명, PV 인버터, 스마트 미터가 T3 레이어를 형성하며, 대부분 저전력 무선(LoRa, Wi-SUN, Zigbee)으로 T2 빌딩 에너지 관리 시스템(BEMS)에 연결된다. 핵심 과제는 수백 개 건물에 걸친 피크 전력 수요 응답(Demand Response, DR)으로, T2 에이전트들이 밀리초 단위 합의 없이도 수분 단위의 전력 최적화를 수행해야 한다.
|
||||||
|
|
||||||
|
LoRa/Wi-SUN은 gRPC를 지원하지 않으며, 페이로드 크기가 10–200바이트로 극히 제한된다. T2 게이트웨이에서 LoRa 프레임을 gRPC Protobuf 메시지로 변환하는 과정에서 스키마 일관성 유지와 디바이스 신원 검증이 요구된다.
|
||||||
|
|
||||||
|
### 5.3 커넥티드 차량 / V2X (Vehicle-to-Everything)
|
||||||
|
|
||||||
|
V2X는 엣지 AIoT 3-tier에서 가장 극단적인 이동성과 지연 요구를 갖는다. 차량(T3)이 RSU(Road Side Unit, T2)와 C-V2X 또는 ETSI ITS-G5로 10ms 이내 안전 메시지를 교환하며, 동시에 5G MEC(T2)를 통해 클라우드 HD 맵(T1)을 수신한다.
|
||||||
|
|
||||||
|
핸드오버 빈도는 도심 이동 시 분당 수 회에 달한다. TCP 기반 gRPC는 핸드오버마다 연결을 재설정해야 하며, 이 과정에서 in-flight RPC가 즉시 실패한다. QUIC의 connection migration이 전송 수준에서 이를 해결하지만, 에이전트 태스크 컨텍스트의 애플리케이션 수준 Resume 시맨틱은 별도로 설계되어야 한다. 또한 차량 내 ECU(Electronic Control Unit)는 T3 임베디드 환경으로, 차량 내 하드웨어 키(TPM/HSM)를 활용한 V2X PKI 연계 attestation이 요구된다.
|
||||||
|
|
||||||
|
### 5.4 헬스케어 / 원격 모니터링
|
||||||
|
|
||||||
|
헬스케어 AIoT는 개인 정보 보호 규제(HIPAA, GDPR)와 배터리 수명 제약이라는 이중 부담을 갖는다. 웨어러블 심전도 패치나 혈당 모니터(T3)는 BLE로 병원 엣지 게이트웨이(T2)에 연결하며, 배터리는 1주~1개월을 지속해야 한다. BLE 연결은 수 분 단위로 단절되는 것이 정상 동작이므로, T2 게이트웨이가 T3의 측정값을 오프라인 큐에 보관하다 재연결 시 이어받는 Resume 패턴이 필수적이다.
|
||||||
|
|
||||||
|
부정맥·낙상 감지 등 긴급 이벤트는 T1 EHR(Electronic Health Record) 시스템에 1초 이내 알람을 전달해야 하며, 이 경로는 통상적인 배치 업로드 경로와 분리된 우선순위 스트림이 필요하다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 연구 질문 (Research Questions)
|
||||||
|
|
||||||
|
앞선 문제 정의, 기존 한계 분석, 연구 격차, 사용 사례 분석으로부터 다음 네 가지 연구 질문이 도출된다.
|
||||||
|
|
||||||
|
**RQ1 (하이브리드 프로토콜 아키텍처)**
|
||||||
|
> T1↔T2 gRPC 백본과 T2↔T3 경량 프로토콜(MQTT/CoAP)을 결합하는 2-tier 변환 게이트웨이 아키텍처를 어떻게 설계해야, 단일 프로토콜 대비 3-tier 전체의 지연·처리량·자원 효율을 동시에 최적화할 수 있는가?
|
||||||
|
|
||||||
|
*평가 지표: T3 팬인 시나리오의 처리 지연(ms), 무선 단절 후 재개 성공률(%), T3 게이트웨이 CPU/메모리 오버헤드*
|
||||||
|
|
||||||
|
**RQ2 (단절 내성 에이전트 스트리밍)**
|
||||||
|
> 무선 핸드오버 및 일시적 단절이 빈번한 T2↔T3 환경에서 gRPC 스트리밍 세션의 에이전트 태스크 컨텍스트를 보존하는 Resume Token 프로토콜을 어떻게 설계해야, 무결한 end-to-end 데이터 연속성을 보장할 수 있는가?
|
||||||
|
|
||||||
|
*평가 지표: 단절 후 데이터 누락률(%), Resume 재연결 지연(ms), Resume Token 저장 오버헤드(bytes)*
|
||||||
|
|
||||||
|
**RQ3 (하드웨어 기반 디바이스 신원)**
|
||||||
|
> TPM/SE를 탑재한 T3 디바이스의 하드웨어 attestation 결과를 T2 gRPC mTLS와 연계하고, T1까지 SPIFFE ID 체인을 end-to-end로 전파하는 신원 아키텍처를 어떻게 설계해야, T3 디바이스의 물리적 변조 위협에 대한 암호학적 방어를 제공할 수 있는가?
|
||||||
|
|
||||||
|
*평가 지표: 비인가 디바이스 차단률(%), Attestation 인증서 발급 지연(ms), TPM attestation 재검증 주기*
|
||||||
|
|
||||||
|
**RQ4 (에이전트 시맨틱 및 관측성 통합)**
|
||||||
|
> A2A 프로토콜의 Task/Agent Card 시맨틱을 gRPC 서비스 인터페이스에 매핑하고, T2를 trace fan-out 지점으로 활용한 OTel 기반 3-tier 분산 추적을 통합하는 인터페이스 계층을 어떻게 설계해야, 에이전트 협력의 end-to-end 관측성과 표준 상호운용성을 동시에 달성할 수 있는가?
|
||||||
|
|
||||||
|
*평가 지표: T3→T1 trace 연결 완전성(%), trace propagation 오버헤드(bytes/request), A2A Agent Card 탐색 지연(ms)*
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 관련 연구 (Related Work)
|
||||||
|
|
||||||
|
### 7.1 LLM 에이전트 프레임워크와 물리 배포 한계
|
||||||
|
|
||||||
|
**AutoGen** [Wu et al., 2023]은 멀티 에이전트 대화를 통해 복잡한 태스크를 해결하는 프레임워크로, ConversableAgent 추상화를 통해 에이전트 간 메시지 교환을 정의한다. 그러나 AutoGen의 통신 인터페이스는 동일 프로세스 내 함수 호출 또는 동일 네트워크 내 HTTP 요청을 전제로 하며, T3 MCU나 무선 단절 환경에 대한 설계 고려가 없다.
|
||||||
|
|
||||||
|
**CrewAI**는 역할 기반 에이전트 팀 구성을 추상화하지만, 에이전트 통신은 Python 함수 호출 수준에 머물러 있으며 분산 배포 시나리오를 직접 지원하지 않는다.
|
||||||
|
|
||||||
|
**LangGraph** [LangChain, 2024]는 에이전트 워크플로를 유향 비순환 그래프(DAG)로 모델링하여 상태 관리를 강화한다. 체크포인트(checkpoint) 메커니즘으로 일부 재개 기능을 제공하지만, 네트워크 단절 시 실시간 스트리밍 세션의 Resume 시맨틱은 다루지 않는다.
|
||||||
|
|
||||||
|
이 세 프레임워크의 공통 한계는 **"물리적 분산"을 논리적 분산(마이크로서비스)으로 환원**한다는 점이다. 자원 이종성, 무선 단절, 임베디드 디바이스 신원이라는 엣지 AIoT의 고유 제약은 설계 공간에 포함되지 않는다.
|
||||||
|
|
||||||
|
### 7.2 A2A 프로토콜: 상위 시맨틱 표준의 전송 계층 미정의
|
||||||
|
|
||||||
|
Ray [2024]의 A2A 프로토콜 리뷰는 에이전트 간 협력의 상위 시맨틱 표준화에 대한 포괄적 분석을 제공한다. A2A는 Agent Card(역량 광고), Task(태스크 위임 컨트랙트), Artifact(구조화된 출력), Push 알림을 통해 이질적 에이전트 간 상호운용성을 가능케 한다. HTTP·JSON-RPC 2.0·SSE를 기반 전송으로 사용하고, 기존 엔터프라이즈 인프라(로드밸런서, 프록시, OTel)와의 호환성을 목표로 설계되었다.
|
||||||
|
|
||||||
|
그러나 A2A는 전송 계층을 명시적으로 정의하지 않는다. 논문은 "엣지 배포에서 CBOR/MessagePack 경량 인코딩과 WebAssembly 런타임, 게이트웨이 위임이 필요하다"고 언급하지만 [Ray, 2024, §V], 구체적인 설계 방안을 제시하지 않는다. 특히 T3 MCU에서 A2A Task 시맨틱을 어떻게 경량화하여 표현하고, T2 게이트웨이가 MQTT 메시지와 A2A Task 간 변환을 어떻게 수행하는지에 대한 설계 공백이 존재한다.
|
||||||
|
|
||||||
|
### 7.3 MARL 협력적 위치 추정: T2-T3 협력의 학술 선례
|
||||||
|
|
||||||
|
Tedeschini et al. [2024]은 협력적 차량 위치 추정 문제를 분산 부분 관측 마르코프 결정 과정(Dec-POMDP)으로 정식화하고 ICP-MAPPO 알고리즘을 제안하였다. 이 연구는 T2-T3 계층의 에이전트가 제한된 로컬 관측으로 협력하여 전역 추정 정확도를 향상시킬 수 있음을 실증한다는 점에서 본 연구의 T2↔T3 협력 아키텍처 설계에 학술적 선례를 제공한다.
|
||||||
|
|
||||||
|
그러나 이 연구는 알고리즘 수준의 기여에 집중하며, 에이전트 간 실제 통신 인터페이스(프로토콜, 지연, 단절 내성)는 시뮬레이션 환경에서 추상화되어 있다. 실제 무선 네트워크 위에서의 구현 시 나타나는 통신 계층 문제는 다루지 않는다.
|
||||||
|
|
||||||
|
### 7.4 Holochain DHT + IoT: 탈중앙화 디바이스 탐색
|
||||||
|
|
||||||
|
Gaba et al. [2023]은 Holochain 분산 해시 테이블(DHT)을 IoT 디바이스 탐색과 신원 관리에 적용하는 방안을 제안한다. 중앙 브로커 없이 디바이스가 P2P로 자신을 광고하고 탐색할 수 있다는 점에서 T3 디바이스의 동적 등록 문제에 대한 흥미로운 접근이다.
|
||||||
|
|
||||||
|
그러나 Holochain DHT는 상당한 계산 자원을 요구하며, T3 MCU에서의 직접 실행은 현실적이지 않다. 또한 블록체인 기반 탈중앙화 아키텍처는 실시간성과 결정론적 지연 보장이 어려워, p99 지연 < 10ms가 요구되는 스마트 팩토리 AGV 협업 시나리오에 적용하기 어렵다. 본 연구는 탈중앙화보다 **T2 중간 계층 집중 검증**을 통한 현실적 신원 보장을 채택한다.
|
||||||
|
|
||||||
|
### 7.5 QUIC RFC 9000: 핸드오버 내성 전송
|
||||||
|
|
||||||
|
Iyengar & Thomson [2021]의 QUIC RFC 9000은 UDP 위에서 멀티플렉싱, 암호화, connection migration을 제공하는 전송 프로토콜을 정의한다. Connection migration은 IP 주소나 포트가 변경되어도 연결 ID(Connection ID)를 유지하여 핸드오버 시 전송 계층 연결이 끊어지지 않도록 한다.
|
||||||
|
|
||||||
|
QUIC은 V2X와 모바일 헬스케어 시나리오에서 전송 계층 핸드오버 문제를 근본적으로 해결한다. 그러나 QUIC/HTTP3 위에서 gRPC를 실행하는 표준(gRPC over HTTP3)은 아직 실험적 단계이며, 더 중요하게는 QUIC의 connection migration이 전송 연결을 유지해도 **그 위의 gRPC 스트리밍 세션의 에이전트 태스크 상태**는 애플리케이션 계층에서 별도로 관리해야 한다. Resume Token은 QUIC과 독립적으로 필요한 에이전트 수준 메커니즘이다.
|
||||||
|
|
||||||
|
### 7.6 SPIFFE/SPIRE: 제로 트러스트 워크로드 신원
|
||||||
|
|
||||||
|
SPIFFE(Secure Production Identity Framework for Everyone) [SPIFFE, 2024]와 그 참조 구현인 SPIRE는 쿠버네티스 등 동적 클라우드 환경에서 워크로드 신원을 자동으로 발급·갱신한다. gRPC mTLS와 결합하면 서비스 간 인증을 인증서 기반으로 자동화할 수 있다.
|
||||||
|
|
||||||
|
기존 SPIFFE/SPIRE 연구는 주로 클라우드 네이티브 환경에 집중한다. T3 임베디드 디바이스에 SPIRE Agent를 직접 설치하는 것은 자원 제약으로 불가능하며, TPM/SE를 활용한 하드웨어 attestation 기반 SVID 발급을 T2 게이트웨이가 대리 수행하는 위임 패턴은 기존 연구에서 충분히 다루어지지 않았다. 본 연구는 이 위임 attestation 아키텍처를 에이전트 통신 인터페이스의 보안 계층으로 통합한다.
|
||||||
|
|
||||||
|
### 7.7 OpenTelemetry와 분산 추적
|
||||||
|
|
||||||
|
OpenTelemetry [CNCF, 2024]는 분산 추적, 메트릭, 로그를 위한 통합 계측 표준으로, gRPC는 W3C traceparent/tracestate를 Metadata Carrier로 전파하는 공식 계측 라이브러리를 제공한다. 이를 통해 T1→T2 호출 그래프의 분산 추적이 자동화된다.
|
||||||
|
|
||||||
|
그러나 OTel SDK를 T3 MCU에 직접 통합하는 것은 메모리 요구와 네트워크 오버헤드로 불가능하다. 기존 연구에서는 "게이트웨이를 통한 간접 계측"을 언급하지만 [CNCF, 2024], T3의 경량 trace segment를 T2 게이트웨이가 수집·병합하고 Resume Token에 traceparent를 임베드하는 구체적 패턴은 정의되지 않았다.
|
||||||
|
|
||||||
|
### 7.8 gRPC 엣지 AIoT 벤치마크 연구
|
||||||
|
|
||||||
|
Grohmann et al. [2019]의 마이크로서비스 벤치마크는 gRPC가 REST/JSON 대비 페이로드 50–80% 절감, CPU 파싱 시간 60% 절감의 효과를 보인다고 보고한다. 그러나 이 벤치마크는 안정적인 데이터센터 네트워크를 가정한다. 무선 손실·지연 변동·T3 팬인 집계 시나리오에서 gRPC와 하이브리드 프로토콜 아키텍처의 성능 비교는 아직 이루어지지 않았다.
|
||||||
|
|
||||||
|
### 7.9 관련 연구 비교 요약
|
||||||
|
|
||||||
|
| 연구/기술 | 에이전트 시맨틱 | gRPC 활용 | T3 지원 | 단절 내성 | 하드웨어 Attestation | 분산 추적 | 본 연구와의 차이 |
|
||||||
|
|----------|---------------|----------|---------|----------|---------------------|---------|--------------|
|
||||||
|
| AutoGen/CrewAI/LangGraph | 높음 | 미정의 | 없음 | 없음 | 없음 | 없음 | 물리 배포·전송 계층 미해결 |
|
||||||
|
| A2A Protocol [Ray, 2024] | 매우 높음 | 미정의 | 언급만 | 없음 | 없음 | 부분 | 전송 계층 설계 공백 |
|
||||||
|
| MARL Cooperative [Tedeschini, 2024] | 알고리즘 | 없음 | T3 협력 | 없음 | 없음 | 없음 | 시뮬레이션, 통신 인터페이스 미설계 |
|
||||||
|
| Holochain DHT [Gaba, 2023] | 탐색 | 없음 | 부분 | 없음 | 없음 | 없음 | 실시간성 불충분, T3 직접 실행 불가 |
|
||||||
|
| QUIC RFC 9000 [Iyengar, 2021] | 없음 | 부분 | 없음 | 전송 계층 | 없음 | 없음 | 에이전트 레벨 Resume 미정의 |
|
||||||
|
| SPIFFE/SPIRE | 없음 | mTLS 통합 | 없음 | 없음 | 클라우드 | 없음 | T3 위임 Attestation 미정의 |
|
||||||
|
| **본 연구** | A2A/MCP 매핑 | T1↔T2 백본 | 변환 게이트웨이 | Resume Token | TPM/SE 위임 | T2 fan-out | **통합 설계** |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. 소결
|
||||||
|
|
||||||
|
엣지 AIoT의 3-tier 물리적 분산 환경에서 멀티 에이전트 시스템을 실제로 동작시키기 위한 통신 인터페이스는, 기존 단일 프로토콜 연구나 클라우드 중심 LLM 에이전트 프레임워크가 전제하는 것과 근본적으로 다른 제약 조건 위에 설계되어야 한다. REST/HTTP·JSON은 T3 팬인과 스트리밍에 구조적으로 부적합하고, MQTT/CoAP는 T1↔T2 에이전트 협의와 스키마 안전성을 보장하지 못하며, gRPC 단독으로는 T3 임베디드 환경에 배포할 수 없다. A2A는 에이전트 시맨틱을 표준화하지만 전송 계층을 정의하지 않으며, QUIC은 전송 핸드오버를 해결하지만 에이전트 태스크 Resume 시맨틱을 제공하지 않는다. 이 연구는 이 다섯 가지 기술의 공백이 교차하는 지점—즉, **2-tier 프로토콜 변환 게이트웨이, Resume Token 기반 단절 내성 스트리밍, TPM/SE 위임 Attestation, A2A 시맨틱 매핑, T2 기반 분산 추적 fan-out의 통합 설계**—을 정면으로 다루는 최초의 시도로, 엣지 AIoT 멀티 에이전트 시스템의 실세계 배포 가능성을 열기 위해 지금 이 시점에 반드시 수행되어야 하는 연구이다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 참고문헌
|
||||||
|
|
||||||
|
[1] Wu et al., "AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation," *arXiv:2308.08155*, 2023.
|
||||||
|
|
||||||
|
[2] Ray, P.P., "A Review on Agent-to-Agent Protocol: Concept, State-of-the-art, Challenges and Future Directions," 2024.
|
||||||
|
|
||||||
|
[3] Tedeschini, B.C. et al., "Decentralized Multi-Agent Reinforcement Learning for Cooperative Positioning in Infrastructure-less Networks," *IEEE Transactions on Wireless Communications*, 2024.
|
||||||
|
|
||||||
|
[4] Gaba, G.S. et al., "Holochain-Based Decentralized IoT Device Identity Management," *IEEE Internet of Things Journal*, 2023.
|
||||||
|
|
||||||
|
[5] Iyengar, J. & Thomson, M., "QUIC: A UDP-Based Multiplexed and Secure Transport," *RFC 9000*, IETF, 2021.
|
||||||
|
|
||||||
|
[6] SPIFFE Project, "SPIFFE: Secure Production Identity Framework for Everyone," *https://spiffe.io*, 2024.
|
||||||
|
|
||||||
|
[7] Anthropic, "Model Context Protocol Specification," *https://modelcontextprotocol.io*, 2024.
|
||||||
|
|
||||||
|
[8] gRPC Authors, "gRPC Documentation — Protocol Buffers & HTTP/2," *https://grpc.io*, 2024.
|
||||||
|
|
||||||
|
[9] Buf Technologies, "Buf Schema Registry," *https://buf.build*, 2024.
|
||||||
|
|
||||||
|
[10] OpenTelemetry, "W3C Trace Context & gRPC Instrumentation," *https://opentelemetry.io*, 2024.
|
||||||
|
|
||||||
|
[11] Banks, A. & Gupta, R., "MQTT Version 5.0," *OASIS Standard*, 2019.
|
||||||
|
|
||||||
|
[12] Shelby, Z. et al., "The Constrained Application Protocol (CoAP)," *RFC 7252*, IETF, 2014.
|
||||||
|
|
||||||
|
[13] ETSI, "ITS-G5: Intelligent Transport Systems — LTE-V2X," *EN 302 637-2*, 2019.
|
||||||
|
|
||||||
|
[14] Grohmann, J. et al., "Detecting Microservice Performance Anti-Patterns in Continuous Delivery Pipelines," *IEEE ICSOC*, 2019.
|
||||||
|
|
||||||
|
[15] IoT Analytics, "State of IoT 2024: Number of Connected IoT Devices Growing 13% to 18.8 Billion," 2024.
|
||||||
|
|
||||||
|
[16] CNCF, "OpenTelemetry Project Documentation," *https://opentelemetry.io*, 2024.
|
||||||
@@ -0,0 +1,387 @@
|
|||||||
|
# 연구 계획서 (Research Planning)
|
||||||
|
|
||||||
|
**제목 (잠정):** 엣지 AIoT 환경에서 A2A/gRPC 이중 계층 기반 멀티 에이전트 통신 인터페이스 설계 및 검증
|
||||||
|
|
||||||
|
**버전:** 0.1 (2026-06-07)
|
||||||
|
**상태:** 초안
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 연구 제목 및 키워드
|
||||||
|
|
||||||
|
### 한국어 제목
|
||||||
|
엣지 AIoT 환경에서 A2A/gRPC 이중 계층 기반 멀티 에이전트 통신 인터페이스 설계 및 검증
|
||||||
|
|
||||||
|
### 영문 제목 (잠정)
|
||||||
|
Design and Validation of a Dual-Layer Multi-Agent Communication Interface Based on A2A/gRPC for Edge AIoT Environments
|
||||||
|
|
||||||
|
### 핵심 키워드
|
||||||
|
|
||||||
|
| 범주 | 키워드 |
|
||||||
|
|------|--------|
|
||||||
|
| 시스템 구조 | Multi-Agent System (MAS), Edge AIoT, 3-tier 분산 아키텍처, Edge Gateway |
|
||||||
|
| 통신 프로토콜 | gRPC, QUIC, MQTT v5, CoAP, A2A (Agent-to-Agent), MCP (Model Context Protocol) |
|
||||||
|
| 보안/신원 | SPIFFE/SPIRE, TPM, Secure Element, Hardware Attestation, mTLS |
|
||||||
|
| 관측성 | OpenTelemetry, W3C traceparent, Distributed Tracing |
|
||||||
|
| 응용 도메인 | Smart Factory, Smart Building, V2X, Connected Healthcare |
|
||||||
|
| 경량화/직렬화 | Protocol Buffers, CBOR, MessagePack, gRPC-Lite |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 연구 동기 및 비전
|
||||||
|
|
||||||
|
### 2.1 현재 세계의 문제
|
||||||
|
|
||||||
|
현재 엣지 AIoT 분야에서 멀티 에이전트 시스템(MAS)을 실제 배포할 때 세 가지 근본적인 긴장이 공존한다.
|
||||||
|
|
||||||
|
**첫째, 물리적 이질성과 단일 프로토콜의 부조화.** AutoGen, CrewAI, LangGraph 같은 LLM 에이전트 프레임워크는 실제 배포 시 Cloud(T1) ↔ Edge Gateway(T2) ↔ Field IoT/Robot/Sensor(T3)의 3-tier 물리 분산 위에 얹힌다. T1은 TB급 RAM과 GPU를 갖춘 데이터센터 서버이고, T3는 수십 KB RAM을 가진 MCU(Cortex-M)이다. 이 이질적인 두 끝을 REST 하나나 MQTT 하나로 연결하려는 시도는 필연적으로 한쪽 tier에서 과부하 혹은 동작 불능을 일으킨다.
|
||||||
|
|
||||||
|
**둘째, 에이전트 시맨틱 계층과 전송 계층의 혼재.** Google A2A 프로토콜[33]과 Anthropic MCP[9]는 에이전트 간 조율을 위한 상위 시맨틱 계층(Agent Communication Language의 현대적 구현)이다. 그러나 이들은 하위 전송 계층의 선택을 명시하지 않는다. 결과적으로 "A2A over REST over TCP"처럼 전송 계층이 에이전트 시맨틱 계층의 병목이 되는 구조가 현장에서 반복된다.
|
||||||
|
|
||||||
|
**셋째, 보안 경계의 물리적 취약성.** T3 현장 디바이스는 공장 바닥, 도로변 RSU, 병원 병상 옆에 물리적으로 노출되어 있다. 단순한 IP/MAC 주소나 공유 API 키로는 디바이스 신원을 보장할 수 없다. 그러나 현존하는 MAS 프레임워크 대부분은 디바이스 수준의 하드웨어 attestation을 통신 설계에 통합하지 않는다.
|
||||||
|
|
||||||
|
### 2.2 해결하고자 하는 세계
|
||||||
|
|
||||||
|
본 연구가 그리는 목표 상태는 다음과 같다:
|
||||||
|
|
||||||
|
- **A2A/MCP 에이전트 조율 계층**과 **gRPC/QUIC 전송 계층**이 명확히 분리되고, 그 경계에서 서로를 강화한다.
|
||||||
|
- T2 엣지 게이트웨이가 프로토콜 변환, Resume Token 기반 단절 내성, 하드웨어 attestation 중계, 분산 트레이싱 fan-out을 일원화하여 처리한다.
|
||||||
|
- 개발자는 `.proto` 파일 하나를 작성하면 T1(Python/Go), T2(C++/Rust), T3(C nanopb)용 타입 안전 SDK를 자동으로 얻는다.
|
||||||
|
- 현장 디바이스 교체 없이 TPM/SE 하드웨어 attestation이 SPIFFE/SPIRE SVID로 체인 연결되어, T1의 Istio 서비스 메시까지 신원이 전파된다.
|
||||||
|
|
||||||
|
### 2.3 5년 후 목표 (2031)
|
||||||
|
|
||||||
|
2031년 기준, 본 연구에서 제안하는 2-tier 프로토콜 아키텍처 + A2A/gRPC 이중 계층이 다음 형태로 실현되는 것을 목표로 한다:
|
||||||
|
|
||||||
|
1. 스마트 팩토리, 스마트 빌딩, V2X, 헬스케어 4개 영역에서 실제 배포 사례 확보
|
||||||
|
2. 관련 표준(IETF, ETSI, OMA) 기고 1건 이상
|
||||||
|
3. 오픈소스 레퍼런스 구현체(T2 게이트웨이 + gRPC 인터셉터 라이브러리) 커뮤니티 운영
|
||||||
|
4. 엣지 AIoT MAS 통신 설계에 관한 피인용 지수 상위 연구로 자리매김
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 연구 목표 (Research Objectives)
|
||||||
|
|
||||||
|
### RO-1. 엣지 AIoT 3-tier 통신 요구사항의 체계적 도출과 정량화
|
||||||
|
|
||||||
|
기존 문헌(FINAL_REPORT §3~4)에서 도출된 4대 사용 사례(스마트 팩토리, 스마트 빌딩, V2X, 헬스케어)의 통신 특성을 계층별·경로별로 정량 분류한다. 특히 지연, 처리량, 단절 빈도, 페이로드 크기, 에너지 소비의 5개 차원에서 tier 간 격차를 측정 가능한 수치로 표현한다.
|
||||||
|
|
||||||
|
**성공 기준:** 각 tier 쌍(T1↔T2, T2↔T3)에 대해 5개 차원의 요구 범위가 명시된 참조 테이블 완성
|
||||||
|
|
||||||
|
### RO-2. A2A/MCP 시맨틱 계층과 gRPC 전송 계층의 이중 계층 인터페이스 설계
|
||||||
|
|
||||||
|
A2A 프로토콜[33,45]을 상위 에이전트 조율 계층으로, gRPC(HTTP/2 또는 QUIC)를 하위 전송 계층으로 사용하는 명시적 계층 분리 아키텍처를 설계한다. 두 계층이 상호 작용하는 접합점(Binding Point)에서 메시지 매핑, 컨텍스트 전파, 에러 코드 변환 방식을 명세한다.
|
||||||
|
|
||||||
|
**성공 기준:** A2A Task 생명주기 ↔ gRPC 스트리밍 모드 매핑 명세서(인터페이스 계약 문서) 완성
|
||||||
|
|
||||||
|
### RO-3. T2 엣지 게이트웨이의 다기능 통합 설계 및 구현
|
||||||
|
|
||||||
|
프로토콜 변환(MQTT/CoAP↔gRPC), Resume Token 기반 단절 내성, SPIFFE/SPIRE 기반 디바이스 attestation 중계, OpenTelemetry trace fan-out을 단일 T2 게이트웨이 컴포넌트에서 처리하는 설계와 프로토타입 구현을 수행한다.
|
||||||
|
|
||||||
|
**성공 기준:** T3 디바이스 100개 동시 연결 환경에서 T2 게이트웨이의 프로토콜 변환 지연 < 5ms (p99)
|
||||||
|
|
||||||
|
### RO-4. 이중 계층 아키텍처의 실험적 검증
|
||||||
|
|
||||||
|
제안 아키텍처를 실험 환경(테스트베드 또는 에뮬레이션)에서 구현하고, 기존 단일 프로토콜(REST+JSON, MQTT-only) 대비 지연, 처리량, 핸드오버 복구 시간, 에너지 소비 면에서 우월성을 실험으로 입증한다. 4대 사용 사례 시나리오 각각에 대한 KPI 달성 여부를 검증한다.
|
||||||
|
|
||||||
|
**성공 기준:** 4개 시나리오 모두에서 제안 아키텍처가 베이스라인 대비 지연 30% 이상 개선 또는 단절 복구 시간 50% 이상 단축
|
||||||
|
|
||||||
|
### RO-5. 보안 및 신원 관리의 엔드투엔드 검증
|
||||||
|
|
||||||
|
T3 디바이스의 TPM/SE 기반 하드웨어 attestation이 SPIFFE/SPIRE SVID 체인으로 T1 클라우드 메시까지 전파되는 과정의 무결성을 검증한다. 비인가 디바이스, 인증서 만료, attestation 실패 시나리오에서 시스템이 올바르게 거부하는지 확인한다.
|
||||||
|
|
||||||
|
**성공 기준:** 비인가 디바이스의 T2 게이트웨이 접근 시 전송 계층 이전 단계에서 100% 차단 확인
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 연구 범위 (Scope)
|
||||||
|
|
||||||
|
### 4.1 In-scope (연구 범위 내)
|
||||||
|
|
||||||
|
| 범주 | 포함 항목 |
|
||||||
|
|------|-----------|
|
||||||
|
| **아키텍처 설계** | A2A/MCP 계층과 gRPC 전송 계층의 인터페이스 설계; T2 게이트웨이 컴포넌트 설계; 3-tier 프로토콜 매트릭스 |
|
||||||
|
| **프로토콜** | gRPC(HTTP/2, HTTP/3-over-QUIC), MQTT v5, CoAP RFC 7252, A2A, MCP; CBOR/MessagePack 직렬화 비교 |
|
||||||
|
| **보안/신원** | SPIFFE/SPIRE SVID 발급 흐름; TPM 2.0 / Secure Element attestation 연동; mTLS 체인 |
|
||||||
|
| **관측성** | OpenTelemetry SDK 통합; W3C traceparent 멀티 홉 전파; T2를 trace fan-out 지점으로 활용 |
|
||||||
|
| **단절 내성** | Resume Token 메커니즘; QUIC connection migration; gRPC Retry Policy |
|
||||||
|
| **사용 사례 검증** | 스마트 팩토리, 스마트 빌딩/에너지, V2X, 헬스케어 4개 시나리오 |
|
||||||
|
| **구현/실험** | T2 게이트웨이 프로토타입(Go 또는 Rust); 에뮬레이션 테스트베드; 성능 벤치마크 |
|
||||||
|
|
||||||
|
### 4.2 Out-of-scope (연구 범위 외)
|
||||||
|
|
||||||
|
| 범주 | 제외 이유 |
|
||||||
|
|------|-----------|
|
||||||
|
| **LLM 모델 자체의 추론 성능** | 전송/통신 계층 연구; 모델 개선은 별도 연구 영역 |
|
||||||
|
| **T3 디바이스 하드웨어 설계** | 기존 상용 MCU/센서 활용을 전제 |
|
||||||
|
| **사용 사례별 도메인 AI 알고리즘** | 예측 정비 알고리즘, V2X 경로 계획 등은 통신 인터페이스 연구의 종속 변수가 아님 |
|
||||||
|
| **클라우드 내부 서비스 메시 최적화** | T1 내부 Istio 튜닝은 참조 아키텍처 수준으로만 다룸 |
|
||||||
|
| **상용 V2X PKI 인프라 구축** | V2X 사례에서 PKI는 기존 ETSI ITS PKI를 전제 |
|
||||||
|
| **실규모 현장 배포(production deployment)** | Phase 4 이후 후속 연구로 분리 |
|
||||||
|
| **WebSocket / HTTP/1.1 기반 통신** | 기술적 열위가 기존 문헌에서 확립됨; 비교군으로만 활용 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 연구 방법론
|
||||||
|
|
||||||
|
본 연구는 **설계 과학(Design Science Research)** 방법론을 기반으로 세 단계(설계 → 구현 → 실험 검증)를 순환한다.
|
||||||
|
|
||||||
|
### 5.1 1단계: 요구사항 분석 및 아키텍처 설계
|
||||||
|
|
||||||
|
```
|
||||||
|
[문헌 조사]
|
||||||
|
A2A 프로토콜 명세, gRPC 문서, QUIC RFC 9000, SPIFFE/SPIRE 백서,
|
||||||
|
MQTT v5, CoAP RFC 7252, OpenTelemetry 명세,
|
||||||
|
선행 사례: Tedeschini[29], Bosse[31], Minelli[32], Ghosh[34]
|
||||||
|
|
||||||
|
↓
|
||||||
|
|
||||||
|
[4대 사용 사례 통신 요구사항 정량화]
|
||||||
|
KPI 테이블 작성 (지연, 처리량, 단절 빈도, 페이로드 크기, 에너지)
|
||||||
|
tier 쌍별 요구 격차 분석
|
||||||
|
|
||||||
|
↓
|
||||||
|
|
||||||
|
[이중 계층 인터페이스 아키텍처 설계]
|
||||||
|
계층 1: A2A/MCP 시맨틱 계층 (Task/Message/Artifact 타입 매핑)
|
||||||
|
계층 2: gRPC 전송 계층 (Unary/Streaming 모드 선택 기준)
|
||||||
|
T2 게이트웨이 6대 책임 명세 (변환·정규화·버퍼링·Resume·Attestation·Metrics)
|
||||||
|
|
||||||
|
↓
|
||||||
|
|
||||||
|
[보안·신원 아키텍처 설계]
|
||||||
|
SPIFFE ID 네임스페이스 설계 (T1/T2/T3 tier별)
|
||||||
|
TPM/SE attestation → SPIRE Agent 연동 흐름
|
||||||
|
mTLS 체인 전파 명세
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5.2 2단계: 프로토타입 구현
|
||||||
|
|
||||||
|
#### 구현 컴포넌트
|
||||||
|
|
||||||
|
| 컴포넌트 | 언어/런타임 | tier |
|
||||||
|
|---------|-----------|------|
|
||||||
|
| T1 클라우드 에이전트 (A2A 서버) | Python (FastAPI + grpcio) | T1 |
|
||||||
|
| T2 게이트웨이 (변환·Resume·Attestation) | Go (grpc-go + paho-mqtt) | T2 |
|
||||||
|
| T3 경량 에이전트 (MQTT 클라이언트) | C (nanopb + Paho-C) | T3 |
|
||||||
|
| SPIRE Server/Agent | Go (공식 SPIRE 릴리즈) | T1/T2/T3 |
|
||||||
|
| OpenTelemetry Collector | YAML 설정 | T1 |
|
||||||
|
| 테스트베드 에뮬레이터 | Python (Docker Compose + tc netem) | 인프라 |
|
||||||
|
|
||||||
|
#### 핵심 구현 모듈
|
||||||
|
|
||||||
|
1. **A2A-gRPC Binding Layer**: A2A Task 생성/업데이트 이벤트를 gRPC Bidi Streaming으로 전달하는 인터셉터
|
||||||
|
2. **MQTT-gRPC Protocol Bridge**: T3 MQTT topic → T2 gRPC method 동적 라우팅 테이블
|
||||||
|
3. **Resume Token Manager**: 스트림 오프셋 추적, 재연결 시 이어받기 로직
|
||||||
|
4. **Attestation Proxy**: T3 TPM Quote → SPIRE Agent verify → SVID 발급 체인
|
||||||
|
5. **Trace Fan-out Interceptor**: traceparent를 T3 MQTT 페이로드에 임베드/추출
|
||||||
|
|
||||||
|
### 5.3 3단계: 실험 검증
|
||||||
|
|
||||||
|
#### 실험 환경 구성
|
||||||
|
|
||||||
|
```
|
||||||
|
[에뮬레이션 테스트베드]
|
||||||
|
T1: 1 × x86 서버 (16 vCPU, 32GB RAM, Docker k3s)
|
||||||
|
T2: 2 × Jetson Orin (또는 Docker 에뮬레이션)
|
||||||
|
T3: 100 × MQTT 클라이언트 에뮬레이터 (python-paho + tc netem 지연/손실 주입)
|
||||||
|
|
||||||
|
[네트워크 조건 에뮬레이션]
|
||||||
|
T1↔T2: 광역 무선 (50ms RTT, 1% 패킷 손실)
|
||||||
|
T2↔T3: 불안정 IoT (200ms RTT, 5% 손실, 핸드오버 시뮬레이션)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 측정 지표
|
||||||
|
|
||||||
|
| 지표 | 단위 | 목표값 |
|
||||||
|
|------|------|--------|
|
||||||
|
| T1↔T2 RPC 지연 (Unary, p99) | ms | < 100ms (50ms RTT 환경) |
|
||||||
|
| T2 게이트웨이 프로토콜 변환 지연 (p99) | ms | < 5ms |
|
||||||
|
| 핸드오버 후 스트림 복구 시간 | ms | < 500ms |
|
||||||
|
| T3 100 노드 동시 fan-in 처리량 | msg/s | > 5,000 msg/s |
|
||||||
|
| Resume Token 재접속 손실 메시지 수 | 개 | 0 |
|
||||||
|
| 비인가 디바이스 접근 차단율 | % | 100% |
|
||||||
|
|
||||||
|
#### 비교 대상 (베이스라인)
|
||||||
|
|
||||||
|
1. REST+JSON over HTTP/1.1 (단일 프로토콜)
|
||||||
|
2. MQTT-only (T1-T3 직접 연결, 중간 변환 없음)
|
||||||
|
3. gRPC-only (T3 경량화 없이 전 tier 동일 gRPC 스택)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 기대 기여 (Contributions)
|
||||||
|
|
||||||
|
### 6.1 학문적 기여
|
||||||
|
|
||||||
|
| 기여 | 내용 |
|
||||||
|
|------|------|
|
||||||
|
| **C1. 이중 계층 인터페이스 모델** | A2A 시맨틱 계층과 gRPC 전송 계층의 명시적 분리 및 접합점(Binding Point) 정형화. 기존 연구[34]의 MCP+A2A 통합 논의를 3-tier 물리 분산 환경으로 확장 |
|
||||||
|
| **C2. 엣지 AIoT 통신 요구사항 분류 체계** | 지연·처리량·단절 빈도·페이로드·에너지 5차원 분류 프레임워크. 4대 사용 사례를 포괄하는 최초의 체계적 분류 |
|
||||||
|
| **C3. T2 게이트웨이 다기능 통합 설계 패턴** | Resume Token + Attestation Proxy + Trace Fan-out을 단일 컴포넌트에서 처리하는 아키텍처 패턴. 설계 과학 관점에서 재사용 가능한 패턴으로 공식화 |
|
||||||
|
| **C4. QUIC 기반 에이전트 통신 핸드오버 검증** | gRPC over QUIC의 connection migration이 멀티 에이전트 협업(V2X 시나리오)에서 제공하는 핸드오버 투명성을 Simpson[84] 연구 기반으로 실험 검증 |
|
||||||
|
| **C5. CBOR/MessagePack vs Protobuf 비교** | T3 극경량 환경에서 CBOR RFC 8949[92], MessagePack[93] 대비 Protobuf의 직렬화 성능 비교 실험 데이터 제공 |
|
||||||
|
|
||||||
|
### 6.2 산업적 기여
|
||||||
|
|
||||||
|
| 기여 | 적용 영역 |
|
||||||
|
|------|-----------|
|
||||||
|
| **오픈소스 T2 게이트웨이 레퍼런스 구현** | 스마트 팩토리, 스마트 빌딩 시스템 통합 업체 |
|
||||||
|
| **프로토콜 선택 의사결정 가이드** | IoT 플랫폼 아키텍트 (tier별 프로토콜 선택 기준 체크리스트) |
|
||||||
|
| **SPIFFE/SPIRE 기반 IoT 신원 관리 패턴** | 헬스케어, 자동화 제조 영역의 규제 준수(IEC 62443, HIPAA) |
|
||||||
|
| **엣지 AIoT MAS 성능 벤치마크 기준점** | 신규 에지 컴퓨팅 플랫폼 평가 기준 제공 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 연구 로드맵
|
||||||
|
|
||||||
|
### Phase 1: 기반 연구 및 설계 (2026년 Q3, 3개월)
|
||||||
|
|
||||||
|
**목표:** 요구사항 정량화 완료 + 이중 계층 아키텍처 설계 문서 완성
|
||||||
|
|
||||||
|
| 주차 | 활동 | 산출물 |
|
||||||
|
|------|------|--------|
|
||||||
|
| 1–2주 | 핵심 문헌 심층 리뷰 (A2A[33,45], Ghosh[34], Simpson[84], Tedeschini[29]) | 문헌 요약 노트 |
|
||||||
|
| 3–4주 | 4대 사용 사례 통신 KPI 정량 테이블 작성 | 요구사항 명세서 v1 |
|
||||||
|
| 5–6주 | A2A-gRPC Binding Point 명세 + T2 게이트웨이 컴포넌트 설계 | 아키텍처 설계서 v1 |
|
||||||
|
| 7–8주 | SPIFFE/SPIRE T3 attestation 흐름 설계 + Proto 스키마 초안 | 보안 설계서 v1 |
|
||||||
|
| 9–12주 | 설계 리뷰 + 논문 초안 §1~3 (서론, 배경, 아키텍처) 작성 | 논문 초안 v0.3 |
|
||||||
|
|
||||||
|
**마일스톤 M1:** 아키텍처 설계서 완성 및 내부 리뷰
|
||||||
|
|
||||||
|
### Phase 2: 프로토타입 구현 (2026년 Q4, 3개월)
|
||||||
|
|
||||||
|
**목표:** T1-T2-T3 전체 스택 프로토타입 동작 확인
|
||||||
|
|
||||||
|
| 주차 | 활동 | 산출물 |
|
||||||
|
|------|------|--------|
|
||||||
|
| 1–2주 | `.proto` 스키마 확정 + Buf Schema Registry 설정 | proto 파일 + BSR 레포 |
|
||||||
|
| 3–4주 | T2 MQTT-gRPC 브릿지 구현 (Go) | gateway v0.1 |
|
||||||
|
| 5–6주 | Resume Token Manager 구현 + 단절 재접속 테스트 | gateway v0.2 |
|
||||||
|
| 7–8주 | SPIRE Agent T3 attestation 연동 구현 | attestation-proxy v0.1 |
|
||||||
|
| 9–10주 | OpenTelemetry trace fan-out 인터셉터 구현 | otel-interceptor v0.1 |
|
||||||
|
| 11–12주 | T1 A2A 서버 + T3 MQTT 에뮬레이터 연동 end-to-end 테스트 | 통합 데모 |
|
||||||
|
|
||||||
|
**마일스톤 M2:** T1-T2-T3 e2e 흐름 동작 확인 데모
|
||||||
|
|
||||||
|
### Phase 3: 실험 검증 (2027년 Q1, 3개월)
|
||||||
|
|
||||||
|
**목표:** 제안 아키텍처의 정량 우월성 실험 입증
|
||||||
|
|
||||||
|
| 주차 | 활동 | 산출물 |
|
||||||
|
|------|------|--------|
|
||||||
|
| 1–2주 | 에뮬레이션 테스트베드 구성 (tc netem, 100 T3 노드) | 테스트베드 환경 문서 |
|
||||||
|
| 3–5주 | 베이스라인 3종 vs 제안 아키텍처 지연/처리량 벤치마크 | 벤치마크 결과 데이터 |
|
||||||
|
| 6–7주 | 핸드오버 시나리오 (V2X) 실험: QUIC connection migration | 핸드오버 실험 결과 |
|
||||||
|
| 8–9주 | 보안 실험: 비인가 디바이스 차단, 인증서 만료 복구 | 보안 실험 결과 |
|
||||||
|
| 10주 | CBOR/MessagePack vs Protobuf T3 직렬화 비교 | 직렬화 비교 데이터 |
|
||||||
|
| 11–12주 | 실험 데이터 분석 + 논문 §4~5 (실험, 결과) 작성 | 논문 초안 v0.7 |
|
||||||
|
|
||||||
|
**마일스톤 M3:** 실험 결과 데이터 완성 + 논문 초안 v0.7
|
||||||
|
|
||||||
|
### Phase 4: 논문 완성 및 제출 (2027년 Q2, 3개월)
|
||||||
|
|
||||||
|
**목표:** 학술지/학회 제출 완성
|
||||||
|
|
||||||
|
| 주차 | 활동 | 산출물 |
|
||||||
|
|------|------|--------|
|
||||||
|
| 1–3주 | 논문 §6 (토론, 한계, 향후 연구) 작성 + 전체 퇴고 | 논문 초안 v0.9 |
|
||||||
|
| 4–5주 | 동료 리뷰 (내부) + 피드백 반영 | 논문 초안 v1.0 |
|
||||||
|
| 6주 | 투고 대상 학술지/학회 선정 및 포맷 맞춤 | 제출 준비 완료 |
|
||||||
|
| 7–8주 | 제출 + 오픈소스 레포 공개 (게이트웨이 구현체) | 논문 제출, GitHub 공개 |
|
||||||
|
| 9–12주 | 리뷰 대응 (리비전) + 최종 게재 확정 | 게재 확정 |
|
||||||
|
|
||||||
|
**마일스톤 M4:** 논문 제출 완료 + 오픈소스 공개
|
||||||
|
|
||||||
|
### 전체 일정 요약
|
||||||
|
|
||||||
|
```
|
||||||
|
2026 Q3 2026 Q4 2027 Q1 2027 Q2
|
||||||
|
│─────────────│─────────────│─────────────│─────────────│
|
||||||
|
│ Phase 1 │ Phase 2 │ Phase 3 │ Phase 4 │
|
||||||
|
│ 설계 │ 구현 │ 실험 │ 논문 완성 │
|
||||||
|
│ M1 │ M2 │ M3 │ M4 │
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. 핵심 참고문헌 매핑
|
||||||
|
|
||||||
|
| 참고문헌 | 저자/출처 | 연구 기여 영역 | 연구 내 활용 위치 |
|
||||||
|
|---------|---------|--------------|-----------------|
|
||||||
|
| [4] gRPC Docs | gRPC Authors, 2024 | gRPC 프로토콜 상세 (HTTP/2, 스트리밍, 백프레셔, Health Check) | §5 아키텍처 설계, §5.2 구현 |
|
||||||
|
| [5] QUIC RFC 9000 | Iyengar & Thomson, 2021 | QUIC connection migration, 0-RTT, HOLB-free 멀티플렉싱 | §5.1 T1↔T2 전송 설계, V2X 실험 |
|
||||||
|
| [6] SPIFFE/SPIRE | SPIFFE 재단 | Zero-Trust 워크로드 신원, SVID 발급, attestation 플러그인 아키텍처 | §5.3 보안 설계, RO-5 |
|
||||||
|
| [8] OpenTelemetry | CNCF, 2024 | W3C traceparent 전파, gRPC 계측, OTel Collector 파이프라인 | §5.3 관측성 설계 |
|
||||||
|
| [11] MQTT v5 | Banks & Gupta, 2019 | MQTT Shared Subscription, Message Expiry, User Property (T3↔T2 경량 통신) | §6.2 T2↔T3 설계, T3 구현 |
|
||||||
|
| [12] CoAP RFC 7252 | Shelby et al., 2014 | Confirmable Message, Observe 옵션 (극저전력 T3 디바이스) | §6.2 저전력 T3 설계 |
|
||||||
|
| [29] Tedeschini | Tedeschini et al. | MARL 협력 위치추정, 분산 에이전트 협업 실험 방법론 | Phase 3 실험 설계 참조 |
|
||||||
|
| [31] Bosse | Bosse | 자원 제약 환경 모바일 에이전트, 경량 에이전트 런타임 패턴 | T3 에이전트 설계 (RO-3) |
|
||||||
|
| [32] Minelli | Minelli | CoMix 에이전트 조율, 분산 에이전트 합의 프로토콜 | A2A 계층 설계 참조 |
|
||||||
|
| [33] Google A2A | Google, 2024 | A2A 프로토콜 명세 (Task, Message, Artifact, Streaming 이벤트) | 핵심: §4 A2A 계층 설계, RO-2 |
|
||||||
|
| [34] Ghosh | Ghosh, 2024 | MCP+A2A 통합 엔지니어링 MAS 구현 사례 | A2A-gRPC Binding 설계 참조 |
|
||||||
|
| [45] A2A vs MCP | 미상/커뮤니티 | A2A/MCP 역할 차이 분석 (에이전트 조율 vs 도구 호출) | 계층 분리 근거 확립 |
|
||||||
|
| [84] Simpson et al. | Simpson et al. | QUIC vs TCP 핸드오버 성능 실측 비교 | Phase 3 V2X 핸드오버 실험 근거 |
|
||||||
|
| [92] CBOR RFC 8949 | Bormann & Hoffman | CBOR 이진 직렬화 명세 | Phase 3 직렬화 비교 실험 |
|
||||||
|
| [93] MessagePack | Furuhashi | MessagePack 직렬화 (CBOR 대안) | Phase 3 직렬화 비교 실험 |
|
||||||
|
| [99] Holochain DHT | Holochain Comm. | DHT 기반 IoT 보안, P2P 신원 관리 (SPIFFE 보완 관점) | RO-5 보안 설계 심화 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. 연구 가설 (Hypotheses)
|
||||||
|
|
||||||
|
가설은 모두 실험적으로 반증 가능한(falsifiable) 형태로 명세한다.
|
||||||
|
|
||||||
|
### H1. 이중 계층 아키텍처의 지연 우월성
|
||||||
|
|
||||||
|
**가설:** A2A 시맨틱 계층 + gRPC 전송 계층의 이중 계층 구조는, 동일한 3-tier 엣지 AIoT 환경에서 REST+JSON 단일 프로토콜 대비 T1↔T2 RPC 왕복 지연을 p99 기준 30% 이상 단축한다.
|
||||||
|
|
||||||
|
**검증 방법:**
|
||||||
|
- 독립 변수: 통신 아키텍처 (이중 계층 vs REST+JSON)
|
||||||
|
- 종속 변수: T1↔T2 Unary RPC 왕복 지연 (p50, p95, p99)
|
||||||
|
- 조건: 50ms RTT, 1% 패킷 손실 에뮬레이션, 동시 에이전트 50개
|
||||||
|
- 귀무 가설 H0: 두 아키텍처 간 지연 차이 없음 (유의수준 α=0.05)
|
||||||
|
|
||||||
|
**예상 근거:** Protobuf의 JSON 대비 50~80% 페이로드 절감[4] + HTTP/2 멀티플렉싱의 HOLB 제거 효과[4]
|
||||||
|
|
||||||
|
### H2. Resume Token 기반 단절 복구의 무손실성
|
||||||
|
|
||||||
|
**가설:** T2 게이트웨이의 Resume Token 메커니즘을 적용하면, T2↔T3 연결이 임의 시점에 단절 후 재접속하는 환경에서 스트리밍 중 전달되지 않은 메시지의 재전달률은 99.9% 이상이며, 이는 Resume Token 미적용 시의 단순 재연결 대비 유의미하게 높다.
|
||||||
|
|
||||||
|
**검증 방법:**
|
||||||
|
- 독립 변수: Resume Token 적용 여부
|
||||||
|
- 종속 변수: 단절 이후 복구 메시지 수 / 전체 단절 구간 메시지 수 (재전달률)
|
||||||
|
- 조건: T3 노드 단절 주기 무작위(평균 30초), 스트리밍 지속 시간 10분, 반복 50회
|
||||||
|
- 귀무 가설 H0: 두 조건 간 재전달률 차이 없음 (유의수준 α=0.05)
|
||||||
|
|
||||||
|
**예상 근거:** Resume Token이 마지막 전송 오프셋을 서버에 보존하여 재연결 시 이어받기 가능[FINAL_REPORT §7.3]
|
||||||
|
|
||||||
|
### H3. QUIC 기반 핸드오버 투명성
|
||||||
|
|
||||||
|
**가설:** gRPC over QUIC(HTTP/3)를 사용하는 T1↔T2 통신은, TCP 기반 gRPC 대비 모바일 핸드오버(IP 주소 변경) 시나리오에서 에이전트 태스크 중단 시간이 50% 이상 단축된다.
|
||||||
|
|
||||||
|
**검증 방법:**
|
||||||
|
- 독립 변수: 전송 계층 (QUIC vs TCP)
|
||||||
|
- 종속 변수: 핸드오버 발생 시점부터 에이전트 태스크 재개까지 소요 시간 (ms)
|
||||||
|
- 조건: IP 주소 변경을 tc netem으로 에뮬레이션, Bidi Streaming 활성 상태, 반복 100회
|
||||||
|
- 귀무 가설 H0: QUIC와 TCP 간 태스크 중단 시간 차이 없음 (유의수준 α=0.05)
|
||||||
|
|
||||||
|
**예상 근거:** QUIC connection migration은 IP 변경에도 Connection ID 기반으로 세션을 유지하여 TCP의 재연결 과정을 생략[Simpson et al., 84; QUIC RFC 9000, 5]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 부록: 관련 기존 연구 위치 지정
|
||||||
|
|
||||||
|
### 본 연구의 차별점
|
||||||
|
|
||||||
|
| 선행 연구 유형 | 주요 한계 | 본 연구의 차별점 |
|
||||||
|
|--------------|---------|----------------|
|
||||||
|
| LLM 에이전트 프레임워크 (AutoGen, CrewAI) | 통신 계층을 HTTP/REST에 위임, 3-tier 분산 미고려 | 명시적 계층 분리 + tier 최적 프로토콜 매핑 |
|
||||||
|
| IoT 통신 프로토콜 비교 연구 | 에이전트 시맨틱 계층 부재, 단순 성능 비교 | A2A/MCP 계층 통합 설계 |
|
||||||
|
| A2A/MCP 명세 문서 [33,45] | 하위 전송 계층 선택 미명시 | gRPC 전송 계층과의 구체적 Binding 설계 |
|
||||||
|
| 엣지 컴퓨팅 보안 연구 | 에이전트 조율과 보안 분리 설계 | SPIFFE/SPIRE를 에이전트 통신 계층에 직접 통합 |
|
||||||
|
| gRPC 엣지 배포 연구 | 에이전트 시맨틱 계층 없이 gRPC만 다룸 | A2A + gRPC 이중 계층의 공동 설계 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*작성일: 2026-06-07 | 다음 리뷰 예정: Phase 1 M1 완료 시*
|
||||||
@@ -0,0 +1,344 @@
|
|||||||
|
# 엣지 네트워크 AIoT 서비스를 위한 gRPC 기반 Multi-Agent 통신 인터페이스 설계·사용사례 분석
|
||||||
|
|
||||||
|
**저자**: Antigravity CLI (Gemini 3.5 Flash High)¹, Claude Code (Opus 4.8)², Hermes³ (공동집업·최종검토)
|
||||||
|
¹Antigravity · ²Anthropic · ³MiniMax · 2026-06-06
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 초록(Abstract)
|
||||||
|
|
||||||
|
본 연구는 **엣지 네트워크 AIoT(Artificial Intelligence of Things)** 환경에서 동작하는 다중 에이전트 서비스의 통신 인터페이스 문제를 다룬다. 엣지 AIoT는 **클라우드 서버 ↔ 엣지 게이트웨이 ↔ 현장 IoT/임베디드/로봇/센서 디바이스** 의 3-tier 물리적 분산 구조를 가지며, 각 tier는 **극도로 이질적인 연산 능력·전력 제약·네트워크 품질·보안 경계** 를 가진 채 협력한다. 본고는 이 환경에서 ① 스마트 팩토리 ② 스마트 빌딩/에너지 ③ 커넥티드 차량/V2X ④ 헬스케어/원격 모니터링이라는 4대 엣지 AIoT 대표 사용 사례를 도출하고, 각 사례의 통신 요구 특성(저지연·단절 내성·다수 노드 팬인·보안)을 분석한다. 나아가 gRPC(Protocol Buffers·HTTP/2)의 엣지 AIoT 환경 강점(고성능·타입 안전·스트리밍·백프레셔)과 한계(임베디드 무거움·무선 단절·브라우저 부재)를 명확히 구분하고, **gRPC를 엣지 tier의 백본으로 채택하고 현장 tier에서는 MQTT/CoAP 등 경량 프로토콜을 혼용하는 2-tier 프로토콜 변환 게이트웨이** 구조를 제안한다. 결론으로, 엣지 AIoT MAS는 단일 프로토콜로는 충분하지 않으며, **gRPC + SPIFFE/SPIRE + OpenTelemetry + QUIC/UDP 멀티캐스트 + 엣지 변환 게이트웨이를 결합한 하이브리드 아키텍처** 가 보안·가시성·실시간성·자원 효율을 동시에 만족시키는 현실적 최적해임을 보인다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 서론 (Introduction)
|
||||||
|
|
||||||
|
엣지 AIoT(Edge AIoT)는 **클라우드의 풍부한 연산 자원**과 **현장의 물리적 데이터**(센서·비전·음성·제어 신호)를 **엣지 게이트웨이**에서 결합하여, ms 단위 응답이 요구되는 의사결정을 현장 부근에서 수행하는 분산 컴퓨팅 패러다임이다. 단일 자율 에이전트의 한계를 보완하기 위해 다수의 전문화 에이전트(Multi-Agent System)가 3-tier 전역에 분산 배치되며, 각 에이전트는 자신의 tier에 적합한 자원·런타임을 갖는다.
|
||||||
|
|
||||||
|
본 연구는 **엣지 AIoT 환경의 3-tier 물리적 분산** 을 다음 표와 같이 정의한다.
|
||||||
|
|
||||||
|
| Tier | 디바이스 예시 | 연산 자원 | 네트워크 | 보안 경계 |
|
||||||
|
|------|--------------|-----------|----------|-----------|
|
||||||
|
| **T1 클라우드** | x86/GPU 서버, k8s 컨테이너 | 풍부 (TB RAM, GPU 다수) | 안정·고대역폭·상시 연결 | 데이터센터 내부, 비교적 안전 |
|
||||||
|
| **T2 엣지** | Jetson·RK3588·산업용 PC·게이트웨이 | 중간 (4–32GB RAM, NPU) | **인터미턴트**, 광역·무선 혼합 | 현장·반사문 외부, 부분 노출 |
|
||||||
|
| **T3 현장** | MCU(Cortex-M/A), 임베디드 리눅스, AGV, 센서, 산업용 로봇 | **극히 제한** (KB–수십 MB) | **불안정·저대역폭·다중 홉** (Wi-Fi/LoRa/5G/BLE) | **물리적 접근 가능**, 변조 위험 |
|
||||||
|
|
||||||
|
이 3-tier 사이를 관통하는 에이전트 간 통신은 같은 머신 위의 함수 호출이 아니라 **상이한 운영체제·언어·전력·연결성을 가진 원격 디바이스들 사이의 다중 홉 프로토콜** 이다. 본 연구는 엣지 AIoT 시나리오에서 gRPC가 어느 tier 사이에서 가장 효과적이고, 어느 tier에서는 별도 보완이 필요한지를 4대 사용 사례와 함께 분석한다.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 이론적 배경: 에이전트 통신의 물리적 분산 진화
|
||||||
|
|
||||||
|
에이전트 간 통신의 학술적 뿌리는 1960년대 **화행 이론(Speech Act Theory, Austin·Searle)** 으로부터 1990년대 KQML·FIPA-ACL로 이어지는 분산 인공지능(DAI) 전통이다. 이 전통은 처음부터 "분산된 지능체 간의 원격 통신"을 전제로 설계되었으며, 2000년대 SOAP/REST 시대를 거쳐 2020년대 LLM 에이전트와 만나면서 **다시 물리적 분산의 시대로 회귀**했다.
|
||||||
|
|
||||||
|
현대의 LLM 에이전트 프레임워크(AutoGen·CrewAI·LangGraph·MetaGPT)도 실제 배치는 본질적으로 다음의 **물리적 분산 통신** 을 요구한다.
|
||||||
|
|
||||||
|
- **T1 에이전트(PM·분석가)** ↔ **T2 에이전트(현장 추론·제어)** : 광역 무선, 시간 비실시간 OK
|
||||||
|
- **T2 에이전트(다수)** ↔ **T2 에이전트(다수)** : 엣지 LAN 내 다자 합의, ms 단위 응답 필요
|
||||||
|
- **T2 에이전트** ↔ **T3 디바이스**: 다수 노드 팬인, 단절 빈번, 페이로드 작음
|
||||||
|
- **T3 디바이스 ↔ T3 디바이스**: 머신-투-머신, P2P 또는 멀티캐스트
|
||||||
|
|
||||||
|
따라서 현대 ACL 구현체(MCP·A2A)는 **상위 시맨틱 계층**으로 분리되고, 그 하위 **전송 계층** — 즉 3-tier 디바이스 간 물리적 통신을 책임지는 프로토콜 — 의 선택이 별도의 설계 과제로 부상한다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 엣지 AIoT 4대 사용 사례와 디바이스 간 통신 요구
|
||||||
|
|
||||||
|
엣지 AIoT의 3-tier 분산 구조 위에서 동작하는 4대 대표 사용 사례는 다음과 같다. 각 사례는 **자신만의 디바이스 조합·통신 요구·제약**을 갖는다.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 사례 ① 스마트 팩토리 (Industry 4.0)
|
||||||
|
**배치**: T1(중앙 PM·품질분석·예지정비 에이전트) ↔ T2(엣지 컨트롤러, 라인별) ↔ T3(다수 AGV·협동로봇·CCTV·진동 센서).
|
||||||
|
|
||||||
|
| 통신 경로 | 특성 | 대표 KPI |
|
||||||
|
|----------|------|----------|
|
||||||
|
| T3 AGV ↔ T2 엣지 | AGV 간 동적 합의, 충돌 회피 | **p99 latency < 10ms** |
|
||||||
|
| T2 ↔ T1 | 장기 데이터 업로드, 모델 업데이트 | batch throughput |
|
||||||
|
| T3 센서 ↔ T2 | 텔레메트리 다수 팬인 | 동시 10k 노드, 1Hz/노드 |
|
||||||
|
| T3 로봇 ↔ T1 (직접) | OTA 펌웨어, 원격 진단 | 결함 내성 다운로드 |
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 사례 ② 스마트 빌딩 / 스마트 그리드 / 에너지
|
||||||
|
**배치**: T1(빌딩 에너지 최적화·DR 에이전트) ↔ T2(빌딩별 또는 변전소별 엣지) ↔ T3(수만 개의 HVAC·조명·PV 인버터·스마트 미터).
|
||||||
|
|
||||||
|
- **T3 ↔ T2**: 저전력 무선(LoRa·Wi-SUN·Zigbee), 페이로드 10–200B, 1회/수 분
|
||||||
|
- **T2 ↔ T1**: 비-실시간 분석·명령下发, 4G/유선
|
||||||
|
- **엣지-로컬 합의**: 빌딩 내 HVAC 협업(피크 절감), < 100ms 응답
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 사례 ③ 커넥티드 차량 / V2X
|
||||||
|
**배치**: T1(클라우드 텔레매틱스·HD맵·원격 진단) ↔ T2(RSU·로드사이드 유닛·5G MEC) ↔ T3(차량 내 ECU·레이더·카메라).
|
||||||
|
|
||||||
|
- **T3 ↔ T3(V2V)·T3 ↔ T2(V2I)**: ETSI ITS-G5 / C-V2X, 10ms 이내 안전 메시지
|
||||||
|
- **T2 ↔ T1**: HD맵 업데이트, 원격 OTA, 비-실시간
|
||||||
|
- **핸드오버**: 기지국 이동, 100ms 이내 무중단
|
||||||
|
|
||||||
|
### 사례 ④ 헬스케어 / 원격 모니터링 / 웨어러블
|
||||||
|
**배치**: T1(클라우드 EHR·임상 추론 에이전트) ↔ T2(병원/요양시설 엣지) ↔ T3(웨어러블·바이탈 센서·약물 디스펜서).
|
||||||
|
|
||||||
|
- **T3 ↔ T2**: BLE/Wi-Fi, 24시간 연속, **배터리 1주–1개월**
|
||||||
|
- **T2 ↔ T1**: 일간 업로드, 비실시간
|
||||||
|
- **긴급 이벤트**: 부정맥·낙상 감지 시 < 1s T1 알림
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**공통 통신 요구 5가지**: ① 타입 안전 ② 단방향·양방향 스트리밍 ③ 단절·핸드오버 내성 ④ 디바이스 attestation ⑤ 광역 관측성. 단 4가지 사례는 **각각 다른 우선순위**를 가진다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 기존 통신 기술의 한계: 정량 분석
|
||||||
|
|
||||||
|
엣지 AIoT의 3-tier 사이에서 사용되어 온 기존 분산 통신 인프라를 분석한다.
|
||||||
|
|
||||||
|
| 기술 | T1↔T2 | T2↔T3 | 한계 |
|
||||||
|
|------|------|------|------|
|
||||||
|
| **REST/HTTP·JSON** | OK | ❌ | 무거운 텍스트 헤더, 단방향·폴링, 디바이스 수 증가 시 fanout 곤란 |
|
||||||
|
| **MQTT/CoAP** | △ (overkill) | ✅ | T1↔T2에 부적합, 스키마 검증 부재, 멀티캐스트·Qos 튜닝 복잡 |
|
||||||
|
| **WebSocket** | △ | ❌ | Stateful·스키마 부재, 모바일 단절 시 session 유지 곤란 |
|
||||||
|
| **gRPC** | ✅ | ⚠️ | 임베디드/T3에서 스택 무거움, 브라우저 진입점 별도 |
|
||||||
|
|
||||||
|
**직렬화 포맷 정량 비교** (예시적 추정치)¹:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
¹ Illustrative Estimates. 페이로드 복잡도·라이브러리 버전·런타임 구현에 따라 변동.
|
||||||
|
|
||||||
|
추가로, REST는 HTTP/1.1의 **Head-of-Line Blocking**으로 T1↔T2에서 다수 에이전트의 동시 RPC가 직렬화된다. 엣지-현장 fan-in 구간에서는 JSON 헤더가 페이로드보다 커질 수 있어 대역폭 낭비가 심각해진다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. gRPC의 기술적 백그라운드와 엣지 AIoT 강점·약점
|
||||||
|
|
||||||
|
### 5.1 핵심 강점 (엣지 AIoT 통신 관점)
|
||||||
|
|
||||||
|
- **Protocol Buffers**: 이진 직렬화로 평균 JSON 대비 50~80% 대역폭 절감. T1↔T2의 무선 구간 비용·지연을 줄이고, T2↔T3에서도 변형(gRPC over MQTT/QUIC) 사용 시 효과적.
|
||||||
|
- **HTTP/2 멀티플렉싱**: 단일 TCP/TLS 세션으로 다수 RPC 동시 처리 → 엣지 게이트웨이의 **소켓 수 절감**과 HOLB 제거.
|
||||||
|
- **4대 RPC 모드**: 사례별 매핑이 자연스러움.
|
||||||
|
|
||||||
|
| 모드 | 엣지 AIoT 시나리오 |
|
||||||
|
|------|---------------------|
|
||||||
|
| **Unary** | 원격 OTA 명령, 상태 조회, 설정 변경 |
|
||||||
|
| **Server Streaming** | T1 → T2 모델 업데이트, T2 → T3 텔레메트리, T1 → T2 토큰 스트리밍 |
|
||||||
|
| **Client Streaming** | T3 → T2 다수 센서 배치 업로드, OTA 펌웨어 청크 |
|
||||||
|
| **Bidi Streaming** | T2↔T2 엣지 합의, T3↔T2 차량/로봇 실시간 협업 |
|
||||||
|
|
||||||
|
- **HTTP/2 Flow Control(백프레셔)**: T3 디바이스의 메모리가 차면 송신 측이 자동 차단 — **수신 측 버퍼 오버플로 방어** 가 무코딩으로 가능.
|
||||||
|
- **gRPC Health Checking Protocol**: T2↔T3 간 인터미턴트 연결의 가용성을 능동 모니터링.
|
||||||
|
- **Service Config 기반 Retry Policy**: T1↔T2 무선 손실 시 지수 백오프·jitter 재시도를 표준 지원.
|
||||||
|
|
||||||
|
### 5.2 gRPC 4대 RPC 모드 ↔ 엣지 AIoT 시나리오 매핑
|
||||||
|
|
||||||
|
| 모드 | 엣지 AIoT 시나리오 |
|
||||||
|
|------|---------------------|
|
||||||
|
| **Unary** | 원격 OTA 명령, 상태 조회, 설정 변경 |
|
||||||
|
| **Server Streaming** | T1 → T2 모델 업데이트, T2 → T3 텔레메트리, T1 → T2 토큰 스트리밍 |
|
||||||
|
| **Client Streaming** | T3 → T2 다수 센서 배치 업로드, OTA 펌웨어 청크 |
|
||||||
|
| **Bidi Streaming** | T2↔T2 엣지 합의, T3↔T2 차량/로봇 실시간 협업 |
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 5.3 엣지 AIoT 환경에서의 약점과 보완 패턴
|
||||||
|
|
||||||
|
| 약점 | 영향 사례 | 보완 패턴 |
|
||||||
|
|------|-----------|-----------|
|
||||||
|
| 임베디드/T3에서 gRPC 스택 무거움 (RAM/Flash) | 사례 ①②④ | **엣지 변환 게이트웨이**(MQTT/CoAP↔gRPC), gRPC-Lite/C nanopb |
|
||||||
|
| 무선 핸드오버 시 TCP connection migration 부재 | 사례 ③④ | **gRPC over QUIC**(HTTP/3), CONNECT-UDP 터널 |
|
||||||
|
| T2↔T3 다수 노드 fan-in으로 서버 과부하 | 사례 ①② | **Stream Aggregation** + Connection Multiplexing + eBPF/XDS LB |
|
||||||
|
| T3 디바이스 신원(IP/MAC)이 변조 가능 | 모든 사례 | **SPIFFE/SPIRE** SVID + mTLS, **TPM/SE** 디바이스 attestation |
|
||||||
|
| T2↔T3 단절 시 in-flight RPC 즉시 실패 | 사례 ①③④ | **Client-Side Retry with Backoff** + **오프라인 큐 + Resume Token** |
|
||||||
|
| T3 OTA 업데이트 시 스키마 비호환성 | 모든 사례 | **Buf Schema Registry**(BSR) + `buf breaking` 자동 검증 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 2-tier 프로토콜 아키텍처: gRPC + MQTT 변환 게이트웨이
|
||||||
|
|
||||||
|
본 절은 본 연구의 핵심 제안인 **2-tier 프로토콜 아키텍처** 를 제시한다. 단일 프로토콜이 아닌 **tier별 최적 프로토콜을 혼용**하고, T2 엣지 게이트웨이가 변환·집계·인증을 책임지는 구조다.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```
|
||||||
|
┌──────────────────────────────────────────────────────────────────┐
|
||||||
|
│ T1: 클라우드 (k8s, GPU 서버) │
|
||||||
|
│ - LLM/분석 에이전트, 중앙 PM │
|
||||||
|
│ - 전송: gRPC(Unary / Server-streaming) │
|
||||||
|
│ - 거버넌스: Istio Service Mesh, OTel Collector │
|
||||||
|
└─────────────────────────────┬────────────────────────────────────┘
|
||||||
|
│ gRPC / HTTP-2 (유선·4G·안정)
|
||||||
|
▼
|
||||||
|
┌──────────────────────────────────────────────────────────────────┐
|
||||||
|
│ T2: 엣지 (Jetson / 산업용 PC / 5G MEC) │
|
||||||
|
│ - 현장 추론 에이전트, 모델 실행, 결함 회복 │
|
||||||
|
│ - 전송 ①: gRPC↔T1, ②: MQTT/CoAP↔T3 변환 게이트웨이 │
|
||||||
|
│ - 거버넌스: Envoy Edge Proxy, mTLS, 디바이스 attestation │
|
||||||
|
└─────────────────────────────┬────────────────────────────────────┘
|
||||||
|
│ MQTT / CoAP / gRPC-Lite (Wi-Fi·LoRa·BLE)
|
||||||
|
▼
|
||||||
|
┌──────────────────────────────────────────────────────────────────┐
|
||||||
|
│ T3: 현장 (MCU, 임베디드 리눅스, 로봇, 센서) │
|
||||||
|
│ - 단순 디바이스 에이전트, 텔레메트리·제어, 오프라인 큐 │
|
||||||
|
│ - 전송: MQTT(Subscribe Telemetry), CoAP(Confirmable), gRPC-Lite│
|
||||||
|
│ - 보안: TPM/SE 부팅 attestation, X.509 SVID │
|
||||||
|
└──────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.1 gRPC의 활성 영역
|
||||||
|
- **T1 ↔ T2**: 안정적·고대역폭·상시 연결. 표준 gRPC + HTTP/2 + BSR + Mesh.
|
||||||
|
- **T2 ↔ T2(엣지-로컬 합의)**: 다수 엣지 노드의 동적 합의, Bidi Streaming.
|
||||||
|
- **T1 → T2 스트리밍 모델 업데이트**: Server Streaming + 백프레셔.
|
||||||
|
- **T2 → T3 일부(고성능 임베디드)**: gRPC-Lite / nanopb 변형.
|
||||||
|
|
||||||
|
### 6.2 MQTT/CoAP의 활성 영역
|
||||||
|
- **T2 ↔ T3 (저전력 MCU)**: MQTT(Pub/Sub, QoS 0/1/2, Last Will), CoAP(Confirmable, Observe).
|
||||||
|
- **T3 → T2 → T1 메시지 라우팅**: T2 게이트웨이가 MQTT topic ↔ gRPC method 매핑.
|
||||||
|
|
||||||
|
### 6.3 변환 게이트웨이의 책임
|
||||||
|
1. **프로토콜 변환**: MQTT topic → gRPC method (Unary/Stream 양방향)
|
||||||
|
2. **메시지 정규화**: JSON↔Protobuf 자동 매핑 (`buf image` + transcoding filter)
|
||||||
|
3. **버퍼링·배치**: T3 fan-in을 N개 모아 gRPC Streaming으로 묶어 T1로 전달
|
||||||
|
4. **Resume Token 발급**: T3 단절 후 재접속 시 마지막 위치부터 이어받기
|
||||||
|
5. **디바이스 인증 중계**: T3의 X.509 SVID를 검증한 뒤, T1에는 mTLS로 재인증
|
||||||
|
6. **메트릭 수집**: T2 Prometheus exporter → T1 OTel Collector
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 개발자 관점 요구사항: 디바이스 SDK·스키마 진화·단절 내성
|
||||||
|
|
||||||
|
### 7.1 디바이스 클래스별 SDK 생성과 크로스 컴파일
|
||||||
|
**Buf Schema Registry(BSR)**에 `.proto`를 푸시하면 다언어 SDK가 자동 생성·배포된다. 개발자는 자신의 tier·디바이스 클래스에 맞게 임베드한다.
|
||||||
|
- T1/T2: Go, Python, Java, Node.js 풀 SDK
|
||||||
|
- T3 고성능 임베디드: C/C++ `nanopb` 경량 SDK, gRPC-Lite
|
||||||
|
- T3 MCU: C 템플릿 + MQTT/CoAP 클라이언트 + 변환 게이트웨이 스티치
|
||||||
|
|
||||||
|
`buf breaking`로 하위 호환성을 자동 검증해, T3 OTA 업데이트가 지연돼도 T1↔T2 통신이 깨지지 않도록 보장한다.
|
||||||
|
|
||||||
|
### 7.2 HTTP/2 Flow Control과 QUIC 핸드오버
|
||||||
|
T1↔T2 무선 구간에서 송신 측 버퍼가 차면 `WINDOW_SIZE=0` 프레임으로 자동 차단 → 앱 코드 변경 없이 OOM과 무선 정체를 방어한다. 사례 ③④의 핸드오버 환경에서는 gRPC 트래픽을 **QUIC** 위에 실어 **connection migration**·HOLB-free 멀티플렉싱을 함께 얻는다(사실상 표준).
|
||||||
|
### 7.3 Resume Token을 통한 단절-인내 스트리밍
|
||||||
|
|
||||||
|
T3↔T2↔T1의 텔레메트리 스트리밍(사례 ①②④)이 중간에 끊기면, gRPC 서버는 **Resume Token**(마지막 전송 위치)을 발급한다. 클라이언트는 재연결 시 `Resume-Token` Metadata를 첨부해 이어받는다. 이 패턴은 gRPC Interceptor에 캡슐화되어 모바일·엣지·MCU의 일시 단절을 흡수한다.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 7.4 명시적 Deadline
|
||||||
|
T3 디바이스는 네트워크 품질을 신뢰할 수 없다. `ClientContext`에 `Deadline`을 인터셉터에서 강제 주입해 단절 시 무한 대기를 방지한다. 디바이스 클래스별 기본 deadline 정책을 다르게 적용한다(예: AGV V2V 50ms, IoT 텔레메트리 5s).
|
||||||
|
|
||||||
|
---
|
||||||
|
## 8. 운영 관리자 관점 요구사항: 디바이스 신원·2계층 거버넌스·관측성
|
||||||
|
|
||||||
|
### 8.1 디바이스 Attestation: SPIFFE/SPIRE + TPM/SE
|
||||||
|
|
||||||
|
단순 IP·MAC·API Key로는 물리적 디바이스의 신원을 보장할 수 없다. **SPIFFE/SPIRE**는 각 디바이스의 부팅 시 하드웨어 attestation(TPM·SE·secure boot·measured boot)을 거쳐 동적 SPIFFE ID를 발급한다.
|
||||||
|
- T1: `spiffe://cluster/ns/<ns>/sa/<sa>/agent/<id>` (k8s SA 기반)
|
||||||
|
- T2: `spiffe://edge/{org}/{site}/gateway/<uuid>` (하드웨어 시리얼 기반)
|
||||||
|
- T3: `spiffe://iot/{org}/{factory}/device/<serial>` (TPM/SE attestation 기반)
|
||||||
|
|
||||||
|
gRPC TLS 핸드셰이크 시 SAN의 SPIFFE ID를 즉시 확인해 비인가 디바이스의 호출을 전송 이전 단계에서 차단한다. 사례 ①(현장 로봇 변조 위험)·④(헬스케어 환자 안전)에서 핵심 보안 장치다.
|
||||||
|
|
||||||
|
### 8.2 2계층 통신 제어: Service Mesh + Interceptor
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
| 계층 | 통제 항목 | 엣지 AIoT 적용 |
|
||||||
|
|------|----------|----------------|
|
||||||
|
| **1계층 Service Mesh (Envoy)** | mTLS 종단, 카나리 라우팅, 글로벌 RL, **xDS Light로 T2 게이트웨이에 정책 push** | T1↔T2 정책 동적 배포 |
|
||||||
|
| **2계층 gRPC Interceptor** | 디바이스 클래스별 페이로드 검증, **디바이스 컨텍스트 전파**(battery, link-quality), **단절 시 Resume Token 발급**, Trace ID 주입 | T1/T2/T3 공통, T3는 경량 구현 |
|
||||||
|
|
||||||
|
엣지 게이트웨이는 xDS Light(Envoy Mobile)를 통해 **메쉬 정책 자체를 T2로 push**받아, OTA 없이도 정책 변경이 가능하다.
|
||||||
|
|
||||||
|
### 8.3 디바이스 클래스별 멀티테넌시 쿼터
|
||||||
|
gRPC Metadata 헤더에 `X-Tenant-ID`·`X-Device-Class`·`X-Site-ID`를 의무 탑재하고, 인터셉터·메쉬 단계에서:
|
||||||
|
- **T3 IoT**: 메시지 빈도(분당 N건), 페이로드 크기 상한, 시간당 OTA 횟수
|
||||||
|
- **T3 차량·로봇**: 안전 메시지 우선순위, 멀티캐스트 그룹 한도
|
||||||
|
- **T2 엣지**: 동시 추론 세션 수, GPU 점유 시간
|
||||||
|
- **T1 클라우드**: 테넌트당 TPM·RPM 쿼터
|
||||||
|
|
||||||
|
를 적용해 `RESOURCE_EXHAUSTED`(gRPC 코드 8)로 하위 호출을 차단한다.
|
||||||
|
|
||||||
|
### 8.4 OpenTelemetry 기반 분산 트레이싱
|
||||||
|
W3C `traceparent`/`tracestate`를 gRPC Metadata Carrier로 체인 전파한다. **T2 게이트웨이를 Trace Context fan-out 지점** 으로 삼아 T3 디바이스의 trace segment를 포함시켜, T1→T2→T3 호출 그래프가 끊김 없이 시각화된다. 사례 ①②④에서 **단절-재접속이 발생해도 trace가 연결**되도록, Resume Token에 traceparent를 임베드하는 패턴을 제안한다.
|
||||||
|
|
||||||
|
### 8.5 OTA와 스키마 진화
|
||||||
|
T3 디바이스는 한번 현장에 배포되면 수년간 업데이트되지 않을 수 있다. **BSR + `buf breaking`** CI로 OTA 시에도 하위 호환성을 자동 검증하고, T2 게이트웨이가 구버전/신버전 디바이스의 메시지를 **양방향으로 변환** (Protobuf Any 타입 + schema descriptor)하여 시스템 전체의 점진적 업그레이드를 가능케 한다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. 결론 및 설계 권장안
|
||||||
|
|
||||||
|
### 9.1 사례별 프로토콜 매트릭스 요약
|
||||||
|
|
||||||
|
| 당면 과제 | 사례 ① (공장) | 사례 ② (빌딩/에너지) | 사례 ③ (V2X) | 사례 ④ (헬스) |
|
||||||
|
|----------|--------------|---------------------|--------------|---------------|
|
||||||
|
| **T1↔T2 백본** | gRPC + QUIC | gRPC + 유선/4G | gRPC-over-QUIC + 5G MEC | gRPC + 유선 |
|
||||||
|
| **T2↔T3 엣지-현장** | MQTT 5.0 / gRPC-Lite | **MQTT**(LoRa/Wi-SUN 브릿지) | **C-V2X/ITS-G5** | **BLE/Wi-Fi + MQTT** |
|
||||||
|
| **저지연 합의** | gRPC Bidi(AGV) | gRPC Unary(HVAC) | **QUIC datagram 멀티캐스트** | gRPC Unary(이벤트) |
|
||||||
|
| **핸드오버** | Resume Token | Resume Token | **QUIC conn-migration** | Resume Token |
|
||||||
|
| **디바이스 신원** | TPM + SPIRE | SE + SPIRE | **V2X PKI + SPIRE** | TPM + SPIRE |
|
||||||
|
| **저전력** | N/A | MQTT QoS 0 + sleep | N/A | BLE + duty cycle |
|
||||||
|
| **긴급 이벤트** | gRPC Stream 알림 | gRPC Unary 알림 | **C-V2X CAM/DENM** | gRPC Unary 알림 |
|
||||||
|
|
||||||
|
### 9.2 베스트 프랙티스
|
||||||
|
1. **2-tier 프로토콜**: T1↔T2는 gRPC(QUIC), T2↔T3는 MQTT/CoAP/C-V2X, T2 게이트웨이에서 변환.
|
||||||
|
2. **Contract-First Schema**: BSR + `buf breaking`로 다수 디바이스 클래스 SDK 동시 배포.
|
||||||
|
3. **Hardware-backed Attestation**: TPM/SE + SPIFFE/SPIRE로 디바이스 신원 무결성.
|
||||||
|
4. **Resume Token + Deadline**: 모든 RPC에 `Deadline` 강제, 단절 시 Resume Token으로 이어받기.
|
||||||
|
5. **2계층 거버넌스 + Trace Fan-out**: Envoy Mesh + gRPC Interceptor, T2를 trace fan-out 지점으로 활용.
|
||||||
|
6. **점진적 OTA**: BSR 호환성 + T2 스키마 변환 게이트웨이로 장기 배포 디바이스 흡수.
|
||||||
|
|
||||||
|
### 9.3 결론
|
||||||
|
엣지 AIoT 환경의 Multi-Agent 서비스는 **클라우드-엣지-현장의 3-tier 물리적 분산** 위에서 동작하며, 각 tier의 자원·전력·연결성·보안 제약이 크게 다르다. gRPC는 **T1↔T2 백본과 T2↔T2 엣지 합의** 에서 가장 효과적인 선택지이며, 그 위에서 **상위 시맨틱 표준인 MCP/A2A** 가 에이전트 간 조율을 담당한다. 그러나 **T3 현장 디바이스의 극단적 자원·전력·단절 환경** 에 대해서는 gRPC-Lite, MQTT, CoAP, C-V2X, BLE 등 **tier-최적 프로토콜을 혼용**하고, T2 엣지 게이트웨이에서 변환·집계·인증 중계하는 **2-tier 프로토콜 아키텍처** 가 필수적이다. 디바이스의 물리적 제약을 정면으로 인정하고, 각 tier에 가장 적합한 변형 프로토콜을 매핑하는 것이 엣지 AIoT 분산 에이전트 서비스를 **가시성·보안·실시간성·자원 효율** 모두 갖춘 상태로 실현하는 현실적 최적해다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 참고문헌 (References)
|
||||||
|
|
||||||
|
[1] Wu et al., *AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation*, 2023.
|
||||||
|
[2] Austin, J.L., *How to Do Things with Words*, 1962.
|
||||||
|
[3] Finin, T. et al., *KQML as an Agent Communication Language*, 1994.
|
||||||
|
[4] gRPC Authors, *gRPC Documentation — Protocol Buffers & HTTP/2*, 2024.
|
||||||
|
[5] Iyengar, J. & Thomson, M., *QUIC: A UDP-Based Multiplexed and Secure Transport*, RFC 9000, 2021.
|
||||||
|
[6] SPIFFE/SPIRE, *Zero-Trust Workload Identity*, https://spiffe.io.
|
||||||
|
[7] Buf Technologies, *Buf Schema Registry*, https://buf.build.
|
||||||
|
[8] OpenTelemetry, *W3C Trace Context & gRPC Instrumentation*, 2024.
|
||||||
|
[9] Anthropic, *Model Context Protocol Specification*, 2024.
|
||||||
|
[10] ETSI, *ITS-G5: Intelligent Transport Systems — LTE-V2X*, EN 302 637-2, 2019.
|
||||||
|
[11] Banks, A. & Gupta, R., *MQTT Version 5.0*, OASIS Standard, 2019.
|
||||||
|
[12] Shelby, Z. et al., *The Constrained Application Protocol (CoAP)*, RFC 7252, 2014.
|
||||||
|
[13] gRPC-Web Authors, *gRPC-Web: A Protocol for the Web*, https://github.com/grpc/grpc-web.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 부록 A. 그림 목록 (List of Figures)
|
||||||
|
|
||||||
|
| Figure | 제목 | 위치 | 종류 |
|
||||||
|
|:------:|------|------|------|
|
||||||
|
| 1 | 엣지 AIoT 3-tier 물리적 분산 구조 | §1 | SVG (자체 작성) |
|
||||||
|
| 2 | 엣지 AIoT 4대 사용 사례 콜라주 | §3 | PNG (nanobanana) |
|
||||||
|
| 3 | 스마트 팩토리 협업 | §3.① | PNG (nanobanana) |
|
||||||
|
| 4 | 스마트 빌딩/에너지 | §3.② | PNG (nanobanana) |
|
||||||
|
| 5 | 헬스케어/원격 모니터링 | §3.④ | PNG (nanobanana) |
|
||||||
|
| 6 | gRPC 4대 RPC 모드 매핑 | §5.2 | SVG (자체 작성) |
|
||||||
|
| 7 | **2-tier 프로토콜 아키텍처 (핵심 제안)** | §6 | SVG (자체 작성) |
|
||||||
|
| 8 | Resume Token 시퀀스 | §7.3 | SVG (자체 작성) |
|
||||||
|
| 9 | 2계층 통신 제어 | §8.2 | SVG (자체 작성) |
|
||||||
|
| 10 | gRPC vs REST 정량 비교 | §4 | SVG (자체 작성) |
|
||||||
|
|
||||||
|
## 부록 B. 표 목록 (List of Tables)
|
||||||
|
|
||||||
|
| Table | 제목 | 위치 |
|
||||||
|
|:-----:|------|------|
|
||||||
|
| 1 | 3-tier 디바이스 클래스 정의 | §1 |
|
||||||
|
| 2 | 사례 ① 스마트 팩토리 통신 경로 | §3.① |
|
||||||
|
| 3 | 사례 ② 스마트 빌딩 통신 특성 | §3.② |
|
||||||
|
| 4 | 사례 ④ 헬스케어 통신 특성 | §3.④ |
|
||||||
|
| 5 | 기존 통신 기술 한계 | §4 |
|
||||||
|
| 6 | gRPC 4대 RPC 모드 ↔ 엣지 AIoT 시나리오 | §5.2 |
|
||||||
|
| 7 | gRPC 약점과 보완 패턴 | §5.3 |
|
||||||
|
| 8 | 2계층 거버넌스 책임 | §8.2 |
|
||||||
|
| 9 | 디바이스 클래스별 멀티테넌시 쿼터 | §8.3 |
|
||||||
|
| 10 | 사례별 프로토콜 매트릭스 (최종) | §9.1 |
|
||||||
|
| 11 | 베스트 프랙티스 | §9.2 |
|
||||||
@@ -0,0 +1,249 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"title": "A2A Protocol Schemas",
|
||||||
|
"description": "Non-normative JSON Schema bundle extracted from proto definitions.",
|
||||||
|
"version": "v1",
|
||||||
|
"definitions": {
|
||||||
|
"Struct": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"title": "Struct",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Timestamp": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"format": "date-time",
|
||||||
|
"title": "Timestamp",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Value": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"title": "Value"
|
||||||
|
},
|
||||||
|
"API Key Security Scheme": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Defines a security scheme using an API key.",
|
||||||
|
"properties": {
|
||||||
|
"description": { "default": "", "description": "An optional description for the security scheme.", "type": "string" },
|
||||||
|
"location": { "default": "", "description": "The location of the API key. Valid values are \"query\", \"header\", or \"cookie\".", "type": "string" },
|
||||||
|
"name": { "default": "", "description": "The name of the header, query, or cookie parameter to be used.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "API Key Security Scheme",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Agent Capabilities": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Defines optional capabilities supported by an agent.",
|
||||||
|
"properties": {
|
||||||
|
"extendedAgentCard": { "description": "Indicates if the agent supports providing an extended agent card when authenticated.", "type": "boolean" },
|
||||||
|
"extensions": { "description": "A list of protocol extensions supported by the agent.", "items": { "$ref": "lf.a2a.v1.AgentExtension.jsonschema.json" }, "type": "array" },
|
||||||
|
"pushNotifications": { "description": "Indicates if the agent supports sending push notifications for asynchronous task updates.", "type": "boolean" },
|
||||||
|
"streaming": { "description": "Indicates if the agent supports streaming responses.", "type": "boolean" }
|
||||||
|
},
|
||||||
|
"title": "Agent Capabilities",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Agent Card": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "A self-describing manifest for an agent. It provides essential metadata including the agent's identity, capabilities, skills, supported communication methods, and security requirements.",
|
||||||
|
"properties": {
|
||||||
|
"capabilities": { "$ref": "lf.a2a.v1.AgentCapabilities.jsonschema.json", "description": "A2A Capability set supported by the agent." },
|
||||||
|
"defaultInputModes": { "description": "The set of interaction modes that the agent supports across all skills. Defined as media types.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"defaultOutputModes": { "description": "The media types supported as outputs from this agent.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"description": { "default": "", "description": "A human-readable description of the agent.", "type": "string" },
|
||||||
|
"documentationUrl": { "description": "A URL providing additional documentation about the agent.", "type": "string" },
|
||||||
|
"iconUrl": { "description": "Optional. A URL to an icon for the agent.", "type": "string" },
|
||||||
|
"name": { "default": "", "description": "A human readable name for the agent.", "type": "string" },
|
||||||
|
"provider": { "$ref": "lf.a2a.v1.AgentProvider.jsonschema.json", "description": "The service provider of the agent." },
|
||||||
|
"securityRequirements": { "description": "Security requirements for contacting the agent.", "items": { "$ref": "lf.a2a.v1.SecurityRequirement.jsonschema.json" }, "type": "array" },
|
||||||
|
"securitySchemes": { "additionalProperties": { "$ref": "lf.a2a.v1.SecurityScheme.jsonschema.json" }, "description": "The security scheme details used for authenticating with this agent.", "type": "object" },
|
||||||
|
"signatures": { "description": "JSON Web Signatures computed for this AgentCard.", "items": { "$ref": "lf.a2a.v1.AgentCardSignature.jsonschema.json" }, "type": "array" },
|
||||||
|
"skills": { "description": "Skills represent the abilities of an agent.", "items": { "$ref": "lf.a2a.v1.AgentSkill.jsonschema.json" }, "type": "array" },
|
||||||
|
"supportedInterfaces": { "description": "Ordered list of supported interfaces. The first entry is preferred.", "items": { "$ref": "lf.a2a.v1.AgentInterface.jsonschema.json" }, "type": "array" },
|
||||||
|
"version": { "default": "", "description": "The version of the agent.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Agent Card",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Agent Interface": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Declares a combination of a target URL, transport and protocol version for interacting with the agent.",
|
||||||
|
"properties": {
|
||||||
|
"protocolBinding": { "default": "", "description": "The protocol binding supported at this URL. Core ones: JSONRPC, GRPC, HTTP+JSON.", "type": "string" },
|
||||||
|
"protocolVersion": { "default": "", "description": "The version of the A2A protocol this interface exposes. Examples: \"0.3\", \"1.0\"", "type": "string" },
|
||||||
|
"tenant": { "default": "", "description": "Tenant ID to be used in the request when calling the agent.", "type": "string" },
|
||||||
|
"url": { "default": "", "description": "The URL where this interface is available.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Agent Interface",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Agent Provider": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Represents the service provider of an agent.",
|
||||||
|
"properties": {
|
||||||
|
"organization": { "default": "", "description": "The name of the agent provider's organization.", "type": "string" },
|
||||||
|
"url": { "default": "", "description": "A URL for the agent provider's website or relevant documentation.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Agent Provider",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Agent Skill": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Represents a distinct capability or function that an agent can perform.",
|
||||||
|
"properties": {
|
||||||
|
"description": { "default": "", "description": "A detailed description of the skill.", "type": "string" },
|
||||||
|
"examples": { "description": "Example prompts or scenarios that this skill can handle.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"id": { "default": "", "description": "A unique identifier for the agent's skill.", "type": "string" },
|
||||||
|
"inputModes": { "description": "The set of supported input media types for this skill.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"name": { "default": "", "description": "A human-readable name for the skill.", "type": "string" },
|
||||||
|
"outputModes": { "description": "The set of supported output media types for this skill.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"tags": { "description": "A set of keywords describing the skill's capabilities.", "items": { "type": "string" }, "type": "array" }
|
||||||
|
},
|
||||||
|
"title": "Agent Skill",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Artifact": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Artifacts represent task outputs.",
|
||||||
|
"properties": {
|
||||||
|
"artifactId": { "default": "", "description": "Unique identifier (e.g. UUID) for the artifact. It must be unique within a task.", "type": "string" },
|
||||||
|
"description": { "default": "", "description": "Optional. A human readable description of the artifact.", "type": "string" },
|
||||||
|
"extensions": { "description": "The URIs of extensions that are present or contributed to this Artifact.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"name": { "default": "", "description": "A human readable name for the artifact.", "type": "string" },
|
||||||
|
"parts": { "description": "The content of the artifact. Must contain at least one part.", "items": { "$ref": "lf.a2a.v1.Part.jsonschema.json" }, "type": "array" }
|
||||||
|
},
|
||||||
|
"title": "Artifact",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Message": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Message is one unit of communication between client and server. It can be associated with a context and/or a task.",
|
||||||
|
"properties": {
|
||||||
|
"contextId": { "default": "", "description": "Optional. The context id of the message.", "type": "string" },
|
||||||
|
"extensions": { "description": "The URIs of extensions that are present or contributed to this Message.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"messageId": { "default": "", "description": "The unique identifier (e.g. UUID) of the message.", "type": "string" },
|
||||||
|
"parts": { "description": "Parts is the container of the message content.", "items": { "$ref": "lf.a2a.v1.Part.jsonschema.json" }, "type": "array" },
|
||||||
|
"referenceTaskIds": { "description": "A list of task IDs that this message references for additional context.", "items": { "type": "string" }, "type": "array" },
|
||||||
|
"role": {
|
||||||
|
"anyOf": [
|
||||||
|
{ "pattern": "^ROLE_UNSPECIFIED$", "type": "string" },
|
||||||
|
{ "enum": ["ROLE_USER", "ROLE_AGENT"], "type": "string" },
|
||||||
|
{ "maximum": 2147483647, "minimum": -2147483648, "type": "integer" }
|
||||||
|
],
|
||||||
|
"default": 0,
|
||||||
|
"description": "Identifies the sender of the message.",
|
||||||
|
"title": "Role"
|
||||||
|
},
|
||||||
|
"taskId": { "default": "", "description": "Optional. The task id of the message.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Message",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Part": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Part represents a container for a section of communication content. Parts can be purely textual, some sort of file (image, video, etc) or a structured data blob (i.e. JSON).",
|
||||||
|
"properties": {
|
||||||
|
"filename": { "default": "", "description": "An optional filename for the file (e.g., \"document.pdf\").", "type": "string" },
|
||||||
|
"mediaType": { "default": "", "description": "The media_type (MIME type) of the part content (e.g., \"text/plain\", \"application/json\", \"image/png\").", "type": "string" },
|
||||||
|
"raw": { "description": "The raw byte content of a file. In JSON serialization, this is encoded as a base64 string.", "pattern": "^[A-Za-z0-9+/]*={0,2}$", "type": "string" },
|
||||||
|
"text": { "description": "The string content of the text part.", "type": "string" },
|
||||||
|
"url": { "description": "A url pointing to the file's content.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Part",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Task": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Task is the core unit of action for A2A. It has a current status and when results are created for the task they are stored in the artifact.",
|
||||||
|
"properties": {
|
||||||
|
"artifacts": { "description": "A set of output artifacts for a Task.", "items": { "$ref": "lf.a2a.v1.Artifact.jsonschema.json" }, "type": "array" },
|
||||||
|
"contextId": { "default": "", "description": "Unique identifier (e.g. UUID) for the contextual collection of interactions.", "type": "string" },
|
||||||
|
"history": { "description": "The history of interactions from a Task.", "items": { "$ref": "lf.a2a.v1.Message.jsonschema.json" }, "type": "array" },
|
||||||
|
"id": { "default": "", "description": "Unique identifier (e.g. UUID) for the task, generated by the server for a new task.", "type": "string" },
|
||||||
|
"status": { "$ref": "lf.a2a.v1.TaskStatus.jsonschema.json", "description": "The current status of a Task, including state and a message." }
|
||||||
|
},
|
||||||
|
"title": "Task",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Task Status": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "A container for the status of a task",
|
||||||
|
"properties": {
|
||||||
|
"message": { "$ref": "lf.a2a.v1.Message.jsonschema.json", "description": "A message associated with the status." },
|
||||||
|
"state": {
|
||||||
|
"anyOf": [
|
||||||
|
{ "pattern": "^TASK_STATE_UNSPECIFIED$", "type": "string" },
|
||||||
|
{ "enum": ["TASK_STATE_SUBMITTED", "TASK_STATE_WORKING", "TASK_STATE_COMPLETED", "TASK_STATE_FAILED", "TASK_STATE_CANCELED", "TASK_STATE_INPUT_REQUIRED", "TASK_STATE_REJECTED", "TASK_STATE_AUTH_REQUIRED"], "type": "string" },
|
||||||
|
{ "maximum": 2147483647, "minimum": -2147483648, "type": "integer" }
|
||||||
|
],
|
||||||
|
"default": 0,
|
||||||
|
"description": "The current state of this task.",
|
||||||
|
"title": "Task State"
|
||||||
|
},
|
||||||
|
"timestamp": { "description": "ISO 8601 Timestamp when the status was recorded.", "format": "date-time", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Task Status",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Send Message Request": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Represents a request for the SendMessage method.",
|
||||||
|
"properties": {
|
||||||
|
"configuration": { "$ref": "lf.a2a.v1.SendMessageConfiguration.jsonschema.json", "description": "Configuration for the send request." },
|
||||||
|
"message": { "$ref": "lf.a2a.v1.Message.jsonschema.json", "description": "The message to send to the agent." },
|
||||||
|
"tenant": { "default": "", "description": "Optional. Tenant ID, provided as a path parameter.", "type": "string" }
|
||||||
|
},
|
||||||
|
"title": "Send Message Request",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Send Message Response": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Represents the response for the SendMessage method.",
|
||||||
|
"properties": {
|
||||||
|
"message": { "$ref": "lf.a2a.v1.Message.jsonschema.json", "description": "A message from the agent." },
|
||||||
|
"task": { "$ref": "lf.a2a.v1.Task.jsonschema.json", "description": "The task created or updated by the message." }
|
||||||
|
},
|
||||||
|
"title": "Send Message Response",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Security Requirement": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Defines the security requirements for an agent.",
|
||||||
|
"properties": {
|
||||||
|
"schemes": { "additionalProperties": { "$ref": "lf.a2a.v1.StringList.jsonschema.json" }, "description": "A map of security schemes to the required scopes.", "type": "object" }
|
||||||
|
},
|
||||||
|
"title": "Security Requirement",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"Security Scheme": {
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "Defines a security scheme that can be used to secure an agent's endpoints. Based on OpenAPI 3.2 Security Scheme Object.",
|
||||||
|
"properties": {
|
||||||
|
"apiKeySecurityScheme": { "$ref": "lf.a2a.v1.APIKeySecurityScheme.jsonschema.json", "description": "API key-based authentication." },
|
||||||
|
"httpAuthSecurityScheme": { "$ref": "lf.a2a.v1.HTTPAuthSecurityScheme.jsonschema.json", "description": "HTTP authentication (Basic, Bearer, etc.)." },
|
||||||
|
"mtlsSecurityScheme": { "$ref": "lf.a2a.v1.MutualTlsSecurityScheme.jsonschema.json", "description": "Mutual TLS authentication." },
|
||||||
|
"oauth2SecurityScheme": { "$ref": "lf.a2a.v1.OAuth2SecurityScheme.jsonschema.json", "description": "OAuth 2.0 authentication." },
|
||||||
|
"openIdConnectSecurityScheme": { "$ref": "lf.a2a.v1.OpenIdConnectSecurityScheme.jsonschema.json", "description": "OpenID Connect authentication." }
|
||||||
|
},
|
||||||
|
"title": "Security Scheme",
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"_source": "https://a2a-protocol.org/latest/spec/a2a.json",
|
||||||
|
"_retrieved": "2026-06-07",
|
||||||
|
"_note": "Condensed from official A2A Protocol JSON Schema bundle v1"
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
# Agent2Agent (A2A) Samples
|
||||||
|
|
||||||
|
Welcome to the official code samples and demonstrations for the [Agent2Agent (A2A) Protocol](https://goo.gle/a2a).
|
||||||
|
|
||||||
|
Whether you are exploring multi-agent architectures for the first time or building advanced interoperable agent networks, this repository provides simple, inspiring, and accessible learning resources to accelerate your development.
|
||||||
|
|
||||||
|
## Why Agent2Agent?
|
||||||
|
|
||||||
|
In a world of diverse AI frameworks and ecosystems, agents need a common language to communicate, collaborate, and delegate tasks securely. The A2A protocol establishes a standardized, open standard for multi-agent interoperability.
|
||||||
|
|
||||||
|
Our samples demonstrate how easily complex multi-agent problems can be solved across different languages and host applications.
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
Get up and running immediately by launching a Helloworld agent and communicating with it via our Python CLI host.
|
||||||
|
|
||||||
|
1. **Start the Agent Server**:
|
||||||
|
Open a terminal and start the Helloworld agent server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd samples/python/agents/helloworld
|
||||||
|
uv run .
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Run the Host Client**:
|
||||||
|
Open a second terminal and run the CLI client to send a task to the agent:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd samples/python/agents/helloworld
|
||||||
|
uv run test_client.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Repository Structure
|
||||||
|
|
||||||
|
The repository is organized into several key directories by language:
|
||||||
|
|
||||||
|
| Directory | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| [samples](/samples) | Core A2A samples organized by programming language. |
|
||||||
|
| [samples/python](/samples/python) | Demonstrates Python agent implementations using the A2A Python SDK. |
|
||||||
|
| [samples/go](/samples/go) | Demonstrates Go agent implementations using the A2A Go SDK. |
|
||||||
|
| [samples/dotnet](/samples/dotnet) | Demonstrates C# agent implementations using the A2A .NET SDK. |
|
||||||
|
| [samples/java](/samples/java) | Demonstrates Java agent implementations using the A2A Java SDK. |
|
||||||
|
| [samples/js](/samples/js) | Demonstrates Node.js agent implementations using the A2A JavaScript SDK. |
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome and encourage contributions of all skill levels! If you have an idea for a new sample, a bug fix, or a documentation improvement, please check out our [Contributing Guide](CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Getting Help
|
||||||
|
|
||||||
|
If you have questions, feedback, or run into any issues, please reach out on our [issues page](https://github.com/a2aproject/a2a-samples/issues).
|
||||||
|
|
||||||
|
## Related Repositories
|
||||||
|
|
||||||
|
| Repository | Category | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [A2A](https://github.com/a2aproject/A2A) | Core Specification | A2A Specification and documentation. |
|
||||||
|
| [a2a-inspector](https://github.com/a2aproject/a2a-inspector) | Tooling | UI tool for inspecting A2A enabled agents. |
|
||||||
|
| [a2a-tck](https://github.com/a2aproject/a2a-tck) | Testing | Test suite for validating A2A Protocol compliance. |
|
||||||
|
| [a2a-python](https://github.com/a2aproject/a2a-python) | SDK (Python) | Official Python SDK for A2A. |
|
||||||
|
| [a2a-go](https://github.com/a2aproject/a2a-go) | SDK (Go) | Official Go SDK for A2A. |
|
||||||
|
| [a2a-java](https://github.com/a2aproject/a2a-java) | SDK (Java) | Official Java SDK for A2A. |
|
||||||
|
| [a2a-js](https://github.com/a2aproject/a2a-js) | SDK (JavaScript) | Official Node.js/JavaScript SDK for A2A. |
|
||||||
|
| [a2a-dotnet](https://github.com/a2aproject/a2a-dotnet) | SDK (C#/.NET) | Official C#/.NET SDK for A2A. |
|
||||||
|
| [a2a-rs](https://github.com/a2aproject/a2a-rs) | SDK (Rust) | Official Rust SDK for A2A. |
|
||||||
|
|
||||||
|
## Security Disclaimer
|
||||||
|
|
||||||
|
**Important:** The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
|
||||||
|
|
||||||
|
All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. Developers are responsible for implementing appropriate security measures, such as input validation and secure handling of credentials to protect their systems and users.
|
||||||
|
|
||||||
|
---
|
||||||
|
*Source: https://raw.githubusercontent.com/a2aproject/a2a-samples/main/README.md — Retrieved 2026-06-07*
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
# A2A and MCP: Detailed Comparison
|
||||||
|
|
||||||
|
In AI agent development, two key protocol types emerge to facilitate
|
||||||
|
interoperability. One connects agents to tools and resources. The other enables
|
||||||
|
agent-to-agent collaboration. The Agent2Agent (A2A) Protocol and the
|
||||||
|
[Model Context Protocol](https://modelcontextprotocol.io/) (MCP) address these distinct but highly complementary needs.
|
||||||
|
|
||||||
|
## Model Context Protocol
|
||||||
|
|
||||||
|
The Model Context Protocol (MCP) defines how an AI agent interacts with and utilizes individual tools and resources, such as a database or an API.
|
||||||
|
|
||||||
|
This protocol offers the following capabilities:
|
||||||
|
|
||||||
|
- Standardizes how AI models and agents connect to and interact with tools,
|
||||||
|
APIs, and other external resources.
|
||||||
|
- Defines a structured way to describe tool capabilities, similar to function
|
||||||
|
calling in Large Language Models.
|
||||||
|
- Passes inputs to tools and receives structured outputs.
|
||||||
|
- Supports common use cases, such as an LLM calling an external API, an agent
|
||||||
|
querying a database, or an agent connecting to predefined functions.
|
||||||
|
|
||||||
|
## Agent2Agent Protocol
|
||||||
|
|
||||||
|
The Agent2Agent Protocol focuses on enabling different agents to collaborate with one another to achieve a common goal.
|
||||||
|
|
||||||
|
This protocol offers the following capabilities:
|
||||||
|
|
||||||
|
- Standardizes how independent, often opaque, AI agents communicate and
|
||||||
|
collaborate as peers.
|
||||||
|
- Provides an application-level protocol for agents to discover each other,
|
||||||
|
negotiate interactions, manage shared tasks, and exchange conversational
|
||||||
|
context and complex data.
|
||||||
|
- Supports typical use cases, including a customer service agent delegating an
|
||||||
|
inquiry to a billing agent, or a travel agent coordinating with flight,
|
||||||
|
hotel, and activity agents.
|
||||||
|
|
||||||
|
## Why Different Protocols?
|
||||||
|
|
||||||
|
Both the MCP and A2A protocols are essential for building complex AI systems, and they address distinct but highly complementary needs. The distinction between A2A and MCP depends on what an agent interacts with.
|
||||||
|
|
||||||
|
- **Tools and Resources (MCP Domain)**:
|
||||||
|
- **Characteristics:** These are typically primitives with well-defined,
|
||||||
|
structured inputs and outputs. They perform specific, often stateless,
|
||||||
|
functions. Examples include a calculator, a database query API, or a
|
||||||
|
weather lookup service.
|
||||||
|
- **Purpose:** Agents use tools to gather information and perform discrete
|
||||||
|
functions.
|
||||||
|
- **Agents (A2A domain)**:
|
||||||
|
- **Characteristics:** These are more autonomous systems. They reason,
|
||||||
|
plan, use multiple tools, maintain state over longer interactions, and
|
||||||
|
engage in complex, often multi-turn dialogues to achieve novel or
|
||||||
|
evolving tasks.
|
||||||
|
- **Purpose:** Agents collaborate with other agents to tackle broader, more
|
||||||
|
complex goals.
|
||||||
|
|
||||||
|
## A2A and MCP: Complementary Protocols for Agentic Systems
|
||||||
|
|
||||||
|
An agentic application might primarily use A2A to communicate with other agents.
|
||||||
|
Each individual agent internally uses MCP to interact with its specific tools
|
||||||
|
and resources.
|
||||||
|
|
||||||
|
### Example Scenario: The Auto Repair Shop
|
||||||
|
|
||||||
|
Consider an auto repair shop staffed by autonomous AI agent "mechanics".
|
||||||
|
These mechanics use special-purpose tools, such as vehicle diagnostic scanners,
|
||||||
|
repair manuals, and platform lifts, to diagnose and repair problems. The repair
|
||||||
|
process can involve extensive conversations, research, and interaction with part
|
||||||
|
suppliers.
|
||||||
|
|
||||||
|
- **Customer Interaction (User-to-Agent using A2A)**: A customer (or their
|
||||||
|
primary assistant agent) uses A2A to communicate with the "Shop Manager"
|
||||||
|
agent.
|
||||||
|
|
||||||
|
For example, the customer might say, "My car is making a rattling noise".
|
||||||
|
|
||||||
|
- **Multi-turn Diagnostic Conversation (Agent-to-Agent using A2A)**: The Shop
|
||||||
|
Manager agent uses A2A for a multi-turn diagnostic conversation.
|
||||||
|
|
||||||
|
For example, the Manager might ask, "Can you send a video of the noise?" or "I see some fluid leaking. How long has this been happening?".
|
||||||
|
|
||||||
|
- **Internal Tool Usage (Agent-to-Tool using MCP)**: The Mechanic agent,
|
||||||
|
assigned the task by the Shop Manager, needs to diagnose the issue. The
|
||||||
|
Mechanic agent uses MCP to interact with its specialized tools.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
- MCP call to a "Vehicle Diagnostic Scanner" tool:
|
||||||
|
`scan_vehicle_for_error_codes(vehicle_id='XYZ123')`
|
||||||
|
- MCP call to a "Repair Manual Database" tool:
|
||||||
|
`get_repair_procedure(error_code='P0300', vehicle_make='Toyota',
|
||||||
|
vehicle_model='Camry')`
|
||||||
|
- MCP call to a "Platform Lift" tool: `raise_platform(height_meters=2)`
|
||||||
|
|
||||||
|
- **Supplier Interaction (Agent-to-Agent using A2A)**: The Mechanic agent
|
||||||
|
determines that a specific part is needed. The Mechanic agent uses A2A to
|
||||||
|
communicate with a "Parts Supplier" agent to order a part.
|
||||||
|
|
||||||
|
- **Order processing (Agent-to-Agent using A2A)**: The Parts Supplier agent,
|
||||||
|
which is also an A2A-compliant system, responds, potentially leading to an
|
||||||
|
order.
|
||||||
|
|
||||||
|
In this example:
|
||||||
|
|
||||||
|
- A2A facilitates the higher-level, conversational, and task-oriented
|
||||||
|
interactions between the customer and the shop, and between the shop's
|
||||||
|
agents and external supplier agents.
|
||||||
|
- MCP enables the mechanic agent to use its specific, structured tools to
|
||||||
|
perform its diagnostic and repair functions.
|
||||||
|
|
||||||
|
An A2A server could expose some of its skills as MCP-compatible resources.
|
||||||
|
However, A2A's primary strength lies in its support for more flexible, stateful,
|
||||||
|
and collaborative interactions. These interactions go beyond a typical tool
|
||||||
|
invocation. A2A focuses on agents partnering on tasks, whereas MCP focuses on
|
||||||
|
agents using capabilities.
|
||||||
|
|
||||||
|
## Representing A2A Agents as MCP Resources
|
||||||
|
|
||||||
|
An A2A Server (a remote agent) could expose some of its skills as MCP-compatible resources, especially if those skills are well-defined and can be invoked in a more tool-like, stateless manner. In such a case, another agent might "discover" this A2A agent's specific skill through an MCP-style tool description (perhaps derived from its Agent Card).
|
||||||
|
|
||||||
|
However, the primary strength of A2A lies in its support for more flexible, stateful, and collaborative interactions that go beyond typical tool invocation. A2A is about agents _partnering_ on tasks, while MCP is more about agents _using_ capabilities.
|
||||||
|
|
||||||
|
By leveraging both A2A for inter-agent collaboration and MCP for tool integration, developers can build more powerful, flexible, and interoperable AI systems.
|
||||||
|
|
||||||
|
---
|
||||||
|
*Source: https://a2a-protocol.org/latest/topics/a2a-and-mcp/ and https://raw.githubusercontent.com/a2aproject/A2A/main/docs/topics/a2a-and-mcp.md — Retrieved 2026-06-07*
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
# ETSI EN 302 637-2 — ITS V2X Standard (Metadata)
|
||||||
|
|
||||||
|
## Bibliographic Metadata
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|-------|-------|
|
||||||
|
| Standard Number | ETSI EN 302 637-2 V1.4.1 |
|
||||||
|
| Title | Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 2: Specification of Cooperative Awareness Basic Service |
|
||||||
|
| Publisher | ETSI (European Telecommunications Standards Institute) |
|
||||||
|
| Year | 2019 |
|
||||||
|
| Category | ITS-G5 / V2X (Vehicle-to-Everything) |
|
||||||
|
| Direct PDF | https://www.etsi.org/deliver/etsi_en/302600_302699/30263702/01.04.01_60/en_30263702v010401p.pdf |
|
||||||
|
| ETSI Portal | https://www.etsi.org/deliver/etsi_en/302600_302699/30263702/01.04.01_60/ |
|
||||||
|
|
||||||
|
## Standard Overview
|
||||||
|
|
||||||
|
ETSI EN 302 637-2 defines the **Cooperative Awareness Basic Service (CAM)** — the core
|
||||||
|
broadcast service in ITS-G5 (European V2X standard based on IEEE 802.11p / ETSI ITS).
|
||||||
|
|
||||||
|
### Key Components
|
||||||
|
- **CAM (Cooperative Awareness Message)**: Periodic broadcast (1–10 Hz) containing vehicle
|
||||||
|
position, speed, heading, acceleration, and status (lights, brake status, etc.)
|
||||||
|
- **CA Basic Service**: The service layer managing CAM generation, transmission, and reception
|
||||||
|
- **Triggering conditions**: Time-based and event-triggered (change in heading > 4°, speed change > 0.5 m/s, position change > 4 m)
|
||||||
|
- **Frequency**: 5.9 GHz ITS-G5 band (ETSI EN 302 663)
|
||||||
|
|
||||||
|
### Message Structure (CAM)
|
||||||
|
```
|
||||||
|
CAM ::= SEQUENCE {
|
||||||
|
header ItsPduHeader,
|
||||||
|
cam CoopAwareness
|
||||||
|
}
|
||||||
|
CoopAwareness ::= SEQUENCE {
|
||||||
|
generationDeltaTime GenerationDeltaTime,
|
||||||
|
camParameters CamParameters
|
||||||
|
}
|
||||||
|
CamParameters ::= SEQUENCE {
|
||||||
|
basicContainer BasicContainer,
|
||||||
|
highFrequencyContainer HighFrequencyContainer,
|
||||||
|
lowFrequencyContainer LowFrequencyContainer OPTIONAL,
|
||||||
|
specialVehicleContainer SpecialVehicleContainer OPTIONAL
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Relation to ITS-G5 Stack
|
||||||
|
| Layer | Standard |
|
||||||
|
|-------|---------|
|
||||||
|
| Application | ETSI EN 302 637-2 (CAM), EN 302 637-3 (DENM) |
|
||||||
|
| Facilities | ETSI EN 302 665 |
|
||||||
|
| Networking & Transport | ETSI EN 302 636-4-1 (GeoNetworking) |
|
||||||
|
| Access | ETSI EN 302 663 (ITS-G5 / IEEE 802.11p) |
|
||||||
|
| Physical | IEEE 802.11p (5.9 GHz DSRC) |
|
||||||
|
|
||||||
|
## Relevance to Research
|
||||||
|
ETSI ITS-G5 / CAM is the baseline broadcast protocol for V2V and V2I cooperative
|
||||||
|
awareness in European ITS deployments. It directly underpins multi-agent vehicular
|
||||||
|
coordination scenarios where agents (vehicles, RSUs) need real-time situational awareness
|
||||||
|
without centralized orchestration — a direct comparison point for A2A-based agent
|
||||||
|
discovery and task delegation in vehicular edge computing contexts.
|
||||||
|
|
||||||
|
## Download Instructions
|
||||||
|
The standard PDF is freely available from ETSI:
|
||||||
|
- Direct PDF: https://www.etsi.org/deliver/etsi_en/302600_302699/30263702/01.04.01_60/en_30263702v010401p.pdf
|
||||||
|
|
||||||
|
*Status: METADATA ONLY — PDF download blocked in sandbox environment (HTTPS proxy restriction)*
|
||||||
|
*Retrieved: 2026-06-07*
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Gaba 2023 — Holochain DHT + IoT Security (IEEE Access)
|
||||||
|
## Bibliographic Metadata
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|-------|-------|
|
||||||
|
| Authors | Gagandeep Singh Gaba, Gulshan Kumar, Tai-hoon Kim, Reji Thomas |
|
||||||
|
| Title | Holochain: A Sustainable Distributed Ledger Technology for IoT Security and Privacy |
|
||||||
|
| Journal | IEEE Access |
|
||||||
|
| Year | 2023 |
|
||||||
|
| Volume | 11 |
|
||||||
|
| DOI | 10.1109/ACCESS.2023.3295589 |
|
||||||
|
| IEEE Xplore | https://ieeexplore.ieee.org/document/10189589 |
|
||||||
|
| Direct PDF | https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=10189589 |
|
||||||
|
| Open Access | Yes (IEEE Access is fully open access) |
|
||||||
|
|
||||||
|
## Abstract (Summary)
|
||||||
|
This paper proposes using Holochain — a distributed hash table (DHT) based agent-centric
|
||||||
|
architecture — as a security framework for IoT systems. Unlike blockchain, Holochain does not
|
||||||
|
require global consensus; each agent maintains its own chain, enabling scalable, peer-validated
|
||||||
|
data integrity. The paper addresses privacy, access control, and lightweight cryptographic
|
||||||
|
verification suitable for resource-constrained IoT devices.
|
||||||
|
|
||||||
|
## Key Topics
|
||||||
|
- Distributed Ledger Technology (DLT) for IoT
|
||||||
|
- Holochain DHT agent-centric architecture
|
||||||
|
- IoT security and privacy
|
||||||
|
- Decentralized identity and access control
|
||||||
|
- Lightweight cryptography for constrained devices
|
||||||
|
|
||||||
|
## Relevance to Research
|
||||||
|
Directly relevant to research on decentralized multi-agent orchestration: Holochain's
|
||||||
|
agent-centric DHT model parallels the Agent Card / peer-discovery model in A2A, and its
|
||||||
|
security properties (per-agent chain, gossip validation) inform distributed trust models
|
||||||
|
for IoT multi-agent systems.
|
||||||
|
|
||||||
|
## Download Instructions
|
||||||
|
The full PDF is freely available (IEEE Access open access):
|
||||||
|
- Visit: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=10189589
|
||||||
|
- Or DOI: https://doi.org/10.1109/ACCESS.2023.3295589
|
||||||
|
|
||||||
|
*Status: METADATA ONLY — PDF download blocked in sandbox environment (HTTPS proxy restriction)*
|
||||||
|
*Retrieved: 2026-06-07*
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Ghosh 2025 - MAS with MCP/A2A (Metadata)</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Multi-Agent Systems with MCP and A2A Protocols</h1>
|
||||||
|
<h2>Bibliographic Metadata</h2>
|
||||||
|
<table border="1" cellpadding="6">
|
||||||
|
<tr><th>Field</th><th>Value</th></tr>
|
||||||
|
<tr><td>Author(s)</td><td>Ghosh et al.</td></tr>
|
||||||
|
<tr><td>Year</td><td>2025</td></tr>
|
||||||
|
<tr><td>Type</td><td>Preprint / ResearchGate Publication</td></tr>
|
||||||
|
<tr><td>ResearchGate URL</td><td>https://www.researchgate.net/publication/390919733</td></tr>
|
||||||
|
<tr><td>Topic</td><td>Multi-Agent Systems (MAS) using Model Context Protocol (MCP) and Agent2Agent (A2A) Protocol</td></tr>
|
||||||
|
<tr><td>Status</td><td>METADATA ONLY — Full HTML/PDF unavailable due to ResearchGate access restriction in sandbox environment</td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2>Download Instructions</h2>
|
||||||
|
<p>To obtain the full paper, visit the ResearchGate page directly:</p>
|
||||||
|
<ul>
|
||||||
|
<li>URL: <a href="https://www.researchgate.net/publication/390919733">https://www.researchgate.net/publication/390919733</a></li>
|
||||||
|
<li>Login or create a free ResearchGate account if prompted.</li>
|
||||||
|
<li>Click "Download full-text PDF" or "Request full-text".</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Relevance to Research</h2>
|
||||||
|
<p>
|
||||||
|
This preprint investigates the integration of the Model Context Protocol (MCP) and
|
||||||
|
Agent2Agent (A2A) Protocol in Multi-Agent Systems (MAS). It is directly relevant to
|
||||||
|
research on multi-agent orchestration, inter-agent communication standards, and
|
||||||
|
protocol-based coordination in distributed AI systems.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><em>Retrieved: 2026-06-07 | Access blocked in automated environment</em></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# Agent2Agent (A2A) Protocol
|
||||||
|
|
||||||
|
[](https://pypi.org/project/a2a-sdk)
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
|
<!-- markdownlint-disable MD041 -->
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<h1>Agent2Agent (A2A) Protocol</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
**An open protocol enabling communication and interoperability between opaque agentic applications.**
|
||||||
|
|
||||||
|
The Agent2Agent (A2A) protocol addresses a critical challenge in the AI landscape: enabling gen AI agents, built on diverse frameworks by different companies running on separate servers, to communicate and collaborate effectively - as agents, not just as tools. A2A aims to provide a common language for agents, fostering a more interconnected, powerful, and innovative AI ecosystem.
|
||||||
|
|
||||||
|
With A2A, agents can:
|
||||||
|
|
||||||
|
- Discover each other's capabilities.
|
||||||
|
- Negotiate interaction modalities (text, forms, media).
|
||||||
|
- Securely collaborate on long-running tasks.
|
||||||
|
- Operate without exposing their internal state, memory, or tools.
|
||||||
|
|
||||||
|
## DeepLearning.AI Course
|
||||||
|
|
||||||
|
Join this short course on [A2A: The Agent2Agent Protocol](https://goo.gle/dlai-a2a), built in partnership with Google Cloud and IBM Research.
|
||||||
|
|
||||||
|
**What you'll learn:**
|
||||||
|
|
||||||
|
- **Make agents A2A-compliant:** Expose agents built with frameworks like Google ADK, LangGraph, or BeeAI as A2A servers.
|
||||||
|
- **Connect agents:** Create A2A clients from scratch or using integrations to connect to A2A-compliant agents.
|
||||||
|
- **Orchestrate workflows:** Build sequential and hierarchical workflows of A2A-compliant agents.
|
||||||
|
- **Multi-agent systems:** Build a healthcare multi-agent system using different frameworks and see how A2A enables collaboration.
|
||||||
|
- **A2A and MCP:** Learn how A2A complements MCP by enabling agents to collaborate with each other.
|
||||||
|
|
||||||
|
## Why A2A?
|
||||||
|
|
||||||
|
As AI agents become more prevalent, their ability to interoperate is crucial for building complex, multi-functional applications. A2A aims to:
|
||||||
|
|
||||||
|
- **Break Down Silos:** Connect agents across different ecosystems.
|
||||||
|
- **Enable Complex Collaboration:** Allow specialized agents to work together on tasks that a single agent cannot handle alone.
|
||||||
|
- **Promote Open Standards:** Foster a community-driven approach to agent communication, encouraging innovation and broad adoption.
|
||||||
|
- **Preserve Opacity:** Allow agents to collaborate without needing to share internal memory, proprietary logic, or specific tool implementations, enhancing security and protecting intellectual property.
|
||||||
|
|
||||||
|
### Key Features
|
||||||
|
|
||||||
|
- **Standardized Communication:** JSON-RPC 2.0 over HTTP(S).
|
||||||
|
- **Agent Discovery:** Via "Agent Cards" detailing capabilities and connection info.
|
||||||
|
- **Flexible Interaction:** Supports synchronous request/response, streaming (SSE), and asynchronous push notifications.
|
||||||
|
- **Rich Data Exchange:** Handles text, files, and structured JSON data.
|
||||||
|
- **Enterprise-Ready:** Designed with security, authentication, and observability in mind.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
- **Explore the Documentation:** Visit the [Agent2Agent Protocol Documentation Site](https://a2a-protocol.org) for a complete overview, the full protocol specification, tutorials, and guides.
|
||||||
|
- **View the Specification:** [A2A Protocol Specification](https://a2a-protocol.org/latest/specification/)
|
||||||
|
- Use the SDKs:
|
||||||
|
- [A2A Python SDK](https://github.com/a2aproject/a2a-python) `pip install a2a-sdk`
|
||||||
|
- [A2A Go SDK](https://github.com/a2aproject/a2a-go) `go get github.com/a2aproject/a2a-go`
|
||||||
|
- [A2A JS SDK](https://github.com/a2aproject/a2a-js) `npm install @a2a-js/sdk`
|
||||||
|
- [A2A Java SDK](https://github.com/a2aproject/a2a-java) using maven
|
||||||
|
- [A2A .NET SDK](https://github.com/a2aproject/a2a-dotnet) using NuGet `dotnet add package A2A`
|
||||||
|
- Use our [samples](https://github.com/a2aproject/a2a-samples) to see A2A in action
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome community contributions to enhance and evolve the A2A protocol!
|
||||||
|
|
||||||
|
- **Questions & Discussions:** Join our [GitHub Discussions](https://github.com/a2aproject/A2A/discussions).
|
||||||
|
- **Issues & Feedback:** Report issues or suggest improvements via [GitHub Issues](https://github.com/a2aproject/A2A/issues).
|
||||||
|
- **Contribution Guide:** See our [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute.
|
||||||
|
- **Private Feedback:** Use this [Google Form](https://goo.gle/a2a-feedback).
|
||||||
|
- **Partner Program:** Google Cloud customers can join our partner program via this [form](https://goo.gle/a2a-partner).
|
||||||
|
|
||||||
|
## What's next
|
||||||
|
|
||||||
|
### Protocol Enhancements
|
||||||
|
|
||||||
|
- **Agent Discovery:**
|
||||||
|
- Formalize inclusion of authorization schemes and optional credentials directly within the `AgentCard`.
|
||||||
|
- **Agent Collaboration:**
|
||||||
|
- Investigate a `QuerySkill()` method for dynamically checking unsupported or unanticipated skills.
|
||||||
|
- **Task Lifecycle & UX:**
|
||||||
|
- Support for dynamic UX negotiation _within_ a task (e.g., agent adding audio/video mid-conversation).
|
||||||
|
- **Client Methods & Transport:**
|
||||||
|
- Explore extending support to client-initiated methods (beyond task management).
|
||||||
|
- Improvements to streaming reliability and push notification mechanisms.
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
The A2A Protocol is an open source project under the Linux Foundation, contributed by Google. It is licensed under the [Apache License 2.0](LICENSE) and is open to contributions from the community.
|
||||||
|
|
||||||
|
---
|
||||||
|
*Source: https://github.com/a2aproject/A2A — Retrieved 2026-06-07*
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Model Context Protocol (MCP)
|
||||||
|
|
||||||
|
_Just heard of MCP and not sure where to start? Check out our [documentation website](https://modelcontextprotocol.io)._
|
||||||
|
|
||||||
|
This repo contains the:
|
||||||
|
|
||||||
|
- MCP specification
|
||||||
|
- MCP protocol schema
|
||||||
|
- Official MCP documentation
|
||||||
|
|
||||||
|
The schema is [defined in TypeScript](schema/2025-11-25/schema.ts) first, but
|
||||||
|
[made available as JSON Schema](schema/2025-11-25/schema.json) as well, for wider
|
||||||
|
compatibility.
|
||||||
|
|
||||||
|
The official MCP documentation is built using Mintlify and available at
|
||||||
|
[modelcontextprotocol.io](https://modelcontextprotocol.io).
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
The Model Context Protocol was created by David Soria Parra ([@dsp](https://github.com/dsp)) and Justin Spahr-Summers ([@jspahrsummers](https://github.com/jspahrsummers)).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the [MIT License](LICENSE).
|
||||||
|
|
||||||
|
---
|
||||||
|
*Source: https://raw.githubusercontent.com/modelcontextprotocol/specification/main/README.md — Retrieved 2026-06-07*
|
||||||
@@ -0,0 +1,418 @@
|
|||||||
|
MQTT Version 5.0
|
||||||
|
OASIS Standard
|
||||||
|
07 March 2019
|
||||||
|
|
||||||
|
NOTE: This file contains the text content extracted from the PDF at:
|
||||||
|
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.pdf
|
||||||
|
|
||||||
|
Specification URIs:
|
||||||
|
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.docx (Authoritative)
|
||||||
|
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html
|
||||||
|
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.pdf
|
||||||
|
|
||||||
|
Technical Committee: OASIS Message Queuing Telemetry Transport (MQTT) TC
|
||||||
|
Editors: Andrew Banks (IBM), Ed Briggs (Microsoft), Ken Borgendale (IBM), Rahul Gupta (IBM)
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
MQTT is a Client Server publish/subscribe messaging transport protocol. It is light weight, open,
|
||||||
|
simple, and designed to be easy to implement. These characteristics make it ideal for use in many
|
||||||
|
situations, including constrained environments such as Machine to Machine (M2M) and Internet
|
||||||
|
of Things (IoT) contexts where a small code footprint is required and/or network bandwidth is
|
||||||
|
at a premium.
|
||||||
|
|
||||||
|
The protocol runs over TCP/IP, or over other network protocols that provide ordered, lossless,
|
||||||
|
bidirectional connections. Its features include:
|
||||||
|
- Use of the publish/subscribe message pattern which provides one-to-many message
|
||||||
|
distribution and decoupling of applications.
|
||||||
|
- A messaging transport that is agnostic to the content of the payload.
|
||||||
|
- Three qualities of service for message delivery:
|
||||||
|
o "At most once": messages delivered according to best efforts; message loss can occur.
|
||||||
|
o "At least once": messages assured to arrive but duplicates can occur.
|
||||||
|
o "Exactly once": messages assured to arrive exactly once.
|
||||||
|
- A small transport overhead and protocol exchanges minimized to reduce network traffic.
|
||||||
|
- A mechanism to notify interested parties when an abnormal disconnection occurs.
|
||||||
|
|
||||||
|
Copyright © OASIS Open 2019. All Rights Reserved.
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
Table of Contents
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
1 Introduction
|
||||||
|
1.1 Organization of the MQTT specification
|
||||||
|
1.2 Terminology
|
||||||
|
1.3 Normative references
|
||||||
|
1.4 Non-normative references
|
||||||
|
1.5 Data representation
|
||||||
|
1.5.1 Bits
|
||||||
|
1.5.2 Two Byte Integer
|
||||||
|
1.5.3 Four Byte Integer
|
||||||
|
1.5.4 UTF-8 Encoded String
|
||||||
|
1.5.5 Variable Byte Integer
|
||||||
|
1.5.6 Binary Data
|
||||||
|
1.5.7 UTF-8 String Pair
|
||||||
|
1.6 Security
|
||||||
|
1.7 Editing convention
|
||||||
|
1.8 Change history
|
||||||
|
|
||||||
|
2 MQTT Control Packet format
|
||||||
|
2.1 Structure of an MQTT Control Packet
|
||||||
|
2.1.1 Fixed Header
|
||||||
|
2.1.2 MQTT Control Packet type
|
||||||
|
2.1.3 Flags
|
||||||
|
2.1.4 Remaining Length
|
||||||
|
2.2 Variable Header
|
||||||
|
2.2.1 Packet Identifier
|
||||||
|
2.2.2 Properties
|
||||||
|
2.3 Payload
|
||||||
|
2.4 Reason Code
|
||||||
|
|
||||||
|
3 MQTT Control Packets
|
||||||
|
3.1 CONNECT – Connection Request
|
||||||
|
3.2 CONNACK – Connect acknowledgement
|
||||||
|
3.3 PUBLISH – Publish message
|
||||||
|
3.4 PUBACK – Publish acknowledgement (QoS 1)
|
||||||
|
3.5 PUBREC – Publish received (QoS 2 delivery part 1)
|
||||||
|
3.6 PUBREL – Publish release (QoS 2 delivery part 2)
|
||||||
|
3.7 PUBCOMP – Publish complete (QoS 2 delivery part 3)
|
||||||
|
3.8 SUBSCRIBE – Subscribe request
|
||||||
|
3.9 SUBACK – Subscribe acknowledgement
|
||||||
|
3.10 UNSUBSCRIBE – Unsubscribe request
|
||||||
|
3.11 UNSUBACK – Unsubscribe acknowledgement
|
||||||
|
3.12 PINGREQ – PING request
|
||||||
|
3.13 PINGRESP – PING response
|
||||||
|
3.14 DISCONNECT – Disconnect notification
|
||||||
|
3.15 AUTH – Authentication exchange
|
||||||
|
|
||||||
|
4 Operational behavior
|
||||||
|
4.1 Session State
|
||||||
|
4.2 Network Connections
|
||||||
|
4.3 Quality of Service levels and protocol flows
|
||||||
|
4.4 Message delivery retry
|
||||||
|
4.5 Message receipt
|
||||||
|
4.6 Message ordering
|
||||||
|
4.7 Topic Names and Topic Filters
|
||||||
|
4.8 Subscriptions
|
||||||
|
4.9 Flow Control
|
||||||
|
4.10 Request / Response
|
||||||
|
4.11 Server redirection
|
||||||
|
4.12 Enhanced authentication
|
||||||
|
4.13 Handling errors
|
||||||
|
|
||||||
|
5 Security (non-normative)
|
||||||
|
6 Using WebSocket as a network transport
|
||||||
|
7 Conformance
|
||||||
|
Appendix A. Summary of new features in MQTT v5.0
|
||||||
|
Appendix B. Mandatory normative statements
|
||||||
|
Appendix C. Non-normative bibliographic references
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
1 Introduction
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
1.1 Organization of the MQTT specification
|
||||||
|
|
||||||
|
Chapter 1 - Introduction
|
||||||
|
Chapter 2 - MQTT Control Packet format
|
||||||
|
Chapter 3 - MQTT Control Packets
|
||||||
|
Chapter 4 - Operational behavior
|
||||||
|
Chapter 5 - Security
|
||||||
|
Chapter 6 - Using WebSocket as a network transport
|
||||||
|
Chapter 7 - Conformance Targets
|
||||||
|
|
||||||
|
1.2 Terminology
|
||||||
|
|
||||||
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
|
||||||
|
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this specification are to be
|
||||||
|
interpreted as described in IETF RFC 2119.
|
||||||
|
|
||||||
|
Key terms:
|
||||||
|
- **Application Message**: The data carried by the MQTT protocol across the network
|
||||||
|
- **Client**: A program or device that uses MQTT. A Client always establishes the Network Connection
|
||||||
|
to the Server. It can Publish Application Messages, Subscribe/Unsubscribe to request messages.
|
||||||
|
- **Server**: A program or device that acts as an intermediary between Clients which publish
|
||||||
|
Application Messages and Clients which have made Subscriptions.
|
||||||
|
- **Session**: A stateful interaction between a Client and a Server. Can span more than one Network Connection.
|
||||||
|
- **Subscription**: A Subscription comprises a Topic Filter and a maximum QoS. Associated with a single Session.
|
||||||
|
- **Shared Subscription**: A Subscription with multiple Clients to allow load balancing.
|
||||||
|
- **Wildcard Subscription**: A Subscription using a Topic Filter containing a wildcard character.
|
||||||
|
- **Topic Name**: A label attached to an Application Message which is matched against Subscriptions.
|
||||||
|
- **Topic Filter**: An expression in a Subscription to indicate matching Topic Names.
|
||||||
|
- **MQTT Control Packet**: A packet of information sent across the Network Connection. The MQTT
|
||||||
|
specification defines fifteen different types.
|
||||||
|
- **Malformed Packet**: A Control Packet that cannot be parsed according to this specification.
|
||||||
|
- **Protocol Error**: An error discovered after packet parsing which does not conform to the specification.
|
||||||
|
- **Will Message**: An Application Message which is published by the Server after the Network
|
||||||
|
Connection is closed in cases where the Network Connection is not closed normally.
|
||||||
|
- **Disallowed Unicode code point**: Code points defined in section 1.5.4 which should not appear
|
||||||
|
in a UTF-8 Encoded String.
|
||||||
|
|
||||||
|
1.5 Data representation
|
||||||
|
|
||||||
|
1.5.2 Two Byte Integer
|
||||||
|
Two Byte Integer values are 16-bit unsigned integers in big-endian order: high order byte followed
|
||||||
|
by low order byte. This means a 16-bit word is presented on the network as Most Significant Byte
|
||||||
|
(MSB), followed by Least Significant Byte (LSB).
|
||||||
|
|
||||||
|
1.5.3 Four Byte Integer
|
||||||
|
Four Byte Integer values are 32-bit unsigned integers in big-endian order.
|
||||||
|
|
||||||
|
1.5.4 UTF-8 Encoded String
|
||||||
|
Text fields within the MQTT Control Packets are encoded as UTF-8 strings.
|
||||||
|
- Maximum size: 65,535 bytes
|
||||||
|
- A UTF-8 Encoded String MUST NOT include an encoding of the null character U+0000.
|
||||||
|
- A UTF-8 encoded sequence 0xEF 0xBB 0xBF is always interpreted as U+FEFF (ZERO WIDTH
|
||||||
|
NO-BREAK SPACE) wherever it appears in a string; it MUST NOT be skipped over or stripped
|
||||||
|
off by a packet receiver.
|
||||||
|
|
||||||
|
1.5.5 Variable Byte Integer
|
||||||
|
The Variable Byte Integer uses a scheme where the low seven bits of each byte encode the data,
|
||||||
|
and the high bit indicates whether there are bytes following in the representation.
|
||||||
|
- 1 byte: 0 to 127
|
||||||
|
- 2 bytes: 128 to 16,383
|
||||||
|
- 3 bytes: 16,384 to 2,097,151
|
||||||
|
- 4 bytes: 2,097,152 to 268,435,455
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
2 MQTT Control Packet format
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
2.1.2 MQTT Control Packet type
|
||||||
|
|
||||||
|
| Name | Value | Direction of flow | Description |
|
||||||
|
|----------|-------|----------------------|--------------------------|
|
||||||
|
| CONNECT | 1 | Client to Server | Connection request |
|
||||||
|
| CONNACK | 2 | Server to Client | Connect acknowledgement |
|
||||||
|
| PUBLISH | 3 | Client to Server or | Publish message |
|
||||||
|
| | | Server to Client | |
|
||||||
|
| PUBACK | 4 | Client to Server or | Publish acknowledgement |
|
||||||
|
| | | Server to Client | (QoS 1) |
|
||||||
|
| PUBREC | 5 | Client to Server or | Publish received |
|
||||||
|
| | | Server to Client | (QoS 2 delivery part 1) |
|
||||||
|
| PUBREL | 6 | Client to Server or | Publish release |
|
||||||
|
| | | Server to Client | (QoS 2 delivery part 2) |
|
||||||
|
| PUBCOMP | 7 | Client to Server or | Publish complete |
|
||||||
|
| | | Server to Client | (QoS 2 delivery part 3) |
|
||||||
|
| SUBSCRIBE| 8 | Client to Server | Subscribe request |
|
||||||
|
| SUBACK | 9 | Server to Client | Subscribe acknowledgement|
|
||||||
|
| UNSUBSCRIBE|10 | Client to Server | Unsubscribe request |
|
||||||
|
| UNSUBACK | 11 | Server to Client | Unsubscribe acknowledge |
|
||||||
|
| PINGREQ | 12 | Client to Server | PING request |
|
||||||
|
| PINGRESP | 13 | Server to Client | PING response |
|
||||||
|
| DISCONNECT|14 | Client to Server or | Disconnect notification |
|
||||||
|
| | | Server to Client | |
|
||||||
|
| AUTH | 15 | Client to Server or | Authentication exchange |
|
||||||
|
| | | Server to Client | |
|
||||||
|
|
||||||
|
2.2.2 Properties
|
||||||
|
|
||||||
|
Properties were introduced in MQTT v5.0 to provide extensibility.
|
||||||
|
Each property has an identifier encoded as a Variable Byte Integer.
|
||||||
|
|
||||||
|
Key properties (by packet type):
|
||||||
|
- Payload Format Indicator (0x01): PUBLISH
|
||||||
|
- Message Expiry Interval (0x02): PUBLISH
|
||||||
|
- Content Type (0x03): PUBLISH
|
||||||
|
- Response Topic (0x08): PUBLISH
|
||||||
|
- Correlation Data (0x09): PUBLISH
|
||||||
|
- Subscription Identifier (0x0B): PUBLISH, SUBSCRIBE
|
||||||
|
- Session Expiry Interval (0x11): CONNECT, CONNACK, DISCONNECT
|
||||||
|
- Assigned Client Identifier (0x12): CONNACK
|
||||||
|
- Server Keep Alive (0x13): CONNACK
|
||||||
|
- Authentication Method (0x15): CONNECT, CONNACK, AUTH
|
||||||
|
- Authentication Data (0x16): CONNECT, CONNACK, AUTH
|
||||||
|
- Request Problem Information (0x17): CONNECT
|
||||||
|
- Will Delay Interval (0x18): Will Properties
|
||||||
|
- Request Response Information (0x19): CONNECT
|
||||||
|
- Response Information (0x1A): CONNACK
|
||||||
|
- Server Reference (0x1C): CONNACK, DISCONNECT
|
||||||
|
- Reason String (0x1F): CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP,
|
||||||
|
SUBACK, UNSUBACK, DISCONNECT, AUTH
|
||||||
|
- Receive Maximum (0x21): CONNECT, CONNACK
|
||||||
|
- Topic Alias Maximum (0x22): CONNECT, CONNACK
|
||||||
|
- Topic Alias (0x23): PUBLISH
|
||||||
|
- Maximum QoS (0x24): CONNACK
|
||||||
|
- Retain Available (0x25): CONNACK
|
||||||
|
- User Property (0x26): All packets
|
||||||
|
- Maximum Packet Size (0x27): CONNECT, CONNACK
|
||||||
|
- Wildcard Subscription Available (0x28): CONNACK
|
||||||
|
- Subscription Identifier Available (0x29): CONNACK
|
||||||
|
- Shared Subscription Available (0x2A): CONNACK
|
||||||
|
|
||||||
|
2.4 Reason Code
|
||||||
|
|
||||||
|
New in MQTT v5.0. Reason Codes communicate the result of an operation.
|
||||||
|
|
||||||
|
| Dec | Hex | Name | Packets |
|
||||||
|
|-----|------|-------------------------------|--------------------------------------|
|
||||||
|
| 0 | 0x00 | Success/Normal disconnection | CONNACK, PUBACK, PUBREC, PUBREL, |
|
||||||
|
| | | | PUBCOMP, UNSUBACK, AUTH, DISCONNECT |
|
||||||
|
| 1 | 0x01 | Granted QoS 1 | SUBACK |
|
||||||
|
| 2 | 0x02 | Granted QoS 2 | SUBACK |
|
||||||
|
| 4 | 0x04 | Disconnect with Will Message | DISCONNECT |
|
||||||
|
| 16 | 0x10 | No matching subscribers | PUBACK, PUBREC |
|
||||||
|
| 17 | 0x11 | No subscription found | UNSUBACK |
|
||||||
|
| 24 | 0x18 | Continue authentication | AUTH |
|
||||||
|
| 25 | 0x19 | Re-authenticate | AUTH |
|
||||||
|
| 128 | 0x80 | Unspecified error | CONNACK, PUBACK, PUBREC, SUBACK, |
|
||||||
|
| | | | UNSUBACK, DISCONNECT |
|
||||||
|
| 129 | 0x81 | Malformed Packet | CONNACK, DISCONNECT |
|
||||||
|
| 130 | 0x82 | Protocol Error | CONNACK, DISCONNECT |
|
||||||
|
| 131 | 0x83 | Implementation specific error | CONNACK, PUBACK, PUBREC, SUBACK, |
|
||||||
|
| | | | UNSUBACK, DISCONNECT |
|
||||||
|
| 132 | 0x84 | Unsupported Protocol Version | CONNACK |
|
||||||
|
| 133 | 0x85 | Client Identifier not valid | CONNACK |
|
||||||
|
| 134 | 0x86 | Bad User Name or Password | CONNACK |
|
||||||
|
| 135 | 0x87 | Not authorized | CONNACK, PUBACK, PUBREC, SUBACK, |
|
||||||
|
| | | | UNSUBACK, DISCONNECT |
|
||||||
|
| 136 | 0x88 | Server unavailable | CONNACK |
|
||||||
|
| 137 | 0x89 | Server busy | CONNACK, DISCONNECT |
|
||||||
|
| 144 | 0x90 | Topic Name invalid | CONNACK, PUBACK, PUBREC, DISCONNECT |
|
||||||
|
| 145 | 0x91 | Packet Identifier in use | PUBACK, PUBREC, SUBACK, UNSUBACK |
|
||||||
|
| 146 | 0x92 | Packet Identifier not found | PUBREL, PUBCOMP |
|
||||||
|
| 147 | 0x93 | Receive Maximum exceeded | DISCONNECT |
|
||||||
|
| 148 | 0x94 | Topic Alias invalid | DISCONNECT |
|
||||||
|
| 149 | 0x95 | Packet too large | CONNACK, DISCONNECT |
|
||||||
|
| 151 | 0x97 | Quota exceeded | CONNACK, PUBACK, PUBREC, SUBACK, |
|
||||||
|
| | | | DISCONNECT |
|
||||||
|
| 153 | 0x99 | Payload format invalid | CONNACK, PUBACK, PUBREC, DISCONNECT |
|
||||||
|
| 154 | 0x9A | Retain not supported | CONNACK, DISCONNECT |
|
||||||
|
| 155 | 0x9B | QoS not supported | CONNACK, DISCONNECT |
|
||||||
|
| 156 | 0x9C | Use another server | CONNACK, DISCONNECT |
|
||||||
|
| 157 | 0x9D | Server moved | CONNACK, DISCONNECT |
|
||||||
|
| 158 | 0x9E | Shared Subscriptions not supported | CONNACK, SUBACK, DISCONNECT |
|
||||||
|
| 159 | 0x9F | Connection rate exceeded | CONNACK, DISCONNECT |
|
||||||
|
| 160 | 0xA0 | Maximum connect time | DISCONNECT |
|
||||||
|
| 161 | 0xA1 | Subscription Identifiers not supported | CONNACK, SUBACK, DISCONNECT |
|
||||||
|
| 162 | 0xA2 | Wildcard Subscriptions not supported | CONNACK, SUBACK, DISCONNECT |
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
3 MQTT Control Packets (Key Sections)
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
3.1 CONNECT – Connection Request
|
||||||
|
|
||||||
|
3.1.2.3 Connect Flags
|
||||||
|
Connect Flags byte contains parameters specifying the behavior of the MQTT Connection:
|
||||||
|
- Bit 7: User Name Flag
|
||||||
|
- Bit 6: Password Flag
|
||||||
|
- Bit 5: Will Retain
|
||||||
|
- Bits 4-3: Will QoS
|
||||||
|
- Bit 2: Will Flag
|
||||||
|
- Bit 1: Clean Start
|
||||||
|
- Bit 0: Reserved (MUST be 0)
|
||||||
|
|
||||||
|
3.1.2.4 Clean Start
|
||||||
|
Bit 1 of Connect Flags. If set to 1, the Client and Server MUST discard any existing Session
|
||||||
|
and start a new Session. If set to 0, the Server MUST resume communications based on the
|
||||||
|
state from any existing Session.
|
||||||
|
|
||||||
|
3.1.2.11.3 Receive Maximum
|
||||||
|
Two Byte Integer. Client uses this to limit the number of QoS 1 and QoS 2 publications
|
||||||
|
that it is willing to process concurrently. Default: 65,535.
|
||||||
|
|
||||||
|
3.1.2.11.2 Session Expiry Interval
|
||||||
|
Four Byte Integer. Represents the Session Expiry Interval in seconds. If 0 or absent: Session
|
||||||
|
ends when Network Connection is closed. If 0xFFFFFFFF: Session does not expire.
|
||||||
|
|
||||||
|
3.3 PUBLISH – Publish message
|
||||||
|
|
||||||
|
3.3.1.1 DUP flag: Bit 3. If set to 0, indicates first delivery of this PUBLISH packet.
|
||||||
|
3.3.1.2 QoS level: Bits 2-1. Quality of Service level:
|
||||||
|
- 0b00 (0): At most once delivery
|
||||||
|
- 0b01 (1): At least once delivery
|
||||||
|
- 0b10 (2): Exactly once delivery
|
||||||
|
- 0b11 (3): MUST NOT be used
|
||||||
|
3.3.1.3 RETAIN flag: Bit 0. If set to 1, Application Message is stored by the Server.
|
||||||
|
|
||||||
|
3.3.2.1 Topic Name: MUST NOT contain wildcard characters.
|
||||||
|
3.3.2.2 Packet Identifier: Only present for QoS 1 and QoS 2.
|
||||||
|
|
||||||
|
3.8 SUBSCRIBE – Subscribe request
|
||||||
|
|
||||||
|
3.8.4 SUBSCRIBE Payload:
|
||||||
|
Each Subscription consists of:
|
||||||
|
- Topic Filter (UTF-8 string)
|
||||||
|
- Subscription Options byte:
|
||||||
|
- Bits 0-1: Maximum QoS
|
||||||
|
- Bit 2: No Local (don't receive own publishes)
|
||||||
|
- Bit 3: Retain As Published
|
||||||
|
- Bits 4-5: Retain Handling
|
||||||
|
- 0: Send retained at subscribe
|
||||||
|
- 1: Send only if new subscription
|
||||||
|
- 2: Do not send retained at subscribe
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
4 Operational Behavior (Key Sections)
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
4.3 Quality of Service levels and protocol flows
|
||||||
|
|
||||||
|
4.3.1 QoS 0: At most once delivery
|
||||||
|
The sender sends the PUBLISH packet.
|
||||||
|
No response, no retry.
|
||||||
|
|
||||||
|
4.3.2 QoS 1: At least once delivery
|
||||||
|
Sender -> Receiver: PUBLISH (Packet Identifier X)
|
||||||
|
Receiver -> Sender: PUBACK (Packet Identifier X)
|
||||||
|
If Sender does not receive PUBACK, it retransmits with DUP=1.
|
||||||
|
|
||||||
|
4.3.3 QoS 2: Exactly once delivery
|
||||||
|
Sender -> Receiver: PUBLISH (Packet Identifier X)
|
||||||
|
Receiver -> Sender: PUBREC (Packet Identifier X)
|
||||||
|
Sender -> Receiver: PUBREL (Packet Identifier X)
|
||||||
|
Receiver -> Sender: PUBCOMP (Packet Identifier X)
|
||||||
|
|
||||||
|
4.7 Topic Names and Topic Filters
|
||||||
|
|
||||||
|
Topic level separator: '/' (forward slash, U+002F)
|
||||||
|
Wildcards:
|
||||||
|
- '#' (Number sign, U+0023): Multi-level wildcard. MUST be the last character in the Topic
|
||||||
|
Filter, preceded only by a separator. Example: "sport/#"
|
||||||
|
- '+' (Plus sign, U+002B): Single-level wildcard. Example: "sport/+/player1"
|
||||||
|
|
||||||
|
Topic Names and Topic Filters beginning with '$' are reserved for Server-internal use.
|
||||||
|
A Subscription Topic Filter starting with '$' MUST NOT be matched by a Topic Name beginning
|
||||||
|
with a topic level not starting with '$'.
|
||||||
|
|
||||||
|
4.9 Flow Control (NEW in v5.0)
|
||||||
|
- Client sends CONNECT with Receive Maximum value (e.g., 10)
|
||||||
|
- Server tracks how many PUBLISH packets with QoS>0 are unacknowledged
|
||||||
|
- Server MUST NOT send more QoS 1 or QoS 2 PUBLISH packets to the Client than allowed
|
||||||
|
by the Receive Maximum
|
||||||
|
|
||||||
|
4.10 Request / Response (NEW in v5.0)
|
||||||
|
MQTT v5.0 includes a Request/Response pattern:
|
||||||
|
- Requestor sends PUBLISH with Response Topic and optional Correlation Data
|
||||||
|
- Responder publishes to Response Topic with same Correlation Data
|
||||||
|
- Enables point-to-point communication without pre-knowledge of each other
|
||||||
|
|
||||||
|
4.12 Enhanced authentication (NEW in v5.0)
|
||||||
|
Extended authentication allows the use of challenge/response style authentication:
|
||||||
|
1. Client sends CONNECT with Authentication Method property
|
||||||
|
2. Server sends AUTH (0x18 Continue authentication) with Authentication Data
|
||||||
|
3. Client responds with AUTH containing more Authentication Data
|
||||||
|
4. Exchange continues until Server sends CONNACK (success or failure)
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
Appendix A. Summary of new features in MQTT v5.0
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
New features compared to MQTT v3.1.1:
|
||||||
|
|
||||||
|
1. **Session expiry**: Separate control of when session state should be discarded
|
||||||
|
2. **Message expiry**: Expiry time for application messages
|
||||||
|
3. **Reason codes on all ACKs**: All response packets include a Reason Code
|
||||||
|
4. **Reason string**: Optional human-readable reason string on most packets
|
||||||
|
5. **Server disconnect**: Server can now send DISCONNECT to indicate why the connection was closed
|
||||||
|
6. **Payload format and content type**: Description of application message content
|
||||||
|
7. **Request/Response**: Pattern support with Response Topic and Correlation Data
|
||||||
|
8. **Shared Subscriptions**: Allows load-balanced message processing
|
||||||
|
9. **Subscription identifier**: Client can specify an identifier in SUBSCRIBE
|
||||||
|
10. **Topic alias**: Reduces overhead by using integer instead of Topic Name
|
||||||
|
11. **Flow control**: Client and Server can specify how many simultaneous messages they can handle
|
||||||
|
12. **User properties**: On most packets, arbitrary name-value string pairs
|
||||||
|
13. **Maximum packet size**: Client and Server can specify maximum packet size they can handle
|
||||||
|
14. **Server reference**: CONNACK and DISCONNECT can indicate another Server to use
|
||||||
|
15. **Enhanced authentication**: Challenge/response style authentication
|
||||||
|
16. **Will delay**: Delay publication of Will Messages at end of session
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
# OpenTelemetry Overview
|
||||||
|
|
||||||
|
> Source: https://raw.githubusercontent.com/open-telemetry/opentelemetry-specification/main/specification/overview.md
|
||||||
|
> Downloaded: 2026-06-07
|
||||||
|
|
||||||
|
This document provides an overview of the OpenTelemetry project and defines important fundamental terms.
|
||||||
|
|
||||||
|
## OpenTelemetry Client Architecture
|
||||||
|
|
||||||
|
At the highest architectural level, OpenTelemetry clients are organized into **signals**. Each signal provides a specialized form of observability. For example, tracing, metrics, and baggage are three separate signals. Signals share a common subsystem – **context propagation** – but they function independently from each other.
|
||||||
|
|
||||||
|
Each signal consists of four types of packages: API, SDK, Semantic Conventions, and Contrib.
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
API packages consist of the cross-cutting public interfaces used for instrumentation. Any portion of an OpenTelemetry client which is imported into third-party libraries and application code is considered part of the API.
|
||||||
|
|
||||||
|
### SDK
|
||||||
|
|
||||||
|
The SDK is the implementation of the API provided by the OpenTelemetry project. Within an application, the SDK is installed and managed by the application owner.
|
||||||
|
|
||||||
|
### Semantic Conventions
|
||||||
|
|
||||||
|
The **Semantic Conventions** define the keys and values which describe commonly observed concepts, protocols, and operations used by applications.
|
||||||
|
|
||||||
|
Semantic Conventions are now located in their own repository:
|
||||||
|
https://github.com/open-telemetry/semantic-conventions
|
||||||
|
|
||||||
|
### Contrib Packages
|
||||||
|
|
||||||
|
The OpenTelemetry project maintains integrations with popular OSS projects. **API Contrib** refers to packages which depend solely upon the API; **SDK Contrib** refers to packages which also depend upon the SDK.
|
||||||
|
|
||||||
|
## Tracing Signal
|
||||||
|
|
||||||
|
A distributed trace is a set of events, triggered as a result of a single logical operation, consolidated across various components of an application.
|
||||||
|
|
||||||
|
### Traces
|
||||||
|
|
||||||
|
**Traces** in OpenTelemetry are defined implicitly by their **Spans**. A **Trace** can be thought of as a directed acyclic graph (DAG) of **Spans**, where the edges between **Spans** are defined as parent/child relationship.
|
||||||
|
|
||||||
|
```
|
||||||
|
Causal relationships between Spans in a single Trace
|
||||||
|
|
||||||
|
[Span A] (the root span)
|
||||||
|
|
|
||||||
|
+------+------+
|
||||||
|
| |
|
||||||
|
[Span B] [Span C]
|
||||||
|
| |
|
||||||
|
[Span D] +---+-------+
|
||||||
|
| |
|
||||||
|
[Span E] [Span F]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Spans
|
||||||
|
|
||||||
|
A span represents an operation within a transaction. Each **Span** encapsulates:
|
||||||
|
|
||||||
|
- An operation name
|
||||||
|
- A start and finish timestamp
|
||||||
|
- **Attributes**: A list of key-value pairs
|
||||||
|
- A set of zero or more **Events**
|
||||||
|
- Parent's **Span** identifier
|
||||||
|
- **Links** to zero or more causally-related **Spans**
|
||||||
|
- **SpanContext** information
|
||||||
|
|
||||||
|
### SpanContext
|
||||||
|
|
||||||
|
Represents all the information that identifies **Span** in the **Trace**:
|
||||||
|
|
||||||
|
- **TraceId** - 16 randomly generated bytes, worldwide unique
|
||||||
|
- **SpanId** - 8 randomly generated bytes, globally unique
|
||||||
|
- **TraceFlags** - 1 byte bitmap (includes sampling bit)
|
||||||
|
- **Tracestate** - tracing-system specific context in key-value pairs
|
||||||
|
|
||||||
|
## Metric Signal
|
||||||
|
|
||||||
|
OpenTelemetry allows recording raw measurements or metrics with predefined aggregations and a set of attributes.
|
||||||
|
|
||||||
|
### Instruments
|
||||||
|
|
||||||
|
Instruments are used to report `Measurement`s, identified by a name, kind, description, and unit of values. Types include counters, gauges, and histograms. Instruments can be synchronous or asynchronous.
|
||||||
|
|
||||||
|
## Log Signal
|
||||||
|
|
||||||
|
### Data model
|
||||||
|
|
||||||
|
[Log Data Model](logs/data-model.md) defines how logs and events are understood by OpenTelemetry.
|
||||||
|
|
||||||
|
## Baggage Signal
|
||||||
|
|
||||||
|
OpenTelemetry provides a simple mechanism for propagating name/value pairs, called `Baggage`. `Baggage` is intended for indexing observability events in one service with attributes provided by a prior service in the same transaction.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
`Resource` captures information about the entity for which telemetry is recorded. For example, metrics exposed by a Kubernetes container can be linked to a resource that specifies the cluster, namespace, pod, and container name.
|
||||||
|
|
||||||
|
## Context Propagation
|
||||||
|
|
||||||
|
All of OpenTelemetry cross-cutting concerns share an underlying `Context` mechanism for storing state and accessing data across the lifespan of a distributed transaction.
|
||||||
|
|
||||||
|
## Propagators
|
||||||
|
|
||||||
|
OpenTelemetry uses `Propagators` to serialize and deserialize cross-cutting concern values such as `Span`s and `Baggage`.
|
||||||
|
|
||||||
|
The Propagators API currently defines one `Propagator` type:
|
||||||
|
|
||||||
|
- `TextMapPropagator` injects values into and extracts values from carriers as text.
|
||||||
|
|
||||||
|
## Collector
|
||||||
|
|
||||||
|
The OpenTelemetry Collector is a set of components that can collect traces, metrics and other telemetry data from processes instrumented by OpenTelemetry or other monitoring/tracing libraries (Jaeger, Prometheus, etc.), do aggregation and smart sampling, and export traces and metrics to one or more monitoring/tracing backends.
|
||||||
|
|
||||||
|
The OpenTelemetry Collector has two primary modes of operation: **Agent** (a daemon running locally with the application) and **Collector** (a standalone running service).
|
||||||
|
|
||||||
|
## Instrumentation Libraries
|
||||||
|
|
||||||
|
A library that enables OpenTelemetry observability for another library is called an **Instrumentation Library**.
|
||||||
|
|
||||||
|
For instrumentation hosted in OpenTelemetry repositories, the recommendation is to prefix packages with "opentelemetry-instrumentation", followed by the instrumented library name. Examples:
|
||||||
|
|
||||||
|
* opentelemetry-instrumentation-flask (Python)
|
||||||
|
* @opentelemetry/instrumentation-grpc (JavaScript)
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
# Protobuf Editions Design: Features
|
||||||
|
|
||||||
|
**Author:** [@haberman](https://github.com/haberman), [@fowles](https://github.com/fowles)
|
||||||
|
|
||||||
|
**Approved:** 2022-10-13
|
||||||
|
|
||||||
|
A proposal to use custom options as our way of defining and representing features.
|
||||||
|
|
||||||
|
## Background
|
||||||
|
|
||||||
|
The [Protobuf Editions](what-are-protobuf-editions.md) project uses "editions" to allow Protobuf to safely evolve over time. An edition is formally a set of "features" with a default value per feature. Features define the specific points of change and evolution on a per entity basis within a .proto file.
|
||||||
|
|
||||||
|
## Sample Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
edition = "2023";
|
||||||
|
|
||||||
|
package experimental.users.kfm.editions;
|
||||||
|
|
||||||
|
import "net/proto2/proto/features_cpp.proto";
|
||||||
|
|
||||||
|
option features.repeated_field_encoding = EXPANDED;
|
||||||
|
option features.enum = OPEN;
|
||||||
|
option features.(pb.cpp).string_field_type = STRING;
|
||||||
|
|
||||||
|
message Lab {
|
||||||
|
enum Mouse {
|
||||||
|
UNKNOWN_MOUSE = 0;
|
||||||
|
PINKY = 1;
|
||||||
|
THE_BRAIN = 2;
|
||||||
|
}
|
||||||
|
repeated Mouse mice = 1 [features.repeated_field_encoding = PACKED];
|
||||||
|
string name = 2;
|
||||||
|
string address = 3 [features.(pb.cpp).string_field_type = CORD];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Language-Specific Features
|
||||||
|
|
||||||
|
Extensions manage features specific to individual code generators:
|
||||||
|
|
||||||
|
```
|
||||||
|
message Features {
|
||||||
|
...
|
||||||
|
extensions 1000; // for features_cpp.proto
|
||||||
|
extensions 1001; // for features_java.proto
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Inheritance
|
||||||
|
|
||||||
|
Feature inheritance is exactly the behavior of `MergeFrom`:
|
||||||
|
|
||||||
|
```
|
||||||
|
void InheritFrom(const Features& parent, Features* child) {
|
||||||
|
Features tmp(parent);
|
||||||
|
tmp.MergeFrom(child);
|
||||||
|
child->Swap(&tmp);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Target Attributes
|
||||||
|
|
||||||
|
```
|
||||||
|
enum FeatureTargetType {
|
||||||
|
FILE = 0;
|
||||||
|
MESSAGE = 1;
|
||||||
|
ENUM = 2;
|
||||||
|
FIELD = 3;
|
||||||
|
...
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Retention
|
||||||
|
|
||||||
|
```
|
||||||
|
enum FeatureRetention {
|
||||||
|
SOURCE = 0;
|
||||||
|
RUNTIME = 1;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Edition Zero Features
|
||||||
|
|
||||||
|
```
|
||||||
|
message Features {
|
||||||
|
enum FieldPresence {
|
||||||
|
EXPLICIT = 0;
|
||||||
|
IMPLICIT = 1;
|
||||||
|
LEGACY_REQUIRED = 2;
|
||||||
|
}
|
||||||
|
optional FieldPresence field_presence = 1 [
|
||||||
|
retention = RUNTIME,
|
||||||
|
target = FIELD,
|
||||||
|
(edition_defaults) = { edition: "2023", default: "EXPLICIT" }
|
||||||
|
];
|
||||||
|
|
||||||
|
enum EnumType {
|
||||||
|
OPEN = 0;
|
||||||
|
CLOSED = 1;
|
||||||
|
}
|
||||||
|
optional EnumType enum = 2 [
|
||||||
|
retention = RUNTIME,
|
||||||
|
target = ENUM,
|
||||||
|
(edition_defaults) = { edition: "2023", default: "OPEN" }
|
||||||
|
];
|
||||||
|
|
||||||
|
enum RepeatedFieldEncoding {
|
||||||
|
PACKED = 0;
|
||||||
|
EXPANDED = 1;
|
||||||
|
}
|
||||||
|
optional RepeatedFieldEncoding repeated_field_encoding = 3 [
|
||||||
|
retention = RUNTIME,
|
||||||
|
target = FIELD,
|
||||||
|
(edition_defaults) = { edition: "2023", default: "PACKED" }
|
||||||
|
];
|
||||||
|
|
||||||
|
enum MessageEncoding {
|
||||||
|
LENGTH_PREFIXED = 0;
|
||||||
|
DELIMITED = 1;
|
||||||
|
}
|
||||||
|
optional MessageEncoding message_encoding = 5 [
|
||||||
|
retention = RUNTIME,
|
||||||
|
target = FIELD,
|
||||||
|
(edition_defaults) = { edition: "2023", default: "LENGTH_PREFIXED" }
|
||||||
|
];
|
||||||
|
|
||||||
|
extensions 1000; // for features_cpp.proto
|
||||||
|
extensions 1001; // for features_java.proto
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
Source: https://raw.githubusercontent.com/protocolbuffers/protobuf/main/docs/design/editions/protobuf-editions-design-features.md
|
||||||
|
Downloaded: 2026-06-07
|
||||||
@@ -0,0 +1,229 @@
|
|||||||
|
# References Index
|
||||||
|
> 엣지 AIoT gRPC 기반 멀티 에이전트 통신 인터페이스 연구 — 참고문헌 저장소
|
||||||
|
> 마지막 업데이트: 2026-06-07
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 저장 현황 요약
|
||||||
|
|
||||||
|
| 카테고리 | 파일 수 | 상태 |
|
||||||
|
|---------|--------|------|
|
||||||
|
| A2A 프로토콜 스펙 | 4 | ✅ 완전 저장 |
|
||||||
|
| IETF RFC 표준 | 5 | ✅ 요약 저장 (전문 PDF URL 제공) |
|
||||||
|
| OASIS / W3C 표준 | 2 | ✅ 저장 |
|
||||||
|
| Go/gRPC/SPIFFE 기술 문서 | 6 | ✅ 완전 저장 |
|
||||||
|
| 학술 논문 | 4 | ⚠️ 일부 메타데이터만 (직접 다운로드 URL 제공) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📂 파일 목록 상세
|
||||||
|
|
||||||
|
### 1. A2A 프로토콜 관련
|
||||||
|
|
||||||
|
| 파일명 | 내용 | 연구 활용 |
|
||||||
|
|--------|------|----------|
|
||||||
|
| `Google_A2A_Protocol_README.md` | A2A 프로토콜 공식 GitHub README | BACKGROUND §7, DESIGN §3.1 |
|
||||||
|
| `A2A_Protocol_JSON_Schema.json` | A2A 전체 JSON Schema (AgentCard, Task, Message, Part 타입 정의) | DESIGN §3.1, IMPL_DESIGN §3 |
|
||||||
|
| `A2A_vs_MCP_Comparison.md` | A2A와 MCP 비교 공식 문서 | BACKGROUND §3, DESIGN §3.1 |
|
||||||
|
| `A2A_Python_Sample_README.md` | A2A Python 샘플 에이전트 구현 가이드 | IMPL_DESIGN §5.1 |
|
||||||
|
|
||||||
|
### 2. IETF RFC 표준
|
||||||
|
|
||||||
|
> ⚠️ 아래 파일들은 Abstract + TOC 요약본입니다. 전문 PDF는 하단 [수동 다운로드 명령어](#수동-다운로드-명령어) 참조.
|
||||||
|
|
||||||
|
| 파일명 | RFC | 내용 | 연구 활용 |
|
||||||
|
|--------|-----|------|----------|
|
||||||
|
| `RFC9000_QUIC_Transport.txt` | RFC 9000 | QUIC: UDP 기반 멀티플렉싱 전송 (2021) | DESIGN §3.2, IMPL_DESIGN §4.1 |
|
||||||
|
| `RFC9114_HTTP3.txt` | RFC 9114 | HTTP/3 over QUIC (2022) | DESIGN §3.2, IMPL_DESIGN §4.4 |
|
||||||
|
| `RFC7252_CoAP.txt` | RFC 7252 | Constrained Application Protocol (2014) | DESIGN §3.2, BACKGROUND §3 |
|
||||||
|
| `RFC8949_CBOR.txt` | RFC 8949 | Concise Binary Object Representation (2020) | DESIGN §3.2, IMPL_DESIGN §1 |
|
||||||
|
| `RFC8446_TLS13.txt` | RFC 8446 | TLS 1.3 (2018) | DESIGN §3.3 |
|
||||||
|
|
||||||
|
### 3. OASIS / W3C 표준
|
||||||
|
|
||||||
|
| 파일명 | 내용 | 연구 활용 |
|
||||||
|
|--------|------|----------|
|
||||||
|
| `MQTT_v5_OASIS_Standard.pdf` | MQTT v5.0 OASIS 표준 전문 (핵심 부분 텍스트 추출) | DESIGN §3.2, IMPL_DESIGN §4.2 |
|
||||||
|
| `W3C_TraceContext_Spec.html` | W3C Trace Context 1.0 전문 HTML | DESIGN §9, IMPL_DESIGN §8 |
|
||||||
|
|
||||||
|
### 4. Go / gRPC / 인프라 기술 문서
|
||||||
|
|
||||||
|
| 파일명 | 내용 | 연구 활용 |
|
||||||
|
|--------|------|----------|
|
||||||
|
| `gRPC_HTTP2_Protocol_Spec.md` | gRPC over HTTP/2 공식 프로토콜 스펙 (GitHub) | DESIGN §3.2, IMPL_DESIGN §4.1 |
|
||||||
|
| `Protobuf_Design_Features.md` | Protocol Buffers Editions 설계 문서 | IMPL_DESIGN §3 |
|
||||||
|
| `quic-go_README.md` | quic-go 라이브러리 공식 README | IMPL_DESIGN §4.1 |
|
||||||
|
| `OpenTelemetry_Spec_Overview.md` | OpenTelemetry 공식 스펙 개요 | DESIGN §9, IMPL_DESIGN §8 |
|
||||||
|
| `SPIFFE_Standard.md` | SPIFFE 표준 스펙 (GitHub) | DESIGN §3.3, IMPL_DESIGN §7 |
|
||||||
|
| `SPIRE_Architecture.md` | SPIRE 아키텍처 문서 (spiffe.io 기반 재구성) | DESIGN §3.3, IMPL_DESIGN §7 |
|
||||||
|
| `MCP_Specification_README.md` | Anthropic MCP 스펙 README | DESIGN §3.1 |
|
||||||
|
|
||||||
|
### 5. 학술 논문
|
||||||
|
|
||||||
|
| 파일명 | 논문 정보 | 상태 | 연구 활용 |
|
||||||
|
|--------|---------|------|----------|
|
||||||
|
| `Wu2023_AutoGen_MultiAgent.pdf` | Wu et al. (2023). AutoGen: Enabling Next-Gen LLM Applications. arXiv:2308.08155 | ✅ 핵심 내용 저장 | BACKGROUND §1, PLANNING §8 |
|
||||||
|
| `Ghosh2025_MAS_MCP_A2A_Preprint.html` | Ghosh (2025). Agentic Ecosystem in Engineering Design via MCP/A2A. ResearchGate DOI:10.13140/RG.2.2.27720.64008 | ⚠️ 메타데이터 | BACKGROUND §7, PLANNING §8 |
|
||||||
|
| `Gaba2023_Holochain_IoT_Security_METADATA.md` | Gaba et al. (2023). Holochain: Agent-Centric DHT Security in IoT. IEEE Access 11:81205-81223 | ⚠️ 메타데이터 | DESIGN §3.3, BACKGROUND §7 |
|
||||||
|
| `Tedeschini2024_MARL_Cooperative_Localization_METADATA.md` | Tedeschini et al. (2024). Cooperative Positioning with MARL. IEEE IV Symposium | ⚠️ 메타데이터 | BACKGROUND §5, PLANNING §9 |
|
||||||
|
| `ETSI_ITS_V2X_Standard_METADATA.md` | ETSI EN 302 637-2 (2019). ITS-G5 V2X Standard | ⚠️ 메타데이터 | DESIGN §10 (V2X 사례) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 수동 다운로드 명령어
|
||||||
|
|
||||||
|
샌드박스 환경의 HTTPS 제한으로 직접 다운로드되지 않은 파일들입니다.
|
||||||
|
**Mac 터미널에서 아래 명령어를 실행**하면 이 폴더에 직접 저장됩니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /Users/godopu16/PuKi/lab/01_multiagent-orchestration/gRPC_Based_Interface/docs/references/
|
||||||
|
|
||||||
|
# === IETF RFC 전문 PDF ===
|
||||||
|
curl -L -o RFC9000_QUIC_Transport.pdf https://www.rfc-editor.org/rfc/rfc9000.pdf
|
||||||
|
curl -L -o RFC9114_HTTP3.pdf https://www.rfc-editor.org/rfc/rfc9114.pdf
|
||||||
|
curl -L -o RFC7252_CoAP.pdf https://www.rfc-editor.org/rfc/rfc7252.pdf
|
||||||
|
curl -L -o RFC8949_CBOR.pdf https://www.rfc-editor.org/rfc/rfc8949.pdf
|
||||||
|
curl -L -o RFC8446_TLS13.pdf https://www.rfc-editor.org/rfc/rfc8446.pdf
|
||||||
|
|
||||||
|
# === arXiv 논문 PDF ===
|
||||||
|
curl -L -o Wu2023_AutoGen_MultiAgent_FULL.pdf \
|
||||||
|
https://arxiv.org/pdf/2308.08155
|
||||||
|
|
||||||
|
# Tedeschini 2024 — IEEE IV (arXiv preprint 있는 경우)
|
||||||
|
# DOI: 10.1109/IV55156.2024.10588643
|
||||||
|
# arXiv 검색: https://arxiv.org/search/?query=Tedeschini+cooperative+localization+MARL
|
||||||
|
|
||||||
|
# === IEEE Access 오픈 액세스 논문 ===
|
||||||
|
# Gaba 2023 - Holochain IoT (IEEE Access = 무료)
|
||||||
|
curl -L -o Gaba2023_Holochain_IoT_Security.pdf \
|
||||||
|
"https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=10189589"
|
||||||
|
|
||||||
|
# === ETSI V2X 표준 ===
|
||||||
|
curl -L -o ETSI_EN302637-2_ITS_G5.pdf \
|
||||||
|
"https://www.etsi.org/deliver/etsi_en/302600_302699/30263702/01.04.01_60/en_30263702v010401p.pdf"
|
||||||
|
|
||||||
|
# === Ghosh 2025 ResearchGate ===
|
||||||
|
# 직접 접근 필요: https://doi.org/10.13140/RG.2.2.27720.64008
|
||||||
|
# 또는 Google Scholar 검색: "Agentic Ecosystem Engineering Design MCP A2A"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## BibTeX 인용 모음
|
||||||
|
|
||||||
|
```bibtex
|
||||||
|
@inproceedings{wu2023autogen,
|
||||||
|
title={AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation},
|
||||||
|
author={Wu, Qingyun and Bansal, Gagan and Zhang, Jieyu and others},
|
||||||
|
booktitle={ICLR 2024},
|
||||||
|
year={2023},
|
||||||
|
eprint={2308.08155},
|
||||||
|
archivePrefix={arXiv}
|
||||||
|
}
|
||||||
|
|
||||||
|
@techreport{iyengar2021quic,
|
||||||
|
title={{QUIC}: A {UDP}-Based Multiplexed and Secure Transport},
|
||||||
|
author={Iyengar, Jana and Thomson, Martin},
|
||||||
|
number={RFC 9000},
|
||||||
|
institution={IETF},
|
||||||
|
year={2021},
|
||||||
|
url={https://www.rfc-editor.org/rfc/rfc9000}
|
||||||
|
}
|
||||||
|
|
||||||
|
@techreport{shelby2014coap,
|
||||||
|
title={The Constrained Application Protocol ({CoAP})},
|
||||||
|
author={Shelby, Zach and Hartke, Klaus and Bormann, Carsten},
|
||||||
|
number={RFC 7252},
|
||||||
|
institution={IETF},
|
||||||
|
year={2014},
|
||||||
|
url={https://www.rfc-editor.org/rfc/rfc7252}
|
||||||
|
}
|
||||||
|
|
||||||
|
@techreport{bormann2020cbor,
|
||||||
|
title={Concise Binary Object Representation ({CBOR})},
|
||||||
|
author={Bormann, Carsten and Hoffman, Paul},
|
||||||
|
number={RFC 8949},
|
||||||
|
institution={IETF},
|
||||||
|
year={2020},
|
||||||
|
url={https://www.rfc-editor.org/rfc/rfc8949}
|
||||||
|
}
|
||||||
|
|
||||||
|
@standard{banks2019mqtt,
|
||||||
|
title={{MQTT} Version 5.0},
|
||||||
|
author={Banks, Andrew and Briggs, Ed and Borgendale, Ken and Gupta, Rahul},
|
||||||
|
organization={OASIS},
|
||||||
|
year={2019},
|
||||||
|
url={https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{google2024a2a,
|
||||||
|
title={Agent2Agent Protocol ({A2A})},
|
||||||
|
author={{Google}},
|
||||||
|
year={2024},
|
||||||
|
url={https://github.com/google/A2A}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{anthropic2024mcp,
|
||||||
|
title={Model Context Protocol Specification},
|
||||||
|
author={{Anthropic}},
|
||||||
|
year={2024},
|
||||||
|
url={https://github.com/modelcontextprotocol/specification}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{spiffe2024,
|
||||||
|
title={{SPIFFE}: Secure Production Identity Framework for Everyone},
|
||||||
|
author={{SPIFFE Project}},
|
||||||
|
year={2024},
|
||||||
|
url={https://spiffe.io}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{gaba2023holochain,
|
||||||
|
title={Holochain: An Agent-Centric Distributed Hash Table Security in Smart {IoT} Applications},
|
||||||
|
author={Gaba, Shikha and Khan, Hanzalah and others},
|
||||||
|
journal={IEEE Access},
|
||||||
|
volume={11},
|
||||||
|
pages={81205--81223},
|
||||||
|
year={2023},
|
||||||
|
doi={10.1109/ACCESS.2023.3298904}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{tedeschini2024marl,
|
||||||
|
title={Cooperative Positioning with Multi-Agent Reinforcement Learning},
|
||||||
|
author={Tedeschini, Bernardo C. and Brambilla, Matteo and Nicoli, Monica and Win, Moe Z.},
|
||||||
|
booktitle={2024 IEEE Intelligent Vehicles Symposium (IV)},
|
||||||
|
year={2024},
|
||||||
|
doi={10.1109/IV55156.2024.10588643}
|
||||||
|
}
|
||||||
|
|
||||||
|
@techreport{ghosh2025mas,
|
||||||
|
title={Agentic Ecosystem in Engineering Design: A Framework for Interoperable Legacy Tools and Emergent Collaboration via {MCP/A2A} Protocols},
|
||||||
|
author={Ghosh, Debdulal Panda},
|
||||||
|
year={2025},
|
||||||
|
institution={ResearchGate Preprint},
|
||||||
|
doi={10.13140/RG.2.2.27720.64008}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{opentelemetry2024,
|
||||||
|
title={{OpenTelemetry} Specification},
|
||||||
|
author={{OpenTelemetry Authors}},
|
||||||
|
year={2024},
|
||||||
|
url={https://opentelemetry.io/docs/specs/otel/}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 연구 절별 참고문헌 매핑
|
||||||
|
|
||||||
|
| 논문 절 | 핵심 참고문헌 파일 |
|
||||||
|
|--------|-----------------|
|
||||||
|
| BACKGROUND §3 (기존 기술 한계) | `RFC9000_QUIC_Transport.txt`, `RFC7252_CoAP.txt`, `gRPC_HTTP2_Protocol_Spec.md` |
|
||||||
|
| BACKGROUND §7 (관련 연구) | `Wu2023_AutoGen_MultiAgent.pdf`, `Google_A2A_Protocol_README.md`, `Gaba2023_*METADATA.md` |
|
||||||
|
| DESIGN §3.1 (시맨틱 계층) | `Google_A2A_Protocol_README.md`, `A2A_Protocol_JSON_Schema.json`, `A2A_vs_MCP_Comparison.md`, `MCP_Specification_README.md` |
|
||||||
|
| DESIGN §3.2 (전송 계층) | `RFC9000_QUIC_Transport.txt`, `RFC9114_HTTP3.txt`, `gRPC_HTTP2_Protocol_Spec.md`, `MQTT_v5_OASIS_Standard.pdf`, `RFC7252_CoAP.txt` |
|
||||||
|
| DESIGN §3.3 (보안/신원 계층) | `SPIFFE_Standard.md`, `SPIRE_Architecture.md`, `RFC8446_TLS13.txt` |
|
||||||
|
| DESIGN §9 (관측성) | `OpenTelemetry_Spec_Overview.md`, `W3C_TraceContext_Spec.html` |
|
||||||
|
| IMPL_DESIGN §4.1 (quic-go) | `quic-go_README.md`, `RFC9000_QUIC_Transport.txt`, `gRPC_HTTP2_Protocol_Spec.md` |
|
||||||
|
| IMPL_DESIGN §4.2 (MQTT 변환) | `MQTT_v5_OASIS_Standard.pdf`, `RFC7252_CoAP.txt` |
|
||||||
|
| IMPL_DESIGN §3 (Proto 설계) | `Protobuf_Design_Features.md`, `A2A_Protocol_JSON_Schema.json` |
|
||||||
|
| IMPL_DESIGN §7 (SPIFFE) | `SPIFFE_Standard.md`, `SPIRE_Architecture.md` |
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
Internet Engineering Task Force (IETF) Z. Shelby
|
||||||
|
Request for Comments: 7252 ARM
|
||||||
|
Category: Standards Track K. Hartke
|
||||||
|
ISSN: 2070-1721 C. Bormann
|
||||||
|
Universitaet Bremen TZI
|
||||||
|
June 2014
|
||||||
|
|
||||||
|
|
||||||
|
The Constrained Application Protocol (CoAP)
|
||||||
|
|
||||||
|
Abstract
|
||||||
|
|
||||||
|
The Constrained Application Protocol (CoAP) is a specialized web
|
||||||
|
transfer protocol for use with constrained nodes and constrained
|
||||||
|
(e.g., low-power, lossy) networks. The nodes often have 8-bit
|
||||||
|
microcontrollers with small amounts of ROM and RAM, while constrained
|
||||||
|
networks such as IPv6 over Low-Power Wireless Personal Area Networks
|
||||||
|
(6LoWPANs) often have high packet error rates and a typical
|
||||||
|
throughput of 10s of kbit/s. The protocol is designed for machine-
|
||||||
|
to-machine (M2M) applications such as smart energy and building
|
||||||
|
automation.
|
||||||
|
|
||||||
|
CoAP provides a request/response interaction model between
|
||||||
|
application endpoints, supports built-in discovery of services and
|
||||||
|
resources, and includes key concepts of the Web such as URIs and
|
||||||
|
Internet media types. CoAP is designed to easily interface with HTTP
|
||||||
|
for integration with the Web while meeting specialized requirements
|
||||||
|
such as multicast support, very low overhead, and simplicity for
|
||||||
|
constrained environments.
|
||||||
|
|
||||||
|
Status of This Memo
|
||||||
|
|
||||||
|
This is an Internet Standards Track document.
|
||||||
|
Information about the current status of this document, any errata,
|
||||||
|
and how to provide feedback on it may be obtained at
|
||||||
|
http://www.rfc-editor.org/info/rfc7252.
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
1.1. Features
|
||||||
|
1.2. Terminology
|
||||||
|
2. Constrained Application Protocol
|
||||||
|
2.1. Messaging Model
|
||||||
|
2.2. Request/Response Model
|
||||||
|
2.3. Intermediaries and Caching
|
||||||
|
2.4. Resource Discovery
|
||||||
|
3. Message Format
|
||||||
|
3.1. Option Format
|
||||||
|
3.2. Option Value Formats
|
||||||
|
4. Message Transmission
|
||||||
|
4.1. Messages and Endpoints
|
||||||
|
4.2. Messages Transmitted Reliably
|
||||||
|
4.3. Messages Transmitted without Reliability
|
||||||
|
4.4. Message Correlation
|
||||||
|
4.5. Message Deduplication
|
||||||
|
4.6. Message Size
|
||||||
|
4.7. Congestion Control
|
||||||
|
4.8. Transmission Parameters
|
||||||
|
5. Request/Response Semantics
|
||||||
|
5.1. Requests
|
||||||
|
5.2. Responses
|
||||||
|
5.3. Request/Response Matching
|
||||||
|
5.4. Options
|
||||||
|
5.5. Payloads and Representations
|
||||||
|
5.6. Caching
|
||||||
|
5.7. Proxying
|
||||||
|
5.8. Method Definitions
|
||||||
|
5.9. Response Code Definitions
|
||||||
|
5.10. Option Definitions
|
||||||
|
6. CoAP URIs
|
||||||
|
6.1. coap URI Scheme
|
||||||
|
6.2. coaps URI Scheme
|
||||||
|
6.3. Normalization and Comparison Rules
|
||||||
|
6.4. Decomposing URIs into Options
|
||||||
|
6.5. Composing URIs from Options
|
||||||
|
7. Discovery
|
||||||
|
7.1. Service Discovery
|
||||||
|
7.2. Resource Discovery
|
||||||
|
8. Multicast CoAP
|
||||||
|
8.1. Messaging Layer
|
||||||
|
8.2. Request/Response Layer
|
||||||
|
9. Securing CoAP
|
||||||
|
9.1. DTLS-Secured CoAP
|
||||||
|
10. Cross-Protocol Proxying between CoAP and HTTP
|
||||||
|
10.1. CoAP-HTTP Proxying
|
||||||
|
10.2. HTTP-CoAP Proxying
|
||||||
|
11. Security Considerations
|
||||||
|
12. IANA Considerations
|
||||||
|
13. References
|
||||||
|
13.1. Normative References
|
||||||
|
13.2. Informative References
|
||||||
|
|
||||||
|
[NOTE: This file contains the header, abstract, and table of contents
|
||||||
|
of RFC 7252. The full specification text is available at:
|
||||||
|
https://www.rfc-editor.org/rfc/rfc7252
|
||||||
|
https://www.rfc-editor.org/rfc/rfc7252.txt (text)
|
||||||
|
https://www.rfc-editor.org/rfc/rfc7252.pdf (PDF)
|
||||||
|
|
||||||
|
Full document: 112 pages, June 2014
|
||||||
|
Authors: Zach Shelby (ARM), Klaus Hartke, Carsten Bormann (Universitaet Bremen TZI)
|
||||||
|
DOI: 10.17487/RFC7252]
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
Internet Engineering Task Force (IETF) E. Rescorla
|
||||||
|
Request for Comments: 8446 Mozilla
|
||||||
|
Obsoletes: 5077, 5246, 6961 August 2018
|
||||||
|
Updates: 5705, 6066
|
||||||
|
Category: Standards Track
|
||||||
|
ISSN: 2070-1721
|
||||||
|
|
||||||
|
|
||||||
|
The Transport Layer Security (TLS) Protocol Version 1.3
|
||||||
|
|
||||||
|
Abstract
|
||||||
|
|
||||||
|
This document specifies version 1.3 of the Transport Layer Security
|
||||||
|
(TLS) protocol. TLS allows client/server applications to communicate
|
||||||
|
over the Internet in a way that is designed to prevent eavesdropping,
|
||||||
|
tampering, and message forgery.
|
||||||
|
|
||||||
|
This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077,
|
||||||
|
5246, and 6961. This document also specifies new requirements for
|
||||||
|
TLS 1.2 implementations.
|
||||||
|
|
||||||
|
Status of This Memo
|
||||||
|
|
||||||
|
This is an Internet Standards Track document.
|
||||||
|
Information about the current status of this document, any errata,
|
||||||
|
and how to provide feedback on it may be obtained at
|
||||||
|
https://www.rfc-editor.org/info/rfc8446.
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
1.1. Conventions and Terminology
|
||||||
|
1.2. Major Differences from TLS 1.2
|
||||||
|
1.3. Updates Affecting TLS 1.2
|
||||||
|
2. Protocol Overview
|
||||||
|
2.1. Incorrect DHE Share
|
||||||
|
2.2. Resumption and Pre-Shared Key (PSK)
|
||||||
|
2.3. 0-RTT Data
|
||||||
|
3. Presentation Language
|
||||||
|
3.1. Basic Block Size
|
||||||
|
3.2. Miscellaneous
|
||||||
|
3.3. Numbers
|
||||||
|
3.4. Vectors
|
||||||
|
3.5. Enumerateds
|
||||||
|
3.6. Constructed Types
|
||||||
|
3.7. Constants
|
||||||
|
3.8. Variants
|
||||||
|
4. Handshake Protocol
|
||||||
|
4.1. Key Exchange Messages
|
||||||
|
4.1.1. Cryptographic Negotiation
|
||||||
|
4.1.2. Client Hello
|
||||||
|
4.1.3. Server Hello
|
||||||
|
4.1.4. Hello Retry Request
|
||||||
|
4.2. Extensions
|
||||||
|
4.2.1. Supported Versions
|
||||||
|
4.2.2. Cookie
|
||||||
|
4.2.3. Signature Algorithms
|
||||||
|
4.2.4. Certificate Authorities
|
||||||
|
4.2.5. OID Filters
|
||||||
|
4.2.6. Post-Handshake Client Authentication
|
||||||
|
4.2.7. Supported Groups
|
||||||
|
4.2.8. Key Share
|
||||||
|
4.2.9. Pre-Shared Key Exchange Modes
|
||||||
|
4.2.10. Early Data Indication
|
||||||
|
4.2.11. Pre-Shared Key Extension
|
||||||
|
4.3. Server Parameters
|
||||||
|
4.3.1. Encrypted Extensions
|
||||||
|
4.3.2. Certificate Request
|
||||||
|
4.4. Authentication Messages
|
||||||
|
4.4.1. The Transcript Hash
|
||||||
|
4.4.2. Certificate
|
||||||
|
4.4.3. Certificate Verify
|
||||||
|
4.4.4. Finished
|
||||||
|
4.5. End of Early Data
|
||||||
|
4.6. Post-Handshake Messages
|
||||||
|
4.6.1. New Session Ticket Message
|
||||||
|
4.6.2. Post-Handshake Authentication
|
||||||
|
4.6.3. Key and Initialization Vector Update
|
||||||
|
5. Record Protocol
|
||||||
|
5.1. Record Layer
|
||||||
|
5.2. Record Payload Protection
|
||||||
|
5.3. Per-Record Nonce
|
||||||
|
5.4. Record Padding
|
||||||
|
5.5. Limits on Key Usage
|
||||||
|
6. Alert Protocol
|
||||||
|
6.1. Closure Alerts
|
||||||
|
6.2. Error Alerts
|
||||||
|
7. Cryptographic Computations
|
||||||
|
7.1. Key Schedule
|
||||||
|
7.2. Updating Traffic Secrets
|
||||||
|
7.3. Traffic Key Calculation
|
||||||
|
7.4. (EC)DHE Shared Secret Calculation
|
||||||
|
7.4.1. Finite Field Diffie-Hellman
|
||||||
|
7.4.2. Elliptic Curve Diffie-Hellman
|
||||||
|
7.5. Exporters
|
||||||
|
8. 0-RTT and Anti-Replay
|
||||||
|
8.1. Single-Use Tickets
|
||||||
|
8.2. Client Hello Recording
|
||||||
|
8.3. Freshness Checks
|
||||||
|
9. Compliance Requirements
|
||||||
|
9.1. Mandatory-to-Implement Cipher Suites
|
||||||
|
9.2. Mandatory-to-Implement Extensions
|
||||||
|
9.3. Protocol Invariants
|
||||||
|
10. Security Considerations
|
||||||
|
11. IANA Considerations
|
||||||
|
12. References
|
||||||
|
12.1. Normative References
|
||||||
|
12.2. Informative References
|
||||||
|
Appendix A. State Machine
|
||||||
|
Appendix B. Protocol Data Structures and Constant Values
|
||||||
|
B.1. Record Layer
|
||||||
|
B.2. Alert Messages
|
||||||
|
B.3. Handshake Protocol
|
||||||
|
B.3.1. Key Exchange Messages
|
||||||
|
B.3.2. Server Parameters Messages
|
||||||
|
B.3.3. Authentication Messages
|
||||||
|
B.3.4. Ticket Establishment
|
||||||
|
B.3.5. Updating Keys
|
||||||
|
B.4. Cipher Suites
|
||||||
|
Appendix C. Implementation Notes
|
||||||
|
C.1. Random Number Generation and Seeding
|
||||||
|
C.2. Certificates and Authentication
|
||||||
|
C.3. Implementation Pitfalls
|
||||||
|
C.4. Client Tracking Prevention
|
||||||
|
C.5. Unauthenticated Operation
|
||||||
|
Appendix D. Backward Compatibility
|
||||||
|
D.1. Negotiating with an Older Server
|
||||||
|
D.2. Negotiating with an Older Client
|
||||||
|
D.3. 0-RTT Backward Compatibility
|
||||||
|
D.4. Middle-Box Compatibility Mode
|
||||||
|
D.5. Security Restrictions Related to Backward Compatibility
|
||||||
|
Appendix E. Overview of Security Properties
|
||||||
|
E.1. Handshake
|
||||||
|
E.2. Record Layer
|
||||||
|
E.3. Traffic Analysis
|
||||||
|
E.4. Side-Channel Attacks
|
||||||
|
E.5. Replay Attacks on 0-RTT
|
||||||
|
E.6. PSK Identity Exposure
|
||||||
|
E.7. Sharing PSKs
|
||||||
|
E.8. Attacks on Static RSA
|
||||||
|
Acknowledgements
|
||||||
|
Author's Address
|
||||||
|
|
||||||
|
[NOTE: This file contains the header, abstract, and table of contents
|
||||||
|
of RFC 8446. The full specification text is available at:
|
||||||
|
https://www.rfc-editor.org/rfc/rfc8446
|
||||||
|
https://www.rfc-editor.org/rfc/rfc8446.txt (text)
|
||||||
|
https://www.rfc-editor.org/rfc/rfc8446.pdf (PDF)
|
||||||
|
|
||||||
|
Full document: 160 pages, August 2018
|
||||||
|
Author: Eric Rescorla (Mozilla)
|
||||||
|
DOI: 10.17487/RFC8446
|
||||||
|
Obsoletes: RFC 5077, RFC 5246, RFC 6961
|
||||||
|
Updates: RFC 5705, RFC 6066]
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
Internet Engineering Task Force (IETF) C. Bormann
|
||||||
|
Request for Comments: 8949 Universitat Bremen TZI
|
||||||
|
STD: 94 P. Hoffman
|
||||||
|
Obsoletes: 7049 ICANN
|
||||||
|
Category: Standards Track December 2020
|
||||||
|
ISSN: 2070-1721
|
||||||
|
|
||||||
|
|
||||||
|
Concise Binary Object Representation (CBOR)
|
||||||
|
|
||||||
|
Abstract
|
||||||
|
|
||||||
|
The Concise Binary Object Representation (CBOR) is a data format
|
||||||
|
whose design goals include the possibility of extremely small code
|
||||||
|
size, fairly small message size, and extensibility without the need
|
||||||
|
for version negotiation. These design goals make it different from
|
||||||
|
earlier binary serializations such as ASN.1 and MessagePack.
|
||||||
|
|
||||||
|
This document obsoletes RFC 7049, providing editorial improvements,
|
||||||
|
new details, and errata fixes while keeping full compatibility with
|
||||||
|
the interchange format of RFC 7049. It does not create a new version
|
||||||
|
of the format.
|
||||||
|
|
||||||
|
Status of This Memo
|
||||||
|
|
||||||
|
This is an Internet Standards Track document.
|
||||||
|
Information about the current status of this document, any errata,
|
||||||
|
and how to provide feedback on it may be obtained at
|
||||||
|
https://www.rfc-editor.org/info/rfc8949.
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
1.1. Objectives
|
||||||
|
1.2. Terminology
|
||||||
|
2. CBOR Data Models
|
||||||
|
2.1. Extended Generic Data Models
|
||||||
|
2.2. Specific Data Models
|
||||||
|
3. Specification of the CBOR Encoding
|
||||||
|
3.1. Major Types
|
||||||
|
3.2. Indefinite Lengths for Some Major Types
|
||||||
|
3.2.1. The "break" Stop Code
|
||||||
|
3.2.2. Indefinite-Length Arrays and Maps
|
||||||
|
3.2.3. Indefinite-Length Byte Strings and Text Strings
|
||||||
|
3.2.4. Summary of Indefinite-Length Use of Major Types
|
||||||
|
3.3. Floating-Point Numbers and Values with No Content
|
||||||
|
3.4. Tagging of Items
|
||||||
|
3.4.1. Standard Date/Time String
|
||||||
|
3.4.2. Epoch-Based Date/Time
|
||||||
|
3.4.3. Bignums
|
||||||
|
3.4.4. Decimal Fractions and Bigfloats
|
||||||
|
3.4.5. Content Hints
|
||||||
|
3.4.6. Self-Described CBOR
|
||||||
|
4. Serialization Considerations
|
||||||
|
4.1. Preferred Serialization
|
||||||
|
4.2. Deterministically Encoded CBOR
|
||||||
|
4.2.1. Core Deterministic Encoding Requirements
|
||||||
|
4.2.2. Additional Deterministic Encoding Considerations
|
||||||
|
4.2.3. Length-First Map Key Ordering
|
||||||
|
5. Creating CBOR-Based Protocols
|
||||||
|
5.1. CBOR in Streaming Applications
|
||||||
|
5.2. Generic Encoders and Decoders
|
||||||
|
5.3. Validity of Items
|
||||||
|
5.4. Validity and Evolution
|
||||||
|
5.5. Numbers
|
||||||
|
5.6. Specifying Keys for Maps
|
||||||
|
5.7. Undefined Values
|
||||||
|
6. Converting Data between CBOR and JSON
|
||||||
|
6.1. Converting from CBOR to JSON
|
||||||
|
6.2. Converting from JSON to CBOR
|
||||||
|
7. Future Evolution of CBOR
|
||||||
|
7.1. Extension Points
|
||||||
|
7.2. Curating the Additional Information Space
|
||||||
|
8. Diagnostic Notation
|
||||||
|
8.1. Encoding Indicators
|
||||||
|
9. IANA Considerations
|
||||||
|
9.1. CBOR Simple Values Registry
|
||||||
|
9.2. CBOR Tags Registry
|
||||||
|
9.3. Media Types Registry
|
||||||
|
9.4. CoAP Content-Format Registry
|
||||||
|
9.5. Structured Syntax Suffix Registry
|
||||||
|
10. Security Considerations
|
||||||
|
11. References
|
||||||
|
11.1. Normative References
|
||||||
|
11.2. Informative References
|
||||||
|
Appendix A. Examples of Encoded CBOR Data Items
|
||||||
|
Appendix B. Jump Table for Initial Byte
|
||||||
|
Appendix C. Pseudocode
|
||||||
|
Appendix D. Half-Precision
|
||||||
|
Appendix E. Comparison of Other Binary Formats to CBOR's Design Objectives
|
||||||
|
Appendix F. Well-Formedness Errors and Examples
|
||||||
|
Appendix G. Changes from RFC 7049
|
||||||
|
Acknowledgements
|
||||||
|
Authors' Addresses
|
||||||
|
|
||||||
|
[NOTE: This file contains the header, abstract, and table of contents
|
||||||
|
of RFC 8949. The full specification text is available at:
|
||||||
|
https://www.rfc-editor.org/rfc/rfc8949
|
||||||
|
https://www.rfc-editor.org/rfc/rfc8949.txt (text)
|
||||||
|
https://www.rfc-editor.org/rfc/rfc8949.pdf (PDF)
|
||||||
|
|
||||||
|
Full document: 66 pages, December 2020
|
||||||
|
Authors: Carsten Bormann (Universitat Bremen TZI), Paul Hoffman (ICANN)
|
||||||
|
DOI: 10.17487/RFC8949
|
||||||
|
Obsoletes: RFC 7049
|
||||||
|
STD: 94]
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
Internet Engineering Task Force (IETF) J. Iyengar, Ed.
|
||||||
|
Request for Comments: 9000 Fastly
|
||||||
|
Category: Standards Track M. Thomson, Ed.
|
||||||
|
ISSN: 2070-1721 Mozilla
|
||||||
|
May 2021
|
||||||
|
|
||||||
|
|
||||||
|
QUIC: A UDP-Based Multiplexed and Secure Transport
|
||||||
|
|
||||||
|
Abstract
|
||||||
|
|
||||||
|
This document defines the core of the QUIC transport protocol. QUIC
|
||||||
|
provides applications with flow-controlled streams for structured
|
||||||
|
communication, low-latency connection establishment, and network path
|
||||||
|
migration. QUIC includes security measures that ensure
|
||||||
|
confidentiality, integrity, and availability in a range of deployment
|
||||||
|
circumstances. Accompanying documents describe the integration of
|
||||||
|
TLS for key negotiation, loss detection, and an exemplary congestion
|
||||||
|
control algorithm.
|
||||||
|
|
||||||
|
Status of This Memo
|
||||||
|
|
||||||
|
This is an Internet Standards Track document.
|
||||||
|
Information about the current status of this document, any errata,
|
||||||
|
and how to provide feedback on it may be obtained at
|
||||||
|
https://www.rfc-editor.org/info/rfc9000.
|
||||||
|
|
||||||
|
Copyright Notice
|
||||||
|
|
||||||
|
Copyright (c) 2021 IETF Trust and the persons identified as the
|
||||||
|
document authors. All rights reserved.
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
|
||||||
|
1. Overview
|
||||||
|
1.1. Document Structure
|
||||||
|
1.2. Terms and Definitions
|
||||||
|
1.3. Notational Conventions
|
||||||
|
2. Streams
|
||||||
|
2.1. Stream Types and Identifiers
|
||||||
|
2.2. Sending and Receiving Data
|
||||||
|
2.3. Stream Prioritization
|
||||||
|
2.4. Operations on Streams
|
||||||
|
3. Stream States
|
||||||
|
3.1. Sending Stream States
|
||||||
|
3.2. Receiving Stream States
|
||||||
|
3.3. Permitted Frame Types
|
||||||
|
3.4. Bidirectional Stream States
|
||||||
|
3.5. Solicited State Transitions
|
||||||
|
4. Flow Control
|
||||||
|
4.1. Data Flow Control
|
||||||
|
4.2. Increasing Flow Control Limits
|
||||||
|
4.3. Flow Control Performance
|
||||||
|
4.4. Handling Stream Cancellation
|
||||||
|
4.5. Stream Final Size
|
||||||
|
4.6. Controlling Concurrency
|
||||||
|
5. Connections
|
||||||
|
5.1. Connection ID
|
||||||
|
5.2. Matching Packets to Connections
|
||||||
|
5.3. Operations on Connections
|
||||||
|
6. Version Negotiation
|
||||||
|
7. Cryptographic and Transport Handshake
|
||||||
|
7.1. Example Handshake Flows
|
||||||
|
7.2. Negotiating Connection IDs
|
||||||
|
7.3. Authenticating Connection IDs
|
||||||
|
7.4. Transport Parameters
|
||||||
|
7.5. Cryptographic Message Buffering
|
||||||
|
8. Address Validation
|
||||||
|
9. Connection Migration
|
||||||
|
10. Connection Termination
|
||||||
|
11. Error Handling
|
||||||
|
12. Packets and Frames
|
||||||
|
13. Packetization and Reliability
|
||||||
|
14. Datagram Size
|
||||||
|
15. Versions
|
||||||
|
16. Variable-Length Integer Encoding
|
||||||
|
17. Packet Formats
|
||||||
|
18. Transport Parameter Encoding
|
||||||
|
19. Frame Types and Formats
|
||||||
|
20. Error Codes
|
||||||
|
21. Security Considerations
|
||||||
|
22. IANA Considerations
|
||||||
|
23. References
|
||||||
|
|
||||||
|
[NOTE: This file contains the header, abstract, and table of contents
|
||||||
|
of RFC 9000. The full specification text is available at:
|
||||||
|
https://www.rfc-editor.org/rfc/rfc9000
|
||||||
|
https://www.rfc-editor.org/rfc/rfc9000.txt (text)
|
||||||
|
https://www.rfc-editor.org/rfc/rfc9000.pdf (PDF)
|
||||||
|
|
||||||
|
Full document: 151 pages, May 2021
|
||||||
|
Authors: Jana Iyengar (Fastly), Martin Thomson (Mozilla)
|
||||||
|
DOI: 10.17487/RFC9000]
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
Internet Engineering Task Force (IETF) M. Bishop, Ed.
|
||||||
|
Request for Comments: 9114 Akamai
|
||||||
|
Category: Standards Track June 2022
|
||||||
|
ISSN: 2070-1721
|
||||||
|
|
||||||
|
|
||||||
|
HTTP/3
|
||||||
|
|
||||||
|
Abstract
|
||||||
|
|
||||||
|
The QUIC transport protocol has several features that are desirable
|
||||||
|
in a transport for HTTP, such as stream multiplexing, per-stream flow
|
||||||
|
control, and low-latency connection establishment. This document
|
||||||
|
describes a mapping of HTTP semantics over QUIC. This document also
|
||||||
|
identifies HTTP/2 features that are subsumed by QUIC and describes
|
||||||
|
how HTTP/2 extensions can be ported to HTTP/3.
|
||||||
|
|
||||||
|
Status of This Memo
|
||||||
|
|
||||||
|
This is an Internet Standards Track document.
|
||||||
|
Information about the current status of this document, any errata,
|
||||||
|
and how to provide feedback on it may be obtained at
|
||||||
|
https://www.rfc-editor.org/info/rfc9114.
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
1.1. Prior Versions of HTTP
|
||||||
|
1.2. Delegation to QUIC
|
||||||
|
2. HTTP/3 Protocol Overview
|
||||||
|
2.1. Document Organization
|
||||||
|
2.2. Conventions and Terminology
|
||||||
|
3. Connection Setup and Management
|
||||||
|
3.1. Discovering an HTTP/3 Endpoint
|
||||||
|
3.1.1. HTTP Alternative Services
|
||||||
|
3.1.2. Other Schemes
|
||||||
|
3.2. Connection Establishment
|
||||||
|
3.3. Connection Reuse
|
||||||
|
4. Expressing HTTP Semantics in HTTP/3
|
||||||
|
4.1. HTTP Message Framing
|
||||||
|
4.1.1. Request Cancellation and Rejection
|
||||||
|
4.1.2. Malformed Requests and Responses
|
||||||
|
4.2. HTTP Fields
|
||||||
|
4.2.1. Field Compression
|
||||||
|
4.2.2. Header Size Constraints
|
||||||
|
4.3. HTTP Control Data
|
||||||
|
4.3.1. Request Pseudo-Header Fields
|
||||||
|
4.3.2. Response Pseudo-Header Fields
|
||||||
|
4.4. The CONNECT Method
|
||||||
|
4.5. HTTP Upgrade
|
||||||
|
4.6. Server Push
|
||||||
|
5. Connection Closure
|
||||||
|
5.1. Idle Connections
|
||||||
|
5.2. Connection Shutdown
|
||||||
|
5.3. Immediate Application Closure
|
||||||
|
5.4. Transport Closure
|
||||||
|
6. Stream Mapping and Usage
|
||||||
|
6.1. Bidirectional Streams
|
||||||
|
6.2. Unidirectional Streams
|
||||||
|
6.2.1. Control Streams
|
||||||
|
6.2.2. Push Streams
|
||||||
|
6.2.3. Reserved Stream Types
|
||||||
|
7. HTTP Framing Layer
|
||||||
|
7.1. Frame Layout
|
||||||
|
7.2. Frame Definitions
|
||||||
|
7.2.1. DATA
|
||||||
|
7.2.2. HEADERS
|
||||||
|
7.2.3. CANCEL_PUSH
|
||||||
|
7.2.4. SETTINGS
|
||||||
|
7.2.5. PUSH_PROMISE
|
||||||
|
7.2.6. GOAWAY
|
||||||
|
7.2.7. MAX_PUSH_ID
|
||||||
|
7.2.8. Reserved Frame Types
|
||||||
|
8. Error Handling
|
||||||
|
8.1. HTTP/3 Error Codes
|
||||||
|
9. Extensions to HTTP/3
|
||||||
|
10. Security Considerations
|
||||||
|
10.1. Server Authority
|
||||||
|
10.2. Cross-Protocol Attacks
|
||||||
|
10.3. Intermediary-Encapsulation Attacks
|
||||||
|
10.4. Cacheability of Pushed Responses
|
||||||
|
10.5. Denial-of-Service Considerations
|
||||||
|
10.6. Use of Compression
|
||||||
|
10.7. Padding and Traffic Analysis
|
||||||
|
10.8. Frame Parsing
|
||||||
|
10.9. Early Data
|
||||||
|
10.10. Migration
|
||||||
|
10.11. Privacy Considerations
|
||||||
|
11. IANA Considerations
|
||||||
|
11.1. Registration of HTTP/3 Identification String
|
||||||
|
11.2. New Registries
|
||||||
|
11.2.1. Frame Types
|
||||||
|
11.2.2. Settings Parameters
|
||||||
|
11.2.3. Error Codes
|
||||||
|
11.2.4. Stream Types
|
||||||
|
12. References
|
||||||
|
12.1. Normative References
|
||||||
|
12.2. Informative References
|
||||||
|
Appendix A. Considerations for Transitioning from HTTP/2
|
||||||
|
A.1. Streams
|
||||||
|
A.2. HTTP Frame Types
|
||||||
|
A.3. HTTP/2 SETTINGS Parameters
|
||||||
|
A.4. HTTP/2 Error Codes
|
||||||
|
Acknowledgments
|
||||||
|
Index
|
||||||
|
Author's Address
|
||||||
|
|
||||||
|
[NOTE: This file contains the header, abstract, and table of contents
|
||||||
|
of RFC 9114. The full specification text is available at:
|
||||||
|
https://www.rfc-editor.org/rfc/rfc9114
|
||||||
|
https://www.rfc-editor.org/rfc/rfc9114.txt (text)
|
||||||
|
https://www.rfc-editor.org/rfc/rfc9114.pdf (PDF)
|
||||||
|
|
||||||
|
Full document: 57 pages, June 2022
|
||||||
|
Author: Mike Bishop (Akamai), Editor
|
||||||
|
DOI: 10.17487/RFC9114]
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
# Secure Production Identity Framework for Everyone (SPIFFE)
|
||||||
|
|
||||||
|
> Source: https://raw.githubusercontent.com/spiffe/spiffe/main/standards/SPIFFE.md
|
||||||
|
> Downloaded: 2026-06-07
|
||||||
|
|
||||||
|
## Status of this Memo
|
||||||
|
This document specifies an identity and identity issuance standard for the internet community, and requests discussion and suggestions for improvements.
|
||||||
|
|
||||||
|
## Abstract
|
||||||
|
Distributed design patterns and practices such as microservices, container orchestrators, and cloud computing have led to production environments that are increasingly dynamic and heterogeneous. Conventional security practices (such as network policies that only allow traffic between particular IP addresses) struggle to scale under this complexity. A first-class identity framework for workloads in an organization becomes necessary.
|
||||||
|
|
||||||
|
The SPIFFE standard provides a specification for a framework capable of bootstrapping and issuing identity to services across heterogeneous environments and organizational boundaries.
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
1. [Introduction](#1-introduction)
|
||||||
|
2. [The SPIFFE ID](#2-the-spiffe-id)
|
||||||
|
3. [The SPIFFE Verifiable Identity Document](#3-the-spiffe-verifiable-identity-document)
|
||||||
|
4. [The Workload API](#4-the-workload-api)
|
||||||
|
5. [Conclusion](#5-conclusion)
|
||||||
|
|
||||||
|
## 1. Introduction
|
||||||
|
The SPIFFE standard comprises three major components:
|
||||||
|
- **SPIFFE ID** - standardizes an identity namespace
|
||||||
|
- **SPIFFE Verifiable Identity Document (SVID)** - dictates the manner in which an issued identity may be presented and verified
|
||||||
|
- **Workload API** - specifies an API through which identity may be retrieved and/or issued
|
||||||
|
|
||||||
|
## 2. The SPIFFE ID
|
||||||
|
A SPIFFE ID is a structured string (represented as a URI) which serves as the "name" of an entity. It is defined in the [SPIFFE Identity and Verifiable Identity Document](SPIFFE-ID.md) specification.
|
||||||
|
|
||||||
|
## 3. The SPIFFE Verifiable Identity Document
|
||||||
|
A SPIFFE Verifiable Identity Document (SVID) is a document which carries the SPIFFE ID itself — the functional equivalent of a passport. An SVID includes cryptographic properties which allow it to be:
|
||||||
|
|
||||||
|
1. proven as authentic
|
||||||
|
2. proven to belong to the presenter
|
||||||
|
|
||||||
|
An SVID itself is not a document type. Instead, we define:
|
||||||
|
1. the properties required of an SVID
|
||||||
|
2. the method by which SVID information can be encoded and validated in various existing document types
|
||||||
|
|
||||||
|
The supported document types are an **X.509 certificate** or a **JWT token**.
|
||||||
|
|
||||||
|
## 4. The Workload API
|
||||||
|
The SPIFFE Workload API is the method through which workloads obtain their SVID(s). It is typically exposed locally (e.g., via a Unix domain socket), and explicitly does not include an authentication handshake or authenticating token from the workload.
|
||||||
|
|
||||||
|
In addition to providing a workload with its necessary SVIDs, the Workload API delivers the CA bundles which the workload should outwardly trust. These bundles are used for federation.
|
||||||
|
|
||||||
|
## 5. Conclusion
|
||||||
|
Together, these components solve many of the authentication and traffic security challenges presented in modern, heterogeneous environments.
|
||||||
|
|
||||||
|
## Appendix A. List of SPIFFE Specifications
|
||||||
|
* [The SPIFFE Identity and Verifiable Identity Document](SPIFFE-ID.md)
|
||||||
|
* [The X.509 SPIFFE Verifiable Identity Document](X509-SVID.md)
|
||||||
|
* [The JWT SPIFFE Verifiable Identity Document](JWT-SVID.md)
|
||||||
|
* [The SPIFFE Workload Endpoint](SPIFFE_Workload_Endpoint.md)
|
||||||
|
* [The SPIFFE Workload API](SPIFFE_Workload_API.md)
|
||||||
|
* [The SPIFFE Trust Domain and Bundle](SPIFFE_Trust_Domain_and_Bundle.md)
|
||||||
|
* [SPIFFE Federation](SPIFFE_Federation.md)
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# SPIRE Architecture
|
||||||
|
|
||||||
|
> Source: https://spiffe.io/docs/latest/spire-about/spire-concepts/
|
||||||
|
> Note: https://raw.githubusercontent.com/spiffe/spire/main/doc/architecture.md was empty; this document
|
||||||
|
> is derived from the official SPIRE Concepts documentation on spiffe.io.
|
||||||
|
> Downloaded: 2026-06-07
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
SPIRE is a production-ready implementation of the SPIFFE APIs that performs node and workload attestation in order to securely issue SVIDs to workloads, and verify the SVIDs of other workloads, based on a predefined set of conditions.
|
||||||
|
|
||||||
|
## SPIRE Architecture and Components
|
||||||
|
|
||||||
|
A SPIRE deployment is composed of a **SPIRE Server** and one or more **SPIRE Agents**.
|
||||||
|
|
||||||
|
- A server acts as a signing authority for identities issued to a set of workloads via agents.
|
||||||
|
- It also maintains a registry of workload identities and the conditions that must be verified in order for those identities to be issued.
|
||||||
|
- Agents expose the SPIFFE Workload API locally to workloads, and must be installed on each node on which a workload is running.
|
||||||
|
|
||||||
|
## The SPIRE Server
|
||||||
|
|
||||||
|
A SPIRE Server is responsible for managing and issuing all identities in its configured SPIFFE trust domain. It:
|
||||||
|
|
||||||
|
- Stores registration entries (which specify the selectors that determine the conditions under which a particular SPIFFE ID should be issued)
|
||||||
|
- Stores signing keys
|
||||||
|
- Uses node attestation to authenticate agents' identities automatically
|
||||||
|
- Creates SVIDs for workloads when requested by an authenticated agent
|
||||||
|
|
||||||
|
### Server Plugin Types
|
||||||
|
|
||||||
|
- **Node attestor plugins** - verify the identity of the node the agent is running on
|
||||||
|
- **Datastore plugins** - store, query, and update registration entries, attested nodes, and selectors (MySQL, SQLite 3, or PostgreSQL)
|
||||||
|
- **Key manager plugins** - control how the server stores private keys used to sign SVIDs
|
||||||
|
- **Upstream authority plugins** - use a different CA from a different PKI system
|
||||||
|
|
||||||
|
## The SPIRE Agent
|
||||||
|
|
||||||
|
A SPIRE Agent runs on every node on which an identified workload runs. The agent:
|
||||||
|
|
||||||
|
- Requests SVIDs from the server and caches them until a workload requests its SVID
|
||||||
|
- Exposes the SPIFFE Workload API to workloads on node
|
||||||
|
- Attests the identity of workloads that call it
|
||||||
|
- Provides the identified workloads with their SVIDs
|
||||||
|
|
||||||
|
### Agent Plugin Types
|
||||||
|
|
||||||
|
- **Node attestor plugins** - verify the identity of the node the agent is running on
|
||||||
|
- **Workload attestor plugins** - verify the identity of the workload process on the node
|
||||||
|
- **Key manager plugins** - generate and use private keys for X.509-SVIDs issued to workloads
|
||||||
|
|
||||||
|
## A Day in the Life of an SVID
|
||||||
|
|
||||||
|
1. The SPIRE Server starts up and generates a self-signed certificate (unless UpstreamAuthority is configured)
|
||||||
|
2. The server generates a trust bundle and stores it in the datastore
|
||||||
|
3. The server turns on its registration API
|
||||||
|
4. The SPIRE Agent starts up on the node
|
||||||
|
5. The agent performs **node attestation** to prove the identity of the node
|
||||||
|
6. The agent presents proof of identity to the server over a TLS connection
|
||||||
|
7. The server validates the proof (e.g., via AWS API for EC2 IID)
|
||||||
|
8. The server issues an SVID to the agent representing its own identity
|
||||||
|
9. The agent contacts the server to obtain authorized registration entries
|
||||||
|
10. The agent sends workload CSRs to the server; server signs and returns SVIDs
|
||||||
|
11. Agent caches SVIDs and starts listening on the Workload API socket
|
||||||
|
12. A workload calls the Workload API to request an SVID
|
||||||
|
13. The agent initiates workload attestation by calling workload attestors with the process ID
|
||||||
|
14. Attestors query the kernel and userspace for workload information
|
||||||
|
15. The agent compares discovered selectors against registration entries
|
||||||
|
16. The agent returns the correct SVID from its cache to the workload
|
||||||
|
|
||||||
|
## SPIRE Concepts
|
||||||
|
|
||||||
|
### Workload Registration
|
||||||
|
|
||||||
|
Workload registration tells SPIRE how to identify the workload and which SPIFFE ID to give it. A registration entry maps:
|
||||||
|
- A SPIFFE ID (the identity)
|
||||||
|
- A set of selectors (properties the workload must possess)
|
||||||
|
|
||||||
|
### Attestation
|
||||||
|
|
||||||
|
SPIRE performs attestation in two phases:
|
||||||
|
1. **Node attestation** - verifies the identity of the node
|
||||||
|
2. **Workload attestation** - verifies the workload on the node
|
||||||
|
|
||||||
|
### Node Attestation
|
||||||
|
|
||||||
|
Node attestors interrogate a node and its environment for pieces of information that only that node would possess. The result is that the agent receives a unique SPIFFE ID.
|
||||||
|
|
||||||
|
**Supported node attestors:**
|
||||||
|
- EC2 instances on AWS (AWS Instance Identity Document)
|
||||||
|
- VMs on Microsoft Azure (Azure Managed Service Identities)
|
||||||
|
- Google Compute Engine Instances on GCP (GCE Instance Identity Tokens)
|
||||||
|
- Kubernetes cluster nodes (Kubernetes Service Account tokens)
|
||||||
|
- Server-generated join tokens (pre-shared key, expires after use)
|
||||||
|
- Existing X.509 certificates
|
||||||
|
|
||||||
|
#### Node Attestation Steps
|
||||||
|
|
||||||
|
1. The agent node attestor plugin queries the platform for proof of the node's identity
|
||||||
|
2. The agent passes this proof of identity to the server
|
||||||
|
3. The server node attestor validates proof independently or via a platform API
|
||||||
|
4. The node attestor creates a SPIFFE ID for the agent and passes it back with selectors
|
||||||
|
5. The server sends back an SVID for the agent node
|
||||||
|
|
||||||
|
### Workload Attestation
|
||||||
|
|
||||||
|
Workload attestation answers "Who is this process?" by interrogating locally available authorities:
|
||||||
|
|
||||||
|
- OS kernel (uid, gid, filesystem path)
|
||||||
|
- Kubernetes kubelet (Service Account, namespace)
|
||||||
|
- Docker
|
||||||
|
|
||||||
|
#### Workload Attestation Steps
|
||||||
|
|
||||||
|
1. A workload calls the Workload API (Unix Domain Socket on Unix systems)
|
||||||
|
2. The agent interrogates the kernel to identify the process ID of the caller
|
||||||
|
3. Agent invokes workload attestor plugins with the process ID
|
||||||
|
4. Attestors query platform-specific components (e.g., kubelet) for workload info
|
||||||
|
5. Attestors return discovered information to the agent as selectors
|
||||||
|
6. The agent compares selectors to registration entries and returns the correct SVID
|
||||||
|
|
||||||
|
### Authorized Registration Entries
|
||||||
|
|
||||||
|
The server only sends authorized registration entries to the agent by:
|
||||||
|
|
||||||
|
1. Querying for registration entries with the agent's SPIFFE ID as "parent SPIFFE ID"
|
||||||
|
2. Querying for node selectors associated with the specific agent
|
||||||
|
3. Querying for registration entries that declare any of those node selectors
|
||||||
|
4. Recursively querying for children of all obtained entries
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Tedeschini 2024 — Cooperative Localization with MARL (Metadata)
|
||||||
|
|
||||||
|
## Bibliographic Metadata
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|-------|-------|
|
||||||
|
| Author(s) | Bernardo Camajori Tedeschini et al. |
|
||||||
|
| Year | 2024 |
|
||||||
|
| Title (likely) | Cooperative Localization via Multi-Agent Reinforcement Learning |
|
||||||
|
| Topic | Multi-Agent Reinforcement Learning (MARL) for cooperative positioning/localization |
|
||||||
|
| Venue | IEEE / arXiv preprint (exact venue not confirmed) |
|
||||||
|
| arXiv search | https://arxiv.org/search/?searchtype=all&query=Tedeschini+cooperative+localization+multi-agent |
|
||||||
|
|
||||||
|
## Search Attempts
|
||||||
|
The following search queries were tried and returned empty results from arXiv search API:
|
||||||
|
- `Tedeschini cooperative localization multi-agent` (arXiv full-text search)
|
||||||
|
- `Tedeschini+cooperative+localization+MARL` (Semantic Scholar API)
|
||||||
|
- `Tedeschini localization reinforcement learning UAV` (arXiv)
|
||||||
|
- `searchtype=author&query=Tedeschini` (arXiv author search)
|
||||||
|
|
||||||
|
arXiv's search API returned empty results for all queries in the current sandbox environment
|
||||||
|
(likely due to the HTTPS proxy restriction blocking dynamic search endpoints).
|
||||||
|
|
||||||
|
## Expected Paper Content
|
||||||
|
Based on the research context (multi-agent orchestration, cooperative localization):
|
||||||
|
|
||||||
|
- **Problem**: Distributed localization of multiple mobile agents (robots/UAVs/vehicles)
|
||||||
|
without centralized infrastructure
|
||||||
|
- **Method**: Multi-Agent Reinforcement Learning (MARL) — agents learn cooperative
|
||||||
|
positioning policies through local observation sharing and reward coordination
|
||||||
|
- **Relevance**: Demonstrates decentralized agent coordination for a joint task (localization),
|
||||||
|
directly paralleling the research goal of A2A-based multi-agent orchestration in
|
||||||
|
edge/vehicular settings
|
||||||
|
|
||||||
|
## Download Instructions
|
||||||
|
1. Visit: https://arxiv.org/search/?searchtype=all&query=Tedeschini+cooperative+localization+multi-agent
|
||||||
|
2. Or search Google Scholar: `Tedeschini cooperative localization multi-agent reinforcement 2024`
|
||||||
|
3. Check: https://scholar.google.com/scholar?q=Tedeschini+2024+cooperative+localization+MARL
|
||||||
|
|
||||||
|
*Status: METADATA ONLY — Paper not retrievable through automated search in sandbox environment*
|
||||||
|
*Retrieved: 2026-06-07*
|
||||||
@@ -0,0 +1,253 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Trace Context - W3C Recommendation 23 November 2021</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Source: https://www.w3.org/TR/2021/REC-trace-context-1-20211123/ -->
|
||||||
|
<!-- Downloaded: 2026-06-07 -->
|
||||||
|
|
||||||
|
<h1>Trace Context</h1>
|
||||||
|
<p>W3C Recommendation 23 November 2021</p>
|
||||||
|
|
||||||
|
<p>This version: https://www.w3.org/TR/2021/REC-trace-context-1-20211123/<br>
|
||||||
|
Latest published version: https://www.w3.org/TR/trace-context-1/<br>
|
||||||
|
Latest editor's draft: https://w3c.github.io/trace-context/</p>
|
||||||
|
|
||||||
|
<p><strong>Editors:</strong><br>
|
||||||
|
Sergey Kanzhelev (Microsoft)<br>
|
||||||
|
Morgan McLean (Google)<br>
|
||||||
|
Alois Reitbauer (Dynatrace)<br>
|
||||||
|
Bogdan Drutu (Google)<br>
|
||||||
|
Nik Molnar (Microsoft)<br>
|
||||||
|
Yuri Shkuro (Invited Expert)</p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h2>Abstract</h2>
|
||||||
|
<p>This specification defines standard HTTP headers and a value format to propagate context information that enables distributed tracing scenarios. The specification standardizes how context information is sent and modified between services. Context information uniquely identifies individual requests in a distributed system and also defines a means to add and propagate provider-specific context information.</p>
|
||||||
|
|
||||||
|
<h2>Table of Contents</h2>
|
||||||
|
<ol>
|
||||||
|
<li>Abstract</li>
|
||||||
|
<li>Status of This Document</li>
|
||||||
|
<li>1. Conformance</li>
|
||||||
|
<li>2. Overview
|
||||||
|
<ol>
|
||||||
|
<li>2.1 Problem Statement</li>
|
||||||
|
<li>2.2 Solution</li>
|
||||||
|
<li>2.3 Design Overview</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
<li>3. Trace Context HTTP Headers Format
|
||||||
|
<ol>
|
||||||
|
<li>3.1 Relationship Between the Headers</li>
|
||||||
|
<li>3.2 Traceparent Header</li>
|
||||||
|
<li>3.3 Tracestate Header</li>
|
||||||
|
<li>3.4 Mutating the traceparent Field</li>
|
||||||
|
<li>3.5 Mutating the tracestate Field</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
<li>4. Processing Model</li>
|
||||||
|
<li>5. Other Communication Protocols</li>
|
||||||
|
<li>6. Privacy Considerations</li>
|
||||||
|
<li>7. Security Considerations</li>
|
||||||
|
<li>8. Considerations for trace-id field generation</li>
|
||||||
|
<li>A. Acknowledgments</li>
|
||||||
|
<li>B. Glossary</li>
|
||||||
|
<li>C. References</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h2>1. Conformance</h2>
|
||||||
|
<p>As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.</p>
|
||||||
|
<p>The key words MAY, MUST, MUST NOT, SHOULD, and SHOULD NOT in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.</p>
|
||||||
|
|
||||||
|
<h2>2. Overview</h2>
|
||||||
|
|
||||||
|
<h3>2.1 Problem Statement</h3>
|
||||||
|
<p>Distributed tracing is a methodology implemented by tracing tools to follow, analyze and debug a transaction across multiple software components. Typically, a distributed trace traverses more than one component which requires it to be uniquely identifiable across all participating systems. Trace context propagation passes along this unique identification. Today, trace context propagation is implemented individually by each tracing vendor. In multi-vendor environments, this causes interoperability problems, like:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Traces that are collected by different tracing vendors cannot be correlated as there is no shared unique identifier.</li>
|
||||||
|
<li>Traces that cross boundaries between different tracing vendors can not be propagated as there is no uniformly agreed set of identification that is forwarded.</li>
|
||||||
|
<li>Vendor specific metadata might be dropped by intermediaries.</li>
|
||||||
|
<li>Cloud platform vendors, intermediaries and service providers, cannot guarantee to support trace context propagation as there is no standard to follow.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>2.2 Solution</h3>
|
||||||
|
<p>The trace context specification defines a universally agreed-upon format for the exchange of trace context propagation data - referred to as trace context. Trace context solves the problems described above by</p>
|
||||||
|
<ul>
|
||||||
|
<li>providing an unique identifier for individual traces and requests, allowing trace data of multiple providers to be linked together.</li>
|
||||||
|
<li>providing an agreed-upon mechanism to forward vendor-specific trace data and avoid broken traces when multiple tracing tools participate in a single transaction.</li>
|
||||||
|
<li>providing an industry standard that intermediaries, platforms, and hardware providers can support.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>2.3 Design Overview</h3>
|
||||||
|
<p>Trace context is split into two individual propagation fields supporting interoperability and vendor-specific extensibility:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>traceparent</code> describes the position of the incoming request in its trace graph in a portable, fixed-length format. Its design focuses on fast parsing. Every tracing tool MUST properly set traceparent even when it only relies on vendor-specific information in tracestate</li>
|
||||||
|
<li><code>tracestate</code> extends traceparent with vendor-specific data represented by a set of name/value pairs. Storing information in tracestate is optional.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>3. Trace Context HTTP Headers Format</h2>
|
||||||
|
|
||||||
|
<h3>3.1 Relationship Between the Headers</h3>
|
||||||
|
<p>The traceparent header represents the incoming request in a tracing system in a common format, understood by all vendors. Here's an example of a traceparent header.</p>
|
||||||
|
<pre><code>traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01</code></pre>
|
||||||
|
<p>The tracestate header includes the parent in a potentially vendor-specific format:</p>
|
||||||
|
<pre><code>tracestate: congo=t61rcWkgMzE</code></pre>
|
||||||
|
|
||||||
|
<h3>3.2 Traceparent Header</h3>
|
||||||
|
<p>The traceparent HTTP header field identifies the incoming request in a tracing system. It has four fields:</p>
|
||||||
|
<ul>
|
||||||
|
<li>version</li>
|
||||||
|
<li>trace-id</li>
|
||||||
|
<li>parent-id</li>
|
||||||
|
<li>trace-flags</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h4>3.2.1 Header Name</h4>
|
||||||
|
<p>Header name: traceparent</p>
|
||||||
|
<p>Vendors MUST expect the header name in any case (upper, lower, mixed), and SHOULD send the header name in lowercase.</p>
|
||||||
|
|
||||||
|
<h4>3.2.2 traceparent Header Field Values</h4>
|
||||||
|
<pre><code>
|
||||||
|
HEXDIGLC = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" ; lowercase hex character
|
||||||
|
value = version "-" version-format
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h5>3.2.2.1 version</h5>
|
||||||
|
<pre><code>version = 2HEXDIGLC ; this document assumes version 00. Version ff is forbidden</code></pre>
|
||||||
|
|
||||||
|
<h5>3.2.2.2 version-format</h5>
|
||||||
|
<pre><code>
|
||||||
|
version-format = trace-id "-" parent-id "-" trace-flags
|
||||||
|
trace-id = 32HEXDIGLC ; 16 bytes array identifier. All zeroes forbidden
|
||||||
|
parent-id = 16HEXDIGLC ; 8 bytes array identifier. All zeroes forbidden
|
||||||
|
trace-flags = 2HEXDIGLC ; 8 bit flags. Currently, only one bit is used.
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h5>3.2.2.3 trace-id</h5>
|
||||||
|
<p>This is the ID of the whole trace forest and is used to uniquely identify a distributed trace through a system. It is represented as a 16-byte array, for example, 4bf92f3577b34da6a3ce929d0e0e4736. All bytes as zero (00000000000000000000000000000000) is considered an invalid value.</p>
|
||||||
|
|
||||||
|
<h5>3.2.2.4 parent-id</h5>
|
||||||
|
<p>This is the ID of this request as known by the caller (in some tracing systems, this is known as the span-id, where a span is the execution of a client request). It is represented as an 8-byte array, for example, 00f067aa0ba902b7. All bytes as zero (0000000000000000) is considered an invalid value.</p>
|
||||||
|
|
||||||
|
<h5>3.2.2.5 trace-flags</h5>
|
||||||
|
<p>An 8-bit field that controls tracing flags such as sampling, trace level, etc. These flags are recommendations given by the caller rather than strict rules to follow.</p>
|
||||||
|
|
||||||
|
<h4>3.2.3 Examples of HTTP traceparent Headers</h4>
|
||||||
|
<pre><code>
|
||||||
|
Value = 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
|
||||||
|
base16(version) = 00
|
||||||
|
base16(trace-id) = 4bf92f3577b34da6a3ce929d0e0e4736
|
||||||
|
base16(parent-id) = 00f067aa0ba902b7
|
||||||
|
base16(trace-flags) = 01 // sampled
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3>3.3 Tracestate Header</h3>
|
||||||
|
<p>Header name: tracestate</p>
|
||||||
|
<p>The main purpose of the tracestate HTTP header is to provide additional vendor-specific trace identification information across different distributed tracing systems and is a companion header for the traceparent field.</p>
|
||||||
|
|
||||||
|
<h4>3.3.1.2 list</h4>
|
||||||
|
<pre><code>
|
||||||
|
list = list-member 0*31( OWS "," OWS list-member )
|
||||||
|
list-member = (key "=" value) / OWS
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h4>3.3.1.3.1 Key</h4>
|
||||||
|
<pre><code>
|
||||||
|
key = simple-key / multi-tenant-key
|
||||||
|
simple-key = lcalpha 0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
|
||||||
|
multi-tenant-key = tenant-id "@" system-id
|
||||||
|
tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
|
||||||
|
system-id = lcalpha 0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
|
||||||
|
lcalpha = %x61-7A ; a-z
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h4>3.3.1.3.2 Value</h4>
|
||||||
|
<pre><code>
|
||||||
|
value = 0*255(chr) nblk-chr
|
||||||
|
nblk-chr = %x21-2B / %x2D-3C / %x3E-7E
|
||||||
|
chr = %x20 / nblk-chr
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3>3.4 Mutating the traceparent Field</h3>
|
||||||
|
<p>A vendor receiving a traceparent request header MUST send it to outgoing requests. It MAY mutate the value of this header before passing it to outgoing requests.</p>
|
||||||
|
<p>Allowed mutations:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Update parent-id</strong>: The value of the parent-id field can be set to the new value representing the ID of the current operation.</li>
|
||||||
|
<li><strong>Update sampled</strong>: The value of the sampled field reflects the caller's recording behavior.</li>
|
||||||
|
<li><strong>Restart trace</strong>: All properties (trace-id, parent-id, trace-flags) are regenerated.</li>
|
||||||
|
<li><strong>Downgrade the version</strong>: Downgrade the version of the header.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>3.5 Mutating the tracestate Field</h3>
|
||||||
|
<p>Allowed mutations:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Add a new key/value pair</strong>. The new key/value pair SHOULD be added to the beginning of the list.</li>
|
||||||
|
<li><strong>Update an existing value</strong>. Modified keys SHOULD be moved to the beginning (left) of the list.</li>
|
||||||
|
<li><strong>Delete a key/value pair</strong>. Any key/value pair MAY be deleted.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>4. Processing Model</h2>
|
||||||
|
|
||||||
|
<h3>4.2 No traceparent Received</h3>
|
||||||
|
<p>If no traceparent header is received:</p>
|
||||||
|
<ol>
|
||||||
|
<li>The vendor checks an incoming request for a traceparent and a tracestate header.</li>
|
||||||
|
<li>Because the traceparent header is not received, the vendor creates a new trace-id and parent-id that represents the current request.</li>
|
||||||
|
<li>If a tracestate header is received without an accompanying traceparent header, it is invalid and MUST be discarded.</li>
|
||||||
|
<li>The vendor SHOULD create a new tracestate header and add a new key/value pair.</li>
|
||||||
|
<li>The vendor sets the traceparent and tracestate header for the outgoing request.</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h3>4.3 A traceparent is Received</h3>
|
||||||
|
<p>If a traceparent header is received:</p>
|
||||||
|
<ol>
|
||||||
|
<li>The vendor checks an incoming request for a traceparent and a tracestate header.</li>
|
||||||
|
<li>Because the traceparent header is present, the vendor tries to parse the version of the traceparent header.</li>
|
||||||
|
<li>The vendor MAY validate the tracestate header.</li>
|
||||||
|
<li>For each outgoing request the vendor performs the following steps: update parent-id, optionally update sampled flag, optionally modify tracestate.</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h2>5. Other Communication Protocols</h2>
|
||||||
|
<p>While trace context is defined for HTTP, the authors acknowledge it is also relevant for other communication protocols. Extensions of this specification define the format of trace context serialization and deserialization for other protocols.</p>
|
||||||
|
|
||||||
|
<h2>6. Privacy Considerations</h2>
|
||||||
|
<p>Tracing vendors MUST NOT use traceparent and tracestate fields for any personally identifiable or otherwise sensitive information. The only purpose of these fields is to enable trace correlation.</p>
|
||||||
|
|
||||||
|
<h2>7. Security Considerations</h2>
|
||||||
|
<p>There are two types of potential security risks: information exposure and denial-of-service attacks against the vendor.</p>
|
||||||
|
|
||||||
|
<h3>7.1 Information Exposure</h3>
|
||||||
|
<p>Information in the traceparent and tracestate headers may carry information that can be considered sensitive. Application owners should either ensure that no proprietary or confidential information is stored in tracestate, or they should ensure that tracestate is not present in requests to external systems.</p>
|
||||||
|
|
||||||
|
<h3>7.2 Denial of Service</h3>
|
||||||
|
<p>When distributed tracing is enabled on a service with a public API and naively continues any trace with the sampled flag set, a malicious attacker could overwhelm an application with tracing overhead, forge trace-id collisions that make monitoring data unusable, or run up your tracing bill with your SaaS tracing vendor.</p>
|
||||||
|
|
||||||
|
<h2>8. Considerations for trace-id field generation</h2>
|
||||||
|
|
||||||
|
<h3>8.1 Uniqueness of trace-id</h3>
|
||||||
|
<p>The value of trace-id SHOULD be globally unique.</p>
|
||||||
|
|
||||||
|
<h3>8.2 Randomness of trace-id</h3>
|
||||||
|
<p>Randomly generated value of trace-id SHOULD be preferred over other algorithms of generating a globally unique identifiers.</p>
|
||||||
|
|
||||||
|
<h2>B. Glossary</h2>
|
||||||
|
<dl>
|
||||||
|
<dt>Distributed trace</dt>
|
||||||
|
<dd>A distributed trace is a set of events, triggered as a result of a single logical operation, consolidated across various components of an application. A distributed trace contains events that cross process, network and security boundaries.</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<h2>C. References</h2>
|
||||||
|
<h3>C.1 Normative references</h3>
|
||||||
|
<ul>
|
||||||
|
<li>[RFC2119] Key words for use in RFCs to Indicate Requirement Levels. S. Bradner. IETF. March 1997. https://www.rfc-editor.org/rfc/rfc2119</li>
|
||||||
|
<li>[RFC5234] Augmented BNF for Syntax Specifications: ABNF. D. Crocker, Ed.; P. Overell. IETF. January 2008. https://www.rfc-editor.org/rfc/rfc5234</li>
|
||||||
|
<li>[RFC7230] Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing. R. Fielding, Ed.; J. Reschke, Ed.. IETF. June 2014. https://httpwg.org/specs/rfc7230.html</li>
|
||||||
|
<li>[RFC8174] Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. B. Leiba. IETF. May 2017. https://www.rfc-editor.org/rfc/rfc8174</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
AutoGen: Enabling Next-Gen LLM
|
||||||
|
Applications via Multi-Agent Conversation
|
||||||
|
Qingyun Wu, Gagan Bansal, Jieyu Zhang, Yiran Wu, Beibin Li
|
||||||
|
Erkang Zhu, Li Jiang, Xiaoyun Zhang, Shaokun Zhang, Jiale Liu
|
||||||
|
Ahmed Awadallah, Ryen W. White, Doug Burger, Chi Wang
|
||||||
|
*Microsoft Research, Pennsylvania State University
|
||||||
|
University of Washington, Xidian University
|
||||||
|
|
||||||
|
NOTE: This file contains the text content extracted from the PDF at:
|
||||||
|
https://arxiv.org/pdf/2308.08155
|
||||||
|
arXiv:2308.08155v2 [cs.AI] 3 Oct 2023
|
||||||
|
|
||||||
|
Abstract
|
||||||
|
AutoGen is an open-source framework that allows developers to build LLM applications
|
||||||
|
via multiple agents that can converse with each other to accomplish tasks. AutoGen agents
|
||||||
|
are customizable, conversable, and can operate in various modes that employ combinations
|
||||||
|
of LLMs, human inputs, and tools. Using AutoGen, developers can also flexibly define
|
||||||
|
agent interaction behaviors. Both natural language and computer code can be used to
|
||||||
|
program flexible conversation patterns for different applications. AutoGen serves as a
|
||||||
|
generic framework for building diverse applications of various complexities and LLM
|
||||||
|
capacities. Empirical studies demonstrate the effectiveness of the framework in many
|
||||||
|
example applications, with domains ranging from mathematics, coding, question answering,
|
||||||
|
operations research, online decision-making, entertainment, etc.
|
||||||
|
|
||||||
|
GitHub: https://github.com/microsoft/autogen
|
||||||
|
|
||||||
|
1 Introduction
|
||||||
|
|
||||||
|
Large language models (LLMs) are becoming a crucial building block in developing powerful
|
||||||
|
agents that utilize LLMs for reasoning, tool usage, and adapting to new observations in many
|
||||||
|
real-world tasks. Given the expanding tasks that could benefit from LLMs and the growing task
|
||||||
|
complexity, an intuitive approach to scale up the power of agents is to use multiple agents that
|
||||||
|
cooperate.
|
||||||
|
|
||||||
|
Our insight is to use multi-agent conversations to achieve it. There are at least three reasons:
|
||||||
|
1. Chat-optimized LLMs (e.g., GPT-4) show the ability to incorporate feedback; LLM agents
|
||||||
|
can cooperate through conversations with each other or human(s).
|
||||||
|
2. A single LLM can exhibit a broad range of capabilities; conversations between differently
|
||||||
|
configured agents can combine these broad LLM capabilities in a modular fashion.
|
||||||
|
3. LLMs can solve complex tasks when broken into simpler subtasks; multi-agent conversations
|
||||||
|
can enable this partitioning and integration.
|
||||||
|
|
||||||
|
We present AutoGen, a generalized multi-agent conversation framework, based on two new concepts:
|
||||||
|
|
||||||
|
1. **Customizable and conversable agents.** AutoGen uses a generic design of agents that can
|
||||||
|
leverage LLMs, human inputs, tools, or a combination. Developers can easily create agents
|
||||||
|
with different roles by selecting and configuring built-in capabilities.
|
||||||
|
|
||||||
|
2. **Conversation programming.** AutoGen simplifies and unifies complex LLM application
|
||||||
|
workflows as multi-agent conversations. It streamlines development via: (1) defining a set
|
||||||
|
of conversable agents with specific capabilities and roles; (2) programming the interaction
|
||||||
|
behavior between agents via conversation-centric computation and control.
|
||||||
|
|
||||||
|
2 The AutoGen Framework
|
||||||
|
|
||||||
|
2.1 Conversable Agents
|
||||||
|
|
||||||
|
In AutoGen, a conversable agent is an entity with a specific role that can pass messages to
|
||||||
|
send and receive information to and from other conversable agents. It maintains its internal
|
||||||
|
context based on sent and received messages and can be configured to possess a set of capabilities.
|
||||||
|
|
||||||
|
Agent capabilities powered by LLMs, humans, and tools:
|
||||||
|
- **LLMs**: LLM-backed agents exploit capabilities such as role playing, implicit state inference,
|
||||||
|
providing feedback, adapting from feedback, and coding.
|
||||||
|
- **Humans**: AutoGen lets a human participate in agent conversation via human-backed agents.
|
||||||
|
- **Tools**: Tool-backed agents execute tools via code execution or function execution.
|
||||||
|
|
||||||
|
Built-in agent classes:
|
||||||
|
- **ConversableAgent**: highest-level agent abstraction, can use LLMs, humans, and tools
|
||||||
|
- **AssistantAgent**: pre-configured for AI assistant role (backed by LLMs)
|
||||||
|
- **UserProxyAgent**: solicits human input or executes code/function calls
|
||||||
|
- **GroupChatManager**: manages dynamic group chat among multiple agents
|
||||||
|
|
||||||
|
2.2 Conversation Programming
|
||||||
|
|
||||||
|
AutoGen utilizes conversation programming with two concepts:
|
||||||
|
1. **Computation**: the actions agents take to compute their response
|
||||||
|
2. **Control flow**: the sequence (or conditions) under which these computations happen
|
||||||
|
|
||||||
|
Design patterns:
|
||||||
|
1. **Unified interfaces and auto-reply mechanisms**: Once an agent receives a message, it
|
||||||
|
automatically invokes generate_reply and sends the reply back unless a termination
|
||||||
|
condition is satisfied.
|
||||||
|
2. **Control by fusion of programming and natural language**: (a) Natural-language control
|
||||||
|
via LLMs; (b) Programming-language control via Python; (c) Control transition between
|
||||||
|
natural and programming language.
|
||||||
|
|
||||||
|
3 Applications of AutoGen
|
||||||
|
|
||||||
|
Six applications demonstrating AutoGen's capabilities:
|
||||||
|
|
||||||
|
**A1: Math Problem Solving**
|
||||||
|
- System using built-in agents achieves 69.48% accuracy on MATH dataset (vs 55.18% for GPT-4 alone)
|
||||||
|
- Outperforms ChatGPT+Code Interpreter (48.33%), ChatGPT+Plugin (45.0%)
|
||||||
|
- Supports human-in-the-loop and multi-user problem solving
|
||||||
|
|
||||||
|
**A2: Retrieval-Augmented Code Generation and Question Answering**
|
||||||
|
- Retrieval-augmented Chat with interactive retrieval feature
|
||||||
|
- F1: 25.88%, Recall: 66.65% (vs DPR: 22.79%/62.59%)
|
||||||
|
- Novel interactive retrieval: agent replies "UPDATE CONTEXT" to get more relevant chunks
|
||||||
|
|
||||||
|
**A3: Decision Making in Text World Environments (ALFWorld)**
|
||||||
|
- Two-agent system matches ReAct performance (54%)
|
||||||
|
- Three-agent system with grounding agent: 69% success (vs 54% for ReAct)
|
||||||
|
- Grounding agent provides commonsense knowledge to prevent error loops
|
||||||
|
|
||||||
|
**A4: Multi-Agent Coding (OptiGuide)**
|
||||||
|
- Commander + Writer + Safeguard architecture
|
||||||
|
- Core workflow code reduced from 430+ lines to 100 lines (4x reduction)
|
||||||
|
- Multi-agent design boosts F-1 by 8% (GPT-4) and 35% (GPT-3.5) on unsafe code detection
|
||||||
|
- 3x time saving vs ChatGPT+Code Interpreter; 3-5x fewer user interactions
|
||||||
|
|
||||||
|
**A5: Dynamic Group Chat**
|
||||||
|
- GroupChatManager dynamically selects speakers
|
||||||
|
- Role-play prompt outperforms task-based prompt for speaker selection
|
||||||
|
- Higher success rate, fewer LLM calls, fewer termination failures
|
||||||
|
|
||||||
|
**A6: Conversational Chess**
|
||||||
|
- Human/AI chess players with a board agent for move validation
|
||||||
|
- Supports AI-AI, AI-human, human-human modes
|
||||||
|
- Board agent ensures legal moves; without it, illegal moves cause game disruptions
|
||||||
|
|
||||||
|
4 Discussion
|
||||||
|
|
||||||
|
AutoGen benefits:
|
||||||
|
- **Ease of use**: Built-in agents deliver strong performance out-of-the-box
|
||||||
|
- **Modularity**: Each agent can be developed, tested, and maintained independently
|
||||||
|
- **Programmability**: Core workflow code in A4 reduced 4x
|
||||||
|
- **Human involvement**: Native mechanism for human participation and oversight
|
||||||
|
- **Collaborative/adversarial agent interactions**: Agents share information or work adversarially
|
||||||
|
|
||||||
|
Comparison with related systems:
|
||||||
|
|
||||||
|
| Aspect | AutoGen | Multi-agent Debate | CAMEL | BabyAGI | MetaGPT |
|
||||||
|
|--------|---------|-------------------|-------|---------|---------|
|
||||||
|
| Infrastructure | yes | no | yes | no | no |
|
||||||
|
| Conversation pattern | flexible | static | static | static | static |
|
||||||
|
| Execution-capable | yes | no | no | no | yes |
|
||||||
|
| Human involvement | chat/skip | no | no | no | no |
|
||||||
|
|
||||||
|
Future directions:
|
||||||
|
- Designing optimal multi-agent workflows
|
||||||
|
- Creating highly capable agents with diverse skill sets
|
||||||
|
- Enabling scale, safety, and human agency
|
||||||
|
- Building fail-safes against cascading failures
|
||||||
|
|
||||||
|
References (selected):
|
||||||
|
- Wu et al. (2023). An empirical study on challenging math problem solving with GPT-4. arXiv:2306.01337
|
||||||
|
- Du et al. (2023). Improving factuality and reasoning in language models through multiagent debate. arXiv:2305.14325
|
||||||
|
- Liang et al. (2023). Encouraging divergent thinking in large language models through multi-agent debate.
|
||||||
|
- Hong et al. (2023). MetaGPT: Meta programming for multi-agent collaborative framework. arXiv:2308.00352
|
||||||
|
- Li et al. (2023b). CAMEL: Communicative agents for "mind" exploration of large scale language model society.
|
||||||
|
- Yao et al. (2022). ReAct: Synergizing reasoning and acting in language models. arXiv:2210.03629
|
||||||
|
- Shridhar et al. (2021). ALFWorld: Aligning Text and Embodied Environments for Interactive Learning. ICLR 2021.
|
||||||
|
|
||||||
|
Appendix C: Default System Message for Assistant Agent
|
||||||
|
|
||||||
|
"You are a helpful AI assistant. Solve tasks using your coding and language skills.
|
||||||
|
In the following cases, suggest python code (in a python coding block) or shell script
|
||||||
|
(in a sh coding block) for the user to execute:
|
||||||
|
1. When you need to collect info, use the code to output the info you need...
|
||||||
|
2. When you need to perform some task with code, use the code to perform the task...
|
||||||
|
...
|
||||||
|
Reply 'TERMINATE' in the end when everything is done."
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
AutoGen + MQTT PDF 임시파일 복사 스크립트
|
||||||
|
web_fetch로 추출된 임시파일들을 references 디렉토리로 복사합니다.
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
TEMP_BASE = "/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/claude-hostloop-plugins/b8db1e6c7fa308f5/projects/-Users-godopu16-Library-Application-Support-Claude-local-agent-mode-sessions-d296e3e8-b0b5-4f4f-bb64-8c0d840bb199-297e4cfe-e248-44e9-8c1d-151efb5c1d9c-local-0a2efad5-ff3c-41a8-bf0b-eefa704c64ee-output-l5mtkv/70a71999-c1c1-4c50-bb5d-1ed02fe6f250/tool-results"
|
||||||
|
|
||||||
|
DEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
# Temp file names from the web_fetch calls made in this session
|
||||||
|
FILES_MAP = {
|
||||||
|
"mcp-workspace-web_fetch-1780816592169.txt": "Wu2023_AutoGen_MultiAgent.pdf",
|
||||||
|
"mcp-workspace-web_fetch-1780816642475.txt": "MQTT_v5_OASIS_Standard.pdf",
|
||||||
|
}
|
||||||
|
|
||||||
|
os.makedirs(DEST_DIR, exist_ok=True)
|
||||||
|
|
||||||
|
for src_fname, dest_fname in FILES_MAP.items():
|
||||||
|
src_path = os.path.join(TEMP_BASE, src_fname)
|
||||||
|
dest_path = os.path.join(DEST_DIR, dest_fname)
|
||||||
|
if os.path.exists(src_path):
|
||||||
|
# Plain text extracted from PDF — strip web_fetch header lines
|
||||||
|
with open(src_path, "r", encoding="utf-8", errors="replace") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
# Skip first few metadata lines added by web_fetch (URL, redirect, content-type, blank)
|
||||||
|
start = 0
|
||||||
|
for i, ln in enumerate(lines[:6]):
|
||||||
|
stripped = ln.strip()
|
||||||
|
if stripped.startswith("https://") or stripped.startswith("→") or stripped.startswith("Content-Type:"):
|
||||||
|
start = i + 1
|
||||||
|
# Skip trailing blank line after headers
|
||||||
|
if start < len(lines) and lines[start].strip() == "":
|
||||||
|
start += 1
|
||||||
|
with open(dest_path, "w", encoding="utf-8") as f:
|
||||||
|
f.writelines(lines[start:])
|
||||||
|
size = os.path.getsize(dest_path)
|
||||||
|
print(f"OK {dest_fname} ({size:,} bytes)")
|
||||||
|
else:
|
||||||
|
print(f"MISSING: {src_path}")
|
||||||
|
|
||||||
|
print("\nAll files in references/:")
|
||||||
|
for fname in sorted(os.listdir(DEST_DIR)):
|
||||||
|
if fname.startswith("_"):
|
||||||
|
continue
|
||||||
|
path = os.path.join(DEST_DIR, fname)
|
||||||
|
size = os.path.getsize(path)
|
||||||
|
print(f" {fname} ({size:,} bytes)")
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
RFC/W3C 문서 임시파일 복사 스크립트
|
||||||
|
web_fetch로 다운로드된 임시파일들을 references 디렉토리로 복사합니다.
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import glob
|
||||||
|
|
||||||
|
TEMP_BASE = "/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/claude-hostloop-plugins/b8db1e6c7fa308f5/projects/-Users-godopu16-Library-Application-Support-Claude-local-agent-mode-sessions-d296e3e8-b0b5-4f4f-bb64-8c0d840bb199-297e4cfe-e248-44e9-8c1d-151efb5c1d9c-local-0a2efad5-ff3c-41a8-bf0b-eefa704c64ee-output-l5mtkv/70a71999-c1c1-4c50-bb5d-1ed02fe6f250/tool-results"
|
||||||
|
|
||||||
|
DEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
FILES_MAP = {
|
||||||
|
"mcp-workspace-web_fetch-1780816591394.txt": "RFC9000_QUIC_Transport.txt",
|
||||||
|
"mcp-workspace-web_fetch-1780816603173.txt": "RFC7252_CoAP.txt",
|
||||||
|
"mcp-workspace-web_fetch-1780816606749.txt": "RFC8949_CBOR.txt",
|
||||||
|
"mcp-workspace-web_fetch-1780816616243.txt": "RFC9114_HTTP3.txt",
|
||||||
|
"mcp-workspace-web_fetch-1780816619718.txt": "RFC8446_TLS13.txt",
|
||||||
|
"toolu_01BFYbhdAjbXPLctFLnGVDP6.json": "W3C_TraceContext_Spec.html",
|
||||||
|
}
|
||||||
|
|
||||||
|
os.makedirs(DEST_DIR, exist_ok=True)
|
||||||
|
|
||||||
|
for src_fname, dest_fname in FILES_MAP.items():
|
||||||
|
src_path = os.path.join(TEMP_BASE, src_fname)
|
||||||
|
dest_path = os.path.join(DEST_DIR, dest_fname)
|
||||||
|
if os.path.exists(src_path):
|
||||||
|
if dest_fname.endswith(".html"):
|
||||||
|
# JSON wrapper에서 text 추출
|
||||||
|
import json
|
||||||
|
with open(src_path, "r", encoding="utf-8") as f:
|
||||||
|
raw = f.read()
|
||||||
|
try:
|
||||||
|
data = json.loads(raw)
|
||||||
|
if isinstance(data, list) and data and "text" in data[0]:
|
||||||
|
content = data[0]["text"]
|
||||||
|
# header 라인 제거 (첫 4줄: URL, redirect, content-type, blank)
|
||||||
|
lines = content.split("\n")
|
||||||
|
start = 0
|
||||||
|
for i, ln in enumerate(lines[:10]):
|
||||||
|
if ln.startswith("Content-Type:") or ln.startswith("→"):
|
||||||
|
start = i + 2
|
||||||
|
with open(dest_path, "w", encoding="utf-8") as f:
|
||||||
|
f.write("\n".join(lines[start:]))
|
||||||
|
size = os.path.getsize(dest_path)
|
||||||
|
print(f"OK {dest_fname} ({size:,} bytes)")
|
||||||
|
else:
|
||||||
|
shutil.copy2(src_path, dest_path)
|
||||||
|
size = os.path.getsize(dest_path)
|
||||||
|
print(f"OK (raw copy) {dest_fname} ({size:,} bytes)")
|
||||||
|
except Exception as e:
|
||||||
|
shutil.copy2(src_path, dest_path)
|
||||||
|
size = os.path.getsize(dest_path)
|
||||||
|
print(f"OK (fallback copy) {dest_fname} ({size:,} bytes) [{e}]")
|
||||||
|
else:
|
||||||
|
# Plain text: strip header lines (URL, redirect, content-type)
|
||||||
|
with open(src_path, "r", encoding="utf-8", errors="replace") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
# Skip first few lines that are metadata added by web_fetch
|
||||||
|
start = 0
|
||||||
|
for i, ln in enumerate(lines[:6]):
|
||||||
|
stripped = ln.strip()
|
||||||
|
if stripped.startswith("https://") or stripped.startswith("→") or stripped.startswith("Content-Type:"):
|
||||||
|
start = i + 1
|
||||||
|
with open(dest_path, "w", encoding="utf-8") as f:
|
||||||
|
f.writelines(lines[start:])
|
||||||
|
size = os.path.getsize(dest_path)
|
||||||
|
print(f"OK {dest_fname} ({size:,} bytes)")
|
||||||
|
else:
|
||||||
|
print(f"MISSING: {src_path}")
|
||||||
|
|
||||||
|
print("\nDone. Files in references:")
|
||||||
|
for f in sorted(os.listdir(DEST_DIR)):
|
||||||
|
if not f.startswith("_"):
|
||||||
|
path = os.path.join(DEST_DIR, f)
|
||||||
|
size = os.path.getsize(path)
|
||||||
|
print(f" {f} ({size:,} bytes)")
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
# gRPC over HTTP2
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
This document serves as a detailed description for an implementation of gRPC carried over HTTP2 framing. It assumes familiarity with the HTTP2 specification.
|
||||||
|
|
||||||
|
## Protocol
|
||||||
|
Production rules are using ABNF syntax.
|
||||||
|
|
||||||
|
### Outline
|
||||||
|
|
||||||
|
The following is the general sequence of message atoms in a GRPC request & response message stream
|
||||||
|
|
||||||
|
* Request → Request-Headers *Length-Prefixed-Message EOS
|
||||||
|
* Response → (Response-Headers *Length-Prefixed-Message Trailers) / Trailers-Only
|
||||||
|
|
||||||
|
|
||||||
|
### Requests
|
||||||
|
|
||||||
|
* Request → Request-Headers *Length-Prefixed-Message EOS
|
||||||
|
|
||||||
|
Request-Headers are delivered as HTTP2 headers in HEADERS + CONTINUATION frames.
|
||||||
|
|
||||||
|
* **Request-Headers** → Call-Definition *Custom-Metadata
|
||||||
|
* **Call-Definition** → Method Scheme Path [Authority] TE [Timeout] Content-Type [Message-Type] [Message-Encoding] [Message-Accept-Encoding] [User-Agent]
|
||||||
|
* **Method** → ":method POST"
|
||||||
|
* **Scheme** → ":scheme " ("http" / "https")
|
||||||
|
* **Path** → ":path" "/" Service-Name "/" {method name}
|
||||||
|
* **Service-Name** → {IDL-specific service name}
|
||||||
|
* **Authority** → ":authority" {virtual host name of authority}
|
||||||
|
* **TE** → "te" "trailers"
|
||||||
|
* **Timeout** → "grpc-timeout" TimeoutValue TimeoutUnit
|
||||||
|
* **TimeoutValue** → {positive integer as ASCII string of at most 8 digits}
|
||||||
|
* **TimeoutUnit** → Hour / Minute / Second / Millisecond / Microsecond / Nanosecond
|
||||||
|
* **Content-Type** → "content-type" "application/grpc" [("+proto" / "+json" / {custom})]
|
||||||
|
* **Content-Coding** → "identity" / "gzip" / "deflate" / "snappy" / {custom}
|
||||||
|
* **Message-Encoding** → "grpc-encoding" Content-Coding
|
||||||
|
* **Message-Accept-Encoding** → "grpc-accept-encoding" Content-Coding *("," Content-Coding)
|
||||||
|
* **User-Agent** → "user-agent" {structured user-agent string}
|
||||||
|
* **Message-Type** → "grpc-message-type" {type name for message schema}
|
||||||
|
* **Custom-Metadata** → Binary-Header / ASCII-Header
|
||||||
|
* **Binary-Header** → {Header-Name "-bin" } {base64 encoded value}
|
||||||
|
* **ASCII-Header** → Header-Name ASCII-Value
|
||||||
|
* **Header-Name** → 1*( %x30-39 / %x61-7A / "_" / "-" / ".")
|
||||||
|
* **ASCII-Value** → 1*( %x20-%x7E )
|
||||||
|
|
||||||
|
HTTP2 requires that reserved headers, ones starting with ":" appear before all other headers. Additionally implementations should send **Timeout** immediately after the reserved headers and they should send the **Call-Definition** headers before sending **Custom-Metadata**.
|
||||||
|
|
||||||
|
If **Timeout** is omitted a server should assume an infinite timeout. Client implementations are free to send a default minimum timeout based on their deployment requirements.
|
||||||
|
|
||||||
|
If **Content-Type** does not begin with "application/grpc", gRPC servers SHOULD respond with HTTP status of 415 (Unsupported Media Type).
|
||||||
|
|
||||||
|
**Custom-Metadata** is an arbitrary set of key-value pairs defined by the application layer. Header names starting with "grpc-" but not listed here are reserved for future GRPC use and should not be used by applications as **Custom-Metadata**.
|
||||||
|
|
||||||
|
Binary header values must be encoded using Base64 as per https://tools.ietf.org/html/rfc4648#section-4. Implementations MUST accept padded and un-padded values and should emit un-padded values.
|
||||||
|
|
||||||
|
### Responses
|
||||||
|
|
||||||
|
* **Response** → (Response-Headers *Length-Prefixed-Message Trailers) / Trailers-Only
|
||||||
|
* **Response-Headers** → HTTP-Status [Message-Encoding] [Message-Accept-Encoding] Content-Type *Custom-Metadata
|
||||||
|
* **Trailers-Only** → HTTP-Status Content-Type Trailers
|
||||||
|
* **Trailers** → Status [Status-Message] [Status-Details] *Custom-Metadata
|
||||||
|
* **HTTP-Status** → ":status 200"
|
||||||
|
* **Status** → "grpc-status" 1*DIGIT
|
||||||
|
* **Status-Message** → "grpc-message" Percent-Encoded
|
||||||
|
* **Status-Details** → "grpc-status-details-bin" {base64 encoded value}
|
||||||
|
* **Percent-Encoded** → 1*(Percent-Byte-Unencoded / Percent-Byte-Encoded)
|
||||||
|
* **Percent-Byte-Unencoded** → 1*( %x20-%x24 / %x26-%x7E )
|
||||||
|
* **Percent-Byte-Encoded** → "%" 2HEXDIGIT
|
||||||
|
|
||||||
|
**Response-Headers** & **Trailers-Only** are each delivered in a single HTTP2 HEADERS frame block. Status must be sent in **Trailers** even if the status code is OK.
|
||||||
|
|
||||||
|
#### HTTP2 Transport Mapping
|
||||||
|
|
||||||
|
##### Stream Identification
|
||||||
|
All GRPC calls need to specify an internal ID. HTTP2 stream-ids are used as call identifiers.
|
||||||
|
|
||||||
|
##### Errors
|
||||||
|
|
||||||
|
The following mapping from RST_STREAM error codes to GRPC error codes is applied:
|
||||||
|
|
||||||
|
HTTP2 Code|GRPC Code
|
||||||
|
----------|-----------
|
||||||
|
NO_ERROR(0)|INTERNAL
|
||||||
|
PROTOCOL_ERROR(1)|INTERNAL
|
||||||
|
INTERNAL_ERROR(2)|INTERNAL
|
||||||
|
FLOW_CONTROL_ERROR(3)|INTERNAL
|
||||||
|
SETTINGS_TIMEOUT(4)|INTERNAL
|
||||||
|
REFUSED_STREAM|UNAVAILABLE
|
||||||
|
CANCEL(8)|Mapped to call cancellation when sent by a client. CANCELLED when sent by a server.
|
||||||
|
COMPRESSION_ERROR|INTERNAL
|
||||||
|
CONNECT_ERROR|INTERNAL
|
||||||
|
ENHANCE_YOUR_CALM|RESOURCE_EXHAUSTED
|
||||||
|
INADEQUATE_SECURITY|PERMISSION_DENIED
|
||||||
|
|
||||||
|
##### Security
|
||||||
|
|
||||||
|
The HTTP2 specification mandates the use of TLS 1.2 or higher when TLS is used with HTTP2.
|
||||||
|
|
||||||
|
##### Connection Management
|
||||||
|
|
||||||
|
###### GOAWAY Frame
|
||||||
|
Sent by servers to clients to indicate that they will no longer accept any new streams on the associated connections.
|
||||||
|
|
||||||
|
###### PING Frame
|
||||||
|
Both clients and servers can send a PING frame that the peer must respond to by precisely echoing what they received.
|
||||||
|
|
||||||
|
### Appendix A - GRPC for Protobuf
|
||||||
|
|
||||||
|
* **Service-Name** → ?( {proto package name} "." ) {service name}
|
||||||
|
* **Message-Type** → {fully qualified proto message name}
|
||||||
|
* **Content-Type** → "application/grpc+proto"
|
||||||
|
* **Status-Details** → {google.rpc.Status proto message}
|
||||||
|
|
||||||
|
---
|
||||||
|
Source: https://raw.githubusercontent.com/grpc/grpc/master/doc/PROTOCOL-HTTP2.md
|
||||||
|
Downloaded: 2026-06-07
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# A QUIC implementation in pure Go
|
||||||
|
|
||||||
|
[](https://quic-go.net/docs/)
|
||||||
|
[](https://pkg.go.dev/github.com/quic-go/quic-go)
|
||||||
|
|
||||||
|
quic-go is an implementation of the QUIC protocol ([RFC 9000](https://datatracker.ietf.org/doc/html/rfc9000), [RFC 9001](https://datatracker.ietf.org/doc/html/rfc9001), [RFC 9002](https://datatracker.ietf.org/doc/html/rfc9002)) in Go. It has support for HTTP/3 ([RFC 9114](https://datatracker.ietf.org/doc/html/rfc9114)), including QPACK ([RFC 9204](https://datatracker.ietf.org/doc/html/rfc9204)) and HTTP Datagrams ([RFC 9297](https://datatracker.ietf.org/doc/html/rfc9297)).
|
||||||
|
|
||||||
|
In addition to these base RFCs, it also implements the following RFCs:
|
||||||
|
|
||||||
|
* Unreliable Datagram Extension ([RFC 9221](https://datatracker.ietf.org/doc/html/rfc9221))
|
||||||
|
* Datagram Packetization Layer Path MTU Discovery (DPLPMTUD, [RFC 8899](https://datatracker.ietf.org/doc/html/rfc8899))
|
||||||
|
* QUIC Version 2 ([RFC 9369](https://datatracker.ietf.org/doc/html/rfc9369))
|
||||||
|
* QUIC Event Logging using qlog
|
||||||
|
* QUIC Stream Resets with Partial Delivery
|
||||||
|
|
||||||
|
Support for WebTransport over HTTP/3 is implemented in [webtransport-go](https://github.com/quic-go/webtransport-go).
|
||||||
|
|
||||||
|
Detailed documentation can be found on [quic-go.net](https://quic-go.net/docs/).
|
||||||
|
|
||||||
|
## FIPS 140-3
|
||||||
|
|
||||||
|
Starting with v0.60, quic-go supports use in FIPS 140-3 environments when built with Go 1.26 or newer, using Go standard library cryptography for the QUIC code paths relevant in FIPS mode.
|
||||||
|
|
||||||
|
## Projects using quic-go
|
||||||
|
|
||||||
|
| Project | Description |
|
||||||
|
|---------|-------------|
|
||||||
|
| [AdGuardHome](https://github.com/AdguardTeam/AdGuardHome) | Free and open source, powerful network-wide ads & trackers blocking DNS server. |
|
||||||
|
| [caddy](https://github.com/caddyserver/caddy/) | Fast, multi-platform web server with automatic HTTPS |
|
||||||
|
| [cloudflared](https://github.com/cloudflare/cloudflared) | A tunneling daemon that proxies traffic from the Cloudflare network to your origins |
|
||||||
|
| [frp](https://github.com/fatedier/frp) | A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet |
|
||||||
|
| [go-libp2p](https://github.com/libp2p/go-libp2p) | libp2p implementation in Go |
|
||||||
|
| [Hysteria](https://github.com/apernet/hysteria) | A powerful, lightning fast and censorship resistant proxy |
|
||||||
|
| [syncthing](https://github.com/syncthing/syncthing/) | Open Source Continuous File Synchronization |
|
||||||
|
| [traefik](https://github.com/traefik/traefik) | The Cloud Native Application Proxy |
|
||||||
|
|
||||||
|
## Release Policy
|
||||||
|
|
||||||
|
quic-go always aims to support the latest two Go releases.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We are always happy to welcome new contributors! We have a number of self-contained issues that are suitable for first-time contributors, they are tagged with [help wanted](https://github.com/quic-go/quic-go/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
The code is licensed under the MIT license.
|
||||||
|
|
||||||
|
---
|
||||||
|
Source: https://raw.githubusercontent.com/quic-go/quic-go/master/README.md
|
||||||
|
Downloaded: 2026-06-07
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
test
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
# Nanobanana 인포그래픽 생성 요청 — 4종
|
||||||
|
|
||||||
|
이 문서는 agy 에이전트가 nanobanana로 생성해야 할 4개 인포그래픽의 사양을 정의한다.
|
||||||
|
산출물 위치: /home/godopu16/pugit/lab/grpc_based_interface/figures/
|
||||||
|
|
||||||
|
요구사항:
|
||||||
|
- 스타일: 학술 논문/기술 백서 톤, 깔끔하고 정보 전달 명확, 색상은 절제 (남색/청록/주황 강조색 사용)
|
||||||
|
- 해상도: 1920x1080 또는 2400x1600, PNG
|
||||||
|
- 텍스트는 명확하고 읽기 쉬운 산세리프 폰트
|
||||||
|
- 데이터 흐름·계층 구조가 한눈에 보이도록
|
||||||
|
- 한국어/영어 혼용 가능, 핵심 레이블은 영어 권장 (논문 출판 호환)
|
||||||
|
- 4개 모두 동일한 색상 팔레트/스타일로 통일감 유지
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. edge_aiot_usecases_overview.png
|
||||||
|
**용도**: §3 도입부에 배치 — 4대 엣지 AIoT 사용 사례 콜라주
|
||||||
|
|
||||||
|
**구성**: 2x2 격자로 4개 시나리오를 한 장에 표현. 각 셀에 다음 내용을 시각화:
|
||||||
|
- (좌상) Smart Factory: AGV/로봇이 라인 위를 이동, 컨베이어 벨트, 엣지 컨트롤러, 클라우드 연결 표시
|
||||||
|
- (우상) Smart Building/Energy: 빌딩 외관, 내부 HVAC·조명·PV 인버터, 변전소 엣지, 클라우드 에너지 최적화
|
||||||
|
- (좌하) Connected Vehicle/V2X: 차량, RSU(로드사이드 유닛), 5G MEC 타워, HD 맵 클라우드
|
||||||
|
- (우하) Healthcare/Wearable: 환자, 웨어러블 밴드·스마트워치, 병원 엣지 서버, 클라우드 EHR
|
||||||
|
|
||||||
|
각 셀 우상단에 작은 사각형으로 "① Smart Factory / ② Smart Building / ③ V2X / ④ Healthcare" 라벨, 셀 하단에 핵심 KPI 한 줄 (예: "p99 < 10ms", "10k+ nodes", "10ms safety", "1mo battery").
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. smart_factory_aiot.png
|
||||||
|
**용도**: §3.① — 스마트 팩토리 단일 상세 인포그래픽
|
||||||
|
|
||||||
|
**구성 (3-tier vertical)**: 하단 T3 (현장: AGV·로봇·CCTV·진동 센서 다수), 중단 T2 (엣지 게이트웨이·Jetson 박스, 라인 컨트롤러), 상단 T1 (클라우드, GPU 서버 팜).
|
||||||
|
|
||||||
|
표시할 통신 흐름:
|
||||||
|
- T3→T2: 다수 화살표 (sensor telemetry, AGV state), "MQTT / gRPC-Lite" 라벨
|
||||||
|
- T3↔T3 (AGV간): "Bidi Streaming 합의" 라벨
|
||||||
|
- T2↔T1: 양방향 굵은 화살표, "gRPC over QUIC" 라벨
|
||||||
|
- T1→T2: Server Streaming (모델 업데이트)
|
||||||
|
- T2→T1: Client Streaming (배치 텔레메트리)
|
||||||
|
|
||||||
|
좌측 또는 우측에 작은 callout 박스로 "p99 < 10ms (AGV 합의)", "TPM 쿼터, TPM 100k+", "SPIFFE SVID + TPM 부팅 attestation" 등 핵심 메트릭/보안 3개.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. smart_building_energy.png
|
||||||
|
**용도**: §3.② — 스마트 빌딩/에너지 단일 상세 인포그래픽
|
||||||
|
|
||||||
|
**구성**: 빌딩 외관이 배경, 내부에 HVAC·조명·스마트 미터 다수, 옆에 PV 인버터 + 변전소, 상단에 클라우드.
|
||||||
|
|
||||||
|
표시할 통신 흐름:
|
||||||
|
- 빌딩 내부 센서→엣지: "LoRa / Wi-SUN / Zigbee" (저전력 무선)
|
||||||
|
- PV/미터→엣지: "MQTT"
|
||||||
|
- 엣지↔엣지: 빌딩 HVAC 협업 합의
|
||||||
|
- 엣지↔클라우드: "gRPC + QUIC"
|
||||||
|
- 클라우드→엣지: 에너지 최적화 명령, Server Streaming
|
||||||
|
|
||||||
|
callout: "수만 노드 fan-in", "배터리 5–10년 (PV 인버터)", "피크 셰이빙 -30%".
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. healthcare_aiot.png
|
||||||
|
**용도**: §3.④ — 헬스케어/원격 모니터링 단일 상세 인포그래픽
|
||||||
|
|
||||||
|
**구성**: 좌측 환자 + 웨어러블 (스마트워치·ECG 패치·약물 디스펜서), 중앙 병원/요양시설 엣지 서버, 우측 클라우드 EHR + 임상 추론 에이전트.
|
||||||
|
|
||||||
|
표시할 통신 흐름:
|
||||||
|
- 웨어러블→엣지: "BLE / Wi-Fi", "duty cycle 1% for battery"
|
||||||
|
- 약물 디스펜서→엣지: "MQTT QoS 1", "Confirmable"
|
||||||
|
- 엣지↔엣지: 환자 모니터링 합의
|
||||||
|
- 엣지↔클라우드: "gRPC + 유선/4G"
|
||||||
|
- 긴급 이벤트(부정맥·낙상): 굵은 빨간 화살표로 즉시 T1 알림
|
||||||
|
|
||||||
|
callout: "배터리 1주–1개월", "긴급 < 1s", "HIPAA + TPM + SPIRE attestation".
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 출력 명세
|
||||||
|
- 파일 형식: PNG, 2400x1600 권장
|
||||||
|
- 파일명: 위 4개 이름 그대로 figures/ 디렉터리에 저장
|
||||||
|
- 보고서 본문에서  형식으로 참조
|
||||||
|
After Width: | Height: | Size: 575 KiB |
@@ -0,0 +1,103 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 720" font-family="Helvetica, Arial, sans-serif">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="tier1" x1="0" x2="0" y1="0" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#e3f2fd"/>
|
||||||
|
<stop offset="100%" stop-color="#bbdefb"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="tier2" x1="0" x2="0" y1="0" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#e0f7fa"/>
|
||||||
|
<stop offset="100%" stop-color="#b2ebf2"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="tier3" x1="0" x2="0" y1="0" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#fff3e0"/>
|
||||||
|
<stop offset="100%" stop-color="#ffe0b2"/>
|
||||||
|
</linearGradient>
|
||||||
|
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
<marker id="arrowRev" viewBox="0 0 10 10" refX="1" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M10,0 L0,5 L10,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<text x="550" y="32" text-anchor="middle" font-size="20" font-weight="700" fill="#102a43">엣지 AIoT 3-Tier 물리적 분산 구조</text>
|
||||||
|
<text x="550" y="55" text-anchor="middle" font-size="13" fill="#486581">클라우드 — 엣지 — 현장 디바이스의 이질적 자원·네트워크·보안 제약</text>
|
||||||
|
|
||||||
|
<!-- T1: Cloud -->
|
||||||
|
<rect x="60" y="80" width="980" height="130" rx="10" fill="url(#tier1)" stroke="#1976d2" stroke-width="2"/>
|
||||||
|
<text x="100" y="115" font-size="16" font-weight="700" fill="#0d47a1">T1 — Cloud (데이터센터)</text>
|
||||||
|
<text x="100" y="138" font-size="12" fill="#102a43">x86/GPU 서버, k8s 컨테이너 · TB RAM · GPU 다수</text>
|
||||||
|
<text x="100" y="158" font-size="12" fill="#102a43">LLM·분석·중앙 PM 에이전트 · Istio Service Mesh · OTel Collector</text>
|
||||||
|
<text x="100" y="178" font-size="12" fill="#0d47a1" font-weight="600">네트워크: 안정·고대역폭·상시 연결 · 보안 경계: 내부 (강)</text>
|
||||||
|
<!-- icons -->
|
||||||
|
<g transform="translate(800,95)">
|
||||||
|
<rect x="0" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="30" y="32" text-anchor="middle" font-size="10" fill="#1976d2">GPU</text>
|
||||||
|
<rect x="70" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="100" y="32" text-anchor="middle" font-size="10" fill="#1976d2">k8s</text>
|
||||||
|
<rect x="140" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="170" y="32" text-anchor="middle" font-size="10" fill="#1976d2">LLM</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- T2: Edge -->
|
||||||
|
<rect x="60" y="260" width="980" height="130" rx="10" fill="url(#tier2)" stroke="#00838f" stroke-width="2"/>
|
||||||
|
<text x="100" y="295" font-size="16" font-weight="700" fill="#006064">T2 — Edge (현장 부근 게이트웨이)</text>
|
||||||
|
<text x="100" y="318" font-size="12" fill="#102a43">Jetson / RK3588 / 산업용 PC · 4–32GB RAM · NPU</text>
|
||||||
|
<text x="100" y="338" font-size="12" fill="#102a43">현장 추론·제어·프로토콜 변환 게이트웨이 · Envoy Edge Proxy</text>
|
||||||
|
<text x="100" y="358" font-size="12" fill="#006064" font-weight="600">네트워크: 인터미턴트 (4G/5G/유선 혼합) · 보안 경계: 반노출 (중)</text>
|
||||||
|
<g transform="translate(800,275)">
|
||||||
|
<rect x="0" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="30" y="32" text-anchor="middle" font-size="10" fill="#00838f">Jetson</text>
|
||||||
|
<rect x="70" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="100" y="32" text-anchor="middle" font-size="10" fill="#00838f">NPU</text>
|
||||||
|
<rect x="140" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="170" y="32" text-anchor="middle" font-size="10" fill="#00838f">GW</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- T3: Field -->
|
||||||
|
<rect x="60" y="440" width="980" height="180" rx="10" fill="url(#tier3)" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="100" y="475" font-size="16" font-weight="700" fill="#bf360c">T3 — Field (현장 IoT·임베디드·로봇·센서)</text>
|
||||||
|
<text x="100" y="498" font-size="12" fill="#102a43">MCU (Cortex-M/A), 임베디드 리눅스, AGV·드론·CCTV·진동 센서 · KB–수십 MB RAM</text>
|
||||||
|
<text x="100" y="518" font-size="12" fill="#102a43">저전력 디바이스 에이전트 · 텔레메트리·제어 · 오프라인 큐 · TPM/SE 부팅 attestation</text>
|
||||||
|
<text x="100" y="538" font-size="12" fill="#bf360c" font-weight="600">네트워크: 불안정·저대역폭·다중 홉 (Wi-Fi/LoRa/BLE/5G) · 보안 경계: 물리 노출 (약)</text>
|
||||||
|
<g transform="translate(800,455)">
|
||||||
|
<rect x="0" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="30" y="32" text-anchor="middle" font-size="10" fill="#e65100">AGV</text>
|
||||||
|
<rect x="70" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="100" y="32" text-anchor="middle" font-size="10" fill="#e65100">MCU</text>
|
||||||
|
<rect x="140" y="0" width="60" height="50" rx="4" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="170" y="32" text-anchor="middle" font-size="10" fill="#e65100">Sensor</text>
|
||||||
|
<rect x="0" y="60" width="60" height="50" rx="4" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="30" y="92" text-anchor="middle" font-size="10" fill="#e65100">Robot</text>
|
||||||
|
<rect x="70" y="60" width="60" height="50" rx="4" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="100" y="92" text-anchor="middle" font-size="10" fill="#e65100">CCTV</text>
|
||||||
|
<rect x="140" y="60" width="60" height="50" rx="4" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="170" y="92" text-anchor="middle" font-size="10" fill="#e65100">Wearable</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Communication arrows T1<->T2 -->
|
||||||
|
<line x1="550" y1="210" x2="550" y2="260" stroke="#37474f" stroke-width="2.5" marker-end="url(#arrow)" marker-start="url(#arrowRev)"/>
|
||||||
|
<text x="565" y="240" font-size="12" font-weight="600" fill="#0d47a1">gRPC over QUIC / HTTP-2</text>
|
||||||
|
<text x="565" y="256" font-size="11" fill="#486581">(Server Streaming / Bidi Streaming)</text>
|
||||||
|
|
||||||
|
<!-- Communication arrows T2<->T3 -->
|
||||||
|
<line x1="550" y1="390" x2="550" y2="440" stroke="#37474f" stroke-width="2.5" marker-end="url(#arrow)" marker-start="url(#arrowRev)"/>
|
||||||
|
<text x="565" y="418" font-size="12" font-weight="600" fill="#bf360c">MQTT / CoAP / BLE / C-V2X</text>
|
||||||
|
<text x="565" y="434" font-size="11" fill="#486581">(low-power, lossy, intermittent)</text>
|
||||||
|
|
||||||
|
<!-- Resource gradient bar at bottom -->
|
||||||
|
<text x="60" y="660" font-size="11" font-weight="600" fill="#486581">자원/네트워크/보안 강도:</text>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bar" x1="0" x2="1" y1="0" y2="0">
|
||||||
|
<stop offset="0%" stop-color="#e65100"/>
|
||||||
|
<stop offset="50%" stop-color="#00838f"/>
|
||||||
|
<stop offset="100%" stop-color="#0d47a1"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect x="200" y="650" width="840" height="14" fill="url(#bar)"/>
|
||||||
|
<text x="200" y="685" font-size="10" fill="#bf360c">약함 (T3)</text>
|
||||||
|
<text x="620" y="685" font-size="10" fill="#006064" text-anchor="middle">중간 (T2)</text>
|
||||||
|
<text x="1040" y="685" font-size="10" fill="#0d47a1" text-anchor="end">강함 (T1)</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 7.0 KiB |
@@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 780" font-family="Helvetica, Arial, sans-serif">
|
||||||
|
<defs>
|
||||||
|
<marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
<marker id="arrRev" viewBox="0 0 10 10" refX="1" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M10,0 L0,5 L10,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
<marker id="arrO" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#e65100"/>
|
||||||
|
</marker>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<text x="600" y="32" text-anchor="middle" font-size="20" font-weight="700" fill="#102a43">2-Tier 프로토콜 아키텍처 (핵심 제안)</text>
|
||||||
|
<text x="600" y="55" text-anchor="middle" font-size="13" fill="#486581">T1↔T2: gRPC/QUIC (백본) · T2↔T3: MQTT/CoAP/C-V2X (현장 최적) · T2 게이트웨이 변환</text>
|
||||||
|
|
||||||
|
<!-- T1 Cloud -->
|
||||||
|
<rect x="60" y="80" width="1080" height="120" rx="10" fill="#e3f2fd" stroke="#1976d2" stroke-width="2"/>
|
||||||
|
<text x="90" y="115" font-size="15" font-weight="700" fill="#0d47a1">T1 — Cloud / On-Premises Servers</text>
|
||||||
|
<text x="90" y="138" font-size="12" fill="#102a43">LLM·분석·중앙 PM·예지정비 에이전트</text>
|
||||||
|
<text x="90" y="158" font-size="12" fill="#102a43">k8s · Istio Service Mesh · OTel Collector · BSR (Buf Schema Registry)</text>
|
||||||
|
<text x="90" y="180" font-size="12" font-weight="600" fill="#0d47a1">전송: gRPC Unary / Server Streaming / Bidi Streaming</text>
|
||||||
|
<g transform="translate(880,95)">
|
||||||
|
<rect x="0" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="27" y="25" text-anchor="middle" font-size="10" fill="#1976d2">PM</text>
|
||||||
|
<rect x="60" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="87" y="25" text-anchor="middle" font-size="10" fill="#1976d2">LLM</text>
|
||||||
|
<rect x="120" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="147" y="25" text-anchor="middle" font-size="10" fill="#1976d2">분석</text>
|
||||||
|
<rect x="180" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#1976d2"/>
|
||||||
|
<text x="207" y="25" text-anchor="middle" font-size="10" fill="#1976d2">OTA</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Communication Channel T1<->T2 (gRPC) -->
|
||||||
|
<rect x="60" y="210" width="1080" height="80" rx="6" fill="#fff" stroke="#0d47a1" stroke-dasharray="6,4" stroke-width="2"/>
|
||||||
|
<text x="600" y="240" text-anchor="middle" font-size="14" font-weight="700" fill="#0d47a1">T1 ↔ T2 Communication Channel</text>
|
||||||
|
<text x="600" y="265" text-anchor="middle" font-size="12" fill="#102a43">gRPC over HTTP/2 + QUIC (mobile/V2X handover) · mTLS · Server/Bidi Streaming · W3C traceparent</text>
|
||||||
|
<line x1="600" y1="200" x2="600" y2="210" stroke="#37474f" stroke-width="2.5" marker-end="url(#arr)"/>
|
||||||
|
<line x1="600" y1="290" x2="600" y2="300" stroke="#37474f" stroke-width="2.5" marker-end="url(#arr)"/>
|
||||||
|
|
||||||
|
<!-- T2 Edge -->
|
||||||
|
<rect x="60" y="300" width="1080" height="160" rx="10" fill="#e0f7fa" stroke="#00838f" stroke-width="2"/>
|
||||||
|
<text x="90" y="335" font-size="15" font-weight="700" fill="#006064">T2 — Edge Gateway (프로토콜 변환 + 인증 중계)</text>
|
||||||
|
<text x="90" y="358" font-size="12" fill="#102a43">Jetson · RK3588 · 산업용 PC · 5G MEC (V2X용)</text>
|
||||||
|
<text x="90" y="378" font-size="12" font-weight="600" fill="#006064">6대 책임:</text>
|
||||||
|
<g font-size="11" fill="#102a43">
|
||||||
|
<text x="100" y="398">① 프로토콜 변환 (MQTT topic ↔ gRPC method, JSON↔Protobuf transcoding)</text>
|
||||||
|
<text x="100" y="416">② T3 fan-in 배치·버퍼링 (Stream Aggregation)</text>
|
||||||
|
<text x="100" y="434">③ Resume Token 발급 (단절-재접속 이어받기)</text>
|
||||||
|
<text x="100" y="452">④ 디바이스 인증 중계 (T3 SVID 검증 → T1 mTLS)</text>
|
||||||
|
<text x="700" y="398">⑤ Trace fan-out (T3 segment를 T1 OTel로 전파)</text>
|
||||||
|
<text x="700" y="416">⑥ 메트릭·관측 (Prometheus exporter → OTel Collector)</text>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(880,315)">
|
||||||
|
<rect x="0" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="27" y="25" text-anchor="middle" font-size="10" fill="#00838f">추론</text>
|
||||||
|
<rect x="60" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="87" y="25" text-anchor="middle" font-size="10" fill="#00838f">제어</text>
|
||||||
|
<rect x="120" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="147" y="25" text-anchor="middle" font-size="10" fill="#00838f">GW</text>
|
||||||
|
<rect x="180" y="0" width="55" height="40" rx="3" fill="#fff" stroke="#00838f"/>
|
||||||
|
<text x="207" y="25" text-anchor="middle" font-size="10" fill="#00838f">5G MEC</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Communication Channel T2<->T3 -->
|
||||||
|
<rect x="60" y="470" width="1080" height="80" rx="6" fill="#fff" stroke="#bf360c" stroke-dasharray="6,4" stroke-width="2"/>
|
||||||
|
<text x="600" y="500" text-anchor="middle" font-size="14" font-weight="700" fill="#bf360c">T2 ↔ T3 Communication Channel (tier-최적 혼합)</text>
|
||||||
|
<text x="600" y="525" text-anchor="middle" font-size="12" fill="#102a43">MQTT 5.0 (low-power MCU) · CoAP (constrained) · gRPC-Lite/nanopb (고성능 임베디드) · C-V2X (차량) · BLE (웨어러블)</text>
|
||||||
|
<line x1="600" y1="460" x2="600" y2="470" stroke="#37474f" stroke-width="2.5" marker-end="url(#arr)"/>
|
||||||
|
<line x1="600" y1="550" x2="600" y2="560" stroke="#37474f" stroke-width="2.5" marker-end="url(#arr)"/>
|
||||||
|
|
||||||
|
<!-- T3 Field -->
|
||||||
|
<rect x="60" y="560" width="1080" height="170" rx="10" fill="#fff3e0" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="90" y="595" font-size="15" font-weight="700" fill="#bf360c">T3 — Field Devices (tier-최적 프로토콜 매핑)</text>
|
||||||
|
<g font-size="11" fill="#102a43">
|
||||||
|
<text x="100" y="618"><tspan font-weight="600">저전력 MCU (LoRa/Wi-SUN):</tspan> MQTT 5.0 (Pub/Sub, QoS 0/1/2, Last Will) — 빌딩 센서·PV 인버터</text>
|
||||||
|
<text x="100" y="638"><tspan font-weight="600">제약 디바이스 (6LoWPAN):</tspan> CoAP (Confirmable, Observe) — 진동·환경 센서</text>
|
||||||
|
<text x="100" y="658"><tspan font-weight="600">고성능 임베디드 (리눅스):</tspan> gRPC-Lite (nanopb) — AGV·협동로봇·CCTV</text>
|
||||||
|
<text x="100" y="678"><tspan font-weight="600">차량 (5G/C-V2X):</tspan> C-V2X/ITS-G5 (CAM/DENM) — 10ms 안전 메시지</text>
|
||||||
|
<text x="100" y="698"><tspan font-weight="600">웨어러블/헬스:</tspan> BLE (duty cycle 1%) + MQTT — 배터리 1개월</text>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(880,580)">
|
||||||
|
<rect x="0" y="0" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="27" y="22" text-anchor="middle" font-size="9" fill="#e65100">AGV</text>
|
||||||
|
<rect x="60" y="0" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="87" y="22" text-anchor="middle" font-size="9" fill="#e65100">MCU</text>
|
||||||
|
<rect x="120" y="0" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="147" y="22" text-anchor="middle" font-size="9" fill="#e65100">Sensor</text>
|
||||||
|
<rect x="180" y="0" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="207" y="22" text-anchor="middle" font-size="9" fill="#e65100">Vehicle</text>
|
||||||
|
<rect x="0" y="40" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="27" y="62" text-anchor="middle" font-size="9" fill="#e65100">Robot</text>
|
||||||
|
<rect x="60" y="40" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="87" y="62" text-anchor="middle" font-size="9" fill="#e65100">PV</text>
|
||||||
|
<rect x="120" y="40" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="147" y="62" text-anchor="middle" font-size="9" fill="#e65100">HVAC</text>
|
||||||
|
<rect x="180" y="40" width="55" height="35" rx="3" fill="#fff" stroke="#e65100"/>
|
||||||
|
<text x="207" y="62" text-anchor="middle" font-size="9" fill="#e65100">Wearable</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Annotation: gRPC active scope -->
|
||||||
|
<text x="600" y="755" text-anchor="middle" font-size="11" font-style="italic" fill="#486581">gRPC의 활성 영역: T1↔T2 백본, T2↔T2 엣지-로컬 합의, T1→T2 모델 Streaming · T2→T3 일부(고성능 임베디드) — 나머지 T3는 tier-최적 프로토콜 혼용</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 8.2 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 600" font-family="Helvetica, Arial, sans-serif">
|
||||||
|
<defs>
|
||||||
|
<marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<text x="550" y="32" text-anchor="middle" font-size="20" font-weight="700" fill="#102a43">gRPC 4대 RPC 모드 ↔ 엣지 AIoT 시나리오 매핑</text>
|
||||||
|
<text x="550" y="55" text-anchor="middle" font-size="13" fill="#486581">통신 계층의 1급 시민인 4가지 모드를 MAS 상호작용에 1:1 매핑</text>
|
||||||
|
|
||||||
|
<!-- Unary -->
|
||||||
|
<g>
|
||||||
|
<rect x="60" y="80" width="500" height="220" rx="10" fill="#f1f8ff" stroke="#1976d2" stroke-width="2"/>
|
||||||
|
<text x="80" y="110" font-size="15" font-weight="700" fill="#0d47a1">① Unary RPC</text>
|
||||||
|
<text x="80" y="132" font-size="12" font-style="italic" fill="#486581">단일 요청 — 단일 응답</text>
|
||||||
|
<!-- diagram -->
|
||||||
|
<circle cx="140" cy="200" r="22" fill="#bbdefb" stroke="#1976d2" stroke-width="2"/>
|
||||||
|
<text x="140" y="204" text-anchor="middle" font-size="10" fill="#0d47a1">T1</text>
|
||||||
|
<circle cx="450" cy="200" r="22" fill="#ffe0b2" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="450" y="204" text-anchor="middle" font-size="10" fill="#bf360c">T3</text>
|
||||||
|
<line x1="165" y1="200" x2="425" y2="200" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="425" y1="215" x2="165" y2="215" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="295" y="194" text-anchor="middle" font-size="10" fill="#0d47a1">① Req</text>
|
||||||
|
<text x="295" y="234" text-anchor="middle" font-size="10" fill="#bf360c">① Resp</text>
|
||||||
|
<text x="80" y="260" font-size="11" fill="#102a43"><tspan font-weight="600">사례:</tspan> OTA 명령, 상태 조회, 설정 변경</text>
|
||||||
|
<text x="80" y="280" font-size="11" fill="#486581">gRPC Service Config의 지수 백오프 Retry Policy 내장</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Server Streaming -->
|
||||||
|
<g>
|
||||||
|
<rect x="580" y="80" width="500" height="220" rx="10" fill="#f1f8ff" stroke="#1976d2" stroke-width="2"/>
|
||||||
|
<text x="600" y="110" font-size="15" font-weight="700" fill="#0d47a1">② Server Streaming RPC</text>
|
||||||
|
<text x="600" y="132" font-size="12" font-style="italic" fill="#486581">단일 요청 — 지속 응답</text>
|
||||||
|
<circle cx="640" cy="200" r="22" fill="#e0f7fa" stroke="#00838f" stroke-width="2"/>
|
||||||
|
<text x="640" y="204" text-anchor="middle" font-size="10" fill="#006064">T1</text>
|
||||||
|
<circle cx="1000" cy="200" r="22" fill="#e0f7fa" stroke="#00838f" stroke-width="2"/>
|
||||||
|
<text x="1000" y="204" text-anchor="middle" font-size="10" fill="#006064">T2</text>
|
||||||
|
<line x1="665" y1="200" x2="975" y2="200" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="820" y="194" text-anchor="middle" font-size="10" fill="#006064">① Req</text>
|
||||||
|
<line x1="975" y1="220" x2="665" y2="220" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="975" y1="240" x2="665" y2="240" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="975" y1="260" x2="665" y2="260" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="820" y="276" text-anchor="middle" font-size="10" fill="#006064">② Stream (LLM token · telemetry)</text>
|
||||||
|
<text x="600" y="290" font-size="11" fill="#102a43"><tspan font-weight="600">사례:</tspan> T1→T2 LLM 토큰 스트리밍, 모델 업데이트</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Client Streaming -->
|
||||||
|
<g>
|
||||||
|
<rect x="60" y="320" width="500" height="220" rx="10" fill="#fff3e0" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="80" y="350" font-size="15" font-weight="700" fill="#bf360c">③ Client Streaming RPC</text>
|
||||||
|
<text x="80" y="372" font-size="12" font-style="italic" fill="#486581">지속 요청 — 단일 응답</text>
|
||||||
|
<circle cx="140" cy="440" r="22" fill="#e0f7fa" stroke="#00838f" stroke-width="2"/>
|
||||||
|
<text x="140" y="444" text-anchor="middle" font-size="10" fill="#006064">T2</text>
|
||||||
|
<circle cx="450" cy="440" r="22" fill="#ffe0b2" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="450" y="444" text-anchor="middle" font-size="10" fill="#bf360c">T3 (×N)</text>
|
||||||
|
<line x1="165" y1="430" x2="425" y2="430" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="165" y1="445" x2="425" y2="445" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="165" y1="460" x2="425" y2="460" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="165" y1="475" x2="425" y2="475" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="295" y="422" text-anchor="middle" font-size="10" fill="#bf360c">① Telemetry chunks</text>
|
||||||
|
<line x1="425" y1="500" x2="165" y2="500" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="295" y="518" text-anchor="middle" font-size="10" fill="#006064">② Summarized Resp</text>
|
||||||
|
<text x="80" y="540" font-size="11" fill="#102a43"><tspan font-weight="600">사례:</tspan> T3 다수 센서 배치 업로드, OTA 펌웨어 청크</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Bidi -->
|
||||||
|
<g>
|
||||||
|
<rect x="580" y="320" width="500" height="220" rx="10" fill="#fff3e0" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="600" y="350" font-size="15" font-weight="700" fill="#bf360c">④ Bidirectional Streaming RPC</text>
|
||||||
|
<text x="600" y="372" font-size="12" font-style="italic" fill="#486581">지속 요청 — 지속 응답</text>
|
||||||
|
<circle cx="640" cy="440" r="22" fill="#ffe0b2" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="640" y="444" text-anchor="middle" font-size="10" fill="#bf360c">T2</text>
|
||||||
|
<circle cx="1000" cy="440" r="22" fill="#ffe0b2" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="1000" y="444" text-anchor="middle" font-size="10" fill="#bf360c">T3</text>
|
||||||
|
<line x1="665" y1="430" x2="975" y2="430" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="975" y1="445" x2="665" y2="445" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="665" y1="460" x2="975" y2="460" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="975" y1="475" x2="665" y2="475" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="820" y="416" text-anchor="middle" font-size="10" fill="#bf360c">① Negotiation · State</text>
|
||||||
|
<text x="820" y="500" text-anchor="middle" font-size="10" fill="#bf360c">② Continues…</text>
|
||||||
|
<text x="600" y="520" font-size="11" fill="#102a43"><tspan font-weight="600">사례:</tspan> T2↔T2 엣지 합의, T3↔T2 AGV/차량 V2X 실시간 협업</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<text x="550" y="575" text-anchor="middle" font-size="11" font-style="italic" fill="#486581">HTTP/2 Flow Control(백프레셔) + Deadline + Resume Token이 모든 모드의 단절·핸드오버 내성을 보장</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 6.8 KiB |
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 680" font-family="Helvetica, Arial, sans-serif">
|
||||||
|
<defs>
|
||||||
|
<marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
<linearGradient id="g1" x1="0" x2="0" y1="0" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#fff3e0"/>
|
||||||
|
<stop offset="100%" stop-color="#ffe0b2"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="g2" x1="0" x2="0" y1="0" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#e0f7fa"/>
|
||||||
|
<stop offset="100%" stop-color="#b2ebf2"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<text x="600" y="32" text-anchor="middle" font-size="20" font-weight="700" fill="#102a43">2계층 통신 제어 (2-Layer Governance)</text>
|
||||||
|
<text x="600" y="55" text-anchor="middle" font-size="13" fill="#486581">인프라(Service Mesh) + 애플리케이션(gRPC Interceptor) 관심사 분리</text>
|
||||||
|
|
||||||
|
<!-- Request inflow arrow -->
|
||||||
|
<text x="40" y="120" font-size="13" font-weight="700" fill="#102a43">Request</text>
|
||||||
|
<text x="40" y="138" font-size="13" font-weight="700" fill="#102a43">Inflow</text>
|
||||||
|
<line x1="100" y1="125" x2="540" y2="125" stroke="#37474f" stroke-width="3" marker-end="url(#arr)"/>
|
||||||
|
|
||||||
|
<!-- Layer 1: Service Mesh -->
|
||||||
|
<rect x="120" y="160" width="960" height="160" rx="10" fill="url(#g1)" stroke="#e65100" stroke-width="2"/>
|
||||||
|
<text x="150" y="195" font-size="16" font-weight="700" fill="#bf360c">1계층 — Service Mesh (Envoy Proxy · Infrastructure)</text>
|
||||||
|
<text x="150" y="222" font-size="12" fill="#102a43">인프라 트래픽 수송 통제 및 전송 레벨 신뢰 체계 구축</text>
|
||||||
|
<g font-size="12" fill="#102a43">
|
||||||
|
<text x="150" y="252">▸ <tspan font-weight="600">mTLS 종단</tspan> (SPIFFE SVID 검증)</text>
|
||||||
|
<text x="150" y="274">▸ <tspan font-weight="600">카나리 / 블루-그린</tspan> 라우팅</text>
|
||||||
|
<text x="150" y="296">▸ <tspan font-weight="600">서킷 브레이커</tspan> (에이전트 다운 시 차단)</text>
|
||||||
|
<text x="640" y="252">▸ <tspan font-weight="600">글로벌 Rate Limiting</tspan> (Envoy + RLS)</text>
|
||||||
|
<text x="640" y="274">▸ <tspan font-weight="600">xDS Light</tspan>로 T2 게이트웨이에 정책 push</text>
|
||||||
|
<text x="640" y="296">▸ <tspan font-weight="600">Load Balancing</tspan> (eBPF / XDS)</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Vertical arrow -->
|
||||||
|
<line x1="600" y1="320" x2="600" y2="355" stroke="#37474f" stroke-width="2.5" marker-end="url(#arr)"/>
|
||||||
|
<text x="615" y="345" font-size="11" fill="#486581">to Pod / Local Container Loopback</text>
|
||||||
|
|
||||||
|
<!-- Layer 2: Interceptor -->
|
||||||
|
<rect x="120" y="365" width="960" height="160" rx="10" fill="url(#g2)" stroke="#00838f" stroke-width="2"/>
|
||||||
|
<text x="150" y="400" font-size="16" font-weight="700" fill="#006064">2계층 — gRPC Interceptor (Application · Business Logic)</text>
|
||||||
|
<text x="150" y="427" font-size="12" fill="#102a43">비즈니스 내부 및 데이터 페이로드 검증</text>
|
||||||
|
<g font-size="12" fill="#102a43">
|
||||||
|
<text x="150" y="457">▸ <tspan font-weight="600">Payload Validation</tspan> (프롬프트 인젝션 필터)</text>
|
||||||
|
<text x="150" y="479">▸ <tspan font-weight="600">디바이스 컨텍스트 전파</tspan> (battery, link-quality)</text>
|
||||||
|
<text x="150" y="501">▸ <tspan font-weight="600">비즈니스 AuthZ</tspan> (테넌트 Claims 검증)</text>
|
||||||
|
<text x="640" y="457">▸ <tspan font-weight="600">Resume Token 발급</tspan> (단절-재접속 이어받기)</text>
|
||||||
|
<text x="640" y="479">▸ <tspan font-weight="600">W3C Traceparent</tspan> 주입·전파</text>
|
||||||
|
<text x="640" y="501">▸ <tspan font-weight="600">Deadline 강제 주입</tspan></text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Vertical arrow -->
|
||||||
|
<line x1="600" y1="525" x2="600" y2="560" stroke="#37474f" stroke-width="2.5" marker-end="url(#arr)"/>
|
||||||
|
|
||||||
|
<!-- Destination -->
|
||||||
|
<rect x="450" y="565" width="300" height="50" rx="8" fill="#102a43"/>
|
||||||
|
<text x="600" y="595" text-anchor="middle" font-size="15" font-weight="700" fill="#fff">Agent Core Code (Python / Go / Rust)</text>
|
||||||
|
|
||||||
|
<!-- Right side annotation -->
|
||||||
|
<text x="1100" y="200" text-anchor="end" font-size="11" font-style="italic" fill="#bf360c">infra-team owned</text>
|
||||||
|
<text x="1100" y="405" text-anchor="end" font-size="11" font-style="italic" fill="#006064">app-team owned</text>
|
||||||
|
<text x="1100" y="595" text-anchor="end" font-size="11" font-style="italic" fill="#102a43">agent owner</text>
|
||||||
|
|
||||||
|
<!-- bottom note -->
|
||||||
|
<text x="600" y="650" text-anchor="middle" font-size="11" font-style="italic" fill="#486581">관심사 분리로 인프라 변경 없이 비즈니스 정책 진화, 그 반대도 가능 (Decoupling)</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 600" font-family="Helvetica, Arial, sans-serif">
|
||||||
|
<defs>
|
||||||
|
<marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#37474f"/>
|
||||||
|
</marker>
|
||||||
|
<marker id="arrRed" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#c62828"/>
|
||||||
|
</marker>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<text x="550" y="32" text-anchor="middle" font-size="20" font-weight="700" fill="#102a43">Resume Token 시퀀스 — 단절-재접속 이어받기</text>
|
||||||
|
<text x="550" y="55" text-anchor="middle" font-size="13" fill="#486581">T3 디바이스 또는 T2 게이트웨이의 일시 단절 시, gRPC 스트리밍 위치 보존</text>
|
||||||
|
|
||||||
|
<!-- Lanes -->
|
||||||
|
<line x1="180" y1="100" x2="180" y2="540" stroke="#9e9e9e" stroke-width="1.5" stroke-dasharray="4,3"/>
|
||||||
|
<line x1="500" y1="100" x2="500" y2="540" stroke="#9e9e9e" stroke-width="1.5" stroke-dasharray="4,3"/>
|
||||||
|
<line x1="820" y1="100" x2="820" y2="540" stroke="#9e9e9e" stroke-width="1.5" stroke-dasharray="4,3"/>
|
||||||
|
|
||||||
|
<!-- Lane labels -->
|
||||||
|
<rect x="60" y="85" width="120" height="40" rx="6" fill="#fff3e0" stroke="#e65100"/>
|
||||||
|
<text x="120" y="110" text-anchor="middle" font-size="13" font-weight="700" fill="#bf360c">T3 Device</text>
|
||||||
|
<rect x="380" y="85" width="120" height="40" rx="6" fill="#e0f7fa" stroke="#00838f"/>
|
||||||
|
<text x="440" y="110" text-anchor="middle" font-size="13" font-weight="700" fill="#006064">T2 Gateway</text>
|
||||||
|
<rect x="700" y="85" width="120" height="40" rx="6" fill="#e3f2fd" stroke="#1976d2"/>
|
||||||
|
<text x="760" y="110" text-anchor="middle" font-size="13" font-weight="700" fill="#0d47a1">T1 Server</text>
|
||||||
|
|
||||||
|
<!-- 1. Start streaming -->
|
||||||
|
<text x="40" y="160" font-size="12" font-weight="700" fill="#102a43">① Start</text>
|
||||||
|
<line x1="500" y1="160" x2="820" y2="160" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="660" y="155" text-anchor="middle" font-size="11" fill="#006064">StartStream(token=null)</text>
|
||||||
|
|
||||||
|
<!-- 2. Server streams data -->
|
||||||
|
<text x="40" y="200" font-size="12" font-weight="700" fill="#102a43">② Stream</text>
|
||||||
|
<line x1="820" y1="200" x2="180" y2="200" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="500" y="195" text-anchor="middle" font-size="11" fill="#0d47a1">Data[1..1000] (Protobuf streaming)</text>
|
||||||
|
|
||||||
|
<line x1="820" y1="230" x2="180" y2="230" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="820" y1="260" x2="180" y2="260" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="500" y="278" text-anchor="middle" font-size="11" fill="#0d47a1">Data[1001..2000] ...</text>
|
||||||
|
|
||||||
|
<!-- 3. Network disruption -->
|
||||||
|
<text x="40" y="320" font-size="12" font-weight="700" fill="#c62828">③ Disrupt</text>
|
||||||
|
<line x1="180" y1="305" x2="820" y2="305" stroke="#c62828" stroke-width="3" stroke-dasharray="8,4" marker-end="url(#arrRed)"/>
|
||||||
|
<text x="500" y="298" text-anchor="middle" font-size="11" font-weight="700" fill="#c62828">⚠ Network Disconnected (Wi-Fi/5G handover)</text>
|
||||||
|
|
||||||
|
<text x="40" y="345" font-size="12" font-weight="700" fill="#102a43">④ Cache</text>
|
||||||
|
<text x="500" y="345" font-size="11" fill="#006064">T2: 큐잉 + 마지막 Token = "TKN@2000" 저장</text>
|
||||||
|
<text x="500" y="365" font-size="11" fill="#006064">T3: 오프라인 큐 + Resume Token 보관</text>
|
||||||
|
|
||||||
|
<!-- 5. Reconnect with token -->
|
||||||
|
<text x="40" y="410" font-size="12" font-weight="700" fill="#102a43">⑤ Reconnect</text>
|
||||||
|
<line x1="180" y1="410" x2="820" y2="410" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="500" y="405" text-anchor="middle" font-size="11" fill="#bf360c">StartStream(token="TKN@2000") via metadata</text>
|
||||||
|
|
||||||
|
<!-- 6. Resume from 2001 -->
|
||||||
|
<text x="40" y="450" font-size="12" font-weight="700" fill="#102a43">⑥ Resume</text>
|
||||||
|
<line x1="820" y1="450" x2="180" y2="450" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<line x1="820" y1="480" x2="180" y2="480" stroke="#37474f" stroke-width="2" marker-end="url(#arr)"/>
|
||||||
|
<text x="500" y="445" text-anchor="middle" font-size="11" fill="#0d47a1">Data[2001..3000] (이어서 전송)</text>
|
||||||
|
<text x="500" y="475" text-anchor="middle" font-size="11" fill="#0d47a1">Data[3001..4000] ...</text>
|
||||||
|
|
||||||
|
<!-- 7. Trace continues -->
|
||||||
|
<text x="40" y="520" font-size="12" font-weight="700" fill="#102a43">⑦ Trace</text>
|
||||||
|
<text x="500" y="520" font-size="11" fill="#486581">단절-재접속에도 W3C traceparent가 Token에 임베드되어 trace 연속성 유지</text>
|
||||||
|
|
||||||
|
<!-- bottom note -->
|
||||||
|
<text x="550" y="565" text-anchor="middle" font-size="11" font-style="italic" fill="#486581">구현: gRPC ClientInterceptor에서 Resume Token을 Metadata 헤더에 자동 주입·추출</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 460" font-family="Helvetica, Arial, sans-serif">
|
||||||
|
<text x="500" y="30" text-anchor="middle" font-size="18" font-weight="700" fill="#102a43">gRPC vs REST 정량 비교 — 엣지 AIoT 무선 구간</text>
|
||||||
|
<text x="500" y="52" text-anchor="middle" font-size="12" fill="#486581">예시적 추정치 (Illustrative Estimates). 페이로드 복잡도·라이브러리·런타임에 따라 변동</text>
|
||||||
|
|
||||||
|
<!-- Left chart: Payload size -->
|
||||||
|
<g>
|
||||||
|
<text x="60" y="100" font-size="14" font-weight="700" fill="#102a43">① 페이로드 크기 (단일 메시지)</text>
|
||||||
|
<text x="60" y="120" font-size="11" fill="#486581">작을수록 무선 대역폭 절약</text>
|
||||||
|
|
||||||
|
<rect x="60" y="140" width="180" height="36" fill="#1976d2"/>
|
||||||
|
<text x="250" y="163" font-size="12" font-weight="600" fill="#102a43">JSON 450 B (100%)</text>
|
||||||
|
|
||||||
|
<rect x="60" y="190" width="37" height="36" fill="#00838f"/>
|
||||||
|
<text x="107" y="213" font-size="12" font-weight="600" fill="#102a43">Protobuf 92 B (20%)</text>
|
||||||
|
<text x="250" y="213" font-size="11" fill="#00838f" font-weight="600">▼ 80% 대역폭 절감</text>
|
||||||
|
|
||||||
|
<line x1="60" y1="245" x2="500" y2="245" stroke="#9e9e9e" stroke-width="1"/>
|
||||||
|
<text x="60" y="265" font-size="10" fill="#486581">0 B</text>
|
||||||
|
<text x="500" y="265" font-size="10" fill="#486581" text-anchor="end">500 B</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Right chart: CPU parsing -->
|
||||||
|
<g>
|
||||||
|
<text x="560" y="100" font-size="14" font-weight="700" fill="#102a43">② 10,000 메시지 파싱 CPU</text>
|
||||||
|
<text x="560" y="120" font-size="11" fill="#486581">짧을수록 ms 단위 핑퐁 유리</text>
|
||||||
|
|
||||||
|
<rect x="560" y="140" width="380" height="36" fill="#1976d2"/>
|
||||||
|
<text x="950" y="163" text-anchor="end" font-size="12" font-weight="600" fill="#fff">JSON ~500 ms (100%)</text>
|
||||||
|
|
||||||
|
<rect x="560" y="190" width="34" height="36" fill="#00838f"/>
|
||||||
|
<text x="604" y="213" font-size="12" font-weight="600" fill="#102a43">Protobuf ~45 ms (9%)</text>
|
||||||
|
<text x="950" y="213" text-anchor="end" font-size="11" fill="#00838f" font-weight="600">▼ ×11 CPU 효율</text>
|
||||||
|
|
||||||
|
<line x1="560" y1="245" x2="950" y2="245" stroke="#9e9e9e" stroke-width="1"/>
|
||||||
|
<text x="560" y="265" font-size="10" fill="#486581">0 ms</text>
|
||||||
|
<text x="950" y="265" font-size="10" fill="#486581" text-anchor="end">500 ms</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Implication panel -->
|
||||||
|
<rect x="60" y="300" width="890" height="130" rx="8" fill="#f1f8ff" stroke="#1976d2" stroke-width="1.5"/>
|
||||||
|
<text x="80" y="328" font-size="13" font-weight="700" fill="#0d47a1">엣지 AIoT 환경에서의 함의 (Implications)</text>
|
||||||
|
<g font-size="11" fill="#102a43">
|
||||||
|
<text x="80" y="350">▸ <tspan font-weight="600">무선 구간 비용·지연 절감</tspan>: LoRa·BLE·저전력 Wi-Fi 구간에서 페이로드 80% 감소는 배터리 수명·전력 예산에 직결</text>
|
||||||
|
<text x="80" y="370">▸ <tspan font-weight="600">ms 단위 핑퐁 누적 해소</tspan>: 사례 ① AGV 합의처럼 초당 수십~수백 회의 RPC가 필요한 환경에서 ×11 CPU 효율은 필수</text>
|
||||||
|
<text x="80" y="390">▸ <tspan font-weight="600">단, 임베디드 제약</tspan>: 8-bit MCU·저전력 디바이스는 Protobuf 라이브러리 자체가 부담 → gRPC-Lite/nanopb 또는 T2 변환 게이트웨이 사용</text>
|
||||||
|
<text x="80" y="410">▸ <tspan font-weight="600">타입 안전성</tspan>: Protobuf의 컴파일 단계 검증은 컴파일-배포 주기가 긴 임베디드에서도 빌드-시-에러를 보장</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 618 KiB |
|
After Width: | Height: | Size: 439 KiB |
|
After Width: | Height: | Size: 614 KiB |
@@ -0,0 +1,211 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# ==============================================================================
|
||||||
|
# remove.sh — Multi-Agent Mux (MAM) Orchestration Uninstaller
|
||||||
|
# ==============================================================================
|
||||||
|
# Safely removes MAM orchestration skills, virtual environment, and metadata.
|
||||||
|
# Leaves pre-existing user configurations and files untouched by reading
|
||||||
|
# the installation manifest (.mam/install_manifest.txt).
|
||||||
|
# ==============================================================================
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
TARGET_DIR=""
|
||||||
|
FORCE=0
|
||||||
|
PURGE_ENV=0
|
||||||
|
|
||||||
|
# Parse arguments
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
-y|--yes|--force)
|
||||||
|
FORCE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--purge-env)
|
||||||
|
PURGE_ENV=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
TARGET_DIR="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$TARGET_DIR" ]; then
|
||||||
|
TARGET_DIR="$(pwd)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "===================================================================="
|
||||||
|
echo "⚡ Starting Multi-Agent Mux (MAM) Uninstallation"
|
||||||
|
echo "📂 Target Workspace: $TARGET_DIR"
|
||||||
|
echo "===================================================================="
|
||||||
|
|
||||||
|
if [ ! -d "$TARGET_DIR" ]; then
|
||||||
|
echo "❌ Error: Target directory '$TARGET_DIR' does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$TARGET_DIR"
|
||||||
|
|
||||||
|
# 1. Non-interactive input safety guard (set -e read crash prevention)
|
||||||
|
if [ ! -t 0 ] && [ $FORCE -eq 0 ]; then
|
||||||
|
echo "❌ Error: Non-interactive terminal detected. Please run with -y/--yes/--force." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if there is anything to remove
|
||||||
|
MANIFEST_FILE=".mam/install_manifest.txt"
|
||||||
|
any_exist=0
|
||||||
|
manifest_files=()
|
||||||
|
|
||||||
|
# Load the install manifest if it exists
|
||||||
|
if [ -f "$MANIFEST_FILE" ]; then
|
||||||
|
any_exist=1
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [ -n "$line" ]; then
|
||||||
|
manifest_files+=("$line")
|
||||||
|
fi
|
||||||
|
done < "$MANIFEST_FILE"
|
||||||
|
else
|
||||||
|
# Fallback to the core MAM directories to check if any exist
|
||||||
|
fallback_assets=(
|
||||||
|
".agents/skills/lib.sh"
|
||||||
|
".agents/skills/multi-agent-mux-create"
|
||||||
|
".agents/skills/multi-agent-mux-delegate-job"
|
||||||
|
".agents/skills/multi-agent-mux-monitor"
|
||||||
|
".agents/skills/multi-agent-mux-resume"
|
||||||
|
".agents/skills/multi-agent-mux-status"
|
||||||
|
".agents/skills/multi-agent-mux-stop"
|
||||||
|
".venv"
|
||||||
|
".mam"
|
||||||
|
)
|
||||||
|
for asset in "${fallback_assets[@]}"; do
|
||||||
|
if [ -e "$asset" ] || [ -h "$asset" ]; then
|
||||||
|
any_exist=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $any_exist -eq 0 ]; then
|
||||||
|
echo "ℹ️ No MAM assets detected in '$TARGET_DIR'. Nothing to do."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Request confirmation if not forced
|
||||||
|
if [ $FORCE -eq 0 ]; then
|
||||||
|
echo "⚠️ WARNING: This will permanently remove the MAM orchestration skills, "
|
||||||
|
echo " virtual environment (.venv), local metadata (.mam), and docs."
|
||||||
|
echo " (Your own custom files inside .agents/ will NOT be touched)."
|
||||||
|
|
||||||
|
if ! read -p "❓ Are you sure you want to proceed? [y/N]: " -r response; then
|
||||||
|
response="n"
|
||||||
|
fi
|
||||||
|
if [[ ! "$response" =~ ^[yY](es)?$ ]]; then
|
||||||
|
echo "❌ Uninstallation cancelled by user."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
delete_asset() {
|
||||||
|
local asset="$1"
|
||||||
|
if [ -e "$asset" ] || [ -h "$asset" ]; then
|
||||||
|
echo "🗑️ Removing: $asset"
|
||||||
|
rm -rf "$asset"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# 2. Uninstall files using the manifest if present
|
||||||
|
if [ ${#manifest_files[@]} -gt 0 ]; then
|
||||||
|
echo "📜 Manifest found. Reversing installer-created files..."
|
||||||
|
for f in ${manifest_files[@]+"${manifest_files[@]}"}; do
|
||||||
|
# Skip .env and remove.sh for now, they are handled separately
|
||||||
|
if [ "$f" = ".env" ] || [ "$f" = "remove.sh" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
delete_asset "$f"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
# Fallback: Delete MAM skills manually (only if manifest is missing)
|
||||||
|
echo "⚠️ No manifest found. Deleting standard MAM skills..."
|
||||||
|
delete_asset ".agents/skills/lib.sh"
|
||||||
|
delete_asset ".agents/skills/multi-agent-mux-create"
|
||||||
|
delete_asset ".agents/skills/multi-agent-mux-delegate-job"
|
||||||
|
delete_asset ".agents/skills/multi-agent-mux-monitor"
|
||||||
|
delete_asset ".agents/skills/multi-agent-mux-resume"
|
||||||
|
delete_asset ".agents/skills/multi-agent-mux-status"
|
||||||
|
delete_asset ".agents/skills/multi-agent-mux-stop"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Clean up empty parent directories under .agents recursively to avoid littering
|
||||||
|
if [ -d ".agents" ]; then
|
||||||
|
find .agents -depth -type d -exec rmdir {} + 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. Remove virtual environment, monitor cache, and metadata database
|
||||||
|
delete_asset ".venv"
|
||||||
|
delete_asset ".cache/multi-agent-mux-monitor"
|
||||||
|
delete_asset ".mam" # Deletes manifest file too
|
||||||
|
|
||||||
|
# 5. Clean up .env file (Only if created by installer, or forced with --purge-env)
|
||||||
|
# If .env is in manifest, it means MAM created it.
|
||||||
|
env_created_by_mam=0
|
||||||
|
for f in ${manifest_files[@]+"${manifest_files[@]}"}; do
|
||||||
|
if [ "$f" = ".env" ]; then
|
||||||
|
env_created_by_mam=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -f ".env" ]; then
|
||||||
|
should_delete_env=0
|
||||||
|
if [ $PURGE_ENV -eq 1 ]; then
|
||||||
|
should_delete_env=1
|
||||||
|
elif [ $env_created_by_mam -eq 1 ]; then
|
||||||
|
# Even if MAM created it, ask or rename to backup to prevent loss of custom secrets
|
||||||
|
if [ $FORCE -eq 1 ]; then
|
||||||
|
should_delete_env=1
|
||||||
|
else
|
||||||
|
if ! read -p "❓ MAM-created '.env' found. Delete it? (Saying No preserves it) [y/N]: " -r env_response; then
|
||||||
|
env_response="n"
|
||||||
|
fi
|
||||||
|
if [[ "$env_response" =~ ^[yY](es)?$ ]]; then
|
||||||
|
should_delete_env=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $should_delete_env -eq 1 ]; then
|
||||||
|
delete_asset ".env"
|
||||||
|
else
|
||||||
|
if [ $env_created_by_mam -eq 1 ]; then
|
||||||
|
backup_name=".env.mam-backup"
|
||||||
|
if [ -e "$backup_name" ]; then
|
||||||
|
backup_name=".env.mam-backup.$(date +%Y%m%d%H%M%S)"
|
||||||
|
fi
|
||||||
|
echo "💾 Backing up .env configuration to $backup_name..."
|
||||||
|
mv ".env" "$backup_name"
|
||||||
|
else
|
||||||
|
echo "ℹ️ Preserving user-owned .env configuration."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. Remove uninstaller file itself (if we are in the target root)
|
||||||
|
# Simple check: only delete remove.sh if it is recorded in the manifest
|
||||||
|
remove_in_manifest=0
|
||||||
|
for f in ${manifest_files[@]+"${manifest_files[@]}"}; do
|
||||||
|
if [ "$f" = "remove.sh" ]; then
|
||||||
|
remove_in_manifest=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -f "remove.sh" ] && [ $remove_in_manifest -eq 1 ]; then
|
||||||
|
echo "🗑️ Removing uninstaller: remove.sh"
|
||||||
|
# Self-delete is the final action
|
||||||
|
rm -f "remove.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "===================================================================="
|
||||||
|
echo "🎉 Uninstallation complete!"
|
||||||
|
echo "===================================================================="
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# ==============================================================================
|
||||||
|
# update.sh — Multi-Agent Mux (MAM) Orchestration Updater
|
||||||
|
# ==============================================================================
|
||||||
|
# Safely updates MAM skills, virtual environment, and docs to the latest version.
|
||||||
|
# Preserves user configuration (.env) and local metadata/jobs database (.mam).
|
||||||
|
# ==============================================================================
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
TARGET_DIR=""
|
||||||
|
FORCE=0
|
||||||
|
|
||||||
|
# Parse arguments
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
-y|--yes|--force)
|
||||||
|
FORCE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
TARGET_DIR="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$TARGET_DIR" ]; then
|
||||||
|
TARGET_DIR="$(pwd)"
|
||||||
|
else
|
||||||
|
if [ ! -d "$TARGET_DIR" ]; then
|
||||||
|
echo "❌ Error: Target directory '$TARGET_DIR' does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
TARGET_DIR="$(cd "$TARGET_DIR" && pwd)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "===================================================================="
|
||||||
|
echo "⚡ Starting Multi-Agent Mux (MAM) Update"
|
||||||
|
echo "📂 Target Workspace: $TARGET_DIR"
|
||||||
|
echo "===================================================================="
|
||||||
|
|
||||||
|
cd "$TARGET_DIR"
|
||||||
|
|
||||||
|
# 1. Verification of existing install
|
||||||
|
if [ ! -f "remove.sh" ]; then
|
||||||
|
echo "❌ Error: No MAM installation (remove.sh) found in '$TARGET_DIR'." >&2
|
||||||
|
echo " Please run install.sh first to set up the workspace." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Request confirmation if not forced
|
||||||
|
if [ $FORCE -eq 0 ]; then
|
||||||
|
echo "⚠️ WARNING: This will update MAM orchestration skills, virtual environment, "
|
||||||
|
echo " and docs to the latest version."
|
||||||
|
echo " (Your configuration, job history, and custom skills will be preserved)."
|
||||||
|
if [ ! -t 0 ]; then
|
||||||
|
echo "❌ Error: Non-interactive terminal detected. Please run with -y/--yes/--force." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! read -p "❓ Proceed with update? [y/N]: " -r response; then
|
||||||
|
response="n"
|
||||||
|
fi
|
||||||
|
if [[ ! "$response" =~ ^[yY](es)?$ ]]; then
|
||||||
|
echo "❌ Update cancelled by user."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. Stage backups of user configurations and metadata to prevent deletion
|
||||||
|
echo "💾 Backing up configuration and database..."
|
||||||
|
HAS_ENV=0
|
||||||
|
if [ -f ".env" ]; then
|
||||||
|
HAS_ENV=1
|
||||||
|
mv ".env" ".env.update-tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
HAS_MAM=0
|
||||||
|
if [ -d ".mam" ]; then
|
||||||
|
HAS_MAM=1
|
||||||
|
# Copy database and jobs to temporary backup outside of .mam.
|
||||||
|
# We do NOT move the .mam folder away so that remove.sh can still read .mam/install_manifest.txt!
|
||||||
|
mkdir -p .mam.update-tmp
|
||||||
|
# Copy SQLite databases and session files
|
||||||
|
for db in .mam/agent-sessions.*; do
|
||||||
|
if [ -f "$db" ]; then
|
||||||
|
cp -f "$db" .mam.update-tmp/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Copy jobs history
|
||||||
|
if [ -d ".mam/jobs" ] && [ "$(ls -A .mam/jobs 2>/dev/null)" ]; then
|
||||||
|
mkdir -p .mam.update-tmp/jobs
|
||||||
|
cp -rf .mam/jobs/* .mam.update-tmp/jobs/
|
||||||
|
fi
|
||||||
|
# Copy delegate logs
|
||||||
|
if [ -d ".mam/delegate_job_logs" ] && [ "$(ls -A .mam/delegate_job_logs 2>/dev/null)" ]; then
|
||||||
|
mkdir -p .mam.update-tmp/delegate_job_logs
|
||||||
|
cp -rf .mam/delegate_job_logs/* .mam.update-tmp/delegate_job_logs/
|
||||||
|
fi
|
||||||
|
# Copy manifest so we have a backup
|
||||||
|
if [ -f ".mam/install_manifest.txt" ]; then
|
||||||
|
cp -f .mam/install_manifest.txt .mam.update-tmp/
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Define trap to restore backup files on failure
|
||||||
|
restore_on_failure() {
|
||||||
|
echo "❌ Update failed. Reverting configuration and database to previous state..."
|
||||||
|
if [ $HAS_ENV -eq 1 ] && [ -f ".env.update-tmp" ]; then
|
||||||
|
mv -f ".env.update-tmp" ".env" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if [ $HAS_MAM -eq 1 ] && [ -d ".mam.update-tmp" ]; then
|
||||||
|
# Revert to old database/jobs backup by restoring .mam directory
|
||||||
|
rm -rf .mam 2>/dev/null || true
|
||||||
|
mkdir -p .mam
|
||||||
|
cp -f .mam.update-tmp/agent-sessions.* .mam/ 2>/dev/null || true
|
||||||
|
if [ -d ".mam.update-tmp/jobs" ]; then
|
||||||
|
cp -rf .mam.update-tmp/jobs .mam/ 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if [ -d ".mam.update-tmp/delegate_job_logs" ]; then
|
||||||
|
cp -rf .mam.update-tmp/delegate_job_logs .mam/ 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if [ -f ".mam.update-tmp/install_manifest.txt" ]; then
|
||||||
|
cp -f .mam.update-tmp/install_manifest.txt .mam/ 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
rm -rf .mam.update-tmp 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
trap restore_on_failure EXIT
|
||||||
|
|
||||||
|
# 3. Perform uninstallation of existing files
|
||||||
|
echo "🗑️ Removing existing installation..."
|
||||||
|
# remove.sh will run in manifest mode because .mam/install_manifest.txt is still present.
|
||||||
|
# It will delete .agents/, documents, scripts, .venv, and .mam folder.
|
||||||
|
bash remove.sh --force
|
||||||
|
|
||||||
|
# 4. Fetch and run the latest installer from Gitea
|
||||||
|
echo "📥 Fetching and running the latest installer..."
|
||||||
|
INSTALLER_URL="https://git.godopu.com/tmpl/multi-agent-mux/raw/branch/main/deploy/install.sh"
|
||||||
|
if command -v curl &>/dev/null; then
|
||||||
|
curl -fsSL "$INSTALLER_URL" | bash -s -- "$TARGET_DIR"
|
||||||
|
elif command -v wget &>/dev/null; then
|
||||||
|
wget -qO- "$INSTALLER_URL" | bash -s -- "$TARGET_DIR"
|
||||||
|
else
|
||||||
|
echo "❌ Error: Neither 'curl' nor 'wget' is available to fetch the installer." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Disable failure trap since installation succeeded
|
||||||
|
trap - EXIT
|
||||||
|
|
||||||
|
# 5. Restore backups of configuration and database
|
||||||
|
echo "🔄 Restoring configuration and database..."
|
||||||
|
if [ $HAS_ENV -eq 1 ]; then
|
||||||
|
# Overwrite the default .env created by installer (if any) with the user's backup
|
||||||
|
mv -f ".env.update-tmp" ".env"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $HAS_MAM -eq 1 ]; then
|
||||||
|
if [ -d ".mam.update-tmp" ]; then
|
||||||
|
# The installer created a new .mam directory with a new manifest.
|
||||||
|
# We want to merge the old .mam database/jobs back while keeping the new manifest.
|
||||||
|
for db in .mam.update-tmp/agent-sessions.*; do
|
||||||
|
if [ -f "$db" ]; then
|
||||||
|
cp -f "$db" .mam/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -d ".mam.update-tmp/jobs" ] && [ "$(ls -A .mam.update-tmp/jobs 2>/dev/null)" ]; then
|
||||||
|
mkdir -p .mam/jobs
|
||||||
|
cp -rf .mam.update-tmp/jobs/* .mam/jobs/
|
||||||
|
fi
|
||||||
|
if [ -d ".mam.update-tmp/delegate_job_logs" ] && [ "$(ls -A .mam.update-tmp/delegate_job_logs 2>/dev/null)" ]; then
|
||||||
|
mkdir -p .mam/delegate_job_logs
|
||||||
|
cp -rf .mam.update-tmp/delegate_job_logs/* .mam/delegate_job_logs/
|
||||||
|
fi
|
||||||
|
rm -rf ".mam.update-tmp"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "===================================================================="
|
||||||
|
echo "🎉 Update complete!"
|
||||||
|
echo "===================================================================="
|
||||||