# Computer Networks

Topic: EntertainmentGames
Sample donated:
Last updated: October 9, 2019

CS601: Computer Networks lab EXERCISE – 1 Write a Program in C/ C++ for error detecting code using CRC-CCITT (16 bit) Objective: To enable the receiver of a message transmitted through noisy channel to check whether the message has been corrupted. The aim of an error detection technique is to enable the receiver of a message transmitted through noisy channel to determine whether the message has been corrupted. To do this, the transmitter constructs a value called a checksum that is the function of message and appends it’s to message.The receiver can then use the same function to calculate the checksum of the received message and compare it with the appended checksum to see if the message was correctly received. IMPLEMENTATION Figure: Euclidean division algorithm The message is represented by a information polynomial i(x). i(x) is store as a bit pattern of k length in an integer array.

The k information bits are represented by k-1 degree polynomial i(x) = i(k-1)x(k-1) + i(k-2)x(k-2) +…………………………….. +i1x+i0 A polynomial code is specified by its generating polynomial g(x).If we assume that we are dealing with a code in which codewords have n bits of which k are information bits and n-k are check bits .

Don't use plagiarized sources.
Get Your Custom Essay on "Computer Networks..."
For You For Only \$13.90/page!

Get custom paper

The generator polynomial for such a code has degree n-k and has the form g(x) = x(n-k) + g(n-k-1)x(n-k-1) +………………………. +g1x+1 The generator polynomial chosen is CCITT-16 (x16+x12+x5+1). 1 CS601: Computer Networks lab Encoding Procedure At Sender Steps 1) Multiply i(x) by x(n-k) by putting zeros in n-k low order positions 2) Divide x(n-k)i(x) by g(x) to get r(x).

Use Euclidean division algorithm with a feedback shift register as shown in above figure x(n-k)i(x) = g(x) q(x) + r(x) where q(x) is quotient and r(x) is remainder 3) Add remainder r(x) to x(n-k)i(x) by putting check bits in n-k lower order positions 4) Based on randomness, the message can be transmitted with error or without error. 5) For transmission with error, introduce an error at random position to the message x(n-k)i(x) and display the position of the error. 6) Transmitted codeword is b(x) = x(n-k)i(x) + (x) Decoding Procedure at the Receiver Steps 1) The received message b(x) is divided by g(x) using Euclidean division algorithm 2) If the remainder is 0 then there is no error in the transmission else Error in the transmission. 2 CS601: Computer Networks lab EXERCISE – 2 Write a Program in C/ C++ for hamming code generation for error detection/correction Objective: To Detect and Correct Single bit errors using Hamming Code. Hamming Code is used to detect and correct single bit error. The key to Hamming Code is the use of extra parity bits.

Hamming code consists of k information bits and n-k check bits, where n is the total number of bits in the codeword. Parity bits are placed in positions having power of 2. IMPLEMENTATION (7,4) HAMMING CODE: ? The Hamming Code for 4-bits of data uses 3 redundant bits. Hamming Code for 4 data bits d4 is d4 b7 d3 b6 d2 b5 r3 b4 d1 b3 r2 b2 r1 b1..

. (position of bits in code) d3 d2 d1 where r1 r2 and r3 are redundant bits. PROCEDURE FOR DETERMINING REDUNDANT BITS: The ability of detecting and correcting errors of Hamming Code comes with the cost of redundant bits.These 3-bits are used to take care of all the 8 different possible states of transmitted 7-bits. ? The r-bits are determined using following equations: d1 = r1 + r2 | d2 = r1 + r3 | modulo-2 arithmetic d3 = r2 + r3 | d4 = r1 + r2 + r3 | 3 CS601: Computer Networks lab These equations are further solved to calculate r-bits: r1 = d1 + d2 + d4 r2 = d1 + d3 + d4 r3 = d2 + d3 + d4 PROCEDURE FOR ERROR DETECTION AND CORRECTION: ? On the receiver side 3 position bits(p1-p3) are calculated: p1 = r1 + d1 + d2 + d4 p2 = r2 + d1 + d3 + d4 p3 = r3 + d2 + d3 + d4 ?These values indicate one of the eight possible states of received code: ——————————————————–p3 p2 p1 state Action for correction ——————————————————–0 0 0 No error -0 0 1 Error in b1 bit Flip b1 0 1 0 Error in b2 bit Flip b2 0 1 1 Error in b3 bit Flip b3 1 0 0 Error in b4 bit Flip b4 1 0 1 Error in b5 bit Flip b5 1 1 0 Error in b6 bit Flip b6 1 1 1 Error in b7 bit Flip b7 ——————————————————–And d4-d1 bits after this operation are the actual transferred data bits. Steps to execute the program At Sender: Code Formation: 1. .

