Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 10.00

Electronic submissions

Programming Assignment 2 Due Feb 02 2015 6:00PM Electronic submissions only

THE WORK MUST BE YOUR OWN!
If you are referencing any outside sources you must cite those clearly.

In this assignment, you will simulate the task of a simple packet router. Three networks A, B and C are defined in the figure mentioned above. Any two hosts within the same network can directly communicate. However, a host needs to contact its default router when it wants to communicate to an external host. Routers A, B and C are the designated default routers for networks A, B and C respectively. There are direct links between Router A and Router B, and Router A and Router C. But there is no direct link between Router B and Router C. In this assignment, you would simulate the routing task of Router A. You need to run a program that would receive incoming packets and make necessary routing decisions based on packet-destinations. You would run another program on the same machine that would generate and send packets to the router program. The source of each generated packet may be any host from any of the networks A, B and C, but packet destination would be a host from a network different from the source network (we assume that two hosts within a network can communicate directly). For some of the

generated packets, the destination would be host from a non-existing network (say, network D). This would verify whether Router A can handle incoming packets that have invalid destinations. When a new packet is generated, the source host would be randomly chosen from networks A, B or C (again chosen randomly). When you need an invalid destination for a generated packet, you can choose 168.130.192.01. Packet ID’s of generated packets should be sequential numbers, and TTL values should be randomly chosen between 1 and 4 inclusive.

Therouter programwill take three command-line arguments:
The router program will:

  • ? read its routing table from the specified file

  • ? The file will consist of multiple lines with the format:


    The subnet and netmask would be in IPv4 dotted decimal. The nexthop value would 0, RouterB or RouterC. The three values will be separated by spaces. For example:

    192.224.0.0 255.255.0.0 RouterC.

    A 0-value of nexthop means a direct delivery of a packet to a host within network A.

  • ? listen to the specified UDP port

  • ? accept simplified IP packets in the format:

    , , , , Example: 215, 192.168.192.4, 192.224.0.7, 64, testing

    For each received packet, your program will:

    • ? decrement the TTL field of the packet
      oif it reaches zero, the packet will be dropped and the "expired packets" counter will be

      updated

    • ? figure out which of the entries in the routing table (if any) match the packet

oit will do this by checking whether the destination address in the packet matches the subnet entry for a particular route, after being ANDed with the netmask of that entry in the routing table.

oIt will scan the routing table sequentially and will use the first route that matches (you can assume the table is sorted according to the longest-prefix first)

oif there is no matching entry, the packet will be dropped and the "unroutable packets" counter will be updated

?if the value of the nexthop field for the entry is 0: oprint the following:

Delivering direct: packet ID=, dest= oupdate the "delivered direct" counter

?if the value of the nexthop field for the entry is RouterB or RouterC
oupdate the counter corresponding to the packets forwarded to that router

Note: whenever a routing decision about a packet is done, the packet would not be processed any further.

Statistics file:
After every 20 packets are processed, you will update the statistics file (the path to which was given as a

command-line argument). The format of the file will be: expired packets:
unroutable packets:
delivered direct:

router B: router C:

Thepacket generator programwill take two command-line arguments:
The program will:

  • ? create packets and set , , , , as mentioned in the first paragraph

  • ? sends packets to router program Packets file:

    After every 20 packets are generated, you will update the packets file (the path to which was given as a command-line argument). The format of the file will be:
    NetA to NetB: NetA to NetC: NetB to NetA: NetB to NetC: NetC to NetA: NetC to NetB: Invalid Destination:

    When the user interrupts with Ctrl+C, you will also update the statistics and packets files before the program exits. To do this, you need to handle theKeyboardInterruptexception.

    Error handling:
    In addition to the above-mentioned KeyboardInterrupt (used to terminate the program), you will need to

    handle any I/O-related exceptions.

    If the routing table file does not exist or cannot be read, your program should print an error message and exit. If the statistics or packets files does not exist and it is unable to create it, it should print an error message and exit. If, later, an error occurs while trying to update the file, it should print an error message and it should continue running (i.e. it should not exit in this case).

If your program is unable to listen to or connect to the specified UDP port it should print an error message and exit.

If an error occurs while receiving an incoming packet, it should print an error message and it should continue running (i.e. it should not exit in this case).

Answers

(5)
Status NEW Posted 17 Sep 2017 07:09 AM My Price 10.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)