Ask Computer Network & Security Expert

Assignment: ROUTER PROGRAM

The goal of this assignment is to route messages through a network of packet-switching programs, much as IP routersforward datagrams in an internet. Your software will determine shortest-path routes through a network in which routers may crash, as well as actually moving messages along these routes. You must use link-state protocol and use Dijkstra's algorithm to computer routes.

REQUIREMENTS

You should write a program called router which you will run multiple times on some combinations of computers. A real router would have physical links to a few neighbors. Instead your simulated router will exchange UDP packets with a few neighbor programs,. The program should not talk directly to non-neighbors: just as on real network, all communication to non-neighbors should be via neighbors.

INTERFACE REQUIREMENT

The program should accept arguments as follows:

Myhost% ./router id port host1 port1 host2 port2 ...

The id is a number between 0 and 19 inclusive that should be unique over all programs in a particular simulated network. The port is the number of a UDP port on which your program should send and receive packets.

The hostNportN pairs are host names and ports of this program's neighbors - there should be other instances of your program running on those hosts listening to the indicated ports.

Your program must read its standard input. From time to time your program will receive a line of input. This line will be a numeric id, and it indicates that your program should arrange to have a data packet delivered to the program with that id. If your program does not have a link to the destination program you cannot send the packet directly: you must forward the packet through a neighbor.

You must forward these data packets along the shortest path to the destination, where each hop in the path is a link between neighboring routers. If there is more than one shortest path, any of them is acceptable. Whenever your program receives a data packet it should print a line to the standard output consisting solely of the unique id of the packet's destination. Do not print anything else to the standard output.

TIME REQUIREMENTS

It should take your program less than a second to either deliver a data packet to the final destination or discard the packet because the destination is not reachable.

Each router should detect the fact that a neighbor has died (or come back to life) within 5 seconds. Within a second after that all routers should be capable of forwarding data packets over shortest paths in the new topology.

You should design the program that it does not need to send more than one packet per second per neighbor when the network topology is not changing. You can send more packets than that for the brief periods (less than a second) in which your routers are exchanging new topology information. This does not include data packets: your program should send data packets as often as asked.

TOPOLOGY REQUIREMENTS

Your program must be able to handle router failure and recovery. You may assume that links never fail. You may also assume that links never discard or corrupt packets, so your flooding and forwarding algorithms do not need to handle these problems.

You can assume that there will be no more than 20 routers in the simulated network.

Your program is allowed to send UDP packets only to the host/port pairs given to it as arguments. Some of the programs indicated may not be running at any given time, and programs may be stopped and re-starded as times passes. You can think of this as routers failing and being fixed.

All routers have bi-directional links. That is, if router A has a link to B, then B will also have a link to A.

OTHER REQUIREMENTS

You must use a link-state protocol. This means that routers are limited to exchanging up/down information about specific links. Each router must use Dijkstra's algorithm to compute table based on the link states.

You may use time stamps to decide whether a flooded link state update is recent. You can use the UNIX time() or gettimeofday() system calls to find the current time. Your time stamp scheme must be able to cope with one of your programs being terminated (as with control-c) and re-started. You can assume that the time on each UNIX host behaves well (i.e increases monotonically at about one second per second), but you cannot assume that the times on different hosts agree. Thus you should never compare time stamps produced by different hosts, only different time stamps produced by the same host.

COMMENTS

Your program only needs to use a single socket. Use sendto() to send packets and recvfrom() to receive them. You can tell who sent you a packet by looking at the sin_addr.s_addr and sin_port fields of the struct returned through the fifth argument to recvfrom().

Your data packets need not to have any payload. They only need a header with a destination address and a TTL. You should use a C struct to help format and decode packets.

WHAT TO HAND IN

Hand in a tar zipped file with the source code, a make file and a comprehensive report.

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M92775894

Have any Question?


Related Questions in Computer Network & Security

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Advanced network design assessment - human factors in

Advanced Network Design Assessment - Human factors in network analysis and design Purpose of the assessment - This assignment is designed to assess students' knowledge and skills related to the following learning outcome ...

Advanced network design assessment - human factors in

Advanced Network Design Assessment - Human factors in network analysis and design Purpose of the assessment - This assignment is designed to assess students' knowledge and skills related to the following learning outcome ...

Assignment descriptionproject scope a typical network

Assignment Description Project Scope: A typical network layout diagram of a firm is given below for illustrative purposes only. The service requirements are enclosed. Figure. Network layout of a firm Service requirements ...

Assignment descriptionproject scope a typical network

Assignment Description Project Scope: A typical network layout diagram of a firm is given below for illustrative purposes only. The service requirements are enclosed. Figure. Network layout of a firm Service requirements ...

After reading this weeks materials please respond to two 2

After reading this week's materials, please respond to TWO (2) of the following questions. AND PROVIDE CITATION IN APA 1. Describe the differences between bus, ring, star and mesh topologies. 2. Explain the TCP/IP Model ...

The abstract should not be more than 250 words describe

The abstract should not be more than 250 words. Describe your project, focusing on research questions and research method for next stage of the project. 1. Introduction [The introduction should describe what the project ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As