3. 4. Get 4-bit(d4-d1) input Determine r-bits(r3-r1) using above equations Form the 7-bit Code by placing r-bits and d-bits in appropriate positions. Send the Code to Receiver At receiver: Error Detection and Correction: 1. Determine position bits(p3-p1) using above equations 2. Use the Table to find the position of error(if present) and to take corrective action. 4 CS601: Computer Networks lab EXERCISE – 3 Write a Program in C/ C++ for client server communication using TCP or IP sockets to make client send the name of the file and server to send back the contents of the requested file if present.Objective: To Use TCP/IP sockets and write a client server program in which the client sends the file name in request message and the server sends back the contents of the requested file if present.

The Berkeley 4BSD series was an almost unbelievable advance in Unix development. Among the features it added were virtual memory, shared memory, and sockets. Sockets were added in 4. 2BSD.

Conceptually, Internet sockets on a Unix system look like a numbered array of interprocess communication channels — so there is a socket 0, socket 1, socket 2, and so forth. They re used in a client-server relationship; a daemon wishing to provide a service creates a socket and listens to it; a client program connects to the socket and makes requests. The daemon is also able to send messages back to the client. Creating a Socket The socket system call is given below: s = socket(domain, type, protocol); The domain is either AF_UNIX or AF_INET.

An AF_UNIX socket can only be used for interprocess communications on a single system, while an AF_INET socket can be used for communications between systems. The type specifies the characteristics of communication on the socket.SOCK_STREAM creates a socket that will reliably deliver bytes in-order, but does not respect messages boundaries; SOCK_DGRAM creates a socket that does respect message boundaries, but does not guarantee to deliver data reliably, uniquely or in order. A SOCK_STREAM socket corresponds to TCP; a SOCK_DGRAM socket corresponds to UDP The protocol selects a protocol. Ordinarily this is 0, allowing the call to select a protocol.

Port numbers below 1024 are reserved – that means only processes with an effective user id of 0 (ie the root) can bind to those ports.Listening to the Socket Once the socket has been created and bound, the daemon needs to indicate that it is ready to listen to it. It does this with the listen system call, as in listen(s, 5); The main thing this does is to set a limit on how many would-be clients can be queued up trying to connect to the socket (the limit in this example is 5). If the limit is exceeded the clients don’t actually get refused, instead their connection requests get dumped on the floor. Eventually they will end up retrying.

Accepting Connections The server is able to accept connections by calling accept: newsock = accept(s, (struct sockaddr *), ); For this call, s is, as you’d expect the socket that was returned oh so long ago by the socket call. The accept() call blocks until the client connects to the socket. Connecting to the daemon 6 CS601: Computer Networks lab A client connects to the socket using the connect call. First it creates a socket using the socket call, then it connects it to the daemon’s socket using connect: connect(s, (struct sockaddr *), sizeof(server)); This call returns a new socket.

This means the daemon can communicate with the client using the newly created (and unnamed) socket, while continuing to listen on the old one. At this point, the server normally forks a child process to handle the client, and goes back to its accept loop. The child doing the communication can either use standard read and write calls, or it can use send and recv. These calls work like read and write, except that you can also pass flags allowing for some options. Sending Data There are a variety of functions that may be used to send outgoing messages. rite() may be used in exactly the same way as it is used to write to files.

This call may only be used with SOCK_STREAM type sockets. #include #include int write(int fd, char *msg, int len); fd is the socket descriptor. msg specifies the buffer holding the text of the message, and len specifies the length of the message.

write() is similar to write() except that it writes from a set of buffers. This is called a gather write. This call may only be used with SOCK_STREAM type sockets.

send() may be used in the same way as write().The prototype is #include #include int send(int fd, char *msg, int len, int flags); fd is the socket descriptor. msg specifies the buffer holding the text of the message, and len specifies the length of the message.

flags may be formed by ORing MSG_OOB and MSG_DONTROUTE. The latter is only useful for debugging. This call may only be used with SOCK_STREAM type sockets. 7 CS601: Computer Networks lab Receiving Data There are a variety of functions that may be used to receive incoming messages. read() may be used in the exactly the same way as for reading from files.There are some complications with non-blocking reads. This call may only be used with SOCK_STREAM type sockets. #include #include int read(int fd, char *buff, int len) fd is the socket descriptor.

