# Linked Data Aware Agent Development Framework for Mobile Devices
## 2 Architecture of LDAF-M
### Communication Infrastructure  
In this subsection, LDAF-M's communication mechanism, which has been developed following the P2P paradigm, is introduced. In addition, it is also discussed how the case of a peer that becomes inaccessible due to a problem arising from a resource constraint in a mobile device is handled in this P2P infrastructure. P2P is an approach for network communication where shared data is processed by two or more client computers, each of which have equal responsibilities. In contrast to the client-server architecture where there are separate dedicated clients and servers, in a P2P infrastructure each of the peers can play the role of both a server and a client. There are three approaches regarding the architecture of a P2P communication infrastructure [24; 25; 26]. These are central, decentralized, and hybrid approaches. A dedicated central server and a group of peers are used in the implementation of a central P2P architecture. The central server maintains a database where it stores the indexes of all peers and the resources that belong to each peer. In the decentralized P2P architecture, there is not any central server that controls the network. Instead, each peer has equal functionality and holds information about its own resources. In other words, each of the peers acts as the index server. The hybrid P2P approach, which is the third-generation architecture, provides a hierarchical structure in which there are super peers having the properties of a central server. Considering the constraints of mobile devices and the scale of the systems that would be constructed using LDAF-M, the communication infrastructure has been based on the centralized P2P approach. In the alternative (i.e., decentralized) P2P approach, since each peer keeps track of its own resources and needs to search resources of other peers, an extra load is introduced for peers. Additionally, a certain level of message traffic occurs on the network because of the circulating queries. On the other hand, using a centralized approach brings in several advantages such as easy implementation and timely responses to queries among peers. In addition, in our case, the connectivity status of a mobile device may dynamically change, as a result of running out of battery or going out of the range of the network. Using the centralized approach, we can easily keep track of and handle the connectivity problems, as it is explained in the following paragraphs. As it can be seen from Figure 2, a group of peers and one central dedicated server have been used for the realization of the central P2P architecture. The dedicated server, which is called the \"index server\", is responsible for controlling and sustaining the P2P network. When any one of the peers becomes online, information associated with resources of this peer are recorded in the database within the index server. In the same way when any of the peers becomes offline, information associated  
Figure 1: Linked Data Aware Agent Development Framework for Mobile Devices (LDAF-M) layers. with that peer is removed from the database within the index server. In addition, each of the online peers sends notifications to the index server periodically in order to indicate that they still actively use the system. If the index server cannot receive notifications from a peer for a certain amount of time, the index server updates its database to indicate that this peer becomes offline. While determining the length of the time interval for periodic notifications of the mobile device agents, we need to consider the timeliness of the notification, but at the same time we need to avoid introducing too much load for the network and the index server. A peer being offline may not be detected for a long time if periodic time intervals are too long. On the other hand, an extra load comes on the index server and the network when the periodic time intervals are too short.