CNET network simulator - developing a simple protocol

Assignment Help Computer Networking
Reference no: EM131858069

Objectives

The programming assignment is intended to give more experience with the cnet network simulator API and its use in developing a simple protocol.

Part 1: The CNET API

This part requires that you familiarize yourself with the contents of the following files:

File/Directory

Remarks

cnet.h

 

cnet's FAQs

ticktock

 

stopandwait

the cnet standard header file (make a local copy of the file from directory $CNETPATH; you may need to refer to it in the future) linked to from the main documentation page

(in the examples directory) the protocol illustrates the use of timer events

(in the examples directory) the protocol implements a stop-and-wait

protocol to achieve reliable communication between two nodes

Answer the following questions.

1. Use the data types defined in cnet.h to complete the following C-struct. If no suitable definition is found in cnet.h use standard C data types.

typedef struct {

....   node_t;        // node type, e.g., NT_ROUTER

....   mytimer;       // a timer identifier

....   src, dest;     // user defined node addresses (not node numbers)

....   ap_pos;        // the (x,y,z)-coordinates of an access point

....   code;          // stores the return value of function CNET_ccitt()

} PACKET;

2. In cnet, each node independently executes a copy of the protocol specified in a topology file. Information about a node is stored in struct nodeinfo. How can a node access its current simulation time (the time advanced by the occurrence of events since the node's last EV REBOOT)? How to print such a value using a printf statement? (Hint: check the FAQs as well as cnet.h.)

Remarks: The simulation time is typically different from the wall-clock time. For example, if the run-speed parameter in the GUI is set to a value other than normal, the simulation time may run either faster or slower than the wall-clock time. Also, one should not assume that the simulation time is synchronized between all nodes by default. Some nodes may have pending undelivered events, and thus their simulation time may be lagging others. The design of the simulator, however, ensures that each node encounters a valid sequence of timed events.

3. Download protocol file ping-W18.c and topology file PING-W18 linked to the course's WEB page. Familiarize yourself with the working of the protocol. Run cnet on the topology file. In the GUI, click on any node to open its output window. Press the DEBUG0 button, labelled Node Info, to obtain more output. Record one of the displayed values of variable delta.

(a) Explain the recorded value of delta given the default settings of the various parame- ters in the topology file.
Note: you may use "cnet -p topologyFile" to obtain the default settings of a topology file.
(b) Explain how to modify the topology file to make delta approximately equal to 1.5 second.

4. In the stopandwait.c protocol, can FRAME SIZE(f) be different from sizeof(f)? Explain.

5. The contents of array msg 1 below is an original transmitted message. The contents of array msg 2 is a corrupted received message obtained by performing a circular right shift operation.

unsigned short msg_1[]= {10,20,30,40,50,60}, msg_2[]= {60,10,20,30,40,50};

Use function CNET IP checksum to compute the checksum for each message. Write the obtained values in your submitted answer to this part.

Note: If the two checksum values are equal then this error detection code fails to detect this type of message corruption.

6. What does the CHECK macro do when the enclosed function call returns an error value (typ- ically 1)? Explain how the information mentioned under API FOR ERROR HANDLING in cnet.h can be used to report an API error to the user (using some easy to understand text message) while allowing the simulator to continue execution.

Remark: You may test the effect of the macro by checking, for example, its behaviour when
CNET write physical is called with a non-existing link.

7. Does the stopandwait.c protocol detect corrupted frames? If yes, explain how this feature is programmed (when appropriate, give C code fragments to illustrate the steps in- volved).

Part 2: Obtaining Topology Information

In this part, you are asked to develop a simple protocol that allows a node to learn about its neigh- bours. In the real world, for example, when a router is rebooted it starts in a state where it does not know any of its neighbours. The developed protocol enables routers to acquire such important information. CNET mimics this behaviour; after the initial node reboot, a node does not know any information about any of its neighbours. It knows, however, that it has nodeinfo.nlinks incident links numbered sequentially starting from link number 1. (Recall that link number 0 is a loopback link that may be used for debugging.)

Your task in this part is to develop a topology learning protocol that enables a node to build a table where the ith entry, 1 i nodeinf o.nlinks, stores the name, address, and type (e.g., a mobile host or router) of the node reachable by the node's ith incident link. This is achieved by sending a HELLO message to each neighbour, and receiving a corresponding HELLO ACK message that carries the neighbour's name, address, and type. More details about the required protocol is given below.

- For convenience of developing your solution, you may start with the program ping-W18.c posted on the course's WEB page. Call your program lab1.c.
- Each node in your program should send multiple HELLO messages on each incident link.
This feature may be useful if the link corrupts some of these messages.
Don't use CNET write physical reliable().
- You may assume that any node in any input topology file has at most MAX DEGREE= 32 neighbours, and each node name has at most MAX NODENAME LEN (see cnet.h) charac- ters (including the terminating null character). A node can be assigned any arbitrary valid integer address.
- Program ping-W18.c prints some information when the DEBUG0 button in a node's GUI is pressed. You are required to add to this list of printed information, the following:
1. The node type (e.g., a router)
2. The number of received HELLO messages, and the number of transmitted HELLO ACK
messages
3. A table that lists for each link i incident to the node, the number i, and the name and the address of the neighbour reachable by this link. For example, (link 2 = routerEast,
100) may be printed to indicate that link number 2 incident to the current node leads to a neighbour called routerEast whose assigned address is 100.
Use a format of your choice to print the above information.
- Test your program with file LAB1 T1 posted on the WEB site, as well as other WAN topol- ogy files of your choice.
- In your report, comment also on the following aspects:
1. Whether a node can identify its neighbours when the probframecorrupt for the links is not zero.
2. Whether the developed protocol produces logical or runtime errors when run on files
LAB1 T2 (a LAN) and LAB1 T3 (a WLAN).

Explain your findings.
- Note: It is not a good idea to place the logic of sending all of the required HELLO messages in the reboot node function. CNET initializes nodes sequentially by executing the logic in the node's reboot node function. An error occurs if a node attempts to send a HELLO message to an uninitialized node.

Deliverables

Typeset a solution file ‘answers' (text, HTML, or PDF) containing your answers to the questions in Part 1, and a program report (one or two pages) for the program in Part 2. The program report should contain the following (minimal set of) sections:

- Design Overview: highlight in point-form the important features of your design
- Program Status: describe the status of your program; mention difficulties encountered in the implementation
- Testing and Results: Explain how you tested your implementation. Describe possible API errors that you may have encountered in testing the program.
- Acknowledgments: acknowledge sources of assistance

Attachment:- Files.rar

Reference no: EM131858069

Questions Cloud

Write one paragraph criticizing the film : Take opposite sides in a debate about a single film. Write one paragraph criticizing the film and then one paragraph defending it.
What letter format will you use block or modified block : What letter format will you use, block or modified block? Are you going to use mixed or open punctuation? How do you keep it interesting, but business based?
Discuss the goals of the youth criminal justice act : Discuss the goals of the Youth Criminal Justice Act in Canada. How do these goals speak to the unique position of youth within our society
Signposts to deter or lessen the impact : The 2001 attacks against the U.S. caught the country somewhat unaware and unprepared. Reviewing the documentation
CNET network simulator - developing a simple protocol : CMPUT 313 - The CNET Simulation Environment - Explain the recorded value of delta given the default settings of the various parame- ters in the topology file
What are the responsibilities of companies : What could Nestlé have done to have avoided the accusations of "killing Third World babies" and still market its product?
Daifference between the castle doctrines : Determine the fundamental difference between the castle doctrines and stand your ground types of criminal defenses.
Identify and describe the layers of cells of the retina : Identify and describe the 5 layers of cells of the retina and discuss the pattern of their interconnections
Compare and contrast the impact on society : Discuss the factors that influenced the evolution of the one crime and the emergence of the other crime. Compare and contrast the impact on society of both type

Reviews

len1858069

2/10/2018 2:09:48 AM

Marking Roughly speaking, the breakdown of marks is as follows: 35% : Part 1 questions 50% : correctness, testing, and results of Part 2 program 15% : quality of the program report (if applicable: the results, justifications, discussions, etc.)

len1858069

2/10/2018 2:07:00 AM

The CNET Simulation Environment (first draft) Due: Friday, February 9, 2018, 09:00 PM - 1. – Testing and Results: Explain how you tested your implementation. Describe possible API errors that you may have encountered in testing the program. – Acknowledgments: acknowledge sources of assistance 2. All submitted programs should compile and run on the lab machines. 3. Combine files answers, and lab1.c into a single tar archive ‘submit.tar’ or ‘submit.tar.gz’. 4. Upload your tar archive using the Lab #1 submission/feedback link on the course’s web page. Late submission (through the above link) is available for 24 hours for a penalty of 10%. 5. It is strongly suggested that you submit early and submit often. Only your last successful primary submission will be used for grading.

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