buff is the address of a buffer area. len is the size of the buffer. readv() may be used in the same way as read() to read into several separate buffers. This is called a scatter read. This call may only be used with SOCK_STREAM type sockets. recv() may be used in the same way as read().

The prototype is #include #include int recv(int s, char *buff, int len, int flags) buff is the address of a buffer area. en is the size of the buffer. flags is formed by ORing MSG_OOB and MSG_PEEK allowing receipt of out of band data and allowing peeking at the incoming data. This call may only be used with SOCK_STREAM type sockets. Steps to execute the exercise ? Client side 1) sfd = Create a socket with the socket(…. ) system call 2) Connect the socket to the address of the server using the connect(sfd, …) system call. The IP address of the server machine and port number of the server service need to be provided. ) Read file name from standard input by n = read(stdio, buffer, sizeof(buffer)) 4) Write file name to the socket using write (sfd, buffer, n) 5) Read file contents from the socket by m = read(sfd, buffer1, sizeof(buffer1)) 6) Display file contents to standard output by write( stdio, buffer1, m) 7) Go to step 5 if m;0 8) Close socket by close (sfd) 8 CS601: Computer Networks lab ? Server side 1) sfd = Create a socket with the socket(…) system call 2) Bind the socket to an address using the bind (sfd, …) system call.

If not sure of machine IP address, keep the structure member s_addr to INADDR_ANY.Assign a port number between 3000 and 5000 to sin_port. 3) Listen for connections with the listen (sfd, …) system call 4) sfd = Accept a connection with the accept (sfd, …) system call.

This call typically blocks until a client connects with the server. 5) Read the filename from the socket by n = read(sfd, buffer, sizeof(buffer)) 6) Open the file by fd = open(buffer) 7) Read the contents of the file by m = read(fd, buffer1, sizeof(buffer1)) 8) Write the file content to socket by write( sfd, buffer1, m) 9) Go to step 7 if m;0 10) Close(sfd) 9 CS601: Computer Networks labEXERCISE – 4 Write a Program in C/ C++ for congestion control using Leaky Bucket algorithm Objective: To demonstrate Congestion Control using Leaky Bucket Leaky bucket is a traffic-shaping algorithm implemented by the sender in a network. The algorithm provides for a steady data transmission rate irrespective of the variation in data generation rate. The program for implementation leaky bucket algorithm can be viewed in two parts 1. Generation of data in variable bursts. 2.

Data transmission at a constant rate. Leaky bucket can be implemented using a circular queue to hold data before it can be transmitted.The size of the circular queue is the size of the bucket size. The data generated from the process is inserted into the queue. When the queue is full, the generated data is discarded.

Data get removed from the queue in FIFO fashion. By using interval timers, generate data in random bursts and store them to bucket. Using timers data from the bucket can be transmitted at a constant rate periodically.

Setitimer API is use to set interval timers to the process to carry out the above functions. The API is defined in sys/time. h header file. Setitimer API prototype: int setitimer (int which, const struct itimerval *val, struct itimerval *old);Setitimer allows up to three timers to be set for a process, and offers a resolution time in microseconds. Expiry of the timer generates signal determined by the ‘which’ argument in the API that can be either TIMER_REAL (SIGALRM) or TIMER_VIRTUAL (SIGVTALRM) or TIMER_PROF (SIGPROF).

We can use the API to set two timers, for generating data and for transmitting data. When the timers go off respective actions associated with the signal handler are called to perform the operations. For generating random burst of data we use the random () function when the timer associated with data generation goes off.

Socket programming or FIFO files can be use to transmit data to the receiver. 10 CS601: Computer Networks lab Steps to execute the program: Main function 1. Establish connection from Sender to Receiver using socket programming or FIFO files. 2. Associate Send_data procedure to handle SIGALRM signal 3. Associate Generate_data procedure to handle SIGVTARLM signal. 4. Set the timer values for ITIMER_REAL timer and ITIMER_VIRTUAL timer in microseconds.

5. Set up the two timers using setitimer API. 6. WHILE TRUE DO a. wait for timers to go off periodically Generate_data function: 1.

Generate a packet. 2.IF bucket (queue) is full DO Discard the packet generated. ELSE Insert the generated data into the bucket (queue). Send_data function: 1.

IF bucket (queue) not empty a. Remove data form bucket (queue). b. Send the removed data to the receiver. ELSE Display ‘Bucket empty’. 11 CS601: Computer Networks lab OPNET Introduction Basics of OPNET IT Guru Academic Edition Objective OPNET stands for Optimized Network Engineering Tools.

OPNET IT Guru Academic Edition enables students to better understand the core concepts of networking and equips them to effectively troubleshoot and manage realworld network infrastructures.Overview OPNET’s IT Guru provides a Virtual Network Environment that models the behavior of your entire network, including its routers, switches, protocols, servers, and individual applications. By working in the Virtual Network Environment, IT managers, network and system planners, and operations staff are empowered to diagnose difficult problems more effectively, validate changes before they are implemented, and plan for future scenarios including growth and failure.OPNET’s Application Characterization Environment (ACE) module for IT Guru enables enterprises to identify the root cause of end-to-end application performance problems and to solve them cost-effectively by understanding the impact of changes.

The labs in this manual are implemented with OPNET IT Guru Academic Edition release 9. 1. OPNET software can be downloaded from www. opnet.

com/itguru-academic/mk-setup. html Start OPNET IT Guru Academic Edition To start OPNET IT Guru Academic Edition: 1. Click on Start ? Programs ? OPNET IT Guru Academic Edition 9. 1. 2.Read the Restricted Use Agreement and if you agree, click I have read this SOFTWARE AGREEMENT and I understand and accept the terms and conditions described herein. Now you should see the starting window of OPNET IT Guru Academic Edition as shown: 12 CS601: Computer Networks lab OPNET IT Guru: IT Guru is a product which is sold with OPNET modules to provide solutions in the areas of application performance analysis, network configuration analysis, and predictive capacity planning with network, application, server, and mainframe models.

System Requirements: ? ? ? ? ? Intel Pentium III, 4 or compatible (500 MHz or better) 256 MB RAM 400 MB disk space Display: 1024×768 or higher resolution, 256 or more colors The English language versions of the following operating systems are supported: Microsoft Windows NT (Service Pack 3, 5, or 6a (Service Packs 4 and 6 are not supported)), ? Windows 2000 (Service Pack 1 and 2 are supported but not required), ? Windows XP (Service Pack 1 is required). 13 CS601: Computer Networks lab How to install OPNET IT Guru Academic Edition? 1. If your computer meets the system requirements, shown above, then download the software from: a. ttps://enterprise37. opnet. com/4dcgi/SIGNUP_NewUserOther 2. Complete the form.

After downloading the software, double-click on the file, ITG_Academic_Edition_v1992, which you just downloaded. 5. Follow the on screen instructions to install the software. Check the OPNET Preferences The OPNET Preferences let you display and edit environment attributes, which control program operations. 1.After starting OPNET, from the Edit menu, choose Preferences. 2. The list of environment attributes is sorted alphabetically according to name.

You can locate attributes faster by typing any part of the attribute’s name in the Find field. 3. Check the value of the license_server attribute.

It has the name of the License Server’s host. If IT Guru is getting its license from the local host (i. e. , the computer on which the software was installed), the value of license_server should be localhost as shown in the following figure. 14 CS601: Computer Networks lab 4. Set the license_server_standalone attribute to TRUE.

This attribute specifies whether the program acts as its own license server. 5. A model directory is a directory that contains OPNET model files.

If the directory is listed in the mod_dirs environment attribute, then OPNET programs will use the models in that directory. Check the value of the mod_dirs attribute. The first directory in the list is where your own models will be saved. In the future you might need to access that directory to back up, copy, or move your models.

IT Guru saves numerous files for every single project you create. 6. Click OK to close the dialog box.Workflow model of IT Guru Overview The steps you use to build a network model and run simulations centers around the Project Editor. In this editor, you can create a network model, choose statistics to collect from each network object or from the whole network, execute a simulation, and view results. Guru Fig:- Workflow of OPNET IT Guru 6 The Project Editor The Project Editor is the main staging area for creating a network simulation. From this editor, you can build a network model using models from the standard library, choose statistics about the network, run a simulation, and view the results. 15CS601: Computer Networks lab Fig:- A Network Model in the Project Editor The Project Editor Window There are several areas in the Project Editor window that are important for building and executing a model.

7 When you open an existing project, your screen should look similar to the following figure. About IT Guru 8 16 CS601: Computer Networks lab The Menu Bar The menu bar is at the top of the editor window. It organizes all the non-context-sensitive editor operations into a set of topical menus. The number of menus and menu operations available change according to the product modules that are enabled.

Context-sensitive editor operations are available by right-clicking on an object or on the background of the workspace. About IT Guru Tool Buttons Several of the more commonly used menu bar selections can also be activated through tool buttons. The buttons shown in the following figure appear in the Project Editor: 3 4 5 6 7 8 9 10 About IT G The Workspace The central, scrollable region of the editor window is the workspace. The network model appears in the workspace, where you can select and drag network objects, and choose context-sensitive menu operations by right-clicking on the background.

The Message Area The message area is located at the bottom of the editor window. It provides information about the status of the tool. Message Area You can left-click on the icon next to the message area to open the message buffer window. The message buffer window shows a list of messages that have appeared in the message area. You can open the message buffer window if part of the message line is truncated in the message area or if you think a later message has replaced an important alert or notification. About IT Guru 17 CS601: Computer Networks labTooltips If you rest the cursor over a tool button or a network object in the workspace, a help balloon appears. The tooltip describes one of the following: • The action that occurs if the button is pressed • Information about the network object 18 CS601: Computer Networks lab EXERCISE – 5 OPNET- Small Internetworks. Objective : To plan for the expansion of a small company’s intranet ( i.

e to ensure that the load added by the second network will not cause the existing network to fail) by analyzing the packet dropped and load on the Server. In this exercise, you plan for the expansion of a small company’s intranet.Currently, the company has a star topology network on the first floor of its office building and plans to add an additional star topology network on another floor. You will build and test this “what-if” scenario to ensure that the load added by the second network will not cause the network to fail. 19 CS601: Computer Networks lab Getting Started When creating a new network model, you must first create a new project and scenario. A project is a group of related scenarios that each explore a different aspect of the network. Projects can contain multiple scenarios.After you create a new project, you use the Startup Wizard to set up a new scenario.

The options in the Wizard let you • Define the initial topology of the network • Define the scale and size of the network • Select a background map for the network. • Associate an object palette with the scenario Startup Wizard automatically appears each time you create a new project. The Startup Wizard allows you to define certain aspects of the network environment. To use the Startup Wizard to set up a new scenario, do the following: 1. If IT Guru is not already running, start it.

. Select File > New…. 3. Select Project from the pull-down menu and click OK.

4. Name the project and scenario, as follows: a. Name the project _Sm_Int Include your initials in the project name to distinguish it from other versions of this project. b. Name the scenario first_floor. c. Click OK.

The Startup Wizard opens. 5. Enter the values shown in the following table in the dialog boxes of the Startup Wizard: 20 CS601: Computer Networks lab A workspace of the size you specified is created.

The object palette you specified opens in a separate window.Creating the Network Network models are created in the Project Editor using nodes and links from the object palette. Node – A representation of a real-world network object that can transmit and receive information. Link – A communication medium that connects nodes to one another. Links can represent electrical or fiber optic cables.

These objects are found in the object palette, a dialog box that contains graphical representations of node and link models. Creating the Network 7 You can use any of three methods to create a network topology, or a combination of all three. One method is to import the topology. Another is o place individual nodes from the object palette into the workspace. The third method is to use Rapid Configuration.

Rapid Configuration creates a network in one action after you select a network configuration, the types of nodes within the network, and the types of links that connect the nodes. 21 CS601: Computer Networks lab Rapid Configuration creates a network in one action after you select a network configuration, the types of nodes within the network, and the types of links that connect the nodes. To create the first-floor network using Rapid Configuration: 1. Select Topology > Rapid Configuration. 2.Select Star from the drop-down menu of available configurations, then click OK..

.. Specify the node models and link models in the network.

Models follow this naming scheme: _… ___ where: • specifies the specific protocol(s) supported by the model • is an abbreviation of the general function of the model • indicates the level of derivation of the model For example: ethernet2_bridge_int specifies the intermediate (int) derivation of a 2-port Ethernet (ethernet2) bridge (bridge). Vendor models have an additional prefix that specifies the vendor and the vendor product number for that particular network object.For example, the 3Com switch used is named: 3C_SSII_1100_3300_4s_ae52_e48_ge3 This node is a stack of two 3Com SuperStack II 1100 and two Superstack II 3300 chassis (3C_SSII_1100_3300) with four slots (4s), 52 auto-sensing Ethernet ports (ae52), 48 Ethernet ports (e48), and 3 Gigabit Ethernet ports (ge3). To specify the nodes and links to use to build the network: 1.

