src/routing/global-routing/global-route-manager-impl.h
author Wilson Thong <wilsonwk@ee.cityu.edu.hk>
Tue, 15 Dec 2009 21:52:50 -0800
changeset 5858 afb51c7f34c2
parent 4745 a0e27af57c8d
child 5935 f89e4d1715b1
permissions -rw-r--r--
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
1457
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
     3
 * Copyright 2007 University of Washington
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
     4
 * 
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1457
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
    17
 *
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
    18
 * Authors:  Craig Dowell (craigdo@ee.washington.edu)
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1316
diff changeset
    19
 *           Tom Henderson (tomhend@u.washington.edu)
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
 */
1112
4f18aeb5e2f1 copywrongs
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    21
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#ifndef GLOBAL_ROUTE_MANAGER_IMPL_H
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
#define GLOBAL_ROUTE_MANAGER_IMPL_H
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
#include <stdint.h>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
#include <list>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
#include <queue>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
#include <map>
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
    29
#include <vector>
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    30
#include "ns3/object.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
#include "ns3/ptr.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
#include "ns3/ipv4-address.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
#include "global-router-interface.h"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
namespace ns3 {
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
const uint32_t SPF_INFINITY = 0xffffffff;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
class CandidateQueue;
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
    40
class Ipv4GlobalRouting;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
 * @brief Vertex used in shortest path first (SPF) computations. See RFC 2328,
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
 * Section 16.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
 * Each router in the simulation is associated with an SPFVertex object.  When
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
 * calculating routes, each of these routers is, in turn, chosen as the "root"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
 * of the calculation and routes to all of the other routers are eventually
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
 * saved in the routing tables of each of the chosen nodes.  Each of these 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
 * routers in the calculation has an associated SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    52
 * The "Root" vertex is the SPFVertex representing the router that is having
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    53
 * its routing tables set.  The SPFVertex objects representing other routers
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    54
 * or networks in the simulation are arranged in the SPF tree.  It is this 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    55
 * tree that represents the Shortest Paths to the other networks.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    56
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    57
 * Each SPFVertex has a pointer to the Global Router Link State Advertisement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
 * (LSA) that its underlying router has exported.  Within these LSAs are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    59
 * Global Router Link Records that describe the point to point links from the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    60
 * underlying router to other nodes (represented by other SPFVertex objects)
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
 * in the simulation topology.  The combination of the arrangement of the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
 * SPFVertex objects in the SPF tree, along with the details of the link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
 * records that connect them provide the information required to construct the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
 * required routes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    66
class SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    69
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
 * @brief Enumeration of the possible types of SPFVertex objects.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
    71
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    72
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
 * Currently we use VertexRouter to identify objects that represent a router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
 * in the simulation topology, and VertexNetwork to identify objects that 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
 * represent a network.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
  enum VertexType {
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
    VertexUnknown = 0,  /**< Uninitialized Link Record */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    79
    VertexRouter,       /**< Vertex representing a router in the topology */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    80
    VertexNetwork       /**< Vertex representing a network in the topology */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
  };
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
    82
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    83
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    84
 * @brief Construct an empty ("uninitialized") SPFVertex (Shortest Path First 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    85
 * Vertex).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
    86
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    87
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
 * The Vertex Type is set to VertexUnknown, the Vertex ID is set to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    89
 * 255.255.255.255, and the distance from root is set to infinity 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    90
 * (UINT32_MAX).  The referenced Link State Advertisement (LSA) is set to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
 * null as is the parent SPFVertex.  The outgoing interface index is set to
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
 * infinity, the next hop address is set to 0.0.0.0 and the list of children
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    93
 * of the SPFVertex is initialized to empty.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
 * @see VertexType
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    96
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    97
  SPFVertex();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
    98
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
 * @brief Construct an initialized SPFVertex (Shortest Path First Vertex).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   101
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
 * The Vertex Type is initialized to VertexRouter and the Vertex ID is found
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
 * from the Link State ID of the Link State Advertisement (LSA) passed as a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
 * parameter.  The Link State ID is set to the Router ID of the advertising
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
 * router.  The referenced LSA (m_lsa) is set to the given LSA.  Other than 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
 * these members, initialization is as in the default constructor.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
 * of the SPFVertex is initialized to empty.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
 * @see SPFVertex::SPFVertex ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
 * @see VertexType
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   112
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
 * @param lsa The Link State Advertisement used for finding initial values.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   114
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   115
  SPFVertex(GlobalRoutingLSA* lsa);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   116
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
 * @brief Destroy an SPFVertex (Shortest Path First Vertex).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   119
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   120
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   121
 * The children vertices of the SPFVertex are recursively deleted.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   122
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   123
 * @see SPFVertex::SPFVertex ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   124
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   125
  ~SPFVertex();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   126
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   128
 * @brief Get the Vertex Type field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   129
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
 * The Vertex Type describes the kind of simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
 * represents.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   134
 * @see VertexType
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
 * @returns The VertexType of the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
  VertexType GetVertexType (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   138
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
 * @brief Set the Vertex Type field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   141
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
 * The Vertex Type describes the kind of simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
 * represents.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
 * @see VertexType
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
 * @param type The new VertexType for the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
  void SetVertexType (VertexType type);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   150
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   151
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   152
 * @brief Get the Vertex ID field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   153
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   154
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   155
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   156
 * represents.  Typically, this is the Router ID for SPFVertex objects 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   157
 * representing routers, and comes from the Link State Advertisement of a 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   158
 * router aggregated to a node in the simulation.  These IDs are allocated
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   159
 * automatically by the routing environment and look like IP addresses 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   160
 * beginning at 0.0.0.0 and monotonically increasing as new routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   161
 * instantiated.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   162
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   163
 * @returns The Ipv4Address Vertex ID of the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   164
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   165
  Ipv4Address GetVertexId (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   166
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   167
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   168
 * @brief Set the Vertex ID field of a SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   169
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   170
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   171
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   172
 * represents.  Typically, this is the Router ID for SPFVertex objects 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   173
 * representing routers, and comes from the Link State Advertisement of a 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   174
 * router aggregated to a node in the simulation.  These IDs are allocated
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   175
 * automatically by the routing environment and look like IP addresses 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   176
 * beginning at 0.0.0.0 and monotonically increase as new routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   177
 * instantiated.  This method is an explicit override of the automatically
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   178
 * generated value.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   179
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   180
 * @param id The new Ipv4Address Vertex ID for the current SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   181
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   182
  void SetVertexId (Ipv4Address id);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   183
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   184
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   185
 * @brief Get the Global Router Link State Advertisement returned by the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   186
 * Global Router represented by this SPFVertex during the route discovery 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   187
 * process.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   188
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   189
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   190
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   191
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   192
 * @see GlobalRouter::DiscoverLSAs ()
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   193
 * @returns A pointer to the GlobalRoutingLSA found by the router represented
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   194
 * by this SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   195
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   196
  GlobalRoutingLSA* GetLSA (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   197
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   198
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   199
 * @brief Set the Global Router Link State Advertisement returned by the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   200
 * Global Router represented by this SPFVertex during the route discovery 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   201
 * process.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   202
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   203
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   204
 * @see SPFVertex::GetLSA ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   205
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   206
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   207
 * @see GlobalRouter::DiscoverLSAs ()
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   208
 * @warning Ownership of the LSA is transferred to the "this" SPFVertex.  You
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   209
 * must not delete the LSA after calling this method.
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   210
 * @param lsa A pointer to the GlobalRoutingLSA.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   211
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   212
  void SetLSA (GlobalRoutingLSA* lsa);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   213
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   214
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   215
 * @brief Get the distance from the root vertex to "this" SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   216
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   217
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   218
 * Each router in the simulation is associated with an SPFVertex object.  When
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   219
 * calculating routes, each of these routers is, in turn, chosen as the "root"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   220
 * of the calculation and routes to all of the other routers are eventually
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   221
 * saved in the routing tables of each of the chosen nodes.  Each of these 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   222
 * routers in the calculation has an associated SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   223
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   224
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   225
 * having its routing tables set.  The "this" SPFVertex is the vertex to which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   226
 * a route is being calculated from the root.  The distance from the root that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   227
 * we're asking for is the number of hops from the root vertex to the vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   228
 * in question.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   229
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   230
 * The distance is calculated during route discovery and is stored in a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   231
 * member variable.  This method simply fetches that value.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   232
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   233
 * @returns The distance, in hops, from the root SPFVertex to "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   234
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   235
  uint32_t GetDistanceFromRoot (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   236
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   237
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   238
 * @brief Set the distance from the root vertex to "this" SPFVertex object.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   239
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   240
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   241
 * Each router in the simulation is associated with an SPFVertex object.  When
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   242
 * calculating routes, each of these routers is, in turn, chosen as the "root"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   243
 * of the calculation and routes to all of the other routers are eventually
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   244
 * saved in the routing tables of each of the chosen nodes.  Each of these 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   245
 * routers in the calculation has an associated SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   246
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   247
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   248
 * having its routing tables set.  The "this" SPFVertex is the vertex to which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   249
 * a route is being calculated from the root.  The distance from the root that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   250
 * we're asking for is the number of hops from the root vertex to the vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   251
 * in question.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   252
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   253
 * @param distance The distance, in hops, from the root SPFVertex to "this"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   254
 * SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   255
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   256
  void SetDistanceFromRoot (uint32_t distance);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   257
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   258
/**
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   259
 * \deprecated Use GetRootExitDirection instead
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   260
 *
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   261
 * @brief Get the interface ID that should be used to begin forwarding packets
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   262
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   263
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   264
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   265
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   266
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   267
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   268
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   269
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   270
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   271
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   272
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   273
 * the root.  The outgoing interface that we're asking for is the interface
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   274
 * index on the root node that should be used to start packets along the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   275
 * path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   276
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   277
 * When initializing the root SPFVertex, the interface ID is determined by
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   278
 * examining the Global Router Link Records of the Link State Advertisement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   279
 * generated by the root node's GlobalRouter.  These interfaces are used to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   280
 * forward packets off of the root's network down those links.  As other 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   281
 * vertices are discovered which are further away from the root, they will 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   282
 * be accessible down one of the paths begun by a Global Router Link Record.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   283
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   284
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   285
 * the forwarding process by sending the packets to the interface of that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   286
 * first hop.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   287
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   288
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   289
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   290
 * In this method, the root node is asking, "which of my local interfaces
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   291
 * should I use to get a packet to the network or host represented by 'this'
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   292
 * SPFVertex."
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   293
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   294
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   295
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   296
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   297
 * @returns The interface index to use when forwarding packets to the host
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   298
 * or network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   299
 */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   300
  uint32_t GetOutgoingInterfaceId (void) const NS_DEPRECATED;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   301
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   302
/**
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   303
 * \deprecated Use SetRootExitDirection instead
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   304
 *
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   305
 * @brief Set the interface ID that should be used to begin forwarding packets
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   306
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   307
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   308
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   309
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   310
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   311
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   312
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   313
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   314
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   315
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   316
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   317
 * the root.  The outgoing interface that we're asking for is the interface
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   318
 * index on the root node that should be used to start packets along the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   319
 * path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   320
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   321
 * When initializing the root SPFVertex, the interface ID is determined by
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   322
 * examining the Global Router Link Records of the Link State Advertisement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   323
 * generated by the root node's GlobalRouter.  These interfaces are used to 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   324
 * forward packets off of the root's network down those links.  As other 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   325
 * vertices are discovered which are further away from the root, they will 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   326
 * be accessible down one of the paths begun by a Global Router Link Record.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   327
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   328
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   329
 * the forwarding process by sending the packets to the interface of that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   330
 * first hop.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   331
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   332
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   333
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   334
 * In this method, we are letting the root node know which of its local
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   335
 * interfaces it should use to get a packet to the network or host represented
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   336
 * by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   337
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   338
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   339
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   340
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   341
 * @param id The interface index to use when forwarding packets to the host or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   342
 * network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   343
 */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   344
  void SetOutgoingInterfaceId (int32_t id) NS_DEPRECATED;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   345
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   346
/**
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   347
 * \deprecated Use GetRootExitDirection instead
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   348
 *
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   349
 * @brief Get the IP address that should be used to begin forwarding packets 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   350
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   351
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   352
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   353
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   354
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   355
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   356
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   357
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   358
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   359
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   360
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   361
 * the root.  The IP address that we're asking for is the address on the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   362
 * remote side of a link off of the root node that should be used as the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   363
 * destination for packets along the path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   364
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   365
 * When initializing the root SPFVertex, the IP address used when forwarding
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   366
 * packets is determined by examining the Global Router Link Records of the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   367
 * Link State Advertisement generated by the root node's GlobalRouter.  This
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   368
 * address is used to forward packets off of the root's network down those
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   369
 * links.  As other vertices / nodes are discovered which are further away
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   370
 * from the root, they will be accessible down one of the paths via a link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   371
 * described by one of these Global Router Link Records.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   372
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   373
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   374
 * the forwarding process by sending the packets to a first hop router down
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   375
 * an interface.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   376
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   377
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   378
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   379
 * In this method, the root node is asking, "which router should I send a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   380
 * packet to in order to get that packet to the network or host represented 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   381
 * by 'this' SPFVertex."
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   382
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   383
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   384
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   385
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   386
 * @returns The IP address to use when forwarding packets to the host
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   387
 * or network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   388
 */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   389
  Ipv4Address GetNextHop (void) const NS_DEPRECATED;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   390
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   391
/**
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   392
 * \deprecated Use SetRootExitDirection instead
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   393
 *
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   394
 * @brief Set the IP address that should be used to begin forwarding packets 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   395
 * from the root SPFVertex to "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   396
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   397
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   398
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   399
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   400
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   401
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   402
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   403
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   404
 * having its routing tables set.  The "this" SPFVertex is the vertex that
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   405
 * represents the host or network to which a route is being calculated from 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   406
 * the root.  The IP address that we're asking for is the address on the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   407
 * remote side of a link off of the root node that should be used as the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   408
 * destination for packets along the path to "this" vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   409
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   410
 * When initializing the root SPFVertex, the IP address used when forwarding
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   411
 * packets is determined by examining the Global Router Link Records of the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   412
 * Link State Advertisement generated by the root node's GlobalRouter.  This
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   413
 * address is used to forward packets off of the root's network down those
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   414
 * links.  As other vertices / nodes are discovered which are further away
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   415
 * from the root, they will be accessible down one of the paths via a link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   416
 * described by one of these Global Router Link Records.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   417
 * 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   418
 * To forward packets to these hosts or networks, the root node must begin
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   419
 * the forwarding process by sending the packets to a first hop router down
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   420
 * an interface.  This means that the first hop address and interface ID must
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   421
 * be the same for all downstream SPFVertices.  We call this "inheriting"
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   422
 * the interface and next hop.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   423
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   424
 * In this method we are telling the root node which router it should send
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   425
 * should I send a packet to in order to get that packet to the network or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   426
 * host represented by 'this' SPFVertex."
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   427
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   428
 * @see GlobalRouter
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   429
 * @see GlobalRoutingLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   430
 * @see GlobalRoutingLinkRecord
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   431
 * @param nextHop The IP address to use when forwarding packets to the host
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   432
 * or network represented by "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   433
 */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   434
  void SetNextHop (Ipv4Address nextHop) NS_DEPRECATED;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   435
/**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   436
 * @brief Set the IP address and outgoing interface index that should be used 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   437
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   438
 * @internal
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   439
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   440
 * Each router node in the simulation is associated with an SPFVertex object.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   441
 * When calculating routes, each of these routers is, in turn, chosen as the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   442
 * "root" of the calculation and routes to all of the other routers are
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   443
 * eventually saved in the routing tables of each of the chosen nodes.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   444
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   445
 * The "Root" vertex is then the SPFVertex representing the router that is
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   446
 * having its routing tables set.  The "this" SPFVertex is the vertex that
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   447
 * represents the host or network to which a route is being calculated from 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   448
 * the root.  The IP address that we're asking for is the address on the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   449
 * remote side of a link off of the root node that should be used as the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   450
 * destination for packets along the path to "this" vertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   451
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   452
 * When initializing the root SPFVertex, the IP address used when forwarding
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   453
 * packets is determined by examining the Global Router Link Records of the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   454
 * Link State Advertisement generated by the root node's GlobalRouter.  This
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   455
 * address is used to forward packets off of the root's network down those
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   456
 * links.  As other vertices / nodes are discovered which are further away
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   457
 * from the root, they will be accessible down one of the paths via a link
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   458
 * described by one of these Global Router Link Records.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   459
 * 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   460
 * To forward packets to these hosts or networks, the root node must begin
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   461
 * the forwarding process by sending the packets to a first hop router down
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   462
 * an interface.  This means that the first hop address and interface ID must
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   463
 * be the same for all downstream SPFVertices.  We call this "inheriting"
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   464
 * the interface and next hop.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   465
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   466
 * In this method we are telling the root node which exit direction it should send
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   467
 * should I send a packet to the network or host represented by 'this' SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   468
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   469
 * @see GlobalRouter
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   470
 * @see GlobalRoutingLSA
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   471
 * @see GlobalRoutingLinkRecord
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   472
 * @param nextHop The IP address to use when forwarding packets to the host
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   473
 * or network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   474
 * @param id The interface index to use when forwarding packets to the host or
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   475
 * network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   476
 */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   477
  void SetRootExitDirection (Ipv4Address nextHop, int32_t id = SPF_INFINITY);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   478
  typedef std::pair<Ipv4Address, int32_t> NodeExit_t;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   479
/**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   480
 * @brief Set the IP address and outgoing interface index that should be used 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   481
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   482
 * @internal
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   483
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   484
 * Each router node in the simulation is associated with an SPFVertex object.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   485
 * When calculating routes, each of these routers is, in turn, chosen as the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   486
 * "root" of the calculation and routes to all of the other routers are
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   487
 * eventually saved in the routing tables of each of the chosen nodes.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   488
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   489
 * The "Root" vertex is then the SPFVertex representing the router that is
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   490
 * having its routing tables set.  The "this" SPFVertex is the vertex that
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   491
 * represents the host or network to which a route is being calculated from 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   492
 * the root.  The IP address that we're asking for is the address on the 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   493
 * remote side of a link off of the root node that should be used as the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   494
 * destination for packets along the path to "this" vertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   495
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   496
 * When initializing the root SPFVertex, the IP address used when forwarding
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   497
 * packets is determined by examining the Global Router Link Records of the
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   498
 * Link State Advertisement generated by the root node's GlobalRouter.  This
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   499
 * address is used to forward packets off of the root's network down those
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   500
 * links.  As other vertices / nodes are discovered which are further away
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   501
 * from the root, they will be accessible down one of the paths via a link
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   502
 * described by one of these Global Router Link Records.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   503
 * 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   504
 * To forward packets to these hosts or networks, the root node must begin
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   505
 * the forwarding process by sending the packets to a first hop router down
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   506
 * an interface.  This means that the first hop address and interface ID must
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   507
 * be the same for all downstream SPFVertices.  We call this "inheriting"
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   508
 * the interface and next hop.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   509
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   510
 * In this method we are telling the root node which exit direction it should send
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   511
 * should I send a packet to the network or host represented by 'this' SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   512
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   513
 * @see GlobalRouter
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   514
 * @see GlobalRoutingLSA
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   515
 * @see GlobalRoutingLinkRecord
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   516
 * @param nextHop The IP address to use when forwarding packets to the host
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   517
 * or network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   518
 * @param exit The pair of next-hop-IP and outgoing-interface-index to use when 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   519
 * forwarding packets to the host or network represented by "this" SPFVertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   520
 */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   521
  void SetRootExitDirection (SPFVertex::NodeExit_t exit);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   522
 /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   523
  * \brief Obtain a pair indicating the exit direction from the root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   524
  *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   525
  * \param i An index to a pair
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   526
  * \return A pair of next-hop-IP and outgoing-interface-index for 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   527
  * indicating an exit direction from the root. It is 0 if the index 'i'
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   528
  * is out-of-range
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   529
  */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   530
  NodeExit_t GetRootExitDirection (uint32_t i) const;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   531
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   532
   * \brief Obtain a pair indicating the exit direction from the root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   533
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   534
   * This method assumes there is only a single exit direction from the root.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   535
   * Error occur if this assumption is invalid.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   536
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   537
   * \return The pair of next-hop-IP and outgoing-interface-index for reaching
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   538
   * 'this' vertex from the root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   539
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   540
  NodeExit_t GetRootExitDirection () const;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   541
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   542
   * \brief Merge into 'this' vertex the list of exit directions from
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   543
   * another vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   544
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   545
   * This merge is necessary when ECMP are found. 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   546
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   547
   * \param vertex From which the list of exit directions are obtain
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   548
   * and are merged into 'this' vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   549
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   550
  void MergeRootExitDirections (const SPFVertex* vertex);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   551
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   552
   * \brief Inherit all root exit directions from a given vertex to 'this' vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   553
   * \param vertex The vertex from which all root exit directions are to be inherrited
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   554
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   555
   * After the call of this method, the original root exit directions
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   556
   * in 'this' vertex are all lost.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   557
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   558
  void InheritAllRootExitDirections (const SPFVertex* vertex);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   559
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   560
   * \brief Get the number of exit directions from root for reaching 'this' vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   561
   * \return The number of exit directions from root
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   562
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   563
  uint32_t GetNRootExitDirections () const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   564
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   565
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   566
 * @brief Get a pointer to the SPFVector that is the parent of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   567
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   568
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   569
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   570
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   571
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   572
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   573
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   574
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   575
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   576
 * having its routing tables set and is the root of the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   577
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   578
 * This method returns a pointer to the parent node of "this" SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   579
 * (both of which reside in that SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   580
 *
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   581
 * @param i The index to one of the parents
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   582
 * @returns A pointer to the SPFVertex that is the parent of "this" SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   583
 * in the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   584
 */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   585
  SPFVertex* GetParent (uint32_t i = 0) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   586
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   587
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   588
 * @brief Set the pointer to the SPFVector that is the parent of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   589
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   590
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   591
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   592
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   593
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   594
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   595
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   596
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   597
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   598
 * having its routing tables set and is the root of the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   599
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   600
 * This method sets the parent pointer of "this" SPFVertex (both of which
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   601
 * reside in that SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   602
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   603
 * @param parent A pointer to the SPFVertex that is the parent of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   604
 * SPFVertex* in the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   605
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   606
  void SetParent (SPFVertex* parent);
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   607
  /**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   608
   * \brief Merge the Parent list from the v into this vertex
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   609
   *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   610
   * \param v The vertex from which its list of Parent is read
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   611
   * and then merged into the list of Parent of *this* vertex.
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   612
   * Note that the list in v remains intact
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   613
   */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   614
  void MergeParent (const SPFVertex* v);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   615
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   616
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   617
 * @brief Get the number of children of "this" SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   618
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   619
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   620
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   621
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   622
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   623
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   624
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   625
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   626
 * having its routing tables set and is the root of the SPF tree.  Each vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   627
 * in the SPF tree can have a number of children that represent host or 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   628
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   629
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   630
 * This method returns the number of children of "this" SPFVertex (which 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   631
 * reside in the SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   632
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   633
 * @returns The number of children of "this" SPFVertex (which reside in the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   634
 * SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   635
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   636
  uint32_t GetNChildren (void) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   637
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   638
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   639
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   640
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   641
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   642
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   643
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   644
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   645
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   646
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   647
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   648
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   649
 * having its routing tables set and is the root of the SPF tree.  Each vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   650
 * in the SPF tree can have a number of children that represent host or 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   651
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   652
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   653
 * This method the number of children of "this" SPFVertex (which reside in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   654
 * the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   655
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   656
 * @see SPFVertex::GetNChildren
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   657
 * @param n The index (from 0 to the number of children minus 1) of the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   658
 * child SPFVertex to return.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   659
 * @warning The pointer returned by GetChild () is a borrowed pointer.  You
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   660
 * do not have any ownership of the underlying object and must not delete
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   661
 * that object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   662
 * @returns A pointer to the specified child SPFVertex (which resides in the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   663
 * SPF tree).
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   664
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   665
  SPFVertex* GetChild (uint32_t n) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   666
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   667
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   668
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   669
 * SPFVertex.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   670
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   671
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   672
 * Each router node in the simulation is associated with an SPFVertex object.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   673
 * When calculating routes, each of these routers is, in turn, chosen as the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   674
 * "root" of the calculation and routes to all of the other routers are
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   675
 * eventually saved in the routing tables of each of the chosen nodes.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   676
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   677
 * The "Root" vertex is then the SPFVertex representing the router that is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   678
 * having its routing tables set and is the root of the SPF tree.  Each vertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   679
 * in the SPF tree can have a number of children that represent host or 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   680
 * network routes available via that vertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   681
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   682
 * This method the number of children of "this" SPFVertex (which reside in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   683
 * the SPF tree.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   684
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   685
 * @see SPFVertex::GetNChildren
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   686
 * @warning Ownership of the pointer added to the children of "this" 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   687
 * SPFVertex is transferred to the "this" SPFVertex.  You must not delete the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   688
 * (now) child SPFVertex after calling this method.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   689
 * @param child A pointer to the SPFVertex (which resides in the SPF tree) to
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   690
 * be added to the list of children of "this" SPFVertex.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   691
 * @returns The number of children of "this" SPFVertex after the addition of
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   692
 * the new child.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   693
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   694
  uint32_t AddChild (SPFVertex* child);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   695
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   696
  /**
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   697
   * @brief Set the value of the VertexProcessed flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   698
   *
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   699
   * Flag to note whether vertex has been processed in stage two of 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   700
   * SPF computation
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   701
   * @param value boolean value to set the flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   702
   */ 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   703
  void SetVertexProcessed (bool value);
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   704
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   705
  /**
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   706
   * @brief Check the value of the VertexProcessed flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   707
   *
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   708
   * Flag to note whether vertex has been processed in stage two of 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   709
   * SPF computation
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   710
   * @returns value of underlying flag
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   711
   */ 
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   712
  bool IsVertexProcessed (void) const;
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   713
  
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   714
  void ClearVertexProcessed (void);
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   715
      
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   716
private:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   717
  VertexType m_vertexType;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   718
  Ipv4Address m_vertexId;
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   719
  GlobalRoutingLSA* m_lsa;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   720
  uint32_t m_distanceFromRoot;
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4297
diff changeset
   721
  int32_t m_rootOif;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   722
  Ipv4Address m_nextHop;
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   723
  typedef std::list< NodeExit_t > ListOfNodeExit_t;
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   724
  /// store the multiple root's exits for supporting ECMP
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   725
  ListOfNodeExit_t m_ecmpRootExits;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   726
  typedef std::list<SPFVertex*> ListOfSPFVertex_t;
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   727
  ListOfSPFVertex_t m_parents;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   728
  ListOfSPFVertex_t m_children;
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   729
  bool m_vertexProcessed; 
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   730
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   731
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   732
 * @brief The SPFVertex copy construction is disallowed.  There's no need for
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   733
 * it and a compiler provided shallow copy would be wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   734
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   735
  SPFVertex (SPFVertex& v);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   736
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   737
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   738
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   739
 * need for it and a compiler provided shallow copy would be wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   740
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   741
  SPFVertex& operator= (SPFVertex& v);
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   742
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   743
  //friend std::ostream& operator<< (std::ostream& os, const ListOfIf_t& ifs);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   744
  //friend std::ostream& operator<< (std::ostream& os, const ListOfAddr_t& addrs);
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 4745
diff changeset
   745
  friend std::ostream& operator<< (std::ostream& os, const SPFVertex::ListOfSPFVertex_t& vs);
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   746
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   747
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   748
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   749
 * @brief The Link State DataBase (LSDB) of the Global Route Manager.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   750
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   751
 * Each node in the simulation participating in global routing has a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   752
 * GlobalRouter interface.  The primary job of this interface is to export
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   753
 * Global Router Link State Advertisements (LSAs).  These advertisements in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   754
 * turn contain a number of Global Router Link Records that describe the 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   755
 * point to point links from the underlying node to other nodes (that will 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   756
 * also export their own LSAs.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   757
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   758
 * This class implements a searchable database of LSAs gathered from every
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   759
 * router in the simulation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   760
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   761
class GlobalRouteManagerLSDB
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   762
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   763
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   764
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   765
 * @brief Construct an empty Global Router Manager Link State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   766
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   767
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   768
 * The database map composing the Link State Database is initialized in
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   769
 * this constructor.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   770
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   771
  GlobalRouteManagerLSDB ();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   772
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   773
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   774
 * @brief Destroy an empty Global Router Manager Link State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   775
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   776
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   777
 * The database map is walked and all of the Link State Advertisements stored
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   778
 * in the database are freed; then the database map itself is clear ()ed to
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   779
 * release any remaining resources.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   780
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   781
  ~GlobalRouteManagerLSDB ();
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   782
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   783
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   784
 * @brief Insert an IP address / Link State Advertisement pair into the Link
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   785
 * State Database.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   786
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   787
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   788
 * The IPV4 address and the GlobalRoutingLSA given as parameters are converted
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   789
 * to an STL pair and are inserted into the database map.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   790
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   791
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   792
 * @see Ipv4Address
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   793
 * @param addr The IP address associated with the LSA.  Typically the Router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   794
 * ID.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   795
 * @param lsa A pointer to the Link State Advertisement for the router.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   796
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   797
  void Insert(Ipv4Address addr, GlobalRoutingLSA* lsa);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   798
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   799
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   800
 * @brief Look up the Link State Advertisement associated with the given
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   801
 * link state ID (address).
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   802
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   803
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   804
 * The database map is searched for the given IPV4 address and corresponding
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   805
 * GlobalRoutingLSA is returned.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   806
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   807
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   808
 * @see Ipv4Address
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   809
 * @param addr The IP address associated with the LSA.  Typically the Router 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   810
 * ID.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   811
 * @returns A pointer to the Link State Advertisement for the router specified
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   812
 * by the IP address addr.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   813
 */
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   814
  GlobalRoutingLSA* GetLSA (Ipv4Address addr) const;
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   815
/**
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   816
 * @brief Look up the Link State Advertisement associated with the given
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   817
 * link state ID (address).  This is a variation of the GetLSA call
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   818
 * to allow the LSA to be found by matching addr with the LinkData field
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   819
 * of the TransitNetwork link record.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   820
 * @internal
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   821
 *
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   822
 * @see GetLSA
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   823
 * @param addr The IP address associated with the LSA.  Typically the Router 
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   824
 * @returns A pointer to the Link State Advertisement for the router specified
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   825
 * by the IP address addr.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   826
 * ID.
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   827
 */
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   828
  GlobalRoutingLSA* GetLSAByLinkData (Ipv4Address addr) const;
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   829
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   830
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   831
 * @brief Set all LSA flags to an initialized state, for SPF computation
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   832
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   833
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   834
 * This function walks the database and resets the status flags of all of the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   835
 * contained Link State Advertisements to LSA_SPF_NOT_EXPLORED.  This is done
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   836
 * prior to each SPF calculation to reset the state of the SPFVertex structures
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   837
 * that will reference the LSAs during the calculation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   838
 *
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   839
 * @see GlobalRoutingLSA
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   840
 * @see SPFVertex
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   841
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   842
  void Initialize ();
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   843
  
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   844
  GlobalRoutingLSA* GetExtLSA (uint32_t index) const;
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   845
  uint32_t GetNumExtLSAs () const;
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   846
      
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   847
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   848
private:
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   849
  typedef std::map<Ipv4Address, GlobalRoutingLSA*> LSDBMap_t;
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   850
  typedef std::pair<Ipv4Address, GlobalRoutingLSA*> LSDBPair_t;
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   851
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   852
  LSDBMap_t m_database;
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   853
  std::vector<GlobalRoutingLSA*> m_extdatabase;
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   854
  
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   855
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   856
 * @brief GlobalRouteManagerLSDB copy construction is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   857
 * need for it and a compiler provided shallow copy would be wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   858
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   859
  GlobalRouteManagerLSDB (GlobalRouteManagerLSDB& lsdb);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   860
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   861
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   862
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   863
 * need for it and a compiler provided shallow copy would be wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   864
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   865
  GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   866
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   867
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   868
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   869
 * @brief A global router implementation.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   870
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   871
 * This singleton object can query interface each node in the system
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   872
 * for a GlobalRouter interface.  For those nodes, it fetches one or
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   873
 * more Link State Advertisements and stores them in a local database.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   874
 * Then, it can compute shortest paths on a per-node basis to all routers, 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   875
 * and finally configure each of the node's forwarding tables.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   876
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   877
 * The design is guided by OSPFv2 RFC 2328 section 16.1.1 and quagga ospfd.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   878
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   879
class GlobalRouteManagerImpl
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   880
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   881
public:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   882
  GlobalRouteManagerImpl ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   883
  virtual ~GlobalRouteManagerImpl ();
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   884
/**
3959
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   885
 * @brief Delete all static routes on all nodes that have a
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   886
 * GlobalRouterInterface
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   887
 *
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   888
 * TODO:  separate manually assigned static routes from static routes that
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   889
 * the global routing code injects, and only delete the latter
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   890
 * @internal
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   891
 *
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   892
 */
ec65107df095 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents: 3937
diff changeset
   893
  virtual void DeleteGlobalRoutes ();
3937
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   894
04f9377661b8 convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents: 2250
diff changeset
   895
/**
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   896
 * @brief Build the routing database by gathering Link State Advertisements
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   897
 * from each node exporting a GlobalRouter interface.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   898
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   899
 */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   900
  virtual void BuildGlobalRoutingDatabase ();
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   901
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   902
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   903
 * @brief Compute routes using a Dijkstra SPF computation and populate
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   904
 * per-node forwarding tables
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   905
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   906
 */
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   907
  virtual void InitializeRoutes ();
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   908
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   909
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   910
 * @brief Debugging routine; allow client code to supply a pre-built LSDB
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   911
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   912
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   913
  void DebugUseLsdb (GlobalRouteManagerLSDB*);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   914
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   915
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   916
 * @brief Debugging routine; call the core SPF from the unit tests
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1113
diff changeset
   917
 * @internal
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   918
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   919
  void DebugSPFCalculate (Ipv4Address root);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   920
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   921
private:
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   922
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   923
 * @brief GlobalRouteManagerImpl copy construction is disallowed.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   924
 * There's no  need for it and a compiler provided shallow copy would be 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   925
 * wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   926
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   927
  GlobalRouteManagerImpl (GlobalRouteManagerImpl& srmi);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   928
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   929
/**
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   930
 * @brief Global Route Manager Implementation assignment operator is
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   931
 * disallowed.  There's no  need for it and a compiler provided shallow copy
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   932
 * would be hopelessly wrong.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   933
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   934
  GlobalRouteManagerImpl& operator= (GlobalRouteManagerImpl& srmi);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   935
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   936
  SPFVertex* m_spfroot;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   937
  GlobalRouteManagerLSDB* m_lsdb;
4628
a5a8c44e4240 bug 521. Ipv4 global routing inefficient. Updated Tom's patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 4616
diff changeset
   938
  bool CheckForStubNode (Ipv4Address root);
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   939
  void SPFCalculate (Ipv4Address root);
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   940
  void SPFProcessStubs (SPFVertex* v);
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   941
  void ProcessASExternals (SPFVertex* v, GlobalRoutingLSA* extlsa);
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   942
  void SPFNext (SPFVertex*, CandidateQueue&);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   943
  int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w, 
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   944
    GlobalRoutingLinkRecord* l, uint32_t distance);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   945
  void SPFVertexAddParent (SPFVertex* v);
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   946
  GlobalRoutingLinkRecord* SPFGetNextLink (SPFVertex* v, SPFVertex* w, 
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   947
    GlobalRoutingLinkRecord* prev_link);
1113
5b63b39161e7 remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents: 1112
diff changeset
   948
  void SPFIntraAddRouter (SPFVertex* v);
1278
41bf67d701a5 global routing csma patch
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
   949
  void SPFIntraAddTransit (SPFVertex* v);
3960
34908804c029 Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents: 3959
diff changeset
   950
  void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v);
4745
a0e27af57c8d Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents: 4628
diff changeset
   951
  void SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v);
4476
4763b00ff02f fix build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   952
  int32_t FindOutgoingInterfaceId (Ipv4Address a, 
1316
f357c6a2bb37 Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function
Tom Henderson <tomh@tomh.org>
parents: 1278
diff changeset
   953
    Ipv4Mask amask = Ipv4Mask("255.255.255.255"));
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   954
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   955
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   956
} // namespace ns3
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   957
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   958
#endif /* GLOBAL_ROUTE_MANAGER_IMPL_H */