Difference between revisions of "RoutesMobilityModel"

From Nsnam
Jump to: navigation, search
Line 28: Line 28:
 
== First Status Report ==
 
== First Status Report ==
 
I set my first milestone as being able to generate a mobility trace given real world start and endpoints (street names, for example), from the ns3 simulation environment.
 
I set my first milestone as being able to generate a mobility trace given real world start and endpoints (street names, for example), from the ns3 simulation environment.
 +
=== Notes ===
 +
The ns3::WaypointMobilityModel works by adding ns3::Waypoints to a dequeue sequentially.
 +
 +
The Google Maps Directions service, however, provides an XML that contains the following concepts:
 +
* Leg - A Leg is a list of Steps. Legs only occur if the user specifies a Waypoint (A to B, passing through C)
 +
* Step - A Step contains Points encoded in a polyline
 +
* Point - A latitude/longitude set
 +
 +
To create a mobility trace, my module uses a list of Legs, each one containing a list of Steps and these, in turn, with a list of points.
 +
 +
At the time, the ns3::WaypointMobilityModel defines a journey as an ordered (by time) sequence of ns3::Waypoints.
 +
My module defines journey as a list of Legs, with each Leg having a list of Steps and each Step with a list of Points.
 
=== Module Design ===
 
=== Module Design ===
 
In order to provide a robust module, it was crucial to design it in such a way that it could be possible to add support for other APIs (such as the OpenStreetMaps's). To achieve this, the Strategy design pattern was used.
 
In order to provide a robust module, it was crucial to design it in such a way that it could be possible to add support for other APIs (such as the OpenStreetMaps's). To achieve this, the Strategy design pattern was used.

Revision as of 01:15, 14 August 2014

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

Project Overview

  • Student: Tiago Cerqueira
  • Mentors: Tom Henderson and Scott Carpenter
  • Abstract: Mobility trace generation in ns-3 is done either by using the Mobility module included in NS-3 or by importing mobility traces generated by third party programs in a compatible format. The Mobility module included in ns-3 gives programmers the building blocks to create simple or complex traces, but is hindered by the fact that creating complex traces using the current module alone takes too long, even for simulations with just a couple of mobility capable nodes. As for mobility traces generated by third party programs, such as SUMO, they can involve too much work for their generation, especially when the researcher's interest - and expertise - is more on the data communication than on the traffic simulation. Using the Google Maps API it is possible to generate complex mobility traces, simply by providing a start and end point. Since the API is robust, well documented and supported, it can be assumed it will be available in the future.
  • About me: I'm a bachelor's student, currently doing an internship at CISTER (Research Center in Real-Time and Embedded Computing Systems) as part of my course's curriculum, where I'm working closely with ns-3. As part of my internship, I’ll be working closely with VANET simulations in ns-3.

Approach

I plan to download a mobility trace as the XML output of the Google Maps Directions API. This API provides its user with an encoded polyline string, which can be easily transformed into geographical coordinates. These, in turn, can be transformed into Cartesian coordinates for use with the NS-3 mobility module. I plan to use in particular ns3::Waypoint and ns3::WaypointMobilityModule classes to import the data contained in the XML trace into the simulator. I plan to allow easy integration for other APIs, if needed, but I'm not going to implement it in this project. I will also provide examples with different wireless technologies, such as LTE and 802.11p/WAVE.

Deliverables

I plan to add classes to the Mobility model to contact the Google API and parse the information received into geographical coordinates. By converting those coordinates to Cartesian coordinates it is then possible to create mobility waypoints It is also possible to provide a rough simulation for the speed at which a node can travel between given waypoints, by considering the speed limits in the tract for a car, and using default values for cycling, walking, and public transportation.

Plan

Each Milestone includes a period of half a week dedicated to test that milestone.

  • First and second week – Design the application and further study its implementation
  • Third and fourth weeks – Implement the design skeleton and implement methods for specifying the information to access and to convert that information to a format that NS-3 can understand
  • Fifth and sixth weeks – Implement methods for converting the information given by Google Maps into waypoints in order to generate a trace based on the Google Maps route. Develop an algorithm to set up reasonable values for the speed of the car/person between two waypoints.
  • Seventh and eight weeks – Perform exhaustive testing to the functionalities implemented.
  • Ninth and tenth weeks – Correct existing bugs and prepare patch

Code repository

My code can be found here

Status Reports

Per agreement with my mentors, I opted for status reports instead of weekly reviews. The idea behind these code reviews is to post one once I accomplish a milestone.

First Status Report

I set my first milestone as being able to generate a mobility trace given real world start and endpoints (street names, for example), from the ns3 simulation environment.

Notes

The ns3::WaypointMobilityModel works by adding ns3::Waypoints to a dequeue sequentially.

The Google Maps Directions service, however, provides an XML that contains the following concepts:

  • Leg - A Leg is a list of Steps. Legs only occur if the user specifies a Waypoint (A to B, passing through C)
  • Step - A Step contains Points encoded in a polyline
  • Point - A latitude/longitude set

To create a mobility trace, my module uses a list of Legs, each one containing a list of Steps and these, in turn, with a list of points.

At the time, the ns3::WaypointMobilityModel defines a journey as an ordered (by time) sequence of ns3::Waypoints. My module defines journey as a list of Legs, with each Leg having a list of Steps and each Step with a list of Points.

Module Design

In order to provide a robust module, it was crucial to design it in such a way that it could be possible to add support for other APIs (such as the OpenStreetMaps's). To achieve this, the Strategy design pattern was used.

Use Cases

I identified the following use cases:

Create mobility trace for a node

  • Name: Create mobility trace for a node
  • Actors: User
  • Description: The user is able to request the module to generate a mobility trace for a single node, based on a given real world route.
  • Preconditions:
  1. The user has internet access
  2. The user possesses a valid API key
  3. The Google Maps Directions service identifies correctly the start and endpoint provided

Create mobility traces for various nodes

  • Name: Create mobility traces for various nodes
  • Actors: User
  • Description: The user is able to request the module to generate a mobility trace for a fixed number of nodes, based on a real world route.
  • Preconditions:
  1. The user has internet access
  2. The user possesses a valid API key
  3. The user provides a list or an array of start and endpoint tokens correctly
  4. The user provides the same number of start and endpoint tokens as nodes in the node container
  5. The Google Maps Directions service identifies correctly the start and endpoint provided

Automatic creation of mobility traces for a node container

  • Name: Automatic creation of mobility traces for a node container
  • Actors: User
  • Description: The user is able to request the module to generate a mobility trace for various nodes, based on a real world route.

This use case will require further study as how to implement it in a way that it is able to generate mobility traces for all nodes in a numerous node container (1000 nodes, for example).

I'm planning on using the Google Maps Places service to generate the start and endpoint tokens required, but due to a few limitations of the service, I'll need to find a workaround to support numerous node containers.

For this iteration, this feature was not implemented

Dependencies

This module is dependent of the following libraries:

  • libcurlpp
  • Xerces-C++
  • GeographicLib

Summary

In summary, these past weeks I achieved the following:

  • Designed the module
  • Coded the classes responsible for performing the API request and treat the information received into a format ns3 can understand
  • Coded use cases: "Create mobility trace for a node" and "Create mobility traces for various nodes"
  • Documented the application using Doxygen and with UML Diagrams

Bellow, you can view the class diagram, the use case diagram and the sequence diagram for the "Create mobility trace for a node" use case.