Set the Center Node Model to 3C_SSII_1100_3300_4s_ae52_e48_ge3. This is a 3Com switch. 22 CS601: Computer Networks lab 2. Set the Periphery Node Model to Sm_Int_wkstn, and change the Number of periphery nodes to 30.This provides 30 Ethernet workstations as the peripheral nodes. 3. Set the Link Model to 10BaseT Specify where the new network will be placed: 1. Set the X center and Y center to 25.

2. Set the Radius to 20. 3. Click OK. ? The network is drawn in the Project Editor: 23 CS601: Computer Networks lab Now that the general network topology has been built, you need to add a server. You will use the second method of creating network objects: dragging them from the object palette into the workspace. 1. If it is not already open, open the object palette by clicking on the Object Palette action button.

2.Find the Sm_Int_server object in the palette and drag it into the workspace. By default, you can create additional instances of the same object by left-clicking after the initial “drag-and-drop” from the palette.

3. Because you do not need additional copies of this model, right-click to turn off node creation. You also need to connect the server to the star network. 1. Find the 10BaseT link object in the palette and click on it.

2. Click on the server object, then click on the switch object in the center of the star. ? A link is drawn, connecting the two objects.

3. Right-click to turn off link creation.Finally, you need to add configuration objects to specify the application traffic that will exist on the network. For this exercise there is: an application definition object with the default configurations of the standard applications, and ? a profile definition object with a profile that models light database access Creating the Network 14 You need only drag the objects into your network.

Doing so means that the traffic caused by workstations accessing a database at a low rate will be modeled. 1. Find the Sm_Application_Config object in the palette and drag it into the workspace 2. Right-click to turn off object creation. 3.Find the Sm_Profile_Config object in the palette, drag it into the workspace, and right- click. 4. Close the object palette.

The network is now built and should look similar to the following figure. 24 ? CS601: Computer Networks lab You are now ready to begin collecting statistics. Collecting Statistics Collecting Statistics You can collect statistics from individual nodes in your network (object statistics) or from the entire network (global statistics). You should get a snapshot of current performance for comparison. To get this baseline, you will collect one object statistic, Server Load, and one global statistic, Ethernet Delay.

Server load is a key statistic that reflects the performance of the entire network. To collect statistics related to the server’s load, do the following steps: 1. Right-click on the server node (node_31) and select Choose Individual Statistics from the server’s Object pop-up menu. ? The Choose Results dialog box for node_31 appears. The Choose Results dialog box hierarchically organizes the statistics you may collect. To collect the Ethernet load on the server: 2.

Click the plus sign next to Ethernet in the Choose Results dialog box to expand the Ethernet statistic hierarchy. 25 CS601: Computer Networks lab a. 3.Click the checkbox next to Load (bits/sec) to enable collection for that statistic. 4. Click OK to close the dialog box. 5. Collecting Statistics 19 Global statistics can be used to gather information about the network as a whole.

For example, you can find out the delay for the entire network by collecting the global Delay statistic: 1. Right-click in the workspace (but not on an object) and select Choose Individual Statistics from the Workspace pop-up menu. 26 CS601: Computer Networks lab 2. 3. 4. 5.

Expand the Global Statistics hierarchy. Expand the Ethernet hierarchy. 0 Click the checkbox next to Delay (sec) to enable data collection.

Click OK to close the Choose Results dialog box. To save the project: Choose File > Save, then click OK (the project already has a name, so you don’t need to rename it). Now that you have specified which statistics to collect and saved the project, you are almost ready to run your simulation. First, though, verify that your repositories preference is set. Repositories contain userdefined components such as process models and pipeline stages that are saved so that simulations will take less time to begin execution. 1. Choose Edit > Preferences. 2.

Type repositories in the Find field and click on the Find button. 3.If the value for repositories is not stdmod, click on the field and enter stdmod in the dialog box. 4. Click OK to close the repositories and Preferences dialog boxes 5. To run a simulation: 1. Select Simulation > Configure Discrete Event Simulation…. You can also open the Configure Discrete Event Simulation dialog box by clicking on the configure/run simulation action button.

2. Type 0. 5 in the Duration: field to simulate one-half hour of network activity. 27 CS601: Computer Networks lab 3. Click the Run button to begin the simulation.

