Geographic Routing using a Cell Structure in Wireless Ad-hoc Networks
1. UNIVERSIDAD CARLOS III DE MADRID
INGENIERÍA DE TELECOMUNICACIÓN
PROYECTO FIN DE CARRERA
Geographic Routing using a Cell Structure
in Wireless Ad-hoc Networks
Autora:
Inés María Bebea González
Tutores:
Celeste Campo Vázquez
Dpto. Ingeniería Telemática
Universidad Carlos III de Madrid
Stefan Rührup
Heinz Nixdorf Institut
Universidad de Paderborn
Octubre de 2007
5. Agradecimientos
Hoy es un día importante. No ya por la defensa de este Proyecto en sí y por el extenso
trabajo realizado, sino porque viene a ser además el fin formal de una larga etapa de mi
vida. Junto a la nostalgia que a todo final acompaña y los recuerdos difuminados por el pa-
so del tiempo, que me quiten lo bailaoo y la inquietante expectativa ante lo que queda por vivir.
Me siento enormemente afortunada por haber tenido acceso a la formación académica que
ahora termina y a la gran cantidad de vivencias que la han acompañado en estos seis años.
Gracias ante todo a mi familia por su confianza y apoyo en todo momento y, sobre todo, por
dejarme soñar.
A todos aquellos que he encontrado en el camino aquí y allá, junto a los que he aprendido y
compartido alegrías y algún disgusto, bailes, paseos, laboratorios, risas, debates, bibliotecas,
éxitos y fracasos, viajes, luchas, sueño y sueños... GRACIAS.
V
7. Resumen
Contexto
El presente Proyecto Final de Carrera es el resultado de dos años de trabajo que se han desa-
rrollado en las Universidades de Paderborn (Alemania) y Carlos III, de ahí que el grueso del
proyecto se presente en lengua inglesa. Durante el primer año el proyecto fue desarrollado en
Alemania y tutelado principalmente por Stefan Rührup, con el cual se llevó a cabo el diseño
de CGFP de manera conjunta. El segundo año continuó dicho trabajo con Stefan ahora a dis-
tancia desde la Universidad Carlos III con el apoyo de Celeste Campo. El producto final de
tan prolongados esfuerzos es la tesis que se presenta a continuación.
Motivación
Una red ad-hoc inalámbrica consta de una colección de nodos dispersos geográficamente
que se comunican entre sí mediante ondas electromagnéticas propagándose en el aire. Las
redes ad-hoc se caracterizan además porque son redes distribuidas y generalmente los nodos
son aparatos con memoria y batería limitadas, lo cual fuerza al ahorro energético a toda
costa. Las comunicaciones inalámbricas gozan de gran interés debido a la dificultad para
encontrar rutas fiables entre pares de nodos comunicantes. Un nodo emisor generalmente
deberá enviar un mensaje a través de varios nodos intermedios hasta alcanzar su destino,
debido a que el radio de cobertura de cada nodo es limitado y no cubre ni mucho menos todo
el área dispuesto para la red. El problema adquiere mayor complejidad al considerar nodos
móviles, ya que la topología de la red cambiará constantemente. Sin embargo, es crucial
poder asegurar que todos los mensajes generados en la red se entregarán a sus destinos: ésta
es la tarea de los protocolos de enrutado. Este Proyecto se centra en protocolos de enrutado
basados en posicionamiento para redes ad-hoc inalámbricas, en los cuales se asume los nodos
son capaces de determinar su localización geográfica. En anteriores investigaciones se ha
VII
8. demostrado que el reenvío de paquetes utilizando información geográfica no es complicado.
Sin embargo, existen situaciones más complicadas, como regiones de baja densidad de nodos
o topologías inconexas que disparan la pérdida de paquetes. Para estos casos se ha de proceder
con otras decisiones para encontrar rutas alternativas.
Las redes ad-hoc han recibido un interés creciente en los últimos años y se han expandido en
multitud de campos incluida la interconexión de dispositivos electrónicos personales como
portátiles, móviles y PDAs, redes de comunicación para emergencias y desastres naturales,
redes de sensores, infraestructura básica de comunicaciones en regiones aisladas del planeta,
etc. Su diseño y perfeccionamiento envuelve diversos campos de la ingeniería desde el
desarrollo hardware, construyéndose cada vez dispositivos de menor tamaño aunque mayor
capacidad y prestaciones, a desarrollo software en aplicaciones y estrategias de comunicación
más avanzadas. Sin embargo, la mayor limitación de los dispositivos ad-hoc es su consumo
energético, el cual viene principalmente de la comunicación: potencia de transmisión y
recepción. Es posible encontrar una extensa bibliografía al respecto acerca de diseño de
antenas para redes ad-hoc, diseños de circuitería electrónica, técnicas de acceso al medio y
estrategias de enrutado pensados para reducir al mínimo dicho consumo.
Como ya se ha comentado, el radio de transmisión de los nodos en redes ad-hoc es limitado,
por lo que se han desarrollado estrategias de enrutado multisalto. Existen multitud de algorit-
mos para controlar la topología de la red de modo que cada nodo pueda encontrar rutas hacia
los demás. Se puede distinguir entre protocolos centralizados o localizados. Los primeros
asignan a ciertos nodos un conocimiento más extenso o total de la red mientras los demás
nodos han de consultarlos, aunque esto hace que ciertos nodos sean críticos. Los segundos
sólo precisan la interacción de los nodos con sus vecinos próximos para lograr objetivos
globales. También cabe diferenciar entre estrategias proactivas, basadas en tablas de rutas
permanentemente actualizadas, y reactivas, donde la topología se construye sólo como paso
previo a la comunicación. En protocolos geográficos o basados en posicionamiento el hecho
de disponer de una visión tan reducida de la red se complementa con el conocimiento de
las posiciones geográficas. Dichos algoritmos son localizados y no manejan tablas de rutas,
ya que esto tiene un coste elevado. Dado que se conoce dónde se encuentra el destinatario,
los paquetes se envían trazando una ruta que implique progreso en cada salto, esto es, en
cada salto el paquete estará más cerca del destinatario. En esto consiste el método greedy de
enrutado.
VIII
9. En ocasiones no es posible progresar, y el paquete se queda bloqueado en algún nodo o se
generan bucles en regiones de la red más despobladas. Para recuperarse de estas situaciones
existen varios métodos recovery. Uno de ellos consiste en planarizar la topología y así para
poder bordear el área hueca siguiendo la regla de la mano derecha. Ésta es la técnica desa-
rrollada en GPSR [KK00], Greedy Perimeter Stateless Routing, y que se estudia en detalle en
este Proyecto, incluyéndose la implementación de dicho protocolo. Sin embargo, precisamen-
te debido a la planarización se inutilizan numerosos enlaces, sobrecargando algunos nodos de
la red. Por ello se ha diseñado a lo largo de este Proyecto un nuevo protocolo basado en una
estructura celular de la red, Cell-based Geographic Forwarding Protocol, basado en las indi-
caciones propuestas por Rührup [RS05] En este protocolo todos los enlaces en la topología de
red son susceptibles de ser utilizados en la creación de rutas.
Objetivos
El objetivo central de este proyecto es el diseño de un protocolo de enrutado basado en una
estructura cuadriculada y su implementación y evaluación de prestaciones mediante el uso de
una herramienta de simulación de redes. Para ello se debe desarrollar un amplio estudio sobre
las técnicas de enrutado en redes ad-hoc y más concretamente sobre enrutado geográfico.
Asimismo ha de conocer el algoritmo GPSR e implementarlo en la herramienta de simulación
escogida, y por tanto, aprender a manejar dicho simulador. Esta implementación se comparará
con aquella del nuevo protocolo para así realizar un estudio comparativo de prestaciones,
haciendo más fiable la validación del protocolo propuesto.
Estado del Arte
En esta sección se realiza una descripción del estado del arte de las técnicas de enrutado
geográfico, en especial GPSR, y de las herramientas de simulación de redes.
En routing geográfico, las decisiones de reenvío se basan en la posición del destinatario y la
posición de vecinos intermedios a un salto de distancia (1-hop neighbors). Greedy Perimeter
Stateless Routing, GPSR, es una estrategia que utiliza tan sólo información local en los
nodos. Un nodo conoce las posiciones de sus vecinos tras haberlas recibido en sucesivos
broadcasts llamados beacons. GPSR utiliza generalmente la regla greedy y una técnica
IX
10. recovery para sortear barreras o huecos cuando greedy falla. Existen varios métodos greedy,
pero el implementado en GPSR es MFR, Most Forwarding wirhin Radius, que decide por el
vecino que consigue más progreso hacia el destinatario.
Cuando hay baja densidad nodal en una zona de la red, se dice que encontramos una barrera.
En estos casos, puede suceder que el nodo que tiene el paquete sea el más próximo de entre
sus vecinos, y la regla greedy se bloquea. Para ello GPSR bordea la barrera siguiendo la regla
de la mano derecha (ver Figura 2.1). En ocasiones esta estrategia puede incurrir en bucles,
cuando entre varios nodos hay enlaces que se cruzan. Esto se evita planarizando la topología
de la red y eliminando de éstos los enlaces más largos. La planarización se basa en que la
topología puede ser representada como un grafo donde los nodos son los vértices y las aristas
se dibujan entre nodos conectados directamente, esto es, si la distancia euclídea entre ellos es
como mucho el radio de transmisión común a ambos. En general los grafos son no planares,
por lo que es necesario realizar una conversión que puede aplicarse localmente. GPSR utiliza
dos tipos de planarización: Gabriel Graph y Relative Neighborhood Graph. Entonces, GPSR
aplica su técnica recovery frente a barreras sobre la topología previamente planarizada.
Desafortunadamente, la planarización priva al enrutado de los enlaces más largos entre nodos,
de modo que elimina la posibilidad de encontrar la ruta más corta entre emisor y destinatario.
Por esta razón, Rührup [RS05] propone una herramienta de control topológico local que evita
esta desventaja. La idea es construir una estructura virtual de clusters gegráficos que contiene
información de los vecinos de segundo salto (2nd-hop) en cada nodo. Los nodos clasifican
las celdas que "ven"según haya vecinos, enlaces o barreras. Esta estructura se construye
localmente en cada nodo y contiene la información necesaria para aplicar las técnicas greedy
y recovery.
El diseño de protocolos de comunicaciones debe ser evaluado mediante técnicas de modela-
do y simulación. En la actualidad existen modelos simplificados que permiten definir dichos
protocolos utilizando lenguajes orientados a objetos como Java o C++, que facilitan la exten-
sión y adaptación de los modelos. Existen muchos simuladores de redes y probablemente el
más extendido es ns-2, un simulador de eventos discretos. Sin embargo, la implementación
en este entorno es ardua y apenas se puede extender a redes no IP. OMNeT++ sin embargo
es un simulador de eventos discretos mucho más manejable, ya que se compone de módulos
jerárquicos y se programa en lenguaje C++. En OMNeT un nodo de la red puede definirse
X
11. como un módulo que se compone de submódulos para los diversos niveles de comunicación:
aplicación, transporte, red y enlace. Cada uno de ellos se programa por separado como una
clase C++, y todos los nodos de la red son instancias de este módulo. OMNeT incluye además
librerías soporte para enrutado. Al tratarse se una herramienta de código abierto, otros desa-
rrolladores pueden ampliar sus librerías fácilmente. Para el desarrollo de este Proyecto ha sido
crucial la existencia de las librerías de la extensión Mobility Framework como soporte para
nodos inalámbricos y móviles. Sin embargo, OMNeT tiene aún mucho trabajo por delante, y
las herramientas de procesado estadístico son algo pobres. Aun así, se puede complementar
con programas de cálculo como Matlab, para realizar cálculos y representaciones gráficas más
elaboradas.
Cell-based Geographic Forwarding Protocol
El diseño e implementación del protocolo CGFP, Cell-based Geographic Forwarding Proto-
col, ha consumido los mayores esfuerzos en el desarrollo del presente Proyecto. CGFP genera
una estructura celular (cell structure) que es una abstracción de la red en tanto representa
una clasificación de las diferentes regiones del territorio de red en una cuadrícula virtual
(ver Figura 3.1). Dicha estructura se compone de celdas enlace (link cells) y celdas barrera
(barrier cells), las cuales indican en qué regiones es posible la comunicación y en cuáles no.
Cada división en la cuadrícula se denomina celda, su tamaño es directamente proporcional al
radio de transmisión y cada celda es identifica de forma unívoca por sus coordenadas celulares.
CGFP asume que la localización geográfica de los nodos es conocida mediante un cierto ser-
vicio de posicionamiento. Como el tamaño de las celdas es conocido, resulta inmediato para
todos los nodos traducir sus coordenadas geográficas en coordenadas celulares globales. Los
nodos de la red almacenan información sobre el área que los rodea también en forma de es-
tructura celular, pero esta vez indexada por coordenadas celulares locales relativas a la celda
donde se encuentra dicho nodo, i.e. este nodo en su propia estructura celular se encuentra en
la celda (0,0). Cada nodo clasifica las celdas a su alrededor en 3 tipos:
– link cells, aquéllas contenidas en la mitad del radio de transmisión de cualquier nodo o
aquéllas cortadas por una arista,
– barrier cells, contenida en el radio de transmisión,
– unclassified cells, exterior al radio de transmisión o más cercana a algún vecino.
XI
12. Como CGFP es un algoritmo distribuido, cada nodo almacena una lista de sus vecinos y
también dos vistas (Views). Las vistas son estructuras celulares que contienen celdas basadas
en información de vecinos a uno o dos saltos de distancia respectivamente. La primera
vista , View 1, posee información de primera mano que cada nodo difunde periódicamente
junto a la lista de vecinos, mientras que la segunda, View 2 es utilizada localmente en el
proceso de enrutado. Las vistas (Views) se inicializan en cada nodo al desplegarse la red. Sin
embargo, estas estructuras han de ir actualizándose a medida que se recibe información de
los vecinos y, en redes móviles, cuando el propio nodo se desplaza. La tarea de actualizar las
estructuras celulares requiere gran cuidado, ya que si fallamos, el enrutado también quedará
inservible. En la implementación surgieron problemas concretos con estas actualizaciones
que se comentan e ilustran con ejemplos en el capítulo 3.
En el protocolo CGFP las rutas de paquetes se construyen basándose en la estructura celular y
utilizando estrategias de reenvío greedy y recovery con la regla de la mano derecha. Cada vez
que un nodo recibe un paquete cuyo destinatario es otro, debe reenviarlo. Si el destinatario se
encuentra entre sus vecinos, entonces deberá entregar el paquete al vecino correspondiente,
y en caso contrario deberá escoger un vecino situado en la posición más prometedora. Este
procedimiento es análogo a GPSR, salvo que la decisión se realiza ahora en base a la estruc-
tura celular. El paquete recibido contiene información acerca de la celda actual, donde reside
virtualmente. Desde dicha celda, el nodo construye una ruta virtual entre celdas ortogonales
en View 2 aplicando greedy o recovery hasta encontrar una celda perteneciente a un vecino,
al cual se reenvía físicamente el paquete. Este procedimiento se repite en cada salto hasta que
los paquetes son entregados a los destinatarios correspondientes.
Implementación
OMNeT++ es un simulador de eventos discretos basado en jerarquías modulares. Los módulos
se especifican utilizando un lenguaje propio de OMNeT, NED, y sus funciones se programan
posteriormente utilizando clases C++. Los parámetros fijos en cada módulo se pueden definir
a priori en las simulaciones mediante los archivos de inicialización, omnetpp.ini. También los
campos las cabeceras de mensajes intercambiables entre nodos de la red se pueden codificar
en archivos MSG, cuya arquitectura se importa desde los diferentes módulos para generar y
encapsular paquetes.
XII
13. En las simulaciones de redes utilizando OMNeT se han definido:
– escenario: un área rectangular de simulación donde se sitúan los nodos de la red.
– nodos: las características de los nodos de la red: protocolos de comunicación, movili-
dad...
– formato de mensaje: cabeceras y datos contenidos en los paquetes de comunicación.
– parámetros relativos al modelo comunicativo a nivel físico, temporizadores, etc.
– generación de estadísticas: recolección de los eventos importantes sucedidos durante la
simulación para caracterizar y evaluar el comportamiento de los protocolos implemen-
tados.
La implementación de los protocolos de enrutado geográfico GPSR y CGFP depende de la
construcción de una pila de protocolos, similar a los niveles OSI, que defina el comportamien-
to de los nodos desde el nivel físico al de aplicación. A nivel físico las ondas electromagnéticas
recibidas por el aire se han de convertir en información digital. En un nivel superior se han
de implementar técnicas de control acceso al medio, MAC, para evitar colisiones entre las
transmisiones de nodos cercanos que se comunican en el medio inalámbrico. Estas dos capas
se implementan en el Mobility Framework como un único módulo nic, network interface
control. Existe en estas librerías una implementación del estándar IEEE 802.11 para WLANs,
que es el utilizado como capa de enlace en las simulaciones de este Proyecto por tres simples
razones: es un estándar bien definido, la implementación existente de GPSR aunque en ns-2
utiliza este estándar, y además está ya programado en OMNeT++/MF. Tanto GPSR como
CGFP son los responsables de garantizar la entrega de paquetes en la red siempre que exista
una ruta entre emisor y destinatario. Por ello, estos protocolos se han implementado en nivel
de red, esto es, en el módulo net. En nivel superior se encontrarían los niveles de transporte
y aplicación, que se han simplificado en un único módulo appl capaz de generar y absorber
tráfico. Además de estos tres submódulos de comunicación, un nodo definido en MF contiene
además otros dos submódulos: blackboard y mobility, encargados de pasar información entre
módulos y proporcionar movilidad al nodo e información sobre su posición geográfica en
el escenario respectivamente. El paquete WLAN contenido en la versión de Mobility Fra-
mework 1.0a5 utilizado en este Proyecto es todavía muy básico y no soporta retransmisiones
ni colisiones en zonas muy densamente pobladas. Por ello sólo ha sido posible experimentar
con escenarios estáticos.
De manera esquemática, las funciones que realiza GPSR son:
XIII
14. – difusión de beacons,
– encontrar una ruta hacia la posición del destinatario,
– mantener la información local actualizada, esto es, la lista de vecinos.
En CGFP se ha creado un módulo específico, denominado cellstr, que gestiona la estructura
celular: actualizaciones y descubrimiento de rutas en celdas. Dicho módulo realiza las siguien-
tes tareas complementarias a las antes mencionadas para también GPSR:
– encontrar una ruta virtual en la estructura celular hacia la posición del destinatario,
– actualizar las estructuras celulares (Views).
Con el fin de ilustrar de forma práctica el funcionamiento de CGFP en OMNeT++, el ejemplo
siguiente muestra la generación de tráfico en un nodo:
1. El módulo de aplicación genera un mensaje para un destinatario aleatorio tras un even-
to de timeout. El módulo mobility proporciona información acerca de la posición del
destinatario y la clase cTopology de OMNeT calcula la longitud de la ruta si es que
existe. Los datos del mensaje se encapsulan en una cabecera que contiene identificador
y posición del destinatario. El paquete se pasa al nivel inferior.
2. El módulo net recibe el paquete. Si el destinatario está registrado en la lista de vecinos,
entonces se encapsula y se entrega al módulo nic para que lo reenvíe a dicho vecino. En
caso contrario, el paquete se pasa al módulo cellstr para que descubra el camino virtual
en View 2 y, consecuentemente, el nodo de siguiente salto.
3. Una función en cellstr comienza a descubrir rutas, en modo greedy o recovery según
corresponda, y al llegar a una celda donde no puede avanzar, almacena en el mensaje
las coordenadas de dicha celda y el vecino a que pertenece. El paquete se devuelve al
módulo net, que lo reenviará al vecino correspondiente.
4. El módulo net encapsula el mensaje incluyendo información para el enrutado virtual en
el siguiente nodo. El paquete se entrega al módulo nic, para que inicie el algoritmo de
contienda que transmitirá la información evitando colisiones.
Con el objetivo de asegurar la fiabilidad de los resultados obtenidos, se han realizado múlti-
ples simulaciones variando ciertos parámetros y generando escenarios diversos permitiendo
un grado controlable de aleatoriedad, que permite que se repitan exactamente las mismas
situaciones con ambos protocolos, facilitando la comparación de sus prestaciones. Durante
las simulaciones se han recogido datos acerca de la longitud de las rutas trazadas por cada
XIV
15. protocolo, la complejidad de los escenarios propuestos en cuando a la dificultad de sortear
barreras y la memoria consumida en los nodos para almacenar información local. Las
ejecuciones se automatizaron usando scripts y awk, mientras los cálculos estadísticos y las
gráficas se generaron con MATLAB.
Para conocer en profundidad las implementaciones presentadas en este Proyecto se remite al
lector al anexo B que incluye una breve documentación de las clases implementadas para el
protocolo CGFP. El CD-ROM que acompaña este texto contiene el código completo escrito
para la simulación de GPSR y CGFP, así como código adicional empleado en el procesado de
las muestras estadísticas.
Resultados
En este apartado se explican las experiencias obtenidas con cada protocolo por separado,
así como un estudio comparativo de ambos. En primer lugar, se muestran los estadísti-
cos correspondientes a las simulaciones de GPSR: una comparación de las longitudes de
las rutas descubiertas utilizando dos planarizaciones diferentes: Gabriel Graph y Relative
Neighborhood Graph, y el detalle de las rutas recovery para los escenarios propuestos. Esta
experiencia muestra que en situaciones de alta densidad nodal, un porcentaje mínimo de
paquetes necesitan la técnica recovery, como es de esperar ya que apenas existen barreras.
Esto se aplica a escenarios estáticos donde los nodos se han colocado aleatoriamente. En estas
simulaciones se observa cómo se pueden encontrar escenarios más complejos que ponen a
prueba las técnicas recovery.
A continuación se realizan los mismos experimentos para CGFP, obteniendo conclusiones
similares. Adicionalmente se presenta una comparación de las rutas obtenidas en diversas
simulaciones variando el parámetro del factor de celda, CF, que determina el tamaño de la
cuadrícula base para la estructura celular. También en este caso se observa con claridad lo
comentado anteriormente respecto a la complejidad de los escenarios.
Posteriormente se han comparado ambos protocolos y su funcionamiento separado en modo
greedy o recovery. En los resultados obtenidos se observa que la respuesta de GPSR para los
paquetes greedy es siempre ligeramente mejor, ya que el método MFR aporta más progreso
XV
16. que el enrutado de celdas. Por otro lado, en los paquetes recovery se distinguen dos patrones:
CGFP funciona bien en escenarios aleatorios, mientras GPSR resulta más satisfactorio en los
escenarios laberínticos. Esto se debe a que estas topologías son cuasi-planares y GPSR utiliza
todos los enlaces posibles, luego CGFP no se beneficia de su mayor ventaja sobre GPSR.
Conclusiones y trabajo futuro
A lo largo de este Proyecto Final de Carrera se han implementado dos protocolos de enru-
tado geográfico y se han analizado y comparado sus prestaciones. Este trabajo incluye un
estudio detallado de la estrategias empleadas típicamente en redes ad hoc, especialmente
GPSR, así como el diseño de un nuevo protocolo, CGFP, basado en una estructura celular.
CGFP, Cell-based Geographic Forwarding Protocol, se presenta en este texto y culmina
con la copublicación de un informe técnico junto a Stefan Rührup [BR06]. Además ambos
protocolos han sido implementados y simulados en OMNeT++, una herramienta de código
abierto para la simulación de redes. El trabajo desarrollado en este proyecto ha implicado, por
tanto, el estudio de la bibliografía existente y aprendizaje de diversas herramientas software
incluyendo OMNeT++ y librerías adicionales, repositorios CVS, scripts.
Los resultados experimentales, que pretenden resumir una comparación entre los protocolos
GPSR y CGFP, han demostrado que el protocolo propuesto CFGP es más eficiente en casos
en los que la topología de red contiene barreras, mientras GPSR tiene una respuesta casi
perfecta en redes sin barreras. Por este motivo se propone como trabajo futuro la combinación
de la estrategia MFR utilizada por GPSR como técnica greedy y la mejora de la técnica de
enrutado celular propuesta por CGFP en zonas con barreras. Por otro lado, cabe destacar que
las aspiraciones iniciales de experimentar con diversos patrones de tráfico y redes móviles se
han visto limitadas por la simplicidad de las funciones proporcionadas por OMNeT++/MF.
En futuros trabajos seguramente muchos de las limitaciones encontradas queden solventadas
por el avance de estas y otras herramientas de simulación.
XVI
17. Acrónimos
ACK Acknowledgment message
AODV Ad hoc On-Demand Distance Vector Routing
AWK Programming language for processing text-based data
CDMA Code Division Multiple Access
CF Cell Factor for cell coordinate conversion in CGFP
CGFP Cell-based Geographic Forwarding Protocol
DREAM Distance Routing Effect Algorithm for Mobility
DSDV Destination-Sequenced Distance-Vector routing
DSR Dynamic Source Routing
FDMA Frequency Division Multiple Access
GG Gabriel Graph
GPS Global Positioning System
GPSR Greedy Perimeter Stateless Routing
INET INET Framework support for for wired, wireless and mobile simulations in OMNeT++
MAC Medium Access Control
MF Mobility Framework support for wireless and mobile simulations in OMNeT++
MFR Most Forward within Radius
NED Network topology description language for OMNeT++
NFP Nearest with Forward Progress
OMNET++ Objective Modular Network Test-bed in C++ simulation tool
PED Personal Electronic Device
RNG Relative Neighborhood Graph
XVII
18. SDMA Space Division Multiple Access
TDMA Time Division Multiple Access
UDG Unit Disk Graph
WLAN Wireless Local Area Network
WSN Wireless Sensor Network
XVIII
23. 1. Introduction
1.1. Motivation
A Wireless Ad Hoc Network consists of a collection of geographically dispersed nodes that
communicate with each other over a wireless medium. First, it may be interesting to highlight
some crucial properties of such networks:
The communication environment is not wired and may include mobility also.
Decentralized. No node is more important than another and packets can be rerouted over
any of them. The main difference is then that ad hoc networks do not rely on expensive
infrastructure of base stations throughout the usage area. Instead, data packets hop from
one node to another until destination is reached.
Hosts are power constrained, as soon as they carry power limited batteries which are
costly to be replace, i.e. sensor nodes are hardly accessible in some sensor networks
scenarios (earthquakes, forest-fire monitoring, etc.).
Communications in wireless networks are of particular interest due to the difficulty of dis-
covering liable paths between pairs of hosts. A source node would typically send a message
through several intermediate nodes until it reaches some other destination node. The wireless
environment must be taken into account as soon as the network topology is variable when
considering mobility. Moreover link connectivity depends on factors such as the transmission
radius or signal attenuation. These details are beyond the scope of this thesis and therefore
they are considered as node parameters. However, it is a matter of routing to ensure packet
delivery in such scenarios. Networks are traditionally modeled using graphs and shortest path
algorithms - Dijkstra or Floyd-Warshall are commonly computed. Although this can be easily
implemented in wired networks, our routing problem requires now more specific solutions.
Then approaches rely on on-line route discovery or the maintenance of routing tables.
1
24. 1. Introduction
Multiple applications are being developed for ad hoc networks in recent years. The expansion
on the use of various personal electronic devices (PEDs) follow the demand of interconnecting
them in an ad hoc fashion. These networks can also be used in disaster relief, such as fire,
flood and earthquake, communications between vehicles, conference environments, tactical
communications and law enforcement (search and rescue). Other contexts include ad hoc
networks as auxiliary networks used in case of failure of the wired system, such as rooftop
networks, static networks with nodes placed on top of buildings. A particularization of ad
hoc networks which receives an special interest are the so called Wireless Sensor Networks
(WSN). Such networks are constituted by hundreds or thousands of small motes that are
able to sense their environment in different manners: temperature, velocity, lightness, sound,
etc. One could say that while ad hoc networks are in general node centric, WSN are data
centric, as communication is based on the interest of collect specific information in a certain
region and not to communicate a couple of determined users. WSN are oriented to potential
commercial applications such as emergency response, real time or building safety monitoring.
Also developing countries can benefit from the autonomy of ad hoc networks. Seoane et al.
[SOSM06] suggest the design of a solar-powered wireless node for low costs static mesh
networks. Other applications which are still under development, are ad hoc access to WLAN
Internet access points, packet radio networks, etc.
Ad hoc networks have received growing interest in recent years and they involve various
fields in Telecommunications engineering, from hardware development in terms of antenna
design, high frequency and electronic circuitry to topology, routing or application schemes.
The main restriction in ad hoc networks design is to reduce power consumption of the
network. Nodes mainly have a small power supply unit, an antenna, a processor, local
memory and some peripherals, such as a photo diode for light measurement in a sensor
network. The activity that consumes more energy at node is communication: transmitting and
receiving power. Thus, two main different techniques have been proposed: reduce number
of transmissions per communication link between pairs of nodes while maintaining power
transmission level for all nodes, or adjust transmission power level and redirect the antenna to
the destination node. The first goal is achieved using topology control ensuring connectivity
with minimal transmission power for each node and for the second goal, technical approaches
on smart antennas for mobile ad hoc networks exist.
2
25. 1.1. Motivation
Nodes that share a wireless medium need techniques of channel multiple access: Time
Division Multiple Access (TDMA), Frequency Division Multiple Access (FDMA), Code
Division Multiple Access (CDMA) and Space Division Multiple Access (SDMA). This work
discusses routing protocols over the medium access control (MAC) protocol of the IEEE
802.11 Wireless Local Area Network (WLAN) Standard, based on a TDMA schedule.
Because, by definition, the responsibilities of organizing and controlling an ad hoc network
are distributed to each node, efficient routing protocols must be designed in a distributed
manner and also be independent of topology. This work focuses on position-based routing in
wireless ad-hoc networks, where each node has the ability to determine its own geographical
position. Geographical routing improvements focus on consuming minimum node storage and
energy, and choosing the good direction in order to bring the packet nearer to its destination.
Previous researches [BMSU01, KWZ02, GS04, KSU99] demonstrated that forwarding
packets towards a destination is not complicated using geographical information of certain
areas in the network. However, one must also consider other special cases, i.e. low node
density or disconnected graphs increase packet losses because a path does not necessarily
exist for every pair of nodes in the network. In those cases other routing decisions follow in
order to recover from the cul-de-sac and find another path.
Limited transmission radius leads to multi-hop routing schemes because in general, direct
communication between source host and destination is not feasible. Frequently, in ad hoc
networks hosts are both end-terminals and routers at the same time. As said before, both host
mobility and also variable node activity produce topology changes.
Various topology control schemes have been proposed in order to have a fast response over
topology variations. The most basic requirements for an ad hoc network are connectivity and
energy efficiency, e.g. if a node moves away from the neighbor which is connected to the
graph then a handover to a new neighbor occurs. A rough classification distinguishes between
centralized or localized algorithms, and proactive or on-demand. Centralized protocols for
topology update need to know conditions at every point in the network and those nodes are
of higher importance than the rest. Consequently a failure occurring on a critical node may
cause serious problems on protocol functionality. On the other hand, localized algorithms
only require interaction of the nodes with neighbors in close proximity in order to achieve
global objectives. Secondly, both routing and topology schemes can also be proactive (e.g.
3
26. 1. Introduction
DSDV [PB94]) or on-demand (e.g. DSR [JM96]). For the first ones, the routing tables are
periodically updated with recent changes on the network or on the nodes, and also uptodate
routes are stored. In contrast, on-demand algorithms build the topology only when a pair
of nodes want to communicate, i.e. flooding schemes. Routing protocols presented in this
thesis are localized and relay on a proactive topology control of the neighborhood (based on
beaconing) and on-demand routing. Thus reduced ’visual fieldóf nodes is complemented by
knowledge of geographical positions.
The traditional routing approach based on IP addressing leads to huge overhead and low
scalability when considering ad hoc networks. Addressing is still a matter of research in such
wireless environments. For now, let hosts know their own position. The Global Positioning
System as an example for obtaining location of nodes is not so preposterous, as tiny and low
cost GPS receivers are already commercial. This document assumes positioning information
is accurate, although real systems poses some problems in terms of reliability. Thus a routing
scheme which uses such information would address network nodes with respect to their
position. Note that the combination of localized topology techniques with position-based
routing causes that a node is only conscious of the sub-topology of its neighborhood, which is
a subgraph where the node itself and their neighbors are included. This solution is both logical
and effective, as soon as it supports scalability and robustness to mobility. As an example,
in sensor networks, the useful information one expects to collect from a host is interesting
because certain measurements must be done in a given area, but the node itself is unimportant.
Position-based or geographical routing does not manage tables of routes. Such a task invol-
ves a high cost and thus on-demand routes are traced using node’s own position, position
of neighbors and destination’s location1 . Then progress consists of forwarding a packet to a
neighboring node which is closer to the destination, that is, in each hop the packet is nearer to
destination. The position of neighbors is typically learned by means of one-hop broadcast. All
nodes periodically send these beacons containing the position of sending node. Three main
routing strategies are distinguished in [WMHF02]: greedy forwarding, directed flooding and
hierarchical routing. For these schemes, a given packet is forwarded to one (greedy) or mo-
re (directed flooding) one-hop neighbors that are closer to the destination. The third strategy
forms a hierarchy that scales to a large number of nodes; it typically combines position-based
routing with hierarchical topology control or other protocols regarding on hierarchical levels.
1 The position of the target node is supposed to be known via a location service, which provides positioning
information, e.g. by a hierarchical approach [LJC+ 00] or by using hash functions [RKY+ 02].
4
27. 1.2. Objectives
If each node broadcasts its own position to the neighbors at regular intervals, then a node
is able to choose the next node that minimizes the distance to the destination. This greedy
forwarding strategy fails, if the packet gets stuck in a local minimum. In this case a recovery
strategy is applied to find a way out of the dead end. Known recovery strategies guide the pa-
cket around this region using the right-hand rule. Such strategies require a planarization of the
network topology to prevent routing loops. For planarization several subgraph constructions
have been proposed like neighborhood graphs or delaunay triangulations.
Greedy Perimeter Stateless Routing (GPSR) proposed by [KK00] combines greedy forwar-
ding and perimeter traversal on a planar graph. In GPSR a packet which encounters a barrier or
hole (absence of intermediate nodes to forward to), starts bordering this empty area following
the righthand rule on a planarized graph. This procedure avoids routing loops caused by
crossing edges. However, planarization removes longer edges in the graph, thus discarding
shorter paths that could be also used in routing. This is the basis for the approach exposed by
Rührup et al. [RS05]: here all edges are susceptable of being used even in perimeter traversal.
The key is the combination of a network grid together with virtual orthogonal forwarding
among cells and accesibility to larger view of the neighborhood (based on 2-hop neighbor
information).
1.2. Objectives
The main subject of this work is to present the design, implementation and evaluation
of the Cell-based Geographic Forwarding Protocol (CGFP). Stefan Rührup and Christian
Schindelhauer, co-tutors of this thesis, present in [RS05] a strategy for routing packets in
wireless ad hoc networks using a cell structure, which is the basis for this protocol. The design
of CGFP has been developed together with S. Rührup and updated and improved during its
implementation and simulations. This work also includes the co-publication of a Technical
Report [BR06] which constitutes a detailed specification of CGFP.
The development of this thesis involves work efforts which can be divided into a set of main
goals and phases of investigation and experimentation in order to clarify the global vision of
the project.
5
28. 1. Introduction
As it has been described before, wireless ad hoc networks count on little specific pro-
perties that must be studied in detail throughout this thesis. Therefore, a wide preliminar
investigation on the state of the art of actual routing strategies regarding ad hoc networks
is necessary. The theoretical basis of this thesis also includes mathematical notions about
graphs, network topologies and greedy and recovery approaches. It is also crucial a good
understanding of the principles of GPSR, Greedy Perimeter Stateless Routing, [KK00]
and an intensive study of its implementation.
Once previous knowledge is adquired, the Cell-based approach presented in [RS05]
grounds the pilars for the design of an innovative position-based routing protocol: the
Cell-based Geographic Routing Protocol (CGFP).
Simulation environments performed with OMNET++ as network simulator must be
used in order to validate and evaluate the functionalities of both protocols. For this pur-
pose, a preliminar phase consisting of testing easy pre-defined protocols and scenarios
is needed. As OMNET++ is thought to simulate wired networks, for the wireless envi-
ronment is necessary to add the Mobility Framework tool. Tests simulating all together
must follow.
Both protocols, GPSR and CGFP, are being implemented and evaluated using the ne-
twork simulator. The implementation of GPSR in C++ using OMNET++ libraries will
both serve as test-bed for masterizing in the use of OMNET++ and MF and the simula-
tion scenarios. The design and implementation of CGFP are planned to be simultaneous,
so bugs on theoretical protocol functionality are corrected and validated at once.
Definition of parameters, metrics and simulation experiments needed to build a compa-
rison of GPSR and CGFP protocols.
Evaluate the behaviour of the protocols in various scenarios. Determine the complexity
of each scenario from the point of view of the difficulty of a routing scheme that must
ensure packet delivery in any case. Experiment with both static and mobile scenarios.
Masive simulation experiments must be executed in order to obtain collections of statis-
tics for further processing. As the data processing tools in OMNET++ is little poor, data
collected in vectors must be imported by a tool such as Matlab for statistical evaluation
and representation.
Due to the circumstances under which this work is developed, it will also be necessary
to perfect auxiliary tools, such as the use of L TEX, CVS repositories and Visual Studio
A
6
29. 1.3. Thesis Contents
for C-programming under Windows O.S.
1.3. Thesis Contents
This thesis is an intensive study on position-based routing protocols, but not an evaluation of
existing protocols. Furthermore, an implementation of a new approach together with an expe-
rimental evaluation, and the design of a new protocol are submitted here. Present introduction
intends to be an overview on fundamentals of mobile ad hoc networks and routing based on
positioning. In Chapter 2 greedy and recovery techniques are introduced in order to fix impor-
tant concepts that are the basis of GPSR (Greedy Perimeter Stateless Routing) protocol. This
protocol is further studied in detail, implemented and simulated. Then that chapter englobes
the state of the art of geographic routing strategies and the simulation environments available
for validating those protocols. The focus of this thesis is developed in Chapter 3, where a new
approach on geographical routing for ad hoc networks, and specially for wireless sensor ne-
tworks, is considered. A new protocol, CGFP (Cell-based Geographic Forwarding Protocol),
based on this approach has been designed and implemented, and a detailed specification in-
cluding pseudo-code is given. Chapter 4 focuses on the implementation of GPSR and CGFP
protocols and simulations under OMNeT++. Simulation results in Chapter 5 show statistical
collections that intend to be a comparison between both protocols. Finally, the evolution of
this project is exposed in Chapter 6. A reflection on conclusions and further work closes this
document.
7
31. 2. State of the art
2.1. Geographic Routing
Geographic routing, also called position-based routing, uses position information of the
nodes to deliver a message to a target location. Forwarding decisions are based on a packet’s
destination position and the position of intermediate 1-hop neighbors. This scheme has
been studied by several authors [WMHF02, GS02, Sto02, BMSU01]. Three main different
classes of position-based schemes can be distinguished: progress methods (i.e. greedy),
directional flooding and hierarchical algorithms. Hierarchical algorithms are highly scalable
and usually combine low level non-position based approaches and high level position based
communications, and as a result, the complexity of tasks assigned to most nodes gets reduced.
In directional flooding a node A forwards a message to all neighbors which are closer to the
destination than A. This scheme is very robust but needs the memorization of past traffic
(e.g. message number or paths used) in order to control data flows and loops and it also
increases network load. However, the combination of different techniques can yield a bet-
ter performance, i.e. a single path progress method uses flooding when no progress is possible.
Some properties are highly desirable for a good performance of routing in a wireless ad-
hoc network. Giordano and Stojmenovic [GS04] give a list of patterns related to the specific
behavior and limitations of such networks.
Communication complexity refers to the number of radio-transmissions that is requi-
red to send a packet from a source to a position-known destination.
Loop freedom. Avoid packets spinning around the network after no destination is found.
Timeouts and past traffic memorization help to solve this. Loops caused by mobility are
temporal in general and are not considered.
Distributed. In localized algorithms, only local decision based on 1-hop information is
9
32. 2. State of the art
needed to achieve global objectives. A possible solution improvement of performance
would be the exchange of 2-hop information (neighborsñeighbors).
Path strategy. Two main possibilities exist: single path, i.e. greedy and recovery strate-
gies, and multi-path, i.e. flooding (see section 2.1.1.
Low energy consumption: minimum hop count, referred to the number of retransmis-
sions on a route, and optimization of power consumption, when adjustment of transmis-
sion power is possible. Hop count assumes delay is proportional to path length and also
that the cost of retransmission is high in both energy and bandwidth.
Reduced storage. Memorize routes and past traffic are affected by node queue size,
node activity and mobility.
Message delivery. Measures ratio of received messages at destination and messages
sent by senders. Collisions at medium access is a disadvantage.
Scalability. Protocols must response for arbitrary number of nodes, e.g. huge quantity
on sensor networks. A simplification defines a scalable network as it is loop free, loca-
lized and single-path.
Robustness. It is highly desirable that routing schemes are robust against topology chan-
ges, i.e due to mobility. One problem to be considered is the accuracy of destination
position, given by an specific device. In mobile scenarios, routing assumes a target node
can deviate from a known position. Another challenge is the message delivery in pre-
sence of obstacles or noisy areas, where the unit disk graph assumption is violated.
As a resume, most important features of a position-based protocol are to ensure a good
delivery rate and average hop count. Note that density, defined as the number of nodes in the
network, closely affects both parameters. Also node activity can save energy and maintain low
overhead. So it is desirable that nodes are not receiving, transmitting or processing, and stay in
an idle state all time they can. In fact, the WLAN standard defines two modes of operation for
nodes in a wireless environment: idle and sleep states. A node in idle state can react to network
activity by changing between receiving and transmitting modes. A node in sleep state cannot
be activated by neighbors and can only change to idle by its own. This functionality is directly
related to the goal of keeping low power consumption at nodes. Just for having an idea, nodes
in ad hoc networks spend about 20 % more energy when receiving than in idle state and about
60 % more in transmit than in idle mode [GS04]. Idle power consumption can be considered
10
33. 2.1. Geographic Routing
as large as that of receiving data. Then the number of retransmissions necessary for commu-
nicating a pair of nodes becomes even more important than just worrying about network delay.
2.1.1. The Greedy Rule
Greedy forwarding is a local forwarding strategy that always tries to achieve a progress
towards the target. The notion of progress appears in several position based approaches
already in the 80s. Given a transmitting node S, progress to a neighboring node A is defined as
the orthogonal projection of the distance S-A onto the line connecting S and the final destina-
tion D [GS04]. Otherwise the transmission is said to be in backward direction. This criterion is
then used by several methods in order to select the next hop among all neighbors, i.e. a random
neighbor with forward progress is selected. A more restrictive condition is proposed by Finn
1987 [Fin87]: select a progress node closest to the destination . Greedy schemes are widely
used in ad hoc networks because they are simple, efficient and scalable, and try to provide
solutions similar to the shortest path. Then a packet is forwarded to a 1-hop neighbor closer
to destination than the current node. This procedure is repeated until the destination is reached.
Often more than one neighbor is suitable of forwarding a packet using the greedy rule. There
are different criteria for this decision: in Most Forward within Radius, MFR [TK84] the
packet would be forwarded to the neighbor that makes most progress towards destination,
and thus the number of hops of the packet would be minimized, Nearest with Forward
Progress, NFP [HL86] supposes nodes can adjust their transmission power and thus decide
for a neighbor which makes progress but is closest to current node, because then low power
is consumed and reduced signal strength prevents from interfering other communications, in
Compass Routing [KSU99] neighbor selected is the closest to the straight line between sender
and destination.
Greedy algorithms are shown to be loop-free in static networks, if there are no local minima
(see section 2.1.2). However, in the presence of mobility loops occur because of outdated
information of neighbor’s position or destination’s position. Some approaches of directed
flooding like DREAM [BCSW98], update destination’s position in order to get more accurate
information as the packet gets closer to destination, thus independently of the location service
used. Duplication of packets may occur when in IEEE 802.11 MAC scheme an ACK gets
11
34. 2. State of the art
lost.
2.1.2. Barriers and Perimeters
Greedy algorithms may also fail on delivering a packet although a path actually exists between
source and destination. They incur the problem of local minima, that is, a packet gets stuck
when no node is closer to destination than the current one and the protocol has to recover
from that point. Several solutions have been proposed in order to ensure message delivery in
such situations: send packet to least backward neighbor, flooding all nodes until a node closer
to destination is found, perimeter traversal following the right hand rule, drop message if it
has to return to the node where it came from. The first solution raises the problem of routing
loops and the second requires that the past traffic is memorized (either sequence numbers by
the nodes or path information in the packet) in order to avoid overloading the network. GPSR
solves the problem of local minima. Description follows in section 2.1.3.
Local minima are found at nodes near to a region with lower density or near to a significant
number of nodes which failed for some cause. Such regions where nodes are depleted are
barriers or holes, also called communication voids. A barrier is characterized by its perimeter
or boundary, a close cycle of nodes with no self-intersections that bounds an empty region.
Fang et al. [FGG04] suggest the a priori identification of those nodes on the network where
packets can stuck because they bounder a barrier. Such infrastructure can be very efficient in
sensor networks but limits its functionality to quasi-static sensor networks. Information about
barriers can be especially useful for some applications. Forest fire alarms are an example:
sensor nodes are destroyed in the fire region and then detecting the boundary helps getting a
definition of the affected area.
2.1.3. Greedy Perimeter Stateless Routing (GPSR)
B. N. Karp and Kung [KK00] propose the Greedy Perimeter Stateless Routing (GPSR)
protocol that combines two modes of operation: greedy forwarding and perimeter traversal
on a planar graph, thus achieving the same connectivity as the original network. GPSR uses
MFR for next hop selection in greedy mode, and beaconing for learning the neighborhood.
12
35. 2.1. Geographic Routing
Figura 2.1.: Local minima at node x and perimeter recovery possibilities [Kar00].
Perimeter traversal can incur in loops because the right-hand rule bordering the barrier can
find crossing edges that bring the message back to an already visited node. This approach
performs a planar graph when a local minimum is reached, thus avoiding loops, as some
edges in the graph are discarded and prohibited in forwarding. The packet would be greedy
forwarded again after reaching a node which is closer to destination than the node where
local minimum was found. For a better understanding of this perimeter strategy, also a brief
introduction to the graph-theoretical basics is given.
2.1.3.1. Beaconing.
The position of neighbors in ad hoc networks is typically learned by periodic broadcasts sent
at each host. In GPSR, position information of 1-hop neighbors is announced by sending
beacons. These beacons contain the identifier or address of sender node and its geographical
coordinates.
beacon
Field Type Description
ID address ID/network address of the sender
pos position geographic position of the sender
GPSR also avoids synchronization of beacons, and therefore collisions at access to medium,
by jittering each beacon’s transmission in an uniform distribution U[0.5B,1.5B], being B the
13
36. 2. State of the art
Figura 2.2.: Greedy forwarding rule pseudocode.
mean inter-beacon transmission interval. A timeout T is also implemented, such that if no bea-
con was received from a certain neighbor for time T, then corresponding node assumes that the
neighbor has failed or left its area of influence. A timeout of T=4.5B has been used in [Kar00].
Also a promiscuous network interface can be used. In this case, nodes include its position in
all data packets they forward, so all hosts within range can update this node’s position. This
functionality can be relevant in mobility scenarios, where updating local information can be
crucial for message delivery.
2.1.3.2. Greedy Forwarding.
At this point the first part of GPSR is defined: greedy forwarding. Packets are marked by their
originator with their destinations’locations. Then at a forwarding node, the locally optimal
choice for next hop is the neighbor geographically closest to the packet’s destination. The
algorithm must then calculate distances from neighbors to destination and decide for the best,
i.e. the most promising neighbor. Now suppose the header of a packet p contains fields p.a, the
address of the packet’s destination, and p.l, the location of the packet’s destination. Assume
also that each node has a neighbor table N, each of whose entries is a pair of a neighbor
node’s address (a) with that neighbor’s location (l). Also node’s own address and location are
denoted by self.a and self.l in pseudocode for the greedy algorithm shown in Figure 2.2.
14
37. 2.1. Geographic Routing
w w
u v u v
Figura 2.3.: RNG (left) and GG (right) planarizations. For edge u − v to be included in the
planar graph, node w should be out of the shaded area.
2.1.3.3. Planarizing Network Topology.
In wireless communications a basic graph model is widely used to model the behavior of
networks. The set of nodes in a network can be understood as a graph where wireless nodes
are the vertices and edges are drawn between directly connected nodes. The unit disc graph
model (UDG) is defined in [GS04] as follows: ’two nodes A and B in the network are
neighbors (and thus joined by an edge) if the Euclidean distance between their coordinates
in the network is at most R, where R is the transmission radius which is equal for all nodes
in the network’. Some variations of this scheme have been also defined and may include
obstacles, nodes each one with particular transmission radii or unidirectional links. However,
many implementations benefit from the simplicity of using the unit graph model.
Planar1 graphs are graphs with no intersecting edges. So in general graphs representing ad
hoc networks are non-planar, but there exist algorithms for obtaining planar subgraphs from
non-planar graphs by removing some edges and ensuring that no subset of vertices gets
disconnected. Most important is that some of them can be applied locally.
The implementation of GPSR in [KK00] includes two different types of planarization: Gabriel
Graph (GG) and Relative Neighborhood Graph (RNG). Then GPSR includes an algorithm
for removing edges in the network graph which are not part of GG or RNG (see Figure 2.4).
It is clear that removing edges from the graph to reduce it to planar, must not disconnect the
graph, as this would be equivalent to divide the network. Figure 2.3 shows how reduction is
made in both schemes: both graphs consider edge u, v out of the planar graph, since node w
1 Actually plane graphs: the embedding in the plane has no crossing edges.
15
38. 2. State of the art
Figura 2.4.: For a full list of its neighbors, N, node u removes non-RNG links.
Figura 2.5.: Right-hand rule: loop caused by crossing edges.
lies inside the shadowed region. Then crossing edges are avoided while connectivity is still
guaranteed via path u − w − v.
2.1.3.4. Perimeter Traversal.
As said before, when a barrier is found, a potential message should border it somehow
and then keep on making progress until it reaches the destination. Perimeter Forwarding is
necessary only when barriers are close. This recovery method in GPSR utilizes the righthand
rule, in order to border the barrier. The protocol firstly forwards to closer faces in the planar
graph. The packet may cross internal and external faces, so it must be stored if the packet
changed the face already for not incurring into loops (see Figure 2.5).
Then, when a packet enters perimeter mode, GPSR records in the packet the location Lp,
which is the site where greedy forwarding failed. This location is used at subsequent hops
to determine whether the packet can be returned to greedy mode. GPSR forwards the packet
on progressively closer faces of the planar topology. A planar graph has two types of faces:
interior faces are the closed polygonal regions bounded by the graph’s edges and exterior
16
40. 2. State of the art
Figura 2.7.: Full graph of wireless network (left). GG subset of the full graph (middle). RNG
subset of full and GG graphs (right) [KK00].
faces are the one unbounded face outside the outer boundary of the graph. On each face,
the traversal uses the right-hand rule to reach an edge that crosses the line between initial
perimeter node and destination. Changing faces amounts to treating the next hop on the
current face as the previous hop, and applying the right-hand rule again. It is also possible
that single node borders multiple edges that cross the line to the destination, so the treatment
of faces is indeed complicated. The pseudocode for the GPSR forwarding algorithm is shown
in Figure 2.6, where RIGHT-HAND-FORWARD and PERI-INIT-FORWARD determine
next hop host dictated by the right-hand rule, FACE-CHANGE determines whether the
packet has reached an edge that crosses the line to destination and GPSR-FORWARD is
the top-level forwarding function called for all arriving packets. This detailed specification
on GPSR will further serve in this project for the implementation of this protocol (see
Section 4.1).
2.1.4. The Cell-based approach
Unfortunately, the planarization cancels out the long edges of the original topology (see
Figure 2.7), such that the routing progress is reduced just in the case when the effective greedy
strategy fails. [RS05] propose a local topology control strategy that avoids the disadvantages
of the planarization. The idea is to construct a virtual geographical cluster structure that
contains the information about the 2-hop-neighborhood of each node. This structure can
be constructed locally and provides each node with the necessary information for greedy
18
41. 2.2. Simulation Environment
forwarding and recovery. Each host uses its positioning capabilities to determine to which cell
it belongs. It can also assign its neighbors to the cells within its transmission range, based on
their position coordinates. Thus, one can abstract from the view of a host’s environment by
classifying the cells. This classification leads to a formal description of barriers.
The cell structure is a tool for describing efficient algorithms, not merely an end in itself. This
structure gives an abstract view on the network and represents regions where nodes reside
(node cells), regions that can be used for the communication flow (link cells) and regions that
cannot be bridged due to the restricted transmission range (barrier cells). The cell sizes are
chosen such that locality ensures communication, and [RS05] prove that the cell path using
node cells and link cells is equivalent to the optimum path connecting two nodes up to a
constant factor.
2.2. Simulation Environment
Modeling and simulation are traditional methods used to evaluate network designs. Although
mathematical modeling play an important role in the design of wireless, mobile and ad
hoc networks, but with growing complexity such models become too complicated and less
practical [BB04]. In these cases simulation is a helpful tool for engineers in order to obtain
and compare the crucial performance characteristics. However, detailed simulations of these
networks may require large amounts of CPU time. Therefore, the development of methods to
speed up simulations has received recent interest. This advances together with the fact that
today most of the models can be defined using object-oriented languages, such as Java, C/C++
or OTcl/Tk, make it easier to extend and adapt existing models in new simulation projects.
2.2.1. OMNeT++
Several publicly available network simulators exist and probably the most widely used sof-
tware in the recent years has been ns-2, a discrete event simulator. However, ns-2 furthers high
interdependence between modules due to its object oriented design and thus ns-2 might be a
good choice for simulating traditional IP networks as a reduced number of protocols is widely
used (i.e. TCP, IEEE 802.11). One problem arises when developing ad hoc networks, as the
19
42. 2. State of the art
implementation of one algorithm is closely related to the specific application and it is also
hardly extendable. The simulation environment chosen for this work is OMNeT++ [Var05]
(Objective Modular Network Test-bed in C++) version 3.1. OMNeT++, is a public-source,
component-based, modular simulation framework. Mallanda et al. [MES+ 05] have identified
a list of challenge features of OMNeT++ in detriment of other simulators as a platform for
developing wireless sensor networks, also applicable for us:
Flexible. Simulation modules can be easily combined and reused.
Hierarchical, built on nested modules.
Base classes in the simulation kernel can be extended due to object-orientation.
Friendly GUI interface for tracing messages and debugging and a command line inter-
face for batch execution.
Libraries provide also statistics, input/output, data collection, data number generators
and data structures.
Simulation kernel uses C++ performing well in large applications.
Own language for describing topology (NED) and initialization file (omnetpp.ini) sim-
plifies configuration for various simulations.
OMNeT++ is a general-purpose tool for discrete event simulations, i.e. state changes (events)
happen at discrete instances in time, and events take zero time to happen. It is assumed that
nothing relevant occurs between two consecutive events, that is, no state change takes place
in the system between the events (in contrast to continuous systems where state changes are
continuous). Computer networks are typically seen as discrete event systems with events such
as start of a packet transmission, end of a packet transmission and expiry of a retransmis-
sion timeout. This model is then complete and accurate enough for the purpose of this thesis.
OMNeT++ general structure can be resumed as follows:
Modules implement application-specific functionality
Modules can be connected by connections
Modules communicate by exchanging messages via connections. Arrival of a message
at a module is an event.
20
43. 2.2. Simulation Environment
Modules are implemented as C++ objects, using support functions from a simulation
library. This is, all modules are instances of certain classes representing module types
User-defined module types can be used to derive new module types via standard inheri-
tance techniques
Topology of module connections is specified using an OMNeT++ specific language
called NED
However, two different mechanisms exist in OMNeT++: HandleMessage and Activity. The
Activity scheme permits coding modules much like an operating system process or a thread.
The main problem here is that it does not scale because every module needs a separate
routing stack and this involves too much memory in the end. It has also been observed that
Activity does not encourage a good programming style. This process-style description is
convenient only when the process has many states but transitions are limited. When one
expect modules to be used in large simulations, involving several modules, HandleMessage is
more convenient to program. The idea is that at each event (message arrival) one simply calls
a user-defined function. For example, module appl (see Figure 2.9) representing application
layer at a host receives a timeout message and generates a packet, then module appl sends a
message to net module posting the packet and necessary additional information so net module
executes appropriate routing tasks.
OMNeT supports developing including pre-defined classes that facilitate programing. As a
tool for supporting routing in telecommunication networks, OMNeT++ includes the cTopo-
logy class, which stores an abstract representation of the network in graph form: modules are
nodes and links are edges in the graph. One can then specify which node types to include,
e.g. Host. Then cTopology functions permits calculations such as shortest paths among hosts
(following Dijkstra’s algorithm), the total number of nodes in the network and the number of
neighbors of a certain node. This tool is crucial in order to automate the comparison of the
performance of packets routed by a given protocol with the ideal response.
By today there is an increasing number of various mobile, ad-hoc and sensor simulation fra-
meworks based in OMNeT++:
Mobility Framework 1.0a5 is currently the reference platform for doing mobile and ad-
hoc simulations with OMNeT++. MF includes a 802.11 model (ad-hoc mode only) but
no routing protocols are implemented, only flooding.
21
44. 2. State of the art
Figura 2.8.: Wireless network with randomly positioned nodes generated using the Mobility Fra-
mework.
INET Framework also includes support for mobile and ad-hoc networks based on code
ported from the MF-1.0a5 release. Mobility, physical and MAC layer have been ported
to INET and significantly improved. MF and INET are largely comparable. Beyond IP
and UDP/TCP there is 802.11, Ethernet, PPP, IPv6, OSPF, RIP, MPLS with LDP and
RSVP-TE signalling, and other protocols.
AODV Framework contains a simplified AODV protocol implementation. It includes
several mobility models not compatible with those of MF/INET.
NesCT allows running TinyOS programs in OMNeT++ for wireless sensor networks.
MACSimulator is a model of various different energy-efficient MAC protocols for wi-
reless sensor networks: T-MAC, S-MAC, L-MAC and simple CSMA.
SENSIM also concentrates on sensor networks: it includes 802.11 and a directed diffu-
sion model.
This work has been developed using the Mobility Framework 1.0a5 [LW05] library package,
which contains the wireless environment for nodes and an implementation of IEEE 802.11
for WLANs.
22
45. 2.2. Simulation Environment
2.2.2. Mobility Framework
The Mobility Framework 1.0a5 (MF) includes the necessary architecture for mobility support
and connections update. The structure of a wireless mobile host consists of 3 submodules
corresponding to the communication tasks: the application (appl module), network (net
module) and physical-MAC layers (nic module), and another 2 submodules: one as platform
for the inter-layer communication (blackboard) and one to cover changeable positioning
coordinates of the host (mobility).
Figura 2.9.: Structure of a host in OMNeT++ using Mobility Framework.
As said in the Introduction, physical and link layers constitute an absolutely wide field of
study in relation to electromagnetic propagation, antenna and circuitry design, and also
channel modeling and link layer implementation. These areas compete to several fields of Te-
lecommunications Engineering, but lay out of the contents of this thesis. The communication
model developed in MF is much simpler:
Wireless transmission is determined by the generation of electrical signals that are translated
into radio waves and propagated over the air. The simplest model is considered here, that is,
free space propagation. Nodes are characterized by isotropic antennas and transmit a certain
power. Such signal power is attenuated inverse proportionally to the distance up to some
exponent (2 is commonly used), following the Friis formula. Then the distance among nodes
in the network determines which pairs of nodes can directly communicate over the air. Then
the sensitivity at the receiver indicates the minimum signal level required to ensure reliable
communications. A node receives the signal and decides at its physical layer about its Signal
23
46. 2. State of the art
to Noise Ratio (SNR). The IEEE 802.11a WLAN standard recommends a noise figure at the
receiver of 10 dB or better. Afterwards, also a calculation of the bit error rate is done, and the
data reaches MAC layer. Such a simple model is implemented in OMNeT++ and followed in
this work. Both physical and MAC layers are one existing module of the Mobility Framework.
A wide margin is left for developing routing and application schemes at each host, regarding
no extra effort than programming common OMNeT++ simulations.
2.2.3. Statistical Data Collection and Processing
OMNeT++ includes a friendly GUI interface which is useful for validating and debugging
step by step packet exchanges and processing at nodes in a certain simulation. Also data
can be collected and plotted using statistics and distribution estimation provided in the
abstract base class cStatistic, where OMNeT++ includes Output Vectors and Output Scalars
for storing simulation results from simple modules and Plove and Scalars for drawing this
data into graphs. Output vectors capture the transient behaviour of the simulation run, while
output scalars are more useful to compare model behaviour under various parameter settings.
However, for a large number of repeated experiments, it is more appropriate to execute
OMNeT++ using the command-line interface and user-defined scripts and then automate
processing of vectors and scalars. One can use numerical packages such as Octave, Matlab
or the statistics package R, as in addition to their support for statistical computations, they
can also create various plots. Other open-source programs include Gnuplot, Grace or ROOT.
Because Matlab is a well-known tool used in previous lectures, scripts written in this language
are being used to present experimental results in this thesis.
24
47. 3. The Cell-based Geographic
Forwarding Protocol
This chapter presents the complete algorithm based on the Cell-based approach presented by
S. Rührup and C. Shindelhauer [RS05]. Then a new protocol called Cell-based Geographic
Routing Protocol is presented and its global functionalities are specified in the following sec-
tions.
3.1. Overview
The cell structure is an abstraction from the network, i.e. it represents a classification of all
different regions in the network area in a virtual grid. The cell structure is composed of link
cells and barrier cells, which indicate regions where communication is possible and regions
where no nodes reside. The classification of these cells is performed by CGFP in a local and
distributed manner. As for GPSR, the cell-based approach assumes the Unit Disk Graph model
as communication model and also positioning capabilities for nodes.
The strategy of the cell structure helps identifying local minima for greedy forwarding, and
improves recovery schemes because it has no need to care about crossing edges and planari-
zation, so all edges in the network are available for being used in forwarding. Avoiding loops
caused by intersecting edges is done by an implicit geographic clustering (see Figure 3.2).
Although this is a proactive model, cell grids are not built on the fly to be used in routing,
but in advance thanks to the information compiled from neighboring nodes. Then, a 2-hop-
proactive mechanism is used as communication pattern: 1st hop compiles the coordinates of
neighbors and 2nd hop collects the information about neighbors of neighbors. Therefore, the
cell structure can be established in a distributed manner thus using only local information.
25
48. 3. The Cell-based Geographic Forwarding Protocol
Figura 3.1.: Unit Disk Graph with transmission radius r and grid subdivision for the same network
region.
Figura 3.2.: CGFP solves the problem of crossing edges without the need of planarization.
26
49. 3.2. The cell structure
One of the principal ideas in [RS05] is to represent the network area as a global grid. Each
grid square is called cell and its side length is a constant factor of the transmission radius. For
≤ 1 3 r then paths in the network and cell routes are equivalent.
2 8
Choosing an appropriate cell size, routing can be as efficient as in the UDG with a constant
loss factor in performance. Before physically forwarding a message, a node would then
virtually forward the message from cell to cell until a barrier prevents from going ahead or its
transmission range is exceeded.
3.2. The cell structure
Supposed the network area is seen by all nodes as a large squared grid, such that each node
resides in one of those square cells. Then each node also constructs a map of the area covered
by its transmission radius, thus creating an own view of its neighborhood. The cells in this cell
structure are classified in order to determine which regions can be used in routing and which
cannot. The cell size is determined by the transmission radius and given to the protocol as a
parameter.
3.2.1. Global and local coordinates
The geographical position of the nodes is known via some kind of location service. Since the
cell size l is an input, it is trivial for a node to convert its geographical position (px , py ) into a
cell position (cx , cy ), given by cx = px / and cy = py / . These coordinates are considered
to be global, as they are absolute and unique in the whole network grid.
(-2,-2) (-1,-2) (0,-2) (1,-2) (2,-2)
(-2,-1) (-1,-1) (0,-1) (1,-1) (2,-1)
(-2,0) (-1,0) (0,0) (1,0) (2,0)
(-2,1) (-1,1) (0,1) (1,1) (2,1)
(-2,2) (-1,2) (0,2) (1,2) (2,2)
Figura 3.3.: Local coordinates
As nodes also store information about their environment, they map this information into local
27
50. 3. The Cell-based Geographic Forwarding Protocol
cell structures1 (see Views in Section 3.2.3). Cells in views are referenced in relation to the
node’s coordinates. An easy way to notate these local coordinates, is to number the cell that
contains the node itself as (0,0). Then the global position of a particular cell in a certain View
can be obtained by simply adding an offset equal to the node’s cell position.
Figura 3.4.: Cell coordinate system.
For all 2-D coordinates, CGFP assumes that positive x-axis points to the right (to the east) and
positive y-axis points downwards (to the south). In the routing phase, the protocol builds a cell
path for forwarding. Thus messages make progress in the cell path by adding a direction to its
current cell position. Figure 3.5 shows how directions are defined.
North
(0,-1)
West (-1,0) (0,0) (1,0) East
(0,1)
South
Figura 3.5.: Directions
3.2.2. Classification of cells
A given node v classifies cells into 3 different types
– link cell, if it lies completely within half of the transmission radius of v or any neighbo-
ring node (half radius rule) or if it is intersected by an edge (edge intersection rule).
1 From now on, cell structure refers to every kind of view at a node, but not to the whole network grid.
28