首页 > > 详细

Lab 7

 - update_routing_table.m: modify the router’s routing table based on

updates from neighboring routers. RIP algorithm explains how this is
supposed to happen such that the minimum number of hops is used
- system.m: is the simulation environment. It continues calling
update_routing_table till no further updates are possible
To run the simulation:
- open Octave, cd to the directory of the scripts
- run init - run system
The system will display the initial and the final routing tables (15x30). Your tasks:
Your task is to use the routing tables to figure out the routing path from
router Rn using a destination IP Address.
Task 1
Write a function to check if an IP address lies with an IP subnet.
Call your function addrExist(addr, netAddr, mask)
The function should return 1 if the address is in the given subnet, zero
otherwise. Check your function works properly.
Note that system.m contains an array NetAddresses of 15 network
addresses and mask pairs that you can use. Task 2
Write a function to find the routing path of an address. Call your function
route(dstAddr, srcRouter, RoutingTables,
NetAddresses, Router2RouterConnectivity)
The function should return a 2xN array, where N is the number of
Networks/Routers visited, i.e. number of hops + 1.
First row is routers, starting by the srcRouter.
Second row are networks visited, ending with the network which
contain dstAdr.
Test your function with the network provided and the addresses provided.
Assume that network N1 will have (address, mask) from index 1 of
NetAddresses, etc.
Task 3
Write a new initialization script, call it init1.m, which represent the following
internet segment
Ignore the autonomous system notation in the above figure, i.e. consider
this internet as a single AS. Test your route function with this internet.
Note that we will use our own init1 to verify your routing solution.
Include few examples you used to test your functions in your report. Submit
all source code, including provided code together with the lab report in one
zip file.
联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!