IP Routing Algorithm Simulation

Write a program for GNU Linux that simulates the IP routing. The following algorithm MUST be used:


RouteDatagram ( Datagram, Routing Table)

Extract destination IP address, D, from the datagram

And compute the network prefix, N;

if N matches any directly connected network address

deliver datagram to destination D over that network

(This involves resolving D to a physical address,

encapsulating the datagram, and sending the frame.)

else if the table contains a host-specific route for D

send datagram to nest-hop specified in table

else if the table contains a route for network N

send datagram to next-hop specified in table

else if the table contains a default route

send datagram to the default router specified in table

else declare a routing error.

The algorithm uses IP to forward a datagram. If this program is given an IP datagram and a routing table, this algorithm selects the next hop to which the datagram should be sent. All routes must specify a next hop that lies on a directly connected network. Network topology must vary. The simulation needs to be fairly detailed, with statistics from the routing table like next hop.

Here is sample data for routing test:

M_ENTRIES table = { 4,

{ {1, 0xc0a80016, 0xffffffff},

{2, 0xabf34718, 0xabf30001},

{3, 0xc0a801ff, 0xc0a80101},

{4, 0xffffffff, 0xc0a80001}



unsigned char data1[] = {0x45, 0x20, 0x00, 0x80, 0xD3, 0xD5, 0x00,

0x00, 0x72, 0x11, 0xC5, 0xC9, 0xab, 0xf3,

0x47, 0x18, 0xC0, 0xA8, 0x00, 0x05, 0x98,

0xED, 0x9C, 0x86, 0x00, 0x6C, 0xD7, 0x1A,

0x98, 0xED, 0xC5, 0x1A, 0x00, 0x00, 0x48,

0x23, 0x62, 0x1A, 0x71, 0x78, 0x00, 0x03,

0x00, 0x55, 0x00, 0x00, 0x23, 0x7D, 0x00,

0x00, 0x01, 0x7B, 0x00, 0x00, 0x00, 0x00,

0x17, 0x03, 0x00, 0x00, 0x40, 0x1D, 0x02,

0xEC, 0x77, 0x6C, 0xC9, 0xBF, 0x1A, 0x8C,

0x7F, 0x57, 0xB7, 0xC7, 0x5A, 0x00, 0xE5,

0xB3, 0xF4, 0x2B, 0x35, 0x64, 0x2B, 0x0F,

0xD9, 0x5E, 0x0A, 0xBB, 0xEB, 0x4B, 0x67,

0x25, 0x1A, 0xF4, 0x78, 0xCB, 0x36, 0x06,

0x7F, 0xC2, 0xC6, 0xFC, 0xCE, 0x7C, 0x83,

0xFE, 0xB0, 0x9B, 0xC9, 0x0D, 0x8A, 0xB0,

0x21, 0x88, 0x35, 0xAD, 0x15, 0xFD, 0xF3,

0xF0, 0x45, 0x03, 0x5A, 0x86, 0x85, 0x00,

0x00, 0x00 };

here is what program might look like:

/* A structure that defines a single entry

The first byte specifies the type of entry.

There are three types of entries,

1. A host specific entry

2. A routed network entry

3. A default entry

see for more info:

[url removed, login to view]

[url removed, login to view] for more info

a directly connected networks are only determined

by looking at the machines IP address and the destination

IP address. If they both are on the same N then the

destination is considered to be on the same network.


typedef struct entry{





unsigned char type_of_entry;

unsigned char matching_criteria[4]; /* routing decision is based if it

matches this address */

unsigned char forwarding_address[4]; /* forwarding or next hop address */


typedef struct entry * PENTRY;

/* A structure that defines a table of entries

The first element specifies how many entries

exist in the table

Each entry that follows is of type ENTRY


typedef struct multiple_entries


int number_of_entries;

PENTRY* entries;


typedef struct multiple_entries * P_MENTRIES;

/* An example of a Table


M_ENTRIES table = { 3,

{ {2, [url removed, login to view],},

{3, 192.168.1.* ,},

{4, 192.168.0.* ,}





Habilidades: Programação C, Engenharia, Linux, Administrador do Sistema

Veja mais: routing simulation, compute network prefix, routing algorithm, simulation routing, routing program, routedatagram algorithm, route algorithm, datagram routing simulation, what is the algorithm, what is an algorithm, what is algorithm in data structure, what is algorithm in computer, what is algorithm, what is a data entry test like, what is a computer algorithm, what is a algorithm, what are the types of data structure, what an algorithm, what algorithm, vector vector int, vector int int, vector int, vector en c, vector element, uses of data structure

Acerca do Empregador:
( 0 comentários ) morristown, United States

ID do Projeto: #181397

9 freelancers estão ofertando em média $163 para esse trabalho


Please check PMB!

$150 USD in 5 dias
(10 Comentários)

hi, I am familiar with simulation.

$170 USD in 15 dias
(2 Comentários)

I can complete this program and give it to you working, within 5 days.

$200 USD in 5 dias
(0 Comentários)

I am interested on this project,hope work for you,3xs and please check your pmb.

$180 USD in 5 dias
(0 Comentários)

Have good experience on C/C++ and Linux. Right now working on Network Domain.

$120 USD in 5 dias
(0 Comentários)

I have already coded a program that captures IP packet form one netwok and sends it to another types of network(wireless). If you need only simulations. bingo!

$200 USD em 1 dia
(0 Comentários)

Hello, check PMB

$150 USD in 2 dias
(0 Comentários)

Hello Sir, This is admin from kodekraze. We are having experienced team of C/C++ and embedded development. Please check your PMB for more details. Thanks, Admin - Kodekraze Team

$150 USD in 8 dias
(0 Comentários)

Hi, I am a freelance programmer and wish to express my interest in this project. Please check the PMB for further details. Vivek

$150 USD in 3 dias
(0 Comentários)