Write program called router which you will run multiple time

Assignment Help Computer Networking
Reference no: EM131937238

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.

Reference no: EM131937238

Questions Cloud

How many liters of benzene gas are formed : The normal boiling point of benzene is 80.1 °C. At 298 K and 95.1 mmHg, how many liters of benzene gas are formed
Standard entropy of vaporization : A comparable amount of disorder is generated when any non-associated liquid evaporates and becomes a gas. An empirical observation called Trouton's
What are some of the most widely publicized dos attacks : What are some of the most widely publicized DoS attacks that have recently occurred? What about attackers who threaten a DoS attack unless a fee is paid?
Standard thermodynamic data : Using standard thermodynamic data at 298K, calculate the change when 1.97 moles of Ca(OH)2(aq) react at standard.
Write program called router which you will run multiple time : You should write a program called router which you will run multiple times on some combinations of computers.
Standard enthalpy change for the reaction : The standard enthalpy change for the reaction of 2.24 moles of CO(g) at this temperature would be _________kJ.
Identify the product of the process : Identify the product of the following process: tellurium with 75 neutrons undergoes ß and ?-decay. Do not indicate metastable state, if any.
Decays by positron emission : Phosphorus-30, which has a half-life of 150 seconds, decays by positron emission.
Atom of the representative elements : Why does the size of the atom of the representative elements decrease from left to right across a period?

Reviews

Write a Review

Computer Networking Questions & Answers

  Networking and types of networking

This assignment explains the networking features, different kinds of networks and also how they are arranged.

  National and Global economic environment and ICICI Bank

While working in an economy, it has a separate identity but cannot operate insolently.

  Ssh or openssh server services

Write about SSH or OpenSSH server services discussion questions

  Network simulation

Network simulation on Hierarchical Network Rerouting against wormhole attacks

  Small internet works

Prepare a network simulation

  Solidify the concepts of client/server computing

One-way to solidify the concepts of client/server computing and interprocess communication is to develop the requirements for a computer game which plays "Rock, Paper, Scissors" using these techniques.

  Identify the various costs associated with the deployment

Identify the various costs associated with the deployment, operation and maintenance of a mobile-access system. Identify the benefits to the various categories of user, arising from the addition of a mobile-access facility.

  Describe how the modern view of customer service

Describe how the greater reach of telecommunication networks today affects the security of resources which an organisation provides for its employees and customers.

  Technology in improving the relationship building process

Discuss the role of Technology in improving the relationship building process Do you think that the setting of a PR department may be helpful for the ISP provider? Why?

  Remote access networks and vpns

safekeeping posture of enterprise (venture) wired and wireless LANs (WLANs), steps listed in OWASP, Securing User Services, IPV4 ip address, IPV6 address format, V4 address, VPN, Deploying Voice over IP, Remote Management of Applications and Ser..

  Dns

problems of IPV, DNS server software, TCP SYN attack, Ping of Death, Land attack, Teardrop attack, Smurf attack, Fraggle attack

  Outline the difference between an intranet and an extranet

Outline the difference between an intranet and an extranet A programmer is trying to produce an applet with the display shown in Figure 1 below such that whenever one of the checkboxes is selected the label changes to indicate correctly what has..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd