Skip to main content
. 2021 Oct 29;21(21):7204. doi: 10.3390/s21217204
Algorithm 3: Content message forwarding and caching mechanism (Uu,Dj,Rm/serv,Ry)
  1. If requested content exists in the CS(Rm) or Ij reaches the server (serv), then following steps are performed:

    • (a)

      Prepare a Content message Dj with initializing corresponding field Name(Dj) and the requested payload.

    • (b)

      Replicate the values of Clus(Ij) and H(Ij) fields from Ij to the Clus(Ij) and H(Ij) fields of Dj.

    • (c)

      Initialize, H(Dj)=0.

    • (d)

      The content provider (Rm/serv) writes its unique cluster identification id (Clus(Rm)/Clus(Serv) in the Clus(Dj) field of Dj.

    • (e)

      Initialize the boolean field η as TRUE.

    • (f)

      Transmit Dj towards Uu.

  2. When Dj reaches to an intermediate router Ry, then Ry perform following steps for caching decisions and content forwarding towards Uu.

  3. Update the value in H(Dj) field as H(Dj) = H(Dj)+1.

  4. If Clus(Ij)Clus(Ry) or Clus(Ij)=Clus(Dj), then move to step-6.

  5. Else,

    • (a)

      Compute, PTRy(Name(Dj) in PTRy.

    • (b)

      Compute, Caching_Gain=PTRy(Name(Dj))×H(Dj)H(Ij)

    • (c)
      If TRCaching_Gain and η=TRUE then,
      • Cache Dj in the CS(Ry) using LFU cache replacement strategy.
      • Reset η=FALSE.
  6. Ry forwards Dj towards the Uu using its PIT.