4. While the simulation runs, a dialog box appears showing the simulation’s progress.The dialog box above shows that, in 5 seconds of elapsed (actual) time, IT Guru has simulated 15 minutes and 19 seconds of network time. The entire simulation should take less than one minute to complete—the elapsed time varies according to the speed of your computer.

When the simulation finishes, the contents of the Messages tab appears. Click the Close button in the Simulation Sequence dialog box. Elapsed Time: Number of seconds the simulation has run Simulated Time: Minutes of network time 5. If your simulation does not complete, if no results were collected, or if the results vary significantly from those shown.Viewing Results You can view results graphically in the Project Editor by selecting View Results from the Workspace pop-up menu. After your simulation has executed, you will want to see the information collected for each statistic. There are several ways to view results; in this lesson you will use the View Results option in the Workspace pop-up menu. 28 CS601: Computer Networks lab To view the server Ethernet load for the simulation: 1.

Right-click on the server node (node_31) choose View Results from the server’s Object pop-up menu. ? The node’s View Results dialog box opens. 2. Expand the Office network. ode_31 > Ethernet hierarchy.

3. Click on the checkbox next to Load (bits/sec) to indicate that you want to view that result. 4. Click the Show button in the View Results dialog box. ? The graph of the server load appears in the Project Editor, as shown in the following figure.

The graph of the server load should resemble the following graph. Note that at its peak, the load on the server is well below 6,000 bits/second. You will need this baseline for comparison after you add the second network. When you finish viewing the server load graph, close this dialog box and the View Results dialog box. If the system prompts you, choose to delete the graph panel. ) You also should look at the Global Ethernet Delay on the network. To view this statistic: 1. Right-click in the workspace, then select View Results from the pop-up menu.

29 CS601: Computer Networks lab 2. Check the box next to Global Statistics > Ethernet > Delay, then click the Show button to view the Ethernet delay for the whole network. The Ethernet delay graph appears in the Project Editor. The graph should resemble the following figure. 30 CS601: Computer Networks lab Note that after the network reaches steady state the maximum delay is around 0. 4 milliseconds.

When you are finished viewing the graph, close it and the View Results dialog box. Simulation time, in minutes Seconds Expanding the Network 29 Expanding the Network You have created a baseline network and gathered statistics about it. Now you are ready to expand the network and verify that it still operates sufficiently well with the additional load. When performing a “what-if” comparison, it is convenient to store the baseline network as one scenario and create the experimental network as a different scenario. You will duplicate the existing scenario and make changes to it instead of building the new topology from the beginning.To duplicate a scenario: 1. Choose Scenarios > Duplicate Scenario..

. 2. Enter expansion as the name for the new scenario. 3.

Click OK.? The scenario, with all the nodes, links, statistics, and the simulation configuration, is duplicated and named expansion. The second-floor segment will resemble the first-floor segment, but will not have a server of its own. To build the new segment: ? Select Topology > Rapid Configuration. ? Choose Star for the topology and click OK… ? Complete the Rapid Configuration dialog box with these values: ? Center Node Model: 3C_SSII_1100_3300_4s_ae52_e48_ge3 ?Periphery Node Model: Sm_Int_wkstn ? Number: 15 ? Link model: 10BaseT ? X: 75, Y: 62.

5, Radius: 20 31 CS601: Computer Networks lab 4. Click OK to create the network. Join the two networks: 1. If it is not already open, click the action button to open the object palette. 2. Drag the Cisco 2514 router icon into the workspace between the two networks. Right-click to turn off node creation. 3.

Click on the 10BaseT link icon in the object palette. 4. Create 10BaseT links between the Cisco router (node_50) and the 3Com switches at the center of each star. 5. Right-click to turn off link creation. . Close the object palette.

Select File > Save. The final network should look like this: 32 CS601: Computer Networks lab To run the expansion scenario: 1. Select Simulation > Configure Discrete Event Simulation….

2. Verify that the Duration is set to 0. 5 hours. 33 3. Click the Run button to begin the simulation.

As before, a window appears showing the simulation’s progress. When the Simulation Speed tab is selected, an animated graph shows both the current and average speed in events per second. 4.

When the simulation is done, close the Simulation Sequence dialog box.Comparing Results 34 Comparing Results To answer the questions posed about the addition of a second network to the existing LAN, you need to compare the results from both of the simulations you ran. You will use the Compare Results menu item in the Object and Workspace pop-up menus to combine statistics from different scenarios in the same graph. To look at the server load from both scenarios at once: 1. Right-click on the server node (node_31) to bring up its Object pop-up menu. 2.

