Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Wireless sensor networks wsn let users to access servers

Wireless Sensor Networks (WSN) let users to access servers, printers, and other network resources regardless of their location, within the wireless reach. This flexibility means that, for example, a user's laptop stays c ...

1 a firms marginal rate of technical substitution at m p lm

1) A firm's marginal rate of technical substitution at M P L/M P = 3, and the ratio of prices of labor and capital ,w/r, is 4. a) Is the firm minimizing its cost? Why or Why not? b) What can it do to improve its situatio ...

Per capita income of winterfell is 15000 with a growth rate

Per capita income of Winterfell is $15,000 with a growth rate of 4%. Per capita income of King's Landing is $25,000 with a growth rate of 0%. How long until per capita income is the same in both locations?

Assignment1 consider a tcp connection between host a and

Assignment 1, Consider a TCP connection between Host A and Host B. Suppose that the TCP segments traveling from Host A to Host B have source port number 10526 and destination port number 80. What are the source and desti ...

Question 1 for rsa encryption we need a modulus that is the

Question : 1. For RSA encryption we need a modulus that is the product of two prime numbers, p and q. Assume p = 11 and q = 13, and thus n = p*q = 143. In this case, the RSA encryption exponent e must be relatively prime ...

Buffer overflowthe common vulnerabilities and exposures cve

Buffer overflow The "Common Vulnerabilities and Exposures" (CVE) is a list of cybersecurity vulnerabilities that have been discovered, and they are collected in a database for everyone to see and improve or patch their s ...

Suppose after collecting data on an existing firms actual

Suppose, after collecting data on an existing firm's actual short-run ouput, the following production function is found to match the data: TP = Q = 5*L + 0.6*L2 - 0.01*L3 1. Using the equation above, find the following e ...

Topic is impacts of data breaches the report will divide in

Topic is "Impacts of data breaches". the report will divide in to 5 section which is : "" 1-Abstract: comprehensive overview of the report in 150 to 200 words. 2- Introduction: Describe the topic and its issue in 250 to ...

Question do some research and find a case of cyber

Question : Do some research and find a case of cyber harassment or cyberbullying. Explain the case, and discuss the relevant theories of criminal justice associated with the perpetrator(s). Your response should be a mini ...

Nbspfor the remaining questions consider a 4-bit block

For the remaining questions, consider a 4-bit block cipher, described in hexadecimal by the following table: Plaintext Ciphertext Plaintext Ciphertext 0 a 8 e 1 c 9 d 2 f a 0 3 6 b 7 4 3 c 5 5 8 d b 6 4 e 9 7 2 f 1 You c ...

  • 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