Freimap

Aus wiki.freifunk.net

Wechseln zu: Navigation, Suche
Freimap
Freimap Screenshot
Developer freimap team
First released
Latest preview version
Release date and age
Frequently updated yes
Programming language JAVA (JDK 1.6)
Platform Cross-platform (Linux, BSD)
Language Multilingual
Status active
Genre
License GNU General Public License, LGPL
Website
Download

Freimap is an Open Source visualization and analysis framework for (mostly) mesh networks, such as for example Freifunk.net. It can read many a different data source and display them as different layers. The network can be browsed and queried in real time, and a time bar allows to trace back to past events. Some statistics of the topology and network traffic may also be generated. Service Discovery is a new feature of Freimap. This means that at Run Time the user can choose, from the settings menu, what kind of datasource he/she wants to use when the application starts. The Freimap software has a menu where the user can choose different functions. The software itself runs in Java, and smoothly at that. It reads data from various sources in the network or a database. There are a lot of possible Datasources that will be implemented including MySql DataSource, OLSRD DataSource, latlon.js DataSource and XML.


Inhaltsverzeichnis

[Bearbeiten] ServiceDiscovery

Service Discovery enables the usage of mdns plugin of olsr. It is developed by Stefano Pilla who started it as a Summer of Code project.

[Bearbeiten] Development Process

