Ns2.35 self-contained satellite network centralized routing Learning

Source: Internet
Author: User

In ns2.35, satroute. CC ,~. H implements centralized Routing

@@In. H files, there are mainly the following types:

1. satrouteagent

ClassSatrouteagent: Public agent

Inheritance relationship:

Satrouteagent <-Agent <-connector <-nsobject <-tclobject, Handler

2. satrouteobject

ClassSatrouteobject: Public routelogic

Inheritance relationship:

Satrouteobject <-routelogic <-tclobject

 

@@In. CC files, there are mainly the following classes:

static class SatRouteClass:public TclClass{  public:SatRouteClass ():TclClass ("Agent/SatRoute") { }TclObject *create (int, const char *const *) {    return (new SatRouteAgent ());}} class_satroute;static class SatRouteObjectClass:public TclClass{  public:        SatRouteObjectClass ():TclClass ("SatRouteObject") { }        TclObject *create (int, const char *const *) {                return (new SatRouteObject ());        }} class_satrouteobject;

 

The above two classes are mainly used to realize the interaction between C ++ and TCL, which is a general definition.

In the. CC file, we mainly implement the methods of the two classes defined in. h.

 

@ Satrouteobject implements a routing algorithm, including computing network topology, computing routing, and route table distribution.

Computing network topology: void satrouteobject: compute_topology ()

Computing route: void satrouteobject: node_compute_routes (intnode)

Voidsatrouteobject: recompute ()

Distribution Route: voidsatrouteobject: populate_routing_tables (INT node)

There are two computing routes. The first is to calculate the route of a node, the second is to calculate the route of the entire network, and the second is to call the basic routelogic method.

Computing routing is said to be a centralized shortest path algorithm. Is it Dijkstra?

@@Route table Organization

In route. H,Neighbor Link Cost Table, route table

struct adj_entry {double cost;void* entry;};struct route_entry {public:int next_hop;void* entry;};

Defined in satroute. hForwarding Table

// Entry in theforwarding tablestruct slot_entry {       int next_hop;             NsObject* entry;};

What is the difference between a route table and a forwarding table?

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.