(Slides for a talk given in the journal-first track of the EDOC 2022 conference.)
The combination of the Internet of Things and blockchain-based technologies represents a real opportunity for supply chain and logistics protagonists, who need more dynamic, trustworthy and transparent tracking systems in order to improve their efficiency and strengthen customer confidence. In parallel, hyperconnected logistics promise more efficient and sustainable goods handling and delivery. This chapter shows how the Ethereum blockchain and smart contracts can be used to implement a shareable and secured tracking system for hyperconnected logistics. A simulation using the well-known AnyLogic software tool provides insights on the monitoring of properties depicting shipment lifecycle constraints through a stream of blockchain log events processed by BeepBeep 3, an open source stream processing engine.
17. Physical Internet
Notion introduced by Benoît Montreuil
(Georgia Tech).
" A global hyperconnected logistics system
enabling seamless open asset sharing and flow
consolidation through standardized
encapsulation, modularization, protocols and
interfaces. "
Keynote talk at EDOC 2017
18. Physical Internet
unified set of standard containers
containerized logistics equipment
standard logistics protocols
certified open logistics facilities
global monitoring system
open decisional and transactional
platforms, analytics, optimization and
simulation
certified providers
7 core components:
19. Physical Internet
unified set of standard containers
containerized logistics equipment
standard logistics protocols
certified open logistics facilities
global monitoring system
open decisional and transactional
platforms, analytics, optimization and
simulation
certified providers
7 core components:
20. Hyperconnected Logistics
unit zone ⊂ cell ⊂ area ⊂ region
The world is split into unit zones:
Hubs link elements of each layer:
access hub < local hub < gateway hub
Montreuil et al.,
Proc. IMHRC 2018
21. Some Challenges
No centralized, pre-planned route
No complete view of the "network"
No complete view of any package's history
How to verify compliance to
correctness properties / service
level agreements?
How to perform analytics?
22. Some Challenges
Operations must be recorded in (near)
real-time
Verification must be possible from
"anywhere" in the network
Goal: create a permanent, tamper-proof
record of the manipulations made on each
parcel.
23. Artifact-centric solution
S. Hallé, R. Khoury, A. El-Hokayem, Y. Falcone. Decentralized
Enforcement of Artifact Lifecycles. EDOC 2016.
Back in
2016....
24. Artifact-centric solution
S. Hallé, R. Khoury, A. El-Hokayem, Y. Falcone. Decentralized
Enforcement of Artifact Lifecycles. EDOC 2016.
Back in
2016....
25. Artifact-centric solution
S. Hallé, R. Khoury, A. El-Hokayem, Y. Falcone. Decentralized
Enforcement of Artifact Lifecycles. EDOC 2016.
Back in
2016....
26. Artifact-centric solution
S. Hallé, R. Khoury, A. El-Hokayem, Y. Falcone. Decentralized
Enforcement of Artifact Lifecycles. EDOC 2016.
Back in
2016....
27. Artifact-centric solution
S. Hallé, R. Khoury, A. El-Hokayem, Y. Falcone. Decentralized
Enforcement of Artifact Lifecycles. EDOC 2016.
Back in
2016....
28. Artifact-centric solution
Concretely, affix a small memory device to
the parcel and append elements to its
peer-action sequence.
Decentralized,
tamper-proof
Requires physical
access to the parcel
29. Blockchain-based solution
Implement actions on parcels as smart
contracts*, and store their occurrence in a
blockchain.
Code stored with the blockchain and that can be called by
transactions sent to its address. Newly received
corresponding transactions will then trigger the code to
be executed on each node of the blockchain network.
*
30. Blockchain-based solution
The blockchain is private.
Made of a set of nodes that can
communicate with each other.
These nodes are separate from the "main"
blockchain of the chosen platform
(Ethereum).
Each maintains a synchronized, agreed-
upon copy of the blockchain.
The contents of the blockchain can be
queried from any node.
31. Blockchain-based solution
Two smart contracts:
Represents a single parcel in the simulation and stores
every action performed on it. Actions can be appended,
or fetched by their index.
Shipment
Interface responsible for managing Shipment contracts.
Used to create new parcels, or to access existing parcels
by their identifier. Can be also used to enforce access
control restrictions or other validation tasks.
ShipmentManager
32. Package Event Streams
Execution of the smart contracts produces
new elements added to the blockchain.
They can be considered as events in a
particular type of stream.
Proposal: use a stream processing engine
to verify compliance and perform analytics.
33. Open source event stream processing
library
Based on basic computing blocks called
processors
Processors can be freely* connected to
each other, producing processing pipelines
https://liflab.github.io/beepbeep-3
34. 300 pages
150+ code examples
Color illustrations
Open access
https://bit.ly/beepbeep-book
35. f
f n
n
P
{
Σ
f
P
n
Apply a function
to each event
Keep one event
every n
Trim the first n
events
Cumulate values of
a function
Fork a stream into
multiple copies
Slice a stream into
multiple sub-
streams
Apply a processor
to a sliding
window of events
Filter events based
on a control signal
f
S. Hallé. A Formalization of Complex Event Processing. EDOC 2014.
36. Listening to blockchain events
An extension to BeepBeep adds a new
processor that listens to events from an
Ethereum blockchain.
CatchEthContractLogs source =
new CatchEthContractLogs("http://host:8545",
"0x6702413C52c8Cf0fc5f", true);
The processor is a
source producing
tuples.
37. Typical parcel events
A simple parcel event can contain the
following attributes:
parcel ID
current x / current y
destination x / destination y
timestamp
action (pickup or delivery)
39. How It Is Done
CatchEthContractLogs catcher = new CatchEthContractLogs(
"http://host:8545",
"0x6702413C52c8Cf0fc5f061C89960a262f40C850c",
true);
Event myEvent = new Event(
"Instructor",
Arrays.asList(
new TypeReference<Utf8String>() {},
new TypeReference<Uint256>() {}
));
ApplyFunction get = new ApplyFunction(
new GetEventParameters(myEvent)
);
Connector.connect(listener, get);
Connector.connect(get, ...);
catcher.start();
Thread.sleep(30000);
catcher.stop();
40. Setup the Ethereum
Beepbeep source
How It Is Done
CatchEthContractLogs catcher = new CatchEthContractLogs(
"http://host:8545",
"0x6702413C52c8Cf0fc5f061C89960a262f40C850c",
true);
Event myEvent = new Event(
"Instructor",
Arrays.asList(
new TypeReference<Utf8String>() {},
new TypeReference<Uint256>() {}
));
ApplyFunction get = new ApplyFunction(
new GetEventParameters(myEvent)
);
Connector.connect(listener, get);
Connector.connect(get, ...);
catcher.start();
Thread.sleep(30000);
catcher.stop();
41. Define an event
type to catch
How It Is Done
CatchEthContractLogs catcher = new CatchEthContractLogs(
"http://host:8545",
"0x6702413C52c8Cf0fc5f061C89960a262f40C850c",
true);
Event myEvent = new Event(
"Instructor",
Arrays.asList(
new TypeReference<Utf8String>() {},
new TypeReference<Uint256>() {}
));
ApplyFunction get = new ApplyFunction(
new GetEventParameters(myEvent)
);
Connector.connect(listener, get);
Connector.connect(get, ...);
catcher.start();
Thread.sleep(30000);
catcher.stop();
42. Filter on that
event type
How It Is Done
CatchEthContractLogs catcher = new CatchEthContractLogs(
"http://host:8545",
"0x6702413C52c8Cf0fc5f061C89960a262f40C850c",
true);
Event myEvent = new Event(
"Instructor",
Arrays.asList(
new TypeReference<Utf8String>() {},
new TypeReference<Uint256>() {}
));
ApplyFunction get = new ApplyFunction(
new GetEventParameters(myEvent)
);
Connector.connect(listener, get);
Connector.connect(get, ...);
catcher.start();
Thread.sleep(30000);
catcher.stop();
43. Connect these
processors to the
desired pipeline
How It Is Done
CatchEthContractLogs catcher = new CatchEthContractLogs(
"http://host:8545",
"0x6702413C52c8Cf0fc5f061C89960a262f40C850c",
true);
Event myEvent = new Event(
"Instructor",
Arrays.asList(
new TypeReference<Utf8String>() {},
new TypeReference<Uint256>() {}
));
ApplyFunction get = new ApplyFunction(
new GetEventParameters(myEvent)
);
Connector.connect(listener, get);
Connector.connect(get, ...);
catcher.start();
Thread.sleep(30000);
catcher.stop();
44. Start the process
and wait for
events
How It Is Done
CatchEthContractLogs catcher = new CatchEthContractLogs(
"http://host:8545",
"0x6702413C52c8Cf0fc5f061C89960a262f40C850c",
true);
Event myEvent = new Event(
"Instructor",
Arrays.asList(
new TypeReference<Utf8String>() {},
new TypeReference<Uint256>() {}
));
ApplyFunction get = new ApplyFunction(
new GetEventParameters(myEvent)
);
Connector.connect(listener, get);
Connector.connect(get, ...);
catcher.start();
Thread.sleep(30000);
catcher.stop();
57. Experimental Evaluation
To assess the feasibility of the approach, a
simulation of a "mega-city" has been
implemented in .
Low parcel density
High parcel density
59. Blockchain Performance
Simulation is run for 100 seconds = 4
hours of real-time.
0
100
200
300
400
500
600
0 20 40 60 80 100
Size
(ko)
Time (s)
0
100
200
300
400
500
600
0 50 100 150 200 250 300
Size
(ko)
Number of actions
60. The blockchain reaches 532 kb (1.6 kb per
action) at the end of the simulation.
The simulation achieves 3.2 transactions
per second (Ethereum's main net can go
up to "a few dozen").
There exist networks that have much
higher processing speeds (Futurepia,
300k).
Blockchain Performance
62. Stream Processing
Few properties are affected by the number
of parcels (for a fixed event rate)
Throughput is much higher than the
blockchain (10⁵ to 10⁶ events per second)
Real-world estimate for Shenzen (China):
400M events per day (i.e. 4,000/s)
63. Conclusion
Lifecycle and analytical properties can be
evaluated on a stream extracted from a
blockchain
Bottleneck likely to be the blockchain
transaction speed
Future work:
monitor directly in smart contract?
fine-grained diagnostics?