© 2008 by wind river; made available under the epl v1.0 | 19-nov-2008 tcf the target communication...
DESCRIPTION
3TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008 Cross Development Communication with “target”: Download (of executables) Start/Stop Execution Debugging Tracing Monitoring …TRANSCRIPT
© 2008 by Wind River; made available under the EPL v1.0 | 19-Nov-2008
TCFThe Target Communication Framework
Michael Scharf, Wind Riverwiki.eclipse.org/DSDP/TM/TCF_FAQ
2 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Credits
• Idea: Felix Burton (Wind River), Eugene Tarassov (Wind River)
• Original implementation Eugene Tarassov
3 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Cross Development
• Communication with “target”:• Download (of executables)• Start/Stop Execution• Debugging• Tracing• Monitoring• …
4 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Today: Incompatible Agent Solutions
UI
Target
Tool A Tool B Tool C Tool D
Agent A Agent B Agent C
Value Add B
Value Add CHost P1
P3
P2
5 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Bad for the User
UI
Target
Tool A Tool B Tool C Tool D
Agent A Agent B Agent C
Value Add B
Value Add CHost P1
P3
P2
? ? ?
6 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Bad Design!
UI
Target
Tool A Tool B Tool C Tool D
Agent A Agent B Agent C
Value Add B
Value Add CHost
7 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Limited eco system
• Too many different tools agents and protocols
8 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Design Goals of TCF
• Framework provides common infrastructure communication protocol Agent: “Service container” Proxying
• Tools can use services in uniform way• Service implementers can focus on functionality
9 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF - Core Design Ideas
• Service knows best how to represent the system get information from there and data-drive layers above If not possible, put the knowledge in the lowest possible layer
and data drive the layers above
• Use the same protocol end-to-end allow value-adding servers to intercept select services
• Services as building blocks E.g. target agent, OCD, simulator Avoid tools specific agents
• Support high latency communication links
10 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Service 4
Service 5
TCF: Common agent and protocol
Tool A Tool B Tool C Tool D
TCF Agent
Value Add
UI
Target
Host
Service 1 Service 2 Service 3
11 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Peer is a Communication endpoint
Service 4
Service 5
Tool A Tool B Tool C Tool D
Value Add
UI
Target
Host
Service 1 Service 2 Service 3
TCF Agent
12 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Service
Service 4
Service 5
Tool A Tool B Tool C Tool D
TCF Agent
Value Add
UI
Target
Host
Service 1 Service 2 Service 3
13 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Message Channel
Service 4
Service 5
Tool A Tool B Tool C Tool D
TCF Agent
Value Add
UI
Target
Host
Service 1 Service 2 Service 3
TCF Channel
TCF Channel
14 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Channels and Messages
• Communication between peers use channels• Channels abstract/hide the transport layer
Currently TCP Possible: RS232, JTAG, USB etc
• Channels transmit Messages
15 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF Communication Protocol
• Message A packet of data Transmitted over communication channel
• Multiple channels per peer
• Proxying/Tunneling Message forwarding “Decorator” can intercept communication “Value-add” services (e.g. debug info) No protocol conversion needed
16 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
The TCF Message Types
• Command (send) Request some action on remote peer
• Progress Long running commands may send “progress ticks”
• Result (reply) Remote peer sends one result for each command!
• Event Notify a change
• Flow control prevent congestion
17 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Command
• Command is a message • Sent to remote peer• Remote peer must send one Result for each Command!
18 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Result
• Result is a message Data, Errors
• Sent as a response to a command• Remote peer sends one Result per Command!
19 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Commands are Asynchronous
• Sender of a command returns immediately Fast on high latency connections
• Sender receives results asynchronously
20 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Event
• Event is a message • Notification about state changes
21 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Message order guaranteed on channel
• Keep state of remote peer• Without message ordering no consistent state• Ordering per channel and direction
Command X=1Result
X=1Event
X=2Command X=3
Event X=4
Result X=3
Event X=5
22 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Flow Control
• Prevent congestion
23 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Service 4
Service 5
TCF: Layered View
Tool A Tool B Tool C Tool D
TCF Agent
Value Add
UI
Target
Host
Service 1 Service 2 Service 3
24 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Communication Layers
Channel
Messages
Services
Transport Layer (e.g. TCP/IP)
25 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Transport Layer: Byte Stream
Channel
Messages
?????????????????????????????????????????????
Services
Transport Layer (e.g. TCP/IP)
26 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Channel: Message Stream
Messages
??????????????????????????????????????????Channel
Services
??????????????????????????????????????????????Transport Layer (e.g. TCP/IP)
27 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Messages: Command Result Event Flow
Messages
??????????????????????????????????????????
C 17 SysMonitor getChildren ??????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
28 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Message Type
Messages C 17 SysMonitor getChildren ??????
Message Type
??????????????????????????????????????????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
29 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Token
Messages C 17 SysMonitor getChildren ??????
Token: Channel Unique
To identify Result
??????????????????????????????????????????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
30 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Service Id
Messages C 17 SysMonitor getChildren ??????
Service id
??????????????????????????????????????????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
31 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Command Name
Messages C 17 SysMonitor getChildren ??????
Command name
??????????????????????????????????????????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
32 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Arguments (byte array)
Messages C 17 SysMonitor getChildren ??????
Arguments (byte array)
??????????????????????????????????????????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
33 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Argument Representation: e.g. JSON
Messages
C 17 SysMonitor getChildren [“p123”]
C 17 SysMonitor getChildren ??????
??????????????????????????????????????????
??????????????????????????????????????????????
Channel
Transport Layer (e.g. TCP/IP)
Services
Marshalling: JSON
34 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
getChildren in JavaC 17 SysMonitor getChildren [“p123”]
R 17 [“p124”, “p125”]
35 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
The 5 TCF Messages
Command C • <token> • <service> • <command> • <arguments>
Progress P • <token> • <progress_data>Result R • <token> • <result_data>Event E • <service> • <event> • <event_data> Flow F • <traffic_congestion_level> •
36 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Value-add
Service 4
Service 5
Tool A Tool B Tool C Tool D
TCF Agent
Value Add
UI
Target
Host
Service 1 Service 2 Service 3
37 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Required service: Locator
• Used to discover peers• Peer lifecycle events• When connected peers can list its services
38 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Auto Discovery
• Discovers Peers and Services
• Simplifies setup Client UI can easily find peers and discover services
• TCF comes with a simple UDP auto discovery Other mechanisms possible and optional
39 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Prototype implementation
• Lightweight C-based agent Minimal agent has < 4000 lines of C code Minimal impact on the target
• Eclipse plug-ins Java TCF implementation to access service
40 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF Services
• Run Control Service• Breakpoints Service• Memory Service• Registers Service
• Processes Service• Stack Trace Service• System Monitor Service • File System Service
41 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Use Case: SimpleJtagDevice
• ProtocolTCP/IP
• ServicesService Manager (returns fixed list of services)Debug (run-control, breakpoint, memory access)Possibly Others (flash programming, download,
etc)• No Dynamic Addition or Removal of Services• No Multiplexing (single client)• No Forwarding• No Dynamic Discovery
41
42 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Use Case: TestExceutionAgent
• ProtocolDepends on OS configuration and board
• ServicesService Manager (returns fixed list of services)Process launch and killStandard I/O redirectionFile system access
• No Dynamic Addition or Removal of Services• No Multiplexing (multiple clients)• No Forwarding• No Dynamic Discovery
42
43 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Use Case: LinuxUserModeAgent
• Protocol Typically TCP/IP, but depends on OS configuration and
hardware• Services
Service Manager Debug (run-control, breakpoint, memory access) OS Awareness (process/thread list, CPU utilization, etc) Process launch and kill Standard I/O redirection File system access
• Possibly Dynamic Addition or Removal of Services• Possibly Multiplexing (multiple clients)• Possibly Forwarding• Possibly Dynamic Discovery
43
44 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
RSE sample
• Process service• File service
45 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF Debugging example
46 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Specification Status
• Review of current and specification of additional services in power.org and Eclipse
47 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Links
• TCF source repository http://www.eclipse.org/dsdp/tm/development/tcf-anonymous.psf svn://dev.eclipse.org/svnroot/dsdp/org.eclipse.tm.tcf/trunk http://dev.eclipse.org/viewsvn/index.cgi/org.eclipse.tm.tcf
/?root=DSDP_SVN• FAQ
http://wiki.eclipse.org/DSDP/TM/TCF_FAQ Has links to all Documentation:
Getting Started (less than what we did) Protocol Specification (messages, events, JSON) Services description Agent description
47
48 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
?
49 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
50 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF vs. ECF
• TCF is a Protocol independent of API
• ECF is an API independent of Protocol
51 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF and the OSI Layers
7 Application Layer
6 Presentation Layer
5 Session Layer
4 Transport Layer
3 Network Layer
2 Data Link Layer
1 Physical Layer
Channel + Messages
JSON
Services
52 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
TCF as Layer 3 and 4
7 Application Layer
6 Presentation Layer
5 Session Layer
4 Transport Layer
3 Network Layer
2 Data Link Layer
1 Physical Layer
JSON
Services
Channel + Messages
53 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
54 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Use Case: SimpleJtagDevice
• Debug (run-control, breakpoint, memory register)• Possibly Others (flash programming, download, etc)
55 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Use Case: TestExceutionAgent
• Process launch and kill• Standard I/O redirection• File system access
56 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008
Use Case: LinuxUserModeAgent
• Debug (run-control, breakpoint, memory, register)• OS Awareness (process/thread list, CPU utilization,
etc potentially with value-add)• Process launch and kill• Standard I/O redirection• File system access• Monitoring (event-config, event-log)
57 TCF: The Target Communication Framework | © 2008 Wind River; made available under the EPL v1.0 | Eclipse Summit Europe | Nov 2008