Choose Compare Results (you can do this from either scenario in the project). 33 CS601: Computer Networks labA View Results dialog box appears containing a hierarchical representation of statistics collected for the server node. When comparing results, choosing a statistic in one scenario produces a graph showing the value of that statistic in all scenarios. To view the results: Select the Office Network.

node_31 > Ethernet > Load (bits/sec) statistic and click the Show button. Your results should resemble those in the following figure (but may not be identical): The following graph is the time average of the Ethernet load between the baseline (first_floor) scenario and the expansion scenario. . 34 CS601: Computer Networks labNote that while the average load for the expansion scenario is higher (as expected), the load as a whole appears to be leveling off (that is, not monotonically increasing), indicating a stable network. Comparing Results The last step is to see how much the network’s delay is affected by adding a second floor. To compare Ethernet delay for the two scenarios: 1.

Close the graph and the Compare Results dialog box for the server. 2. Right-click in the workspace, then select Compare Results from the Workspace pop-up menu. 3. Select the Global Statistics > Ethernet > Delay (sec) statistic. 4. Click Show to display the graph.

The graph of the Global Ethernet Delay appears. Your graph of Ethernet Delay should resemble the following: 35 CS601: Computer Networks lab This graph shows that there is no significant change in Ethernet delay on the network. Although server load has increased, delay has not.

5. Select File > Close and save changes before closing. 36 CS601: Computer Networks lab EXERCISE – 6 OPNET- Simulate three nodes point-to-point networks with duplex links between them. Set the queue size and vary the bandwidth and find the number of packets dropped. Objective: To Simulate a 3 node point to point network with duplex links between them.Set the Queue size and vary the bandwidth and find the number of packets dropped.

Solution: Step 1: Create a New Project Step 2: Create the Network ? Select Object Palette box. ? Select Client_server from drop down menu. ? ? ? ? ? Choose eth4_slip4_multihomed_client objects (3 numbers). Choose Application Config, and Profile Config objects. Select ethernet from Object Palette. Choose 10baseT link and connect the client nodes. (as shown in Fig 2.

) Close the Object Palette box. 37 CS601: Computer Networks lab Fig 2. Point-to-Point Network Step 3: Configure the Network Application ? Select Application config object. Right click and select Edit Attributes. 38 CS601: Computer Networks lab ? ? ? Select Application Definitions => set row = 1. In row go to row0 => set Name = video.

Select description => set Video Conferencing = High Resolution Video. Click Ok. Step 4: Configure the Profile ? Select Profile config object.

? Right click and select Edit Attributes. ? Select Profile Configuration. Set row = 1.

? In row0, set Profile Name = video profile. Select Applications. Set row=1. Go to row0 set Name = video, Start Time Offset to constant(1), in Repeatability, Inter Repetition Time to exponential(0.

) and Number of Repetition to unlimited and Repitation Pattern to concurrent. ? In Repeatability, Inter Repetition Time to constant (1) and Number of Repetition to exponential (0. 1) and Repitation Pattern to concurrent.

? Click Ok. For any ambiguity in the above steps, please refer to the diagram below. 39 CS601: Computer Networks lab Step 5: Configure Network Objects ? Select any eth4_slip4_multihomed_client. ? Right click and Select Similar Nodes. ? Right click and select Edit Attributes. ? Select Application Support Profiles => set rows to 1. ? In rows => go to row0 => set Profile Name = video profile.

Select Application Support Services. Select edit => set rows =1. Set Name = video for that row. ? Select IP Processing Information => set Memory Size to 8MB => set Datagram Forwarding Rate to 5000. 40 CS601: Computer Networks lab ? ? Check Apply Changes to Selected Objects. Click Ok. Step 6: Selecting Statistics for viewing results ? Right click on the work space and select choose individual statistics => in Global Statistics go to IP, select traffic dropped. ? In Node Statistics => select IP =>Traffic Dropped (Packets/Sec), Traffic Received (Packets/Sec) and Traffic Sent (Packets/Sec).

? Click Ok.Step 7: Run the simulation ? Click run simulation icon from the toolbar. ? Set the Duration to 10 seconds. ? Click Run. Step 8: View Results ? Right click on the work space and select View Results.

x

Hi!
I'm Jessica!

Don't know how to start your paper? Worry no more! Get professional writing assistance from me.