Research Article

[Retracted] 5G-EECC: Energy-Efficient Collaboration-Based Content Sharing Strategy in Device-to-Device Communication

Algorithm 3

Cache discovery in D2D.
Input:
(i) Data item ID
Output: Getting requested data (Di) from caching node
Steps
(1) Getting requested data from caching node
(2) Content requester check the local cache for required data
(3) if local cache search (requested data item = found)
(4)  then
(5)  return requested Di
(6)  cluster leader update cluster table (energy level of nodes, cache node entry)
(7) else
(8)  if neighboring search ((Di) = found)
(9)   then
(10)    send reply_packet from neighbor (content provider id, data item id) to content requester
(11)    data request_packet from requester to content provider
(12)    return requested Di
(13)    cluster leader update cluster table (energy level of nodes, cache node entry)
(14)   else
(15)    Send data request_packet (data item id) to cluster head
(16)    Cluster head start searching process Do
(17)   if Cluster head entry search (requested data item = found)
(18)    then
(19)    return requested Di
(20)   else
(21)    Send data creation_packet msg (data item) to base station
(22)    if (helper energy > threshold energy && helper capacity > threshold capacity)
(23)     then
(24)     Base station sorts helper in ascending order based on energy and capacity and distributes content
(25)    else
(26)     return requested Di from base station
(27)    end if
(28)   end if
(29)  end if
(30)end if