<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Notes on Relationship of P Colonies to Osmotic Computing and Computer Viruses</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Šárka Vavrečková</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Silesian University in Opava</institution>
          ,
          <addr-line>Bezručovo nám. 13, Opava</addr-line>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>P colonies with transferable programs are one of the newer variants of P colonies, which allow the transfer of programs between agents and the environment when certain conditions are met. Code transfer is also known from other concepts: in the concept of Osmotic computing we encounter the transfer of MELs between IoT devices and the cloud, and the long-standing concept of computer viruses uses infecting common applications with appended code. In this paper, the reader will find an outline comparison of these three concepts concerning the possibilities of transferring code fragments or programs.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;P colony</kwd>
        <kwd>transferable program</kwd>
        <kwd>Osmotic computing</kwd>
        <kwd>MEL</kwd>
        <kwd>virus</kwd>
        <kwd>shellcode</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <sec id="sec-1-1">
        <title>The paradigm is motivated by procedures from biol</title>
        <p>
          ogy or chemistry, where solvent molecules pass through
P colonies are a simple computational model based on a semi-permeable membrane into other regions in the
membrane systems. P colonies were introduced in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] in environment with higher solute concentration (osmosis).
2004 and since then many variations (types of programs, The issue is further developed in [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] considering the
form of environment, etc.) have been developed. Focus- way in which MELs, in particular, can migrate between
ing on the basic variant, the environment containing ob- the cloud and edge resources and focusing more on the
jects of a given type is shared by agents that also contain Internet of Things. Datta and Bonnet in [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] show the use
objects in their internal environment and are equipped of MELs in securing connected “smart” cars and other
with programs consisting of rules. The programs allow similar devices.
the agents to influence not only themselves but also the A virus is malicious program code that spreads by
environment. In paper [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], the concept of P colonies with infecting available programs with a copy of itself. There
transferable programs is introduced, where programs can is quite a lot of literature and websites about computer
be transferred between an agent and the environment viruses, e.g. [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
and vice versa. According to [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], shellcode can be described as a code
        </p>
        <p>The principle of traveling programs, or code in general, injection attack. An attacker inserts a code into an
existcan be found elsewhere: e.g. in the concept of Osmotic ing chosen file to access the command interface (shell) of
computing or (if we focus on the nowadays very frequent the compromised system. Shellcode is one of the ways
topic of cybersecurity) also in the activity of viruses, a virus can work.
shellcode, etc.</p>
        <p>
          Villari et al. in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] introduce the concept of “Osmotic In Section 2 we define P colonies, and add a
descripcomputing” as a paradigm intended mainly for IoT (In- tion of the possibility of using transferable programs in
ternet of Things) network, the main purpose of which is P colonies. This concept is explained with examples. In
to increase the accessibility of resources and services in the same section, we follow the definition of the
princia computer network, including cloud services. MicroEle- ple of Osmotic computing, where we mainly focus on
ments (MELs) are simple entities consisting of programs explaining the possibility of transferring MELs between
(MicroServices) and data (MicroData). IoT applications the involved devices. The last topic of Section 2 is the
can be decomposited into MELs. The interface between issue of computer viruses and shellcode. Here we also
the IoT application and the edge environment (Edge Data- focus on the process of transmitting or adding new code
Centers), and also between the edge environment and the to infected programs.
cloud (Cloud DataCenters), is called membrane: MELs can In the next two sections, we will try to capture the
cormigrate through membranes to where they are needed. relations between P colonies with transferable programs
and two other concepts in which computational elements
(e.g., program code) are being transmitted: the concept
of osmotic computing and the principle of operation of
computer viruses and shellcode.
        </p>
        <p>ITAT’23: Information technologies – Applications and Theory,
September 22–26, 2023, Tatranské Matliare, Slovakia
$ sarka.vavreckova@fpf.slu.cz (ˇ. Vavrečková)</p>
        <p>© 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License
CPWrEooUrckReshdoinpgs IhStpN:/c1e6u1r3-w-0s.o7r3g ACttEribUutRion W4.0oInrtekrnsahtioonpal (PCCroBYce4.0e).dings (CEUR-WS.org)</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>
        the given object  in the environment. Also, this type of
