-
Notifications
You must be signed in to change notification settings - Fork 2
Implement behavior services and attack framework for RSU #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tori-da-vi
wants to merge
8
commits into
CAVISE:main
Choose a base branch
from
tori-da-vi:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
af0b3e2
Implement behavior services and attack framework for RSU
tori-da-vi 5c72ca3
text translation
tori-da-vi 1193fc0
add heading
tori-da-vi 564eb9a
changed the file path
tori-da-vi c334fca
Add OpenCDA Service Layer link to navigation
tori-da-vi ebe2b06
Add analysis of neural network architectures for trajectory prediction
tori-da-vi f0e3705
Add article on trajectory planning for autonomous vehicles
tori-da-vi 1a4c505
Add links for Neural Network and AIM Trajectory Planning
tori-da-vi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| OpenCDA Service Layer | ||
| ========== | ||
|
|
||
| Behavior Service Orchestration | ||
| ------------------------------- | ||
|
|
||
| A behavior service system has been introduced for simulation participants, including | ||
| Road-Side Units (RSU) and vehicles. | ||
|
|
||
| The ``BehaviorService`` interface defines the protocol that every service attached to | ||
| a participant must implement. It describes the service lifecycle: | ||
|
|
||
| * ``on_attach`` - initialize the service for a particular participant instance | ||
| * ``process`` - process incoming messages and return a typed result | ||
| * ``on_detach`` - release service resources before the participant is destroyed | ||
|
|
||
| ``BehaviorServiceRegistry`` is a global registry that supports: | ||
|
|
||
| * registration via the ``@BehaviorServiceRegistry.register`` decorator | ||
| * class lookup by service name | ||
| * a ``create_service`` factory method | ||
|
|
||
| The registry automatically discovers and loads built-in services from the ``services/`` | ||
| subpackage. | ||
|
|
||
| A ``DummyService`` has been added for testing purposes. It accepts text messages and | ||
| returns them with an appended suffix, verifying that registration and message routing | ||
| work correctly. | ||
|
|
||
| Both ``RSUManager`` and ``VehicleManager`` have been updated to support service | ||
| configuration and lifecycle management - including config loading from YAML, | ||
| attach/detach handling, and message routing by ``service_id``. This unified the | ||
| service architecture across vehicles and road-side infrastructure. | ||
|
|
||
| AIM Services | ||
| ------------ | ||
|
|
||
| ``AIMModelManager`` has been extracted from the OpenCDA core into the service layer | ||
| to align with the service-based architecture. Three new services were introduced. | ||
|
|
||
| **aim-server** | ||
|
|
||
| The server-side AIM service. It receives a batch of requests from vehicles, | ||
| runs ML inference, and returns predicted trajectories. | ||
|
|
||
| **aim-client** | ||
|
|
||
| The client-side service, running on each vehicle. It builds a request to the server | ||
| with the vehicle's current position, speed, heading, and route. | ||
| Upon receiving a response, it generates a movement command for the ``movement-controller``. | ||
|
|
||
| **movement-controller** | ||
|
|
||
| Accepts movement commands with a target position and controls vehicle motion. | ||
|
|
||
| All inter-service communication is routed through typed ``TransportMessage`` objects, | ||
| eliminating direct dependencies between components. | ||
|
|
||
| Service Priority | ||
| ---------------- | ||
|
|
||
| Priority-aware ordering has been added to the behavior service system. Services are | ||
| now initialized and processed in ascending order of their numeric ``priority`` field - | ||
| a lower value means the service runs first. Priority is configured in the | ||
| scenario YAML file. | ||
|
|
||
| Attack Framework *(Draft)* | ||
| --------------------------- | ||
|
|
||
| A framework for simulating adversarial attacks on simulation participants has been | ||
| introduced. | ||
|
|
||
| Core abstractions: | ||
|
|
||
| * ``AttackProtocol`` - interface for a concrete attack, composed of stages (``AttackStageProtocol``) | ||
| * ``AttackManager`` - orchestrates attacks, manages registries, and collects results | ||
| * ``AttackRegistry`` - registry of registered attacks | ||
| * ``StageRegistry`` - registry of attack stages | ||
| * ``AttackContext`` - execution context passed to an attack at runtime | ||
| * ``AttackResult`` - result produced by a completed attack | ||
|
|
||
| **Capability System** | ||
|
|
||
| A capability binding mechanism (``CapabilityBindings``) has been introduced, linking | ||
| named capabilities (``Capability``) to concrete service methods. This allows attacks | ||
| and external components to interact with a service through a stable interface, | ||
| without knowledge of its internal implementation. | ||
|
|
||
| Supported capabilities: | ||
|
|
||
| * ``request.observe`` - observe incoming requests | ||
| * ``request.submit`` - submit requests | ||
| * ``response.observe`` - observe responses | ||
| * ``response.submit`` - submit responses | ||
| * ``command.submit`` - submit movement commands | ||
| * ``state.observe`` - observe service state | ||
|
|
||
| **BehaviorService Extensions** | ||
|
|
||
| The ``BehaviorService`` protocol has been extended with a ``get_state()`` method that | ||
| returns an immutable snapshot of the current service state. State objects have been | ||
| implemented for the existing services: | ||
|
|
||
| * ``AIMServerState`` - tracked and processed vehicle IDs and counts | ||
| * ``AIMClientState`` - attachment status and next target position | ||
|
|
||
| **Example Attack** | ||
|
|
||
| ``AIMClientResponseSniffer`` has been added as a demonstration attack. It uses a | ||
| ``Sniffer`` stage to intercept AIM server response messages addressed to clients. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove info about DummyService