The freimap base has not been made with an IDE like Netbeans or Eclipse so the first work is to port old freimap to the new IDE. Netbeans is used here as it has a simple and really intuitive GUI Builder and you can make a lot of things in a simple way. Stefano: "However during the porting to Netbeans IDE I have had to modify a lot of things because there was not the possibility to change software GUI with netbeans GUI Builder with the current implementation of the software." (find info about Netbeans GUI Builder here: http://www.netbeans.org/features/java/swing.html)

The “new Freimap” is able to capture the map from OpenStreetMap with the package of JXMpakit (JXMapViewer). The JXMapViewer is an open source (LGPL) Swing component created by the developers at SwingLabs (http://www.swinglabs.com). At its core, the JXMapViewer is a special JPanel that knows how to load map tiles from an image server. All of the details of how to convert coordinates to pixels, cache tiles, and stitch them together on screen are nicely hidden inside JXMapViewer's API. All you need to do is add it to your Swing application the way you would with any other JPanel.

[Bearbeiten] Integrated Components

JmDNS is a Java implementation of multi-cast DNS and can be used for service registration and discovery in local area networks like Freifunk network. JmDNS is fully compatible with Apple's Bonjour (Rendezvous). The Zeroconf working group is working towards zero configuration IP networking. Multi-cast DNS and DNS service discovery provide a convient ways for devices and services to register themselves, and to discover other network-based services without relying on centrally administered services. Java as a language is not appropriate for low-level network configuration, but it is very useful for service registration and discovery. JmDNS provides easy-to-use pure-Java mDNS implementation that runs on most JDK1.4 compatible VMs. The code is released under the LGPL license so that it can be freely incorporated into other products and services.

JmDNS

import javax.jmdns.JmDNS; JmDNS jmdns = new JmDNS(); System.out.println(”Host: “ + jmdns.getHostName()); System.out.println(”Interface: “ + jmdns.getInterface()); ServiceInfo si[] = jmdns.list(”_http._tcp.local.”); jmdns.addServiceTypeListener(new MyServiceTypeListener());


Encapsulates info about a JmDNS Service

import javax.jmdns.ServiceInfo;

System.out.println(”Host: “ + jmdns.getHostName() ); System.out.println(”Interface: “ + jmdns.getInterface()); ServiceInfo si[] = jmdns.list(”_http._tcp.local.”); System.out.println(”Service 0 : “ + si[ 0 ].getServer() + “--” + si[ 0 ].getPort() + “--” + si[ 0 ].getNiceTextString() );

ServiceListener Additions, Removals

ServiceTypeListener New service type discovery

Both listen for ServiceEvents


[Bearbeiten] New Freimap

Freimap with Service discovery is a new kind of Freimap software. The difference are for example the absence of config.yaml because the application could automatically find the corrent config. At Run Time the user can choose, from the settings menu, what kind of datasource want use when the application start. Now Freimap software has a menu in which user can made a lot of choice for example

From a File Menu: Open and Save Files, exit from Application

From Edit Menu: Go to Default postion, add a nodes to the map, take a snapshot, Apply filter, Find a node, Preferences of Application. The last one is to implement.

From the View Menu: Hide/Show Nodes, Links, Minimap, Zoom Buttons, Node info, List of nodes

From Help menu: show who works to the project and a guide from Freimap


There are a lot of possible Datasources:

MySql DataSource (must be implemented)

OLSRD DataSource (must be implemented)

latlon.js DataSource

Xml


The software can also open and save xml, txt and js files for add waypoints (nodes) to the map and save it with a multiple selection...if the user adds a waypoint from the contest menu he can choose to delete or save it in a file for future consultation. Another important tools could be “Find Node”. When an user want to find a node he can search it by name, by ip or by lat lon. If user know Lat Lon he can go in a particolar position with the tools “Go Here” in the edit menu. If the lat lon is a position of a node the software automatically select the node. (must be implemented)

For Service Discovery the situation are that now when you right click on a node you can go in a Contest Menu where you can click “Service Discovery”. Now mdns works fine but in this way you can select all service in the network. My idea is to find a way to select only the service of a node when you click “service discovery menu”. In general, clients are not interested in finding *every* service on the network, just the services that the client knows how to talk to. However, for problem diagnosis and network management tools, it may be useful for network administrators to find the list of advertised service types on the network, even if those service names are just opaque identifiers and not particularly informative in isolation. For this reason, a special meta-query is defined. A DNS query for PTR records with the name "_services._dns-sd._udp.<Domain>" yields a list of PTR records, where the rdata of each PTR record is the two-label name of a service type, e.g. "_http._tcp." These two-label service types can then be used to construct subsequent Service Instance Enumeration PTR queries, in this <Domain> or others, to discover a list of instances of that service type. A Service Type Enumeration PTR record's rdata SHOULD contain just two labels, without any additional "<Domain>" suffix. Clients processing received Service Type Enumeration PTR records with more than two labels SHOULD interpret the first two labels as a service type and silently ignore any additional labels in the PTR rdata. My solution is to implement the research of all services when application starts and add all found services in a HashMap where the key is the name of the node (or FQID, or ID) and the values is an array with all the found services. When user click on a service discovery menu the services is searched in this HashMap. The problems at this point are:


1) Two or more nodes has the same name …for this reason I prefer to implement a hashmap where the key is an IP or another unique ID

2) When you are behind NAT the application (but also mdns-plugin of OLSR) doesn’t work fine. In this case the only solution is to remove NAT when possibile.


The HashMap must be refreshed everytime but we have to find a method for refresh hashmap only when the user ask for node’s services and it must refresh only services of requested node. However it must be a method that do not request a lot of traffic. I think that now the best solution is to recall "_services._dns-sd._udp.<Domain>" everytime you need a refresh of a services HashMap.

This is easy to implement but the GSoC deadline has not afforded me to conclude this work. I hope that I can continue to work to this project because I’ve a really good ideas for new Freimap.

However now main goals of Freimap are:


• MySql Datasource (parse mysql database already exists)

• Implement File Save (we need a standard or global extension like .fmp but also xml, js and txt are good)

• Implement Draws of Link (now I’m working on this “bug”, I've a problem to traslate x y position from JMapViewer to X Y of JTable)

• Implement Service Discovery with previous considerations.

• …..all the others things that are not implemented yet.

[Bearbeiten] External Links

Persönliche Werkzeuge