rule can be applied only if the specified objects exist in
We assume the reader to be familiar with the basics of the given environments.
the formal language theory and membrane computing The checking rules (1/2) are composed of two rules
[
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ]. We denote the length of a word  by ||. The 1 and 2 of any of the previous two types. Only one of
empty word is represented by the symbol , so || = 0. these rules will be applied, with the first listed having
a higher priority. Only if the first rule cannot be executed,
2.1. P Colonies the second rule in order may be executed.
The initial configuration of a P Colony Π is an ( +
1)Membrane computing is a framework of parallel dis- tuple of multisets  for 1 ≤  ≤  for the agents , and
tributed processing introduced by Gheorghe Paˇun in  for the environment. Generally, the configuration of
1998. Information about this paradigm is available in a P Colony Π with capacity  is
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], or the bibliography at http://ppage.psystems.eu/
[2023-07-02]. Membrane systems are based on the hier- (1, . . . , ,  )
archical structure of membranes in cells and can be used
to model distributed computing. Mathematical models where  ∈ * , || = ,  ∈ * ,  ∈ (−{ })* .
of membrane systems have been called P Systems. Several derivation modes have been defined, difering
      </p>
      <p>
        P colonies develop the concept of P systems by enrich- in the way the rules are selected at each derivation step.
ing the system with agents that evolve activities accord- In the maximally parallel derivation mode, all agents
ing to specific programs. can work parallely in each derivation step (each agent
non-deterministically chooses one of its programs with
Definition 1 ([
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]). A P colony of capacity ,  ≥ 1, is applicable rules). In the sequential derivation mode, only
a construct one (non-deterministically chosen) agent can work in
Π = ( , , ,  , 1, . . . , ) where each derivation step. The calculation halts if no agent
ifnds an applicable program.
•  is an alphabet, its elements are called objects,
•  ∈  is the environmental object of the colony,
•  ∈  is the final object of the colony,
•  is a finite multiset over −{ } called the initial
      </p>
      <p>state of the environment,
• , 1 ≤  ≤ , are agents where each agent
 = (, ) is defined as follows:
–  is the initial state of the agent, a multiset</p>
      <p>over  consisting of  objects,
–  = {,1, . . . , , } is a finite set of
programs where each program consists of 
rules, the rules can be in one of the following
forms:
∗  → , ,  ∈  called an evolution</p>
      <p>rule,
∗  ↔ , ,  ∈  called a
communi</p>
      <p>cation rule,
∗ 1/2 called a checking rule, 1, 2
are both evolution or communication
rules.</p>
      <sec id="sec-2-1">
        <title>The evolution rules are of the form  → . This type</title>
        <p>of rule allows the agent to influence itself, i.e. its internal
environment: an object  inside the agent is rewritten to
the specified object . The rule can only be applied if at
least one occurrence of the object  exists in the internal
environment of the agent.</p>
        <p>
          The communication rules ( ↔ ) are intended for
communication between the given agent and the
environment. An object  inside the agent is swapped with
2.2. Transferable Programs in P Colonies
In [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], the concept of transferable programs for P colonies
has been introduced. A transferable program is an
ordered pair (program, condition) located inside an agent
or the environment. The program can be transferred from
the agent to the environment or from the environment
to the agent (from the source to the destination), and the
stated condition determines under what circumstances
this transfer will occur.
        </p>
        <p>The condition can be one of the following two types:
• Object condition: the destination must contain
certain objects for the program to be transfered
(or must not contain when there is the negation
symbol in the condition). This type of condition
is a set of multisets of objects, the size of the given
multisets is equal to capacity of the P Colony.
• Program condition: the destination must contain
a specified program (or must not, if the negation
symbol is present).</p>
        <sec id="sec-2-1-1">
          <title>Thus, the definition of P colony presented in the pre</title>
          <p>vious subsection changes in the part specifying the
programs of agents, and it is also necessary to add programs
located in the environment to the definition, the rest
remains the same.</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>Example 1. Let Π be a P colony of capacity 2. Capacity</title>
          <p>is reflected in both the number of objects in the agent
environment and the number of rules in each agent pro- programs, for example ⟨ → ⟩. The configuration has
been modified to</p>
          <p>(, , )</p>
        </sec>
        <sec id="sec-2-1-3">
          <title>There are three transferable programs in the environ</title>
          <p>ment. The first one is suitable for 1, the third for 2.</p>
        </sec>
        <sec id="sec-2-1-4">
          <title>So the agents are changed as follows:</title>
          <p>1 = (︀ , { ⟨ → ⟩ , ⟨ → ⟩ , ⟨ ↔ ⟩ , ⟨ → ⟩ ,
(⟨ →  ; {}⟩)})︀
(⟨ →  ;  → ⟩)})︀
2 = (︀ , { ⟨ → ⟩ , ⟨ → ⟩ , ⟨ ↔ ⟩ , ⟨ → ⟩ ,</p>
        </sec>
        <sec id="sec-2-1-5">
          <title>The set of transferable programs in the environment has changed. The third program was not classified as permanent, so it is no longer part of the environment gram.</title>
        </sec>
        <sec id="sec-2-1-6">
          <title>For the illustration, we present here an example program of one of agents, using object condition:</title>
          <p>(⟨ → ;  ↔ ⟩ ; {, ¬})</p>
        </sec>
        <sec id="sec-2-1-7">
          <title>This means that if this program is in an agent it can</title>
          <p>only be transferred to the environment when there are at
least two occurrences of the  object in the environment
and there is no  pair. If this program is in an
environment, it can be transfered to an agent when the condition
holds for the internal environment of that agent.</p>
          <p>
            What happens to the program at the original location
if the conditions for transfer are met? According to [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ],
a program can be classified as
permament, in this case
one copy of the program remains at the original location
and the other is transferred. The program remains at the
original location (including the “permanent” property),
but loses this property at the new location. If a program
is not permanent, it is removed at its original location.
          </p>
        </sec>
        <sec id="sec-2-1-8">
          <title>In each computation step, an agent can either apply</title>
          <p>
            one of its applicable programs or transfer one of programs
in or out.[
            <xref ref-type="bibr" rid="ref2">2</xref>
            ] This implies that the transfer of programs is
actually an analogy of programs (but the action would
not be transferable).
ferable programs. There are two agents:
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Example 2. Let Π be a P colony of capacity 1 with trans- is</title>
        <p>1 = (︀ , {⟨ → ⟩ , ⟨ → ⟩ , ⟨ ↔ ⟩ , ⟨ → ⟩})︀
2 = (︀ , {⟨ → ⟩ , ⟨ → ⟩ , ⟨ ↔ ⟩ , ⟨ → ⟩})︀</p>
        <p>In their initial state, these agents do not contain any
transferable programs (although they could). We have
only the  symbols in the environment at the beginning
of the computation. For the purpose of clarity, if we limit
reprezentation of the configuration of the system to just
the states of the agents and the environment (the
configuration of the environment properly includes programs
not imported in any agent), the initial configuration is
very simple:</p>
        <p>(, , )</p>
        <sec id="sec-2-2-1">
          <title>There are the following transferable programs in the environment at the beginning of computation: after the transfer.</title>
          <p>︀{ (⟨ →  ; {}⟩) ,
(⟨ ↔  ; {}⟩)</p>
          <p>︀}</p>
          <p>In the next step of the calculation, the agents can use
the newly obtained programs, i.e. the state of the agents
and the environment has been changed as follows:
(, , )
(, , )
1 can use its third program, 2 can use its fourth
program, the new state of the agents and the environment</p>
        </sec>
        <sec id="sec-2-2-2">
          <title>In the next steps, the agents will use their own programs, import other programs from the environment, or export a transferable program to the environment for use by another agent.</title>
        </sec>
        <sec id="sec-2-2-3">
          <title>The above example shows how transferable programs</title>
          <p>behave. Programs can also be transferred in the other
direction, i.e. from agents into the environment. This
allows an agent to drop a program it does not need.</p>
          <p>Another example of using P colonies with transferable
programs, which would be more complex to describe, is
as follows: Agents are gardeners. Each of them grows
a specific plant whose progressive development (growth
phase) and condition (healthy, dry, insect infested, etc.) is
captured in their status objects. Agents pick up tools (i.e.,
programs) from the environment as needed (according
to these objects), and return unneeded tools.
2.3. Osmotic Computing
︀{ (⟨ →  ; {}⟩) ,
(⟨ ↔  ; {}⟩) ,
(⟨ →  ;  → ⟩) ︀}
programs.</p>
        </sec>
        <sec id="sec-2-2-4">
          <title>The first two programs contain object condition, and</title>
          <p>the third program contains program condition. The  In biology and chemistry, osmosis is the process of
transsymbol in the subscript indicates permanent transferable
ferring molecules between two media of diferent
den</p>
        </sec>
        <sec id="sec-2-2-5">
          <title>During the first step of the computation, 1 uses one</title>
          <p>of the programs that overwrite the  symbol, for exam- here it is about the dynamic migration of microservices
ple the first one: ⟨ → ⟩. 2 also has a choice of two
between diferent parts of a computer network.
sities across a semipermeable membrane. Osmotic
computing carries this principle into the field of technology:</p>
          <p>
            According to Osmotic computing[
            <xref ref-type="bibr" rid="ref4">4</xref>
            ], an application ager. The Node Manager continuously analyzes the
de(very often running on an IoT device) can be decomposed vice properties and checks whether the MELs in the
into parts called MicroElements (MELs) consisting of corresponding set  are satisfied. The Osmotic
ReMicroServices (code) and MicroData (data). Since IoT source Manager then balances the workload across the
devices usually don’t have much computing power, it network in cooperation with the Node Managers from
makes sense to move some of the computation (i.e., some each device.[
            <xref ref-type="bibr" rid="ref12">12</xref>
            ]
of the MELs) elsewhere, such as to another device on
the same network or to the cloud. To do this, we need 2.4. Virus and Shellcode
the MEL to be relatively self-contained, independent of
other parts of the application, and also to have an inter- The term computer virus is known, at least in a hint,
face to enable these transfers and provide the necessary to the general public. It is computer code embedded
communication. in a host program that usually performs operations not
intended by the author of the program. In addition to
Definition 2 (according to [
            <xref ref-type="bibr" rid="ref11">11</xref>
            ]). The infrastructure these operations, the virus also infects other files, i.e. it
topology in Osmotic computing can be represented by di- inserts its own code (or its functional equivalent) into
rected graph  = ( ,  ) where  is the set of nodes other reachable files. The malicious code executed by the
(vertices) and  is the set of pars of vertices called links. virus is called payload. The payload is usually encrypted
Each element in  is characterized by various comput- or otherwise encoded to make it more dificult to detect.
ing parameters (CPU, memory etc.), each element of  In addition to the payload, another code is embedded in
is characterized by various network parameters (latency, the infected file to guide the computation to the payload
bandwidth, etc.). and, of course, to decrypt or decode it.[
            <xref ref-type="bibr" rid="ref13 ref6">6, 13</xref>
            ] Shellcode
          </p>
          <p>
            Osmotic toolkit consists of pre-configured container can be one of the ways a virus can work, i.e. its payload.
images intended for various elements in  . Shellcode is, according to [
            <xref ref-type="bibr" rid="ref14">14</xref>
            ], the code that allows
          </p>
          <p>Applications in the Osmotic ecosystem can be repre- a hacker to perform his intent (get access to a file, get
sented by graph  = ( ,  ) where  is the set of access to certain data, escalate access privileges, start
enMELs and  is the set of their interconnections. Each cryption, etc.). Originally, this code has been used to run
MEL in  is characterized by the specific resource re- a shell (a command environment through which a hacker
quirements, constraints and scheduling policies. The could e.g. remotely control the system), hence the name,
edges in the set  determine between which elements but nowadays the term is more generally understood
of  MELs can be transferred. (shellcodes are also able to run other types of commands
or gain higher access privileges).</p>
          <p>
            The implementation is based on the principle of SDN
(Software Defined Network), i.e. computer network vir- Definition 3 (according to[
            <xref ref-type="bibr" rid="ref7">7</xref>
            ]). Shellcode can be
tualization. Software representation of  nodes (MELs) thought of as a sequence of additional commands added
is possible using containers ([
            <xref ref-type="bibr" rid="ref11">11</xref>
            ] used the container sys- to a program, which is executed immediately after the
tem Docker for this purpose). Each device (node  ) can program itself starts and usually lead to the exploitation
run various number of containers with MELs (nodes  ) of some vulnerability in the system or application.
according to its capabilities and MELs requirements. A special type of shellcode, called a bind shell, connects
          </p>
          <p>Containers are actually pre-built images of systems to a network port (HTTP or FTP ports are often used)
(operating systems running on computers, IoT devices, when executed and allows an attacker to establish
network devices, etc.) so not just the application itself, a remote connection to the device on which it is running.
but everything in software it needs. The purpose is to
simplify the application deployment as much as possible, Infecting a program is usually done by inserting a
speincluding configuration. In the case of Osmotic comput- cial sequence of Bytes into the target program and
modiing, there is also an ecosystem for migration and com- fying the rest of the code to force the processor to execute
munication of MELs. A MEL can be moved to a diferent the added code at the correct time. And, of course, the
node  (respectively to a diferent container  ) if the purpose is to hide these changes from antivirus programs
conditions for it to run, such as memory capacity or CPU as much as possible.
performance, are not met in the original location. An- If an antivirus finds an infected program, it either
other reasons for moving may be to optimize network moves it to quarantine (it defacto makes the malicious
communication, or to ensure cybersecurity, where we code inaccessible) or it can try to repair the infection,
pull MELs from cloud to our own network. which means the reverse procedure to the one described</p>
          <p>Each element of the set  is managed by the Node above.</p>
          <p>
            Manager component, the whole system is managed by As mentioned above, the payload of a virus is usually
a special element of  called Osmotic Resource Man- encrypted and there is also a decryption sequence in
the code. While the payload can be very heterogeneous
and therefore harder to detect (and it is encrypted), the
decryption instructions are easier to detect. Polymorphic
viruses[
            <xref ref-type="bibr" rid="ref13">13</xref>
            ] can modify their decryption sequence as they
spread, making detection more dificult. The modification
is based on a simple principle: the same computational
operation can be performed in many diferent ways. For
example, the result 25 can be reached by 5 * 5, 20 + 5,
3 * 6 + 7, 100/4, 9 * 7 − 38. Code instructions can also
be put together in various ways: we can add instructions
without directly afecting the result, etc.
          </p>
          <p>
            Antivirus programs use an emulator to detect
polymorphic viruses, in which they emulate the process of
decrypting a potential locations in a program with an
encrypted payload. Attackers have developed a new
generation of viruses: metamorphic viruses. Metamorphic
code[
            <xref ref-type="bibr" rid="ref13">13</xref>
            ] does not rely on making copies of the payload,
but what was to apply to the polymorphic code for the
decryption sequence applies to the payload in the
metamorphic code: when spread, a functionally equivalent
diferent code is produced instead of a copy of the
payload. The problem of detecting metamorphic viruses is
NP-complete[
            <xref ref-type="bibr" rid="ref13">13</xref>
            ]. However, not only attackers but also
defenders can use metamorphic code. It can be very
effective in defending against certain types of attacks, as
even defensive tools find it useful to be hidden.
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. P Colonies with Transferable</title>
    </sec>
    <sec id="sec-4">
      <title>Programs vs. Osmotic</title>
    </sec>
    <sec id="sec-5">
      <title>Computing Concept</title>
      <sec id="sec-5-1">
        <title>In this section, we focus on the correlations between</title>
        <p>P colonies with transferable programs and the concept
of Osmotic computing.
directly equipped with a transfer condition, this condition
concerns either the (non) presence of certain objects or
programs in the target. MELs in the Osmotic computing
concept have a condition built into the properties of the
elements of the set  , the transport of a given MEL is
possible if these conditions match the equipment of the
target node in the set  .</p>
      </sec>
      <sec id="sec-5-2">
        <title>3) P colonies are a mathematical model and have been</title>
        <p>designed to be easy to analyze their computation.
Capacity of P colony is determined, which is reflected in the
number of objects in each agent’s internal environment,
and also in the number of rules in the agents’ programs.</p>
        <p>As for transferable programs, the number of rules in
such a program must also be equal to the capacity of the
P colony.</p>
        <p>The concept of Osmotic computing is more free in this
respect, it is heterogeneous in principle. The analogue
of the agents from P colonies are the devices in the
network hosting MELs, which can be very diferent from
each other in their parameters, and the analogue of the
transmitted programs are just the MELs. MELs can be
of varying complexity (longer or shorter programs). On
the other hand, there is also a similarity: an agent of
a P colony may contain diferent amounts of programs,
a device in the Osmotic computing concept may contain
various amounts of MELs. In both cases, the number of
MELs can be changed dynamically.
4) Programs in P colonies use three types of rules, as
follows from Definition 1. Their task is to work with
objects (transformation or transfer). MELs, on the other
hand, are composed of instructions prescribed by
implementations for a given host type (operating system
and processor on a given device). Thus, the set of
usable instructions varies but is certainly very large (tens,
hundreds). These instructions may also work with data
(analogous to objects), but they may also be other types
of tasks.
1) The concept of Osmotic computing can be described
using graphs – Definition 2 uses graph  for the
infrastructure and graph  for the communication structure 5) Although the rules in the P colony do not directly
creof applications. Since not all nodes of the graph  can ate new symbols, the  object is available in any quantity.
host MELs and there can be multiple MELs (from  ) in Therefore, the quantity of other objects within the
envia single node in  , the graphs do not overlap in their ronment can be freely increased simply by transforming
nodes. the environment object into some other object. MELs
typ</p>
        <p>We can also represent the structure of a P colony with ically run in an IoT device (or, for example, in cloud). IoT
transferable programs using graphs. The graph  for devices are very often composed of sensors, and sensors
the infrastructure is very simple, the agents are not con- are typically the source of data. Thus, MELs can generate
nected to each other but only to the environment. With data without the need for any auxiliary object. However,
the next graph  we can describe the nodes and paths the impacts are similar. The reverse operation (removal
for transferring programs. Since programs can be both or consumption of objects or data) is also implemented
at the agents and in the environment, the two graphs in P colony by transforming an object into an  object;
practically overlap. for MELs, this procedure is straightforward.</p>
      </sec>
      <sec id="sec-5-3">
        <title>2) In both systems there is some transfer conditionality</title>
        <p>(programs in the case of P colonies and MELs in the
case of Osmotic computing). A P colony program is</p>
      </sec>
      <sec id="sec-5-4">
        <title>6) The concept of Osmotic computing is rather intended</title>
        <p>to be centralized: each node in  has its own Node
Manager, and there is an Osmotic Resource Manager in</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>4. P Colonies with Transferable</title>
    </sec>
    <sec id="sec-7">
      <title>Programs vs. Computer Viruses</title>
      <p>the network managing the whole system. In contrast, rules of type  →  for various symbols  ∈  with
P colonies are decentralized in principle. a suitable condition (here the condition would prescribe
the existence of the symbol  in the agent’s internal
environment). If an agent were infected by such a rule, it
would lose its internal state.</p>
      <p>Next, we focus on the similarities between P colonies
with transferable programs and the operation of viruses
and shellcode.
1) In the case of P Colony, the transfer of programs can be
considered as an alternative activity. An agent can either
execute one of its programs, or receive a new program
from the environment, or divest itself of one of its
programs. In the Osmotic computing concept, the migration
of MELs can also occur repeatedly and can be seen as an
alternative activity on the devices involved.</p>
      <p>
        In the case of a virus, the program is infected once
(unless it is a massive infection with a wide range of
diferent viruses), and the opposite operation (removal
of malicious code by the antivirus) is not expected to be
repeated often. These operations are not considered an
alternative to other activities.
2) Another significant diference is the contextuality of
operation. P colonies with transferable programs have
a certain type of context built into the program transfer
conditions, consisting of the presence or absence of
objects or programs in the target. The context for viruses
and the shellcode embedding mechanism is much more
strict: each shellcode must be customized for the target
system (it must be made up of instructions that the target
system understands), and in addition, the application that
is to host the added code must be modified in multiple
places (it is not enough just to add a new section of code
e.g. to the end of the given file). There is no space for
details in this paper (see [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], e.g. hackers use the bufer
overflow mechanism, which requires modifications at
several places in addition to inserting new code).
      </p>
      <p>
        P colonies are motivated by biological processes (simple
3) The next criterion being compared is similar to cri- cell, passing of nutrients across membranes, etc.) but are
terion #3 and #4 from the previous section. Also, the intended from the beginning as a mathematical model.
structure of virus code is much less strict than the struc- The concept of Osmotic computing is motivated by
proture of agents in the P colony. It depends on what exactly cesses in biology and chemistry (membrane as a
comthe shellcode (or other type of virus payload) is supposed munication interface) but from the beginning they are
to do, and its length and complexity depends on that. intended to be used in practice, in technology. While in
There are also diferent approaches to writing shellcode. the computational model of P colonies,  is defined as the
The best known type probably is Aleph1[
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], but there ifnal object and the end of the computation is assumed
are many others. The situation is further complicated by (the number of objects  is considered as the result of the
polymorphic and metamorphic viruses, where there is computation), the concept of Osmotic computing does
a large variability even within the same virus family. not assume any end of the activity, the important thing
      </p>
      <p>If we wanted to simulate infecting agents with ma- is the process itself. This is not only a significant
diferlicious code in a P colony with transferable programs, ence between the two systems, but it also complicates
it would not be so complicated. It would be enough to somewhat the comparison of other parameters of these
insert one or more programs containing, for example, systems.
4) Similar to the concept of Osmotic computing, for
viruses, it is not so important what (numerical) result
is reached at the end of the computation, but the process
itself is significant, unlike P colonies.
5) Infecting an application with malicious code does not
usually mean that part of the original application code
is lost (although this is not impossible) but rather that
something new is added. Overwriting occurs elsewhere
rather than inside the application itself, for example, data
on disk is encrypted or deleted. If we are looking for an
equivalent in the transferable programs in P colonies, it
would be a transferable program containing rules that
afect the environment (in P colony, an agent cannot
affect another agent directly, except by planting a program
through the environment).
6) If we focus on the activity of antivirus, simulating
its operations in a P colony with transferable programs
would consist in enriching the environment with
“disinfecting” programs. If an agent is disabled by a malicious
program (e.g. such that its environment consists only of
objects for which it has no programs), then in the next
derivation step it imports a suitable disinfecting program
whose purpose is to repair its internal environment.</p>
      <sec id="sec-7-1">
        <title>7) P colonies are decentralized in principle. The system</title>
        <p>of computer viruses is decentralized too. But, on the
other hand, the operation of antivirus, which is based on
a similar principle (finding a target and working with its
code), is centralized.</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>5. Conclusions</title>
      <sec id="sec-8-1">
        <title>The design of a virus and shellcode in general is also</title>
        <p>motivated by an ending (infecting other programs and
selected malicious actions in the form of encrypting
content, taking control, stealing data, etc.), but this ending
cannot be simply represented by numbers.</p>
        <p>In conclusion, some similarities can be found between
the three systems (the possibility of code transfer), other
similarities always exist in the particular pair being
compared. Therefore, to a limited extent, there are
possibilities to simulate certain operations of one system in
another, as we showed in the previous section on the
comparison of P colonies with transferable programs and
viruses.</p>
        <p>
          Colonies with transferable programs have not yet been
studied in detail; in fact, there is no precise definition.
For example, it is not clear from [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] whether the action
of importing/exporting a program is an alternative for
agents to using some other program, or whether this
import/export can be performed in the single step at the
same time as the use of another program. In this paper,
we assume the first option.
        </p>
        <p>Therefore, future research can be targeted in the
following direction: to establish a precise and detailed
definition of P colonies with transferable programs, to
investigate the behavior of the system in specific situations
and with specific parameters, taking into account the
impact of the use of transferable programs, the impact of
marking programs as permanent, etc.</p>
        <p>Another interesting direction of research is the
possibility of using P colonies with transferable programs
to simulate various systems and processes, e.g. in the
area of security (distributing program updates, managing
encryption algorithms,. . . ).</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Kelemen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kelemenová</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Păun, P colonies: A biochemically inspired computing model</article-title>
          ,
          <source>in: Workshop and Tutorial Proceedings. Ninth International Conference on the Simulation and Synthesis of Living Systems (Alife IX)</source>
          , Boston, Massachusetts,
          <year>2004</year>
          , pp.
          <fpage>82</fpage>
          -
          <lpage>86</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Ciencialová</surname>
          </string-name>
          , L. Cienciala,
          <article-title>Transferable knowledge in p colonies</article-title>
          ,
          <source>in: Information Technologies - Applications and Theory</source>
          <year>2022</year>
          (
          <article-title>ITAT 2022)</article-title>
          , volume
          <volume>3226</volume>
          ,
          <string-name>
            <surname>Zuberec</surname>
          </string-name>
          , Slovakia,
          <year>2022</year>
          , pp.
          <fpage>167</fpage>
          -
          <lpage>174</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Villari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fazio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dustdar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Rana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Ranjan</surname>
          </string-name>
          ,
          <article-title>Osmotic computing: A new paradigm for edge/- cloud integration</article-title>
          ,
          <source>IEEE Cloud Computing</source>
          <volume>3</volume>
          (
          <year>2016</year>
          )
          <fpage>76</fpage>
          -
          <lpage>83</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V.</given-names>
            <surname>Sharma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Srinivasan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. N. K.</given-names>
            <surname>Jayakody</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Rana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <article-title>Managing service-heterogeneity using osmotic computing</article-title>
          , in: International Conference on Communication,
          <source>Management and Information Technology (ICCMIT</source>
          <year>2017</year>
          ), Warsaw, Poland,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Datta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Bonnet</surname>
          </string-name>
          ,
          <article-title>Next-generation, data centric and end-to-end iot architecture based on microservices</article-title>
          , in: IEEE International Conference on Consumer Electronics - Asia
          <string-name>
            <surname>(ICCE-Asia</surname>
            <given-names>)</given-names>
          </string-name>
          ,
          <year>2018</year>
          , pp.
          <fpage>206</fpage>
          -
          <lpage>212</lpage>
          . doi:
          <volume>10</volume>
          .1109/ICCE-ASIA.
          <year>2018</year>
          .
          <volume>8552135</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D.</given-names>
            <surname>Ferbrache</surname>
          </string-name>
          , A Pathology of Computer Viruses, Springer Science &amp; Business
          <string-name>
            <surname>Media</surname>
          </string-name>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Liguori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Al-Hossami</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Controneo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Natella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Cukic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Shaikh</surname>
          </string-name>
          ,
          <article-title>Can we generate shellcodes via natural language? an empirical study</article-title>
          ,
          <source>Automated Software Engineering</source>
          <volume>29</volume>
          (
          <year>2022</year>
          ). doi:https://doi. org/10.1007/s10515-022-00331-3.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J. E.</given-names>
            <surname>Hopcroft</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. D.</given-names>
            <surname>Ullman</surname>
          </string-name>
          , Introduction to Automata Theory, Languages and Computation,
          <string-name>
            <surname>Addison-Wesley</surname>
          </string-name>
          ,
          <year>1979</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>G.</given-names>
            <surname>Păun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Rozenberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Salomaa</surname>
          </string-name>
          ,
          <source>The Oxford Handbook of Membrane Computing</source>
          , Oxford University Press, New York,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>G.</given-names>
            <surname>Păun</surname>
          </string-name>
          ,
          <source>Membrane Computing: An Introduction</source>
          , Springer, Heidelberg,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Buzachis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Boruta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Villari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Spillner</surname>
          </string-name>
          ,
          <article-title>Modeling and emulation of an osmotic computing ecosystem using osmotictoolkit</article-title>
          , in: 2021 Australasian Computer Science Week Multiconference, ACSW '21,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2021</year>
          . URL: https://doi.org/ 10.1145/3437378.3444366. doi:
          <volume>10</volume>
          .1145/3437378. 3444366.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>M.</given-names>
            <surname>Nardelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Nastic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dustdar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Villari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Ranjan</surname>
          </string-name>
          ,
          <article-title>Osmotic flow: Osmotic computing + iot workflow</article-title>
          ,
          <source>IEEE Cloud Computing</source>
          <volume>4</volume>
          (
          <year>2017</year>
          )
          <fpage>68</fpage>
          -
          <lpage>75</lpage>
          . doi:
          <volume>10</volume>
          .1109/
          <string-name>
            <surname>MCC</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <volume>22</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>W.</given-names>
            <surname>Wong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Stamp</surname>
          </string-name>
          ,
          <article-title>Hunting for metamorphic engines</article-title>
          ,
          <source>Journal in Computer Virology</source>
          <volume>2</volume>
          (
          <year>2006</year>
          )
          <fpage>211</fpage>
          -
          <lpage>229</lpage>
          . doi:
          <volume>10</volume>
          .1007/s11416-006-0028-7.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>S.</given-names>
            <surname>Harris</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Harper</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Eagle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Ness</surname>
          </string-name>
          , Gray Hat Hacking, Second Edition,
          <string-name>
            <surname>McGraw-Hill Professional</surname>
          </string-name>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>