Home
Experiment Manual
Contents
1. Interface Source Code Help Concept Algorithm Pseudo Code amp Flow Chart Save the Interface source code in another txt 9 hm Pseudo code E Flow Ch file LinkState Notepad 5 File Edit Format View Help include lt stdlib h gt include lt stdio h gt gt M gt ThisPC include lt conio h gt Organize v include lt string h gt ie Downloads a Folders 6 define _NETSIMDLL 2 Recent places Desktop define _MEM_BUFFER1 100 a Homegroup define _MEM_BUFFER2 500 define _MEM_BUFFER3 1000 k Desktop Documents int iBackup 15 temporary variable to hold the curre IF Documents T Downloads Downloads char bTraversed 15 15 flag to make a check mark a B Music to store the distances between each node In this a Pictures Music ramVVRam out signed int costMatrix 15 15 B Videos int iRow iCol 0 to hold the current row and q Local Disk C ca Local Disk D y Global variable CN inkState int distance 100 Array to store the distance from Save as type Text Documents txt int path 100 Array for storing the Path from sour ae Encoding ANSI m ar int include 100 Flag array for storing whether a f int source To store the source node int destination to store the destination node char iFlag Iteration Flag Step 2 Create Input txt file Create a new text fil
2. 5 oF Ka ON 5 O Ka H N UAUA O O m O O 40 60 Data Rate NOTE The procedure to create graph is same as provided in Experiment 2 12 Inference The number of packets transmitted to the destination is based on the network link s speed So when link is forwarding more packets the number of packets transmitted to the destination is more Because of this throughput linearly increases when data rate link speed increases in Graph I 70 Experiment 7 To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and determine collision across different nodes Theory Carrier Sense Multiple Access Collision Detection CSMA CD This protocol includes the improvements for stations to abort their transmissions as soon as they detect a collision Quickly terminating damaged frames saves time and bandwidth This protocol is widely used on LANs in the MAC sub layer If two or more stations decide to transmit simultaneously there will be a collision Collisions can be detected by looking at the power or pulse width of the received signal and comparing it to the transmitted signal After a station detects a collision it aborts its transmission waits a random period of time and then tries again assuming that no other station has started transmitting in the meantime Procedure In NetSim Select Simulation gt New gt Legacy Networks gt Traditional Ethernet 1 Create Design the N
3. 9 g Delete v Paste Styles Sot amp Find amp a 0 0 z He Format Q gt Filter Select Clipboa 3 Click on dropdown button jumper Cells Editing PRY Pl B E D E G H l Source 7 contention_Window Time Micro Sec Ee Sort Smallest to Largest 1035 2 Sort Largest to Smallest 1035 2 Sort by Color gt 1035 2 l 1035 2 Clear Filter From Source ID a i 1035 2 ilter by E or 1070 4 Number Filters gt 1070 4 1070 4 Time vs Contention Window Size Graph Note This graph is plotted for all rows of ContentionWindow txt file after filtering X Axis is Contention_Window column and Y Axis is Time Micro Sec column Contention Window Size Byte Time Vs Contention Window Size X X L o O ee kbA a go 4 l a bee e gg fe gt amp gt SS Se ee ee ee a 4 4B ED T D A ee ee TEP 0 0O 4D EED CTE 2000000 4000000 6000000 8000000 10000000 12000000 Time Micro Secs NOTE The procedure to create graph is same as provided in Experiment 2 78 Graph II Note This graph is plotted for the first 200 rows of ContentionWindow txt file X Axis is Contention_Window column and Y Axis is Time Micro Sec column Time vs Contention Window Size Graph Time Vs Contention Window Size T gt co e3 N N z O O Cc Y Cc w w Cc O O 1000000 1500000 2000000 Time Micro Secs NOTE The procedure to create graph is same as provided in Exper
4. p NETWORK_LAYER ve APPLICATION _LAYER Network Protocol IPV4 oO to Wired Node G l TRANSPORT_LAYER NETWORK LAYER IP_Address A RG J Sm interface1 Ethernet Subnet_Mask gt Interface Ethemet 2 Set Buffer Size 8 Interface3_Ethernet Default_Gateway Buffer size MB 8 oO Scheduling type i 11 Simulate Simulation Time 100 Sec 3 Set Scheduling Type Priority After completion of the experiment Save the experiment for future analysis of results 12 Configure the Network Sample 5 W Follow all the steps as shown in Sample and modify only the Router properties and Wired Link properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to FIFO za ROUTER Properties Router 1 GLOBAL_PROPERTIES APPLICATION_LAYER TRANSPORT_LAYER NETWORK_LAYER om interface 1 Ethernet gt Interface2_Ethernet gt Interface Ethernet 1 Check which Interface is connected to Wired Node G Interface 1_Ethernet NETWORK_LAYER Network Protocol IPV4 IP_Address TELLI Subnet_Mask 255 255 0 0 Default_Gateway Buffer size MB Scheduling type 3 Set Scheduling Type FIFO 50 Wired Link Properties Right click on Wired Link gt Properties and set the values
5. Link Properties Wired Link 1 2 amp 3 Uplink Speed Mbps 0 064 Downlink Speed Mbps 0 064 13 Model Traffic in the Network Sample 5 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties Application Properties Source ID 4 Wired Node 3 Wired Node 2 Wired Node 2 Wired Node D C B B Destination ID 7 Wired Node 7 Wired Node 7 Wired Node 7 Wired Node a S S a S anses iP ET CK of Inter Packet Inter 10000 10000 10000 100000 Arrival Time ps 14 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 15 Configure the Network Sample 6 Follow all the steps as shown in Sample 5 and modify only the Router properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to Priority 16 Simulate wa ROUTER Properties Ji Router 1 GLOBAL_PROPERTIES APPLICATION_LAYER TRANSPORT_LAYER NETWORK_LAYER om interface 1 Ethernet gt Interface2_Ethernet gt Interface3_Ethernet L Check which Interface is connected to Wired Node G Interface1_Ethernet rNETWORK_LAYER Network Protocol IP_Address Subnet_Mask Default_Gateway Buffer size MB Schedulin
6. Undelayed 1 Select Transport Layer 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties appi Properties Remove Change Icon 3 Right Click on Application gt 2 Click anywhere above grid and select Properties 200 250 300 350 Application Properties 4 Wireless Node D Destination ID A Node G Value Bytes 1460 Value us 2336 4 Simulate Sample 1 Simulation Time 10 Sec D 1 click on Run Simulata ai After completion of the experiment Save We Trace Metrics the experiment for future analysis of iL results 82 5 Configure the Network Sample 2 Follow all the steps as shown in Sample and modify only the Wired Node properties and Application properties as shown below OR User can also select the Go back to Network option select the Edit button and modify only the Wired Node properties and Application properties as shown below nN D M ter 1 TTE Sjaan Programming Utilities Help Wired Node Properties Disable TCP in Wireless Node D and Wireless Node E All the remaining properties of the remaining devices and links are same 6 Model Traffic in the Network Sample 2 Application Properties 4 Wireless Node D 5 Wireless Node
7. Users who do not have a licensed version of NetSim in their PC s can practice as explained below First run the exercise in sample mode The user would see that an Input txt file is created in Win OS temp folder this can be reached by typing temp NetSim in Windows run window This input file should be read by the user code and it should generate an Output txt This Output txt file is read by NetSim and shown graphically to the user User can follow the steps provided in Appendix Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code The Output txt file will vary based on the Data_file In this case the size of Data_File file is 11 264 bytes Input txt file contents Output_Capacity 100 Buffer_Size 100 Input_Capacity 100 200 120 400 100 600 100 100 100 100 Output txt file contents 100 gt 100 gt 100 gt 100 gt 100 gt 100 gt 100 gt 100 gt 100 gt 100 gt 100 gt 0 gt 0 gt 20 gt 300 gt 0 gt 500 gt 0 gt 0 gt 0 gt 0 gt 0 gt 11 gt 130 Appendix 1 Programming exercise How to practice without NetSim Shortest Path Step 1 Copy Interface Source Code ode P E Click on Interface Source Code and save the code in a text file ma For Example meted As an example Shortest Path programming o5 j exercise is being considered Open the programming exercise and select
8. 7 Wired Node G 5 Wired Node E 7 Wired Node G 4 Wired Node D 7 Wired Node G 3 Wired Node C 7 Wired Node G 2 Wired Node B 7 Wired Node G 2 Wired Node B 7 Wired Node G Ce eson Gison Casom Gom en Packet Size Size Pack ari ve 7 Packet Inter Arrival Time ps IVa 10000 10000 10000 10000 10000 100000 24 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 55 25 Configure the Network Sample 10 Follow all the steps as shown in Sample 9 and modify only the Router properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to Priority wa ROUTER Properties Ji Router 1 Interface1_Ethernet x GLOBAL_PROPERTIES NETWORK_LAYER f APPLICATION_LAYER Network Protocol IPV4 Oo TRANSPORT_LAYER eS NETWORK LAYER IP_Address 11 1 1 1 Oo gt e terface 1 Ethernet Subnet_Mask 255 255 0 0 A gt Interface2_Ethernet gt Interface3_Ethernet Default_Gateway 2 Set Buffer Size 8 1 Check which EEE 2 7 ll Schedulin FIFO F Interface is connected PE to Wired Node G 3 Set Scheduling Type Priority 26 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for futur
9. Debug ae melee C Includes Bera las ttc C Dev Cpp include C Dev Cpp ib gec mingw3243 4 2 include In the programs tab edit the following paths as shown in screenshot 136 Compiler Settings Directories You may want to change the programs filenames that are used in Dev C for example when using 4 cross compiler gec accese make makeere gdb dbese windres windres ese dilwrap dlwrap ese mj gprof profere a s Default Compiler Settings Directories You may want to change the programs filenames that are used in Dev C for example when using a cross compiler EXDevCpptbrigccee SSCS windres C Dev Cpp bin windes exe 0 o dilwrap C Dev Cpp bin dlwrapexe 00 aprof C Dev Cpp bin gprofexe 0 lt Default 137
10. Experiment 19 Experiment 2 Simulate a three nodes point to point network with duplex links between them Set the queue size and vary the bandwidth and find the number of packets dropped Theory Router forwards packets from one network to another network When arrival rate of packets is greater than the service departure rate packets get buffered queued Once the buffer queue is completely filled all arriving packets will be dropped Procedure In NetSim Select Simulation gt New gt Internetworks 1 Create Design the Network Devices Required Router 3 Wired Nodes Network Diagram Note While creating network first place the Router Then place Wired Node B C and D as shown here Connect Wired Node B with Router first Then connect Wired Node C and Wired Node D with Router Wired Node B Wired Node D 20 2 Configure the Network Sample 1 Wired Node Properties Disable TCP in Wired Node B Right Click Wired Node B Properties 4 WIREDNODE Properties a db Wired Node 2 TRANSPORT _LAYER GLOBAL_PROPERTIES TCP 2 Deselect s APETCATIG s Protocol are RANSPORT_LAYER B Checkbox a E MSS bytes 10 Interfacel_Ethernet Congestion_Control_Algo OLD_TAHOE X Window_Size MSS 8 1 Select Transport Layer Acknowledgement_Type Undelayed cco UDP Protocol UDP Segment Size bytes 1472 Router Properties Right click on Router
11. Wireless Sensor Networks Personal Area Networks LTE Networks and Cognitive Radio Networks Users can open save and delete experiments as desired The different experiments can also be analyzed using the analytics option in the simulation menu Programming NetSim covers various programming exercises along with concepts algorithms pseudo code and flowcharts Users can also write their own source codes in C C and can link them to NetSim Some of the programming concepts are Address resolution protocol ARP Classless inter domain routing CIDR Cryptography Distance vector routing shortest path Subnetting etc Utilities This section handles the user management section used for adding deleting users setting passwords etc Basics Consists of Animated explanations of networking principles protocol working and packet formats Help Consists of NetSim User Manual which displays all the Help related to NetSim Opens the Simulation menu consisting of New Open and Delete User can simulate Internetworks Legacy Cellular BGP Advanced Wireless Networks Wireless Sensor Networks Cognitive Radio Networks and LTE Networks Opens the Programming menu where different network programming lab exercises are available Menu to create users set passwords and sample exam mode Switching of users can be done through the login as option a Simulation Programming Basics Utilities Help Consists of Animated
12. follow the steps 1 Copy the data in an Excel sheet 2 Select the data Go to Insert gt Scatter under Charts gt Scatter with Straight Lines and Markers Graph I Link Speed of Wired Link 2 16 Inference The number of packets dropped decreases as the link speed of wired link increases Hence from the Graph I it can be inferred that as the link speed of second link decreases packets arrival rate is higher than the rate at which packets are forwarded by the Router via link 2 As a result queue size increases quickly and the buffer gets filled Hence the newly arrive packets at the queue will be dropped 27 Experiment 3 Simulate a three node point to point network with the links connected as follows n0 gt n2 n1 gt n2 and n2 gt n3 Apply TCP agent between n0 n3 and UDP between n1 n3 Apply relevant applications over TCP and UDP agents changing the parameter and determine the number of packets sent by TCP UDP n0 n1 and n3 are nodes and n2 Is router Theory TCP TCP recovers data that is damaged lost duplicated or delivered out of order by the internet communication system This is achieved by assigning a sequence number to each octet transmitted and requiring a positive acknowledgment ACK from the receiving TCP If the ACK is not received within a timeout interval the data is retransmitted At the receiver side sequence number is used to eliminate the duplicates as well as to order the segments
13. gt Properties Set buffer size to 8 MB Accept default values for remaining parameters ya ROUTER Properties p Router 1 Interface 1_Ethernet GLOBAL_PROPERTIES NETWORK_LAYER APPLICATION_LAYER Network Protocol IPV4 1 Go to each Interface ou TRANSPORT_LAYER l i NETWORK_LAYER IP_Address 11 1 1 1 i l a interface 1 Ethernet E gt Interface2_Ethernet d p Interface3_Ethernet Default_Gateway oO 0 Subnet_Mask 255 255 0 0 0 2 Set Buffer Size 8 Buffer size MB 8 Scheduling type FIFO Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties Wired Link 1 d Link 2 0 Uplink Speed Mbps Downlink Speed Mbps 21 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties ha Remove te Change Icon 3 Right Click on Application 2 Click anywhere above grid and select Properties Application 250 300 200 350 Application Properties Modify the Application properties as specified in the left table Application Type Custom Ya APPLICATION Properties TN 4 Application l Application 1 Source ID 2 Wired Node B Appication1 Application Type Destination ID 3 Wired Node C d Sy Application ID Source_Count Source
14. lt Path where Input txt is saved gt For Example In this example the exe file LinkState exe and Input txt is present at D New So in command prompt go to the folder where exe file is saved 133 D gt cd New Do ANew gt LinkState exe Y dis New D ANew gt NOTE For Chat programming exercise Experiment 6 type For Sender lt EXEName gt lt blank gt lt Path where Input txt is saved gt send For Receiver lt EXE Name gt lt blank gt lt Path where Input txt is saved gt receive Step 5 Check the output txt file After running in the command prompt Output txt file will be created at the same location where Input txt file 1s saved User can compare and check the content of Output txt file with the NetSim user manual For Example Here according to this example the Output txt file will be created at D New folder User can open the file and compare the content with NetSim user manual Output txt content View ais PC Local Disk Ds New wo Name Date modified Type Size LJ Input 5 6 2015 12 49PM Text Document 1 KB E LinkState 7 4 2014 3 18 AM Application 36 20153 3 04 Ph 134 Appendix 2 Creating exe file using Dev C 1 Open the C source code file in Dev C Then go to Execute gt Compile File Edit Search View Project CEDR Debug Tools CVS Window Help COTE EE ay Taa Run Ctrl F10 Parameters a a
15. Bytes Transmitted Transmitted Tenei v x Metrics txt 10000 00 33667 ss 16413 4363 1716 00 17965300 00 25666416 00 v X Metrics xt 10000 00 28365 63 14190 36585122 00 14519700 00 22065422 00 v x Metrics txt 10000 00 24176 st 11399 30608766 00 12821720 00 17787046 00 gt For Other Networks select the Experiment based on the tab selected When one of the tabs is selected all the experiments saved under the particular Network will be listed Click on the Experiment Name to add it onto the Metrics Table 17 Saving an Experiment For all Networks except Legacy Networks Step 1 After simulation of the network on the top left corner Performance Metrics Link Metrics a Queue Metrics TCP Metrics of Performance metrics screen click on the Save Network and Metric 4 IP Metrics Dibia i UE IP Forwarding Tabi imulation Time ms Metric as button G8 jb IP Forwarding Table rv ARP Metrics er PT i 4 Application Metrics Step 2 Specify the Experiment Name and Save Path and click on OK Experiment Name Exp 1 Save path D Exp 1 For Legacy Networks Step 1 After simulation of the network on the top left corner of Performance metrics screen Performance Metrics Link Metrics ben Queue Metrics c i TCP Metrics a IP Metrics Ge IP Forwarding Table click on the Save Network and Metric Metric as button Simulation Time ms St
16. Code Write a program for Hamming code generation for error detection and correction Theory Hamming code is for Single Bit Error Detection and Correction It is based on Parity Even Odd Parity It allows any single bit error to be detected and corrected It involves adding one or four check bits depending on the formula to the data for error detection as well as error correction These bits are called Check Bits In order to find the number of check bits introduced in the message bits there is a general formula For a message of size m bits and r check bits then the condition m r 1 lt 2 should be valid Example Consider the message size m of 4 bits and we will find out the number of check bits according to the formula When r 3 we have 4 3 1 8 and 2 is 8 and so the number of Check Bits to be introduced 1s 3 Algorithm Read the contents of the input file 1 e the input data type of parity and the error data from the Input txt and store it in variables like the above method 1 Get the length of the input data and calculate the number of Check Bits to be introduced according to the condition m r 1 lt 2 Where m is length of the original data and r is the number of check bits to be introduced 1n the string 2 Ifthe passed flag type of parity is 2 then it is Even parity else it is Odd parity 120 3 Place the Check Bits at the appropriate position according to t
17. E Destination ID 7 Wireless Node G 8 Wireless Node H Distribution Constant Distribution Constant Constant 7 Simulate Sample 2 Simulation Time 10 Sec Value Bytes 1460 1460 Value us 2336 2336 After completion of the simulation Save the experiment for future analysis of results 83 8 Configure the Network Sample 3 Follow all the steps as shown in Sample and modify only the Wired Node properties and Application properties as shown below Wired Node Properties Disable TCP in Wireless Node D Wireless Node E and Wireless Node F All the remaining properties of the remaining devices and links are same 9 Model Traffic in the Network Sample 3 Application Properties 4 Wireless Node D 5 Wireless Node E 6 Wireless Node F Destination ID 7 Wireless Node G 8 Wireless Node H 9 Wireless Node I Packet Size Value Bytes 1460 1460 1460 Value us 2336 2336 2336 10 Simulate Sample 3 Simulation Time 10 Sec After completion of the simulation Save the experiment for future analysis of results 11 Configure the Network Sample 4 Follow all the steps as shown in Sample 1 and modify only the Wired Node properties and Application properties as shown below Wired Node Properties Disable TCP in Wireless Node D Wireless Node E Wireless Node F and Wireless Node G 84 All the remaining properties of the remaining devices and links are same 12 Mo
18. Env View Zoom After completion of the experiment Save the Metrics sin 1 Click on Run Simulation experiment for future analysis of results Steps to save an experiment Step 1 After simulation of the network on the top left corner of Performance metrics screen click on the Save Network and Metric as button Step 2 Specify the Experiment Name and Save Path and click on OK Save path D Exp 1 38 5 Model Traffic in the Network Sample 2 Follow all the steps as shown in Sample and modify only the Application properties as shown below OR User can also select the Go back to Network option select the Edit button and modify only the Application properties as shown below Application Properties Application Type Custom for TELNET 4 Wired Node D Wired Node A Destination ID a awe Node E havaianas S Node F Packet Inter Arrival Time ket Inter Arr NOTE The procedure to create multiple applications are as follows Step 1 Click on the ADD button present in the bottom left corner to add a new application a Tr cee Application 1 Application_Type Application ID Source_Count Source_ID Destination_Count Destination_ID Start_Time s End_Time s Src_to_Dest eoooossss PACKET_SIZE Distribution Value Bytes INTER_ARRIVAL_TIME Distribution Value mi
19. MSS 8 J Acknowledgement_Type Undelayed fi UDP Protocol 7 UDP fF Segment_Size bytes 1472 oO 29 d Wired Node 3 GLOBAL_PROPERTIES a ADD AYER TRANSPORT_LAYER TCP Protocol W TCP Oo MSS bytes 1460 fi Congestion_Control_Algo OLD_TAHOE Window_Size mss 8 Acknowledgement_Type Undelayed UDP Protocol Segment_Size bytes 1472 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties opie Properties R 350 400 emove KI 3 Right Click on Application button and select Properties 2 Click anywhere above grid NOTE The procedure to create multiple applications are as follows Step 1 Click on the ADD button present in the bottom left corner to add a new application uao a O O B Application r Application 1 T L Application 1 Application Type CUSTOM a Application ID Source_Count Source_ID Destination_Count Destination_ID Start_Time s End_Time s eeooeeoeoe Src_to_Dest rPACKET_SIZE Distribution Value Bytes INTER_ARRIVAL_TIME Distribution CONSTANT Value micro sec 10000 Application Properties Create two 2 Application and set the values as shown below Source ID 2 Wired Node B Destination ID 4 Wired Node D
20. Router 4 ation 0 ADD Wired Node E n6 VOICE Wired Node G _ Wired Node F 2 Configure the Network Sample 1 Wired Node Properties Disable TCP in Wired Node B 45 Right Click Wired Node B Properties 4 WIREDNODE Properties lt a _ Wired Node 2 TRANSPORT_LAYER GLOBAL_PROPERTIES p TCP 2 Deselect TCP os ARETOA TITON Emine Protocol TRANSPORT_LAYER DP Checkbox witiceae Kiana MSS bytes 1400 Interface1_Ethernet Congestion_Control_Algo OLD_TAHOE X Window _Size MSS 8 1 Select Transport Layer Acknowledgement_Type Undelayed 0 10 d UDP Protocol UDP Segment_Size bytes 1472 Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to FIFO 7 eaS Ya ROUTER Properties db Router 1 rInterface6_Ethernet GLOBAL_PROPERTIES NETWORK_LAYER j APPLICATION_LAYER Network Protocol IPV4 TRANSPORT_LAYER i NETWORK LAYER IP_Address 11 6 1 1 Interface 1_Ethernet i Interface2_Ethernet b Interface3_Ethernet Default_Gateway i i Interface4 Ethernet Subnet_Mask 255 255 0 0 Interfaces Ethernet Buffer size MB 8 H O UGLE S Scheduling type FIFO Protocol ARP 1 Check which Interface pap retry interval 10 is connected to Wired F 3 Node G Protocol ETHERNET 0 MAC_Address C2FF
21. The user would see that an Input txt file is created in Win OS temp folder this can be reached by typing temp NetSim in Windows run window This input file should be read by the user code and it should generate an Output txt This Output txt file 1s read by NetSim and shown graphically to the user User can follow the steps provided in Appendix Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code The Output txt file will vary based on the Data_file In this case the Data File file contains the text a 95 Input txt file contents Algorithm CRC_12 Condition No_ Error File_Path C Users TETCOS Desktop New Text Document txt gt Note Create any file of size lt 5000 Byte Type the location of the file in Data_File Output txt file contents BCF 000 Note Output txt content will vary depending on the file contents 96 Experiment 11 Sorting Bubble Sort Write a program for frame sorting technique used in buffers Theory Sorting is the ordering of data in either an increasing or decreasing order One of the fundamental challenges of computer science is ordering a list of items Sorting algorithms are designed with the following objectives 1 Minimize exchange or wholesale movement of data 2 Move data from secondary storage to main memory in large blocks This is done becaus
22. and Receiver must agree upon the Generator Polynomial in advance Both the high and low order of the generator must be 1 The size of data must be greater than the size of the Generator polynomial to compute the checksum The computed checksum is appended to the transmitting frame If the receiver gets the frame it tries dividing it by Generator polynomial if there is a reminder there has been a transmission error else no error The Generator polynomial for CRC CCITT is given below a x The Binary equivalent of CRC CCITT is 10001000000100001 Algorithm No Error Case Sender side e Get the input from Input txt Parse the file content 88 e Call the In built function readFile szfilename It returns the stored value to the local variable szere e Convert the data string szcrc that has to be transmitted into a binary representation Get ASCII value of the first character Divide the ASCII value by 2 and append the remainder to a string The quotient is taken as the next number for the division 3 Repeat the above division until the quotient of the number is less than 2 Finally a remainder string having s and 0 s is obtained This reminder is the binary representation of that character Continue the above process for all the characters in the data string szcrc e Append 16 0 s to the final binary string formed by the above step e Divide the binary converted data string using the
23. on the F1 Help for details on how to proceed with your own code The scenario will be obtained as shown below Follow the steps KZ NetSim Programming Help E KA Cryptography Rivest Shamir Adleman RSA Algorithm Mode o 5 109 i ns Select Mode Input Plain Text One character 1 5 lt 020 Give Character Click Run to execute Concept Algorithm Pseudo Code amp Flt Steere maull Ilall Click here to view Interface Source Cod Concept Al gorithm and Pseudo Code amp Flowchart Click here to Interface Source 117 Results FZ NetSim Programming s Utilities Help Cryptography Rivest Shamir Adleman RSA Algorithm Input alue of P Plain Text kaa One character only Yalue of Q alue of N p q alue of Z p 1 q 1 alue of Kp alue of Ks Plain Text Cipher Text Concept Algorithm Pseudo Code amp Flow Chart 7 Interface Source Code User Mode In User Mode the user needs to edit the Interface Source Code at the following location void fnRSAQ Write your own code here So the user needs to add the user code create exe and attach it with NetSim to run The User code which is to be added is given below void fnRSACQ User code part start Write you own code for Rivest Shamir Adelman Algorithm HERE nRsaQ 3 118 nRsaP 11 nNVal nRsaQ nRsaP nZVa nRsaQ 1 CnR
24. side The output is stored in the variable szReceive array of characters with size 10 Error Case Sender side e Get the input from Input txt Parse the file content e Call the In built function readFile szfilename It returns the stored value to the local variable szcrc e Convert the data string szcrc to be transmitted into binary representation 1 Get ASCII value of the first character 2 Divide the ASCII value by 2 and append the remainder to a string The quotient is taken as the next number for the division 3 Repeat the above division until the quotient of the number is less than 2 4 Finally we get the remainder string having 1 s and 0 s which is the binary representation of that character 5 Continue above process for all the characters in the data string szcrc e Append 16 0 s to the final binary string formed by the above step e Divide the binary converted data string using the Generator Polynomial as given above in Concept 1 Take the MSB 17 bits from the binary data string 90 2 If the leading bit of the binary data string is 0 do an XOR operation with the 17 bits of 0 s and get the remainder which is also 17 bits 3 Else if the leading bit of the binary data string is 1 do an XOR operation with the 17 bits with binary converted CRC CCITT polynomial and get the remainder which is also 17 bits 4 The first bit of the remainder is left out and t
25. txt file is read by NetSim and shown graphically to the user User can follow the steps provided in Appendix 1 Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code Input txt file contents Parity Odd Data ABC Error_Position 1 Data_Bits_Original 01000001010000100100001 1 Data_Bits_Error 0 10000010 100001001000010 Output txt file contents 5 3 gt 5 gt 7 gt 9 gt 11 gt 13 gt 15 gt 17 gt 19 gt 21 gt 23 gt 25 gt 27 gt 29 gt 1 gt 1 gt 3 gt 6 gt 7 gt 10 gt 11 gt 14 gt 15 gt 18 gt 19 gt 22 gt 23 gt 26 gt 27 gt 30 gt 1 gt 1 gt 5 gt 6 gt 7 gt 12 gt 13 gt 14 gt 15 gt 20 gt 21 gt 22 gt 23 gt 28 gt 29 gt 30 gt 1 gt 1 gt 9 gt 10 gt 11 gt 12 gt 13 gt 14 gt 15 gt 24 gt 25 gt 26 gt 27 gt 28 gt 29 gt 30 gt 1 gt 1 gt 17 gt 18 gt 19 gt 20 gt 21 gt 22 gt 23 gt 24 gt 25 gt 26 gt 27 gt 28 gt 29 gt 30 gt 1 gt 1 gt 3 gt 5 gt 7 gt 9 gt 11 gt 13 gt 15 gt 17 gt 19 gt 21 gt 23 gt 25 gt 27 gt 29 gt 0 gt 0 gt 3 gt 6 gt 7 gt 10 gt 11 gt 14 gt 15 gt 18 gt 19 gt 22 gt 23 gt 26 gt 27 gt 30 gt 1 gt 1 gt 5 gt 6 gt 7 gt 12 gt 13 gt 14 gt 15 gt 20 gt 2 1 gt 22 gt 23 gt 28 gt 29 gt 30 gt 0 gt 0 gt 9 gt 10 gt 11 gt 12 gt 13 gt 14 gt 15 gt 24 gt 25 gt 26 gt 27 gt 28 gt 29 gt 30 gt 1 gt 1 gt 17 gt 18 gt 19 gt 20 gt 21 gt 22 gt 23 gt 24 gt 25 gt 26 gt 27 gt 28 gt 29 gt 30 gt 1 gt 1 gt 1 gt 4 gt 5 gt 124 Experiment 16 Leaky Bucket Algorithm W
26. with v Burn New folder ef Jr Favorites Name R Type Size Da BE Desktop __ BrowsePath TXT File 1KB 7 6 Bb Downloads E Recent Places EY Configiog TXT File 19 KB ConfigOutput TXT File 4KB 7 1 ow Libraries L Configuration TXT File 1KB 7 1 L Documents q Configuration XML Document 12KB 7 S a Music E Contentionwindow TXT File 116KB 7 1 Pictures GUILog TXT File OKB 7 1 E Videos _ info tmp TMP File 1KB 6 1 IpAddress TXT File 1KB 7 1 e Homegroup LicenseErrorLog TXT File 7KB 7A Comparison Table If collision occurs the entry will be added in the table by incrementing _Count field value by 1 So the last entry of the particular Source_ID Total Collision Count Home Insert Page Layout Formulas Data Review View Team EES Calibri 1 Z General v A a Insety E AA EZEZ 3 e 3 Delete gy Pare pii A iE iE lt 0 00 mes ee x E lt DY A BEJ Format 2 Clipboard Cells Sort Smallest to Largest Sort the selection so that lowest values are at the tc Source_ID JCollision_Count Time Micro Sec 1 1035 2 1035 2 2 Sort amp Filter gt Sort 1035 2 1035 2 1035 2 1070 4 Smallest to Largest NFP Fe ee Sort Warning Microsoft Excel found data next to ul meted the date Rullnotbese 3 Select Expand What do you want to do the Selection Continue with the curr
27. 1 111 ARP 3 Protocol MAC_Address 2399EB3BE404 Seo CCCo Connected To Protocol Link_Type Ethernet_Standard Connection_Medium ETHERNET i WIRED IEEE802 3u WIRED Step 2 Configure Link Right click on any Link and select Properties User can set values according requirement In above scenario default values already present in the properties are accepted to Wired Link 4 Properties Link Medium Link Mode Max Uplink Speed Mbps Max Downlink Speed Mbps Uplink BER Downlink BER Uplink Propagation Delay microsec Downlink Propagation Delay microsec Modify User can set values according to requirement Modify the properties of any device and click on Accept In above scenario default values already present in the properties are accepted 3 Modify Properties Remove Graphics 3 Modify Properties eecoeococe 11 3 Model Traffic in the Network After the network is configured user needs to model traffic from Wired Node B to Wired Node E Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties i Properties Remove Change Icon E PA 00 and select Properties 3 Right Click on Application In above scenario set Source_Id as 2 Wired Node B
28. 1460 10000 4 Simulate Simulation Time 100 Sec 1 Click on Run Simulation After completion of the experiment Save the experiment for future analysis of results Steps to save an experiment Simulation Syogramming Utilities Help Step 1 After simulation of the network on the top left corner of Performance metrics screen 6 Queue Metric i J TCP Metrics ait click on the Save Network and oe hate Aaah L ARP Metrics Metric as button J See ee Packets Transmitted 4 Application Metrics Step 2 Specify the Experiment Name and Save Path and click on OK Experiment Name Exp 1 Save path D Exp 1 31 5 Model Traffic in the Network Sample 2 Follow all the steps as shown in Sample and modify only the Application properties as shown below OR User can also select the Go back to Network option select the Edit button and modify only the Application properties as shown below sigakation Programming Utilities Help Application Properties Create 2 Application and set the values as shown below 2 Wired Node B 3 Wired Node C Destination ID 4 Wired Node D 4 Wired Node D Distribution Constant Value Bytes 1460 1460 Distribution Constant Value us 5000 5000 6 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 7 M
29. 3 gt 6 gt 5 Router_ID 3 gt Router_Name Router_3 gt No_Of_Neighbour 2 gt Neighbours_ID 2 gt 4 Router_ID 4 gt Router_Name Router_4 gt No_Of_Neighbour 2 gt Neighbours_ID 3 gt 6 Router_ID 5 gt Router_Name Router_5 gt No_Of_Neighbour 1 gt Neighbours_ID 2 Router_ID 6 gt Router_Name Router_6 gt No_Of_Neighbour 2 gt Neighbours_ID 4 gt 2 Output txt file contents O gt 1 gt 2 gt 1 gt 0 0 gt 2 gt 1 gt 1 gt 0 0 gt 2 gt 3 gt 1 gt 0 0 gt 2 gt 5 gt 1 gt 0 0 gt 2 gt 6 gt 1 gt 0 0 gt 3 gt 2 gt 1 gt 0 0 gt 3 gt 4 gt 1 gt 0 0 gt 4 gt 3 gt 1 gt 0 0 gt 4 gt 6 gt 1 gt 0 0 gt 5 gt 2 gt 1 gt 0 0 gt 6 gt 2 gt 1 gt 0 0 gt 6 gt 4 gt 1 gt 0 1 gt 1 gt 2 gt 1 gt 0 1 gt 1 gt 3 gt 2 gt 2 1 gt 1 gt 5 gt 2 gt 2 1 gt 1 gt 6 gt 2 gt 2 1 gt 2 gt 1 gt 1 gt 0 1 gt 2 gt 3 gt 1 gt 0 1 gt 2 gt 4 gt 2 gt 6 1 gt 2 gt 5 gt 1 gt 0 1 gt 2 gt 6 gt 1 gt 0 1 gt 3 gt 1 gt 2 gt 2 1 gt 3 gt 2 gt 1 gt 0 1 gt 3 gt 4 gt 1 gt 0 1 gt 3 gt 5 gt 2 gt 2 1 gt 3 gt 6 gt 2 gt 4 1 gt 4 gt 1 gt 3 gt 3 106 1 gt 4 gt 2 gt 2 gt 6 1 gt 4 gt 3 gt 1 gt 0 1 gt 4 gt 5 gt 3 gt 3 1 gt 4 gt 6 gt 1 gt 0 1 gt 5 gt 1 gt 2 gt 2 1 gt 5 gt 2 gt 1 gt 0 1 gt 5 gt 3 gt 2 gt 2 1 gt 5 gt 4 gt 3 gt 2 1 gt 5 gt 6 gt 2 gt 2 1 gt 6 gt 1 gt 2 gt 2 1 gt 6 gt 2 gt 1 gt 0 1 gt 6 gt 3 gt 2 gt 4 1 gt 6 gt 4 gt 1 gt 0 1 gt 6 gt 5 gt 2 gt 2 2 gt 1 gt 2 gt 1 gt 0 22 gt 1 gt 3 gt 2 gt 2 2 gt 1 gt 4 gt 3 gt 2 2 gt 1 gt 5 gt 2 gt 2 2 gt 1 gt 6 gt 2 gt 2 2 gt 2 gt 1 gt 1 gt 0 2 gt 2 gt 3 gt 1 gt 0 2 gt 2 gt 4 gt 2 g
30. CB297A0C 0 ee 0 Protocol ETHERNET 0 Link Properties Uplink Speed Mbps Uplink BER Downlink BER Downlink Speed Mbps 46 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties Application Properties oie tesa Packet Size Packet Inter Arrival 10000 100000 Time us NOTE The procedure to create multiple applications are as follows Step 1 Click on the ADD button present in the bottom left corner to add a new application e a T r Application 1 Application_Type Application ID Source_Count Source_ID Destination_Count Destination_ID Start_Time s End_Time s Src_to_Dest eeoocoeces PACKET_SIZE Distribution Value Bytes rINTER_ARRIVAL_TIME Distribution CONSTANT Value micro sec 10000 4 Simulate Simulation Time 100 Sec After completion of the experiment Save the yam 1 Click on Run Simulation p experiment for future analysis of results 5 Configure the Network Sample 2 Follow all the steps as shown in Sample 1 and modify only the Router properties as shown below OR User can also select the Go back to Network option select the Edit button and modify only the Router properties as shown below SU ion Programming Utilities Hel EB g
31. Classes Debug ARP c a Compile amp Run F9 Rebuild All Ctrl F11 Syntax Check Clean Profile analysis Dev C will create the exe file in the same location where the C source code file 1s located 2 Once exe file is created link that exe file with NetSim gt Programming gt User mode Note For Windows 8 and above use Dev C v 5 11 Note For Windows Vista set up Dev C as shown below In Dev C 4 9 9 2 exe go to Tools gt Compiler Options gt Directories tab gt Binaries tab Add the following path as per your installation directory in the text box provided and click on add button C Dev Cpp libexec gcc mingw32 3 4 2 SAREN Directories Miger tua Binaries os Cincludes C Includes fC Dev Cpp libexec acc mingw32 3 4 2 ki Replac Delete Invalid Default vo XM Cancel Help 135 Me meee Directories Mmm Project Classes Debug Binaries Libraries Clncludes C Includes C Dev Cpp Bin C Dev Cpp libexec gec mingw32 3 4 2 In the C Includes tab add the follwing path in the text box provided and click on add button C Dev Cpp lib gcc mingw32 3 4 2 include Ben e a eA Directories Mimo cm Eee eels C Includes Masai Ta a C Dev Cpp include Ic Dev Cpp ib acc mingw32 3 4 2 include a Replace Add Delete Delete Invalid A Defaut Lv X cence 2 Her errs CAE HHA i Be a eea Directories mmr iim Project Classes
32. Desktop pi Downloads t Recent Places T Libraries 5 Documents a Music Pictures H Videos e Homegroup Comparison Chart Graph I Note These charts are plotted only for Source_ID 1 The procedure is as follows Name S L BrowsePath L CollisionCount ConfigLog L ConfigOutput Configuration Configuration _ ContentionWindow _ GUILog _ info tmp IpAddress LicenseErrorLog File Home Insert Paste Y Clipboard B Calibri 11 May BIFU i Aa Page Layout Formulas Data Review View Team a Q General Ay gInserty E 7 a fale 2 F Delete wl Styles Find amp New folder Type Size Da TXT File 1KB 7 TXT File 126KB 7 1 TXT File 19KB 7 TXT File 4KB 7A TXT File 1KB 7 1 XML Document TXT File TXT File OKB 7 1 TMP File LKB 6 1 TXT File 1KB 7 1 TXT File 7KB 7A v paj Formaty Ar Cells Select 7 2 Sort Smallest to Largest j Zl Sort Largest to Smallest wre Opb pd pb 1035 2 1035 2 1035 2 1070 4 G Custom Sort 2 Sort amp Filter gt Filter Filter Ctrl Shift L Enable filtering of t cell Once filtering is tur the arrow in the col 77 A PN N File Home Insert Page Layout Formulas Data Review View Team a O oco Fe B Calibri 1 aB BZ U j AK General A aInserty E AY a wl
33. Generator Polynomial as given above in Concept p lt Take the MSB 17 bits from the binary data string If the leading bit of the binary data string is 0 do an XOR operation with the 17 bits of O s and get the remainder which is also 17 bits Else if the leading bit of the binary data string is 1 do an XOR operation with the 17 bits with binary converted CRC CCITT polynomial and get the remainder which is also 17 bits The first bit of the remainder is left out and the remainder is made to 16 bits If there are successive bits in the data make the previous remainder bit to 17 bits by bringing down the next bit into the data e Convert the final remainder into HEXA equivalent character Divide the final remainder at the end of step 5 4 into blocks of 4 bits Convert each block into equivalent HEXA character Thus the output of this whole process will be a 4 nibble checksum that 1s attached to the transmitting frame 89 Receiver side CRC Coding e Repeat the Steps 1 to 4 of the Sender side CRC coding and get the szere value for the data e Convert the HEXA equivalent string szSender to its binary format This is the Hexadecimal to binary conversion process e Append the binary format of the above step to the szcrc variable Then append 16 Os to the szere variable e Repeat the Steps 5 and 6 of the Sender Side CRC coding to calculate the CRC value for the receiver
34. H NETWORK_LAYER IP_Address 11 1 1 E Oo il Interface 1_Ethernet Subnet_Mask 355 355 0 0 7 gt gt Interface2_Ethernet eS Interface3_Ethernet Default_Gateway 2 Set Buffer Size 8 1 Check which Interface a G D i i li is connected to Wired Seay tyne EF Node G 3 Set Scheduling Type FIFO Wired Link Properties Right click on Wired Link gt Properties and set the values Wired Link 1 amp 2 Wired Uplink Speed Mbps Downlink Speed Mbps 8 Model Traffic in the Network Sample 3 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties Application Properties 3 Wired Node C 2 Wired Node B 2 Wired Node B 7 Wired Node G 7 Wired Node G 7 Wired Node G C a Packet Inter 10000 10000 100000 Arrival Time us 49 9 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 10 Configure the Network Sample 4 Follow all the steps as shown in Sample 3 and modify only the Router properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to Priority za ROUTER Properties 1 Check which di Router 1 Interface 1_Eti Interface is connected GLOBAL_PROPERTIES
35. Internetworks 1 Create Design the Network Devices Required 1 Switch 2 Access Point 6 Wireless Nodes Device Placement NOTE To edit the position change the x y co ordinates in Global Properties as shown F WIRELESSNODE Properties os GLOBAL_PROPERTIES EO GLOBAL_PROPERTIES DEVICE_NAME Wireless Node A i TRANSPORT_LAYER DEVICE_TYPE WirelessNode_1 NETWORK_LAYER i Interface 1_WLAN Type NODE To change 250 Co ordinates click amp edit 100 Seeoeo 80 Set the exact x and y co ordinates for respective device in device property which is mentioned in the above table to get the same result as obtained in this manual Device Name Y Lon Access Point A 170 110 Access Point B 331 191 Switch C 251 151 Wireless Node D 130 Wireless Node E 145 Wireless Node F 170 Wireless Node G 331 Wireless Node H 360 Wireless Node I 371 Network Diagram Bee clots Node F r Se j ElEs Node Mog 2 Configure the Network Sample 1 Wired Node Properties Disable TCP in Wireless Node D Right Click Wireless Node D Properties 81 I di Wireless Node 4 TRANSPORT_LAYER i 2 Deselect TCP TCP yp Checkbox GLOBAL_PROPERTIES j APPLICATION TA Protocol ITRANSPORT LAYER 3 MSS bytes Lo Interface 1_ WIRELESS Congestion_Control_Algo OLD_TAHOE m Window _Size MSS 8 Oo 0
36. J So the user needs to add the user code create exe and attach it with NetSim to run The User code which is to be added is given below void fnDistVectAlgorithm User code part start do This do while loop is to update the table information till it knows all the router s information present in the network I for To go to No of router for nRouterTable 1 nRouterTable lt g_nNo0fRouters nRouterTable II for Select the source router for nNeighbour 1 nNeighbour lt g_nNo0fRouters nNeighbour III for move to all router 1f Table nRouterTable nCostID nNeighbour 1 I if select the neigh router int nDestID 1 104 for nDestID 1 nDestID lt g_nNoOfRouters nDestID IV for select the routing table of neigh 1fCnDestID nRouterTable 477 II if if Table nRouterTable nDestID nDestID 0 amp amp Table nNeighbour nDestID nDestID 0 III if This loop is to check whether the neighbour router 1s DESTINATION or not Table nRouterTable nDestID nDestID nDestID Table nRouterTable nNextHop nDestID nNeighbour Table nRouterTable nCostID nDestID Table nNeighbour nCostID nDestID 1 else if Table nRouterTable nNextHop nDestID nDestID Table nRouterTable nCostID nDe stID 1 amp amp Table nNeighbour nDestID nDestID 0 else if This loop ss to check whether the neighbour router is the destination or not and also check whether
37. NetSim Simulation Platform for Network R amp D Experiment Manual Terai The information contained in this document represents the current view of TETCOS on the issues discussed as of the date of publication Because TETCOS must respond to changing market conditions it should not be interpreted to be a commitment on the part of TETCOS and TETCOS cannot guarantee the accuracy of any information presented after the date of publication This manual is for informational purposes only TETCOS MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS DOCUMENT Warning DO NOT COPY Copyright in the whole and every part of this manual belongs to TETCOS and may not be used sold transferred copied or reproduced in whole or in part in any manner or in any media to any person without the prior written consent of TETCOS If you use this manual you do so at your own risk and on the understanding that TETCOS shall not be liable for any loss or damage of any kind TETCOS may have patents patent applications trademarks copyrights or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from TETCOS the furnishing of this document does not give you any license to these patents trademarks copyrights or other intellectual property Unless otherwise noted the example companies organizations products domain names e mail addresses
38. Parity odd Input Data Error Position Data Bits 7 wo nterface Source Co NetSin 1 Maximum 8 Alphabets SH Enter the Data te __ Select the Error Position Click run to execute Rerresn Click here to view the Concept Concept Algorithm Pseudo Code amp Flo emo or Algorithm Pseudo code and Flow chart Click here to Interface Source Code 122 Results After you click RUN button you can see the Hamming string Original data and Error data in binary format as shown in the following screen shots FZ NetSim Programming Help s Hamming Code Mode oO Hamming String Position 54 Original lo Error o Input EJ Data Original Data Maximum 8 Alphabets Position Error Position Data Bits Original 01001110011001010111010001010011011010 0101101101 Error 01001110011001010111010001010011011010 Error Data 0101101100 PEE Position Action Help w Concept Algorithm Pseudo Code amp Flow Chart w Interface Source Code lt User Mode In User Mode the user needs to edit the Interface Source Code at the following location int fnHamming O Write your own code here return 1ErrorPosition End of Function fnhammingErrorPosition So the user needs to add the user code create exe and attach it with NetSim to run The User code w
39. Rate Data Rate is the speed at which data can be transmitted from one device to another It 1s often measured in megabits million bits per second Procedure In NetSim Select Simulation gt New gt Internetworks 1 Create Design the Network Devices Required 2 Switches 6 Wired Nodes 65 Network Diagram 4 Wired Node e D r Wired Node 3 Wired Node C _ _ _ Note While creating network place the devices according to the Node ID given in diagram above in order to easily understand the settings to be configured as provided in this manual For example Figure shows Wired Node A has Node ID 1 and Wired Node B has Node ID 2 So first place a Wired Node at the location of Wired Node A and then at Wired Node B and so on 2 Configure the Network Sample 1 Wired Node Properties Disable TCP in Wired Node A 4 WIREDNODE Properties x db Wired Node 2 TRANSPORT_LAYER GLOBAL_PROPERTIES TCP 2 Deselect TCP D uakina an Protocol TRANSPORT_LAYER J Checkbox a Daa MJ Wawic TCR MSS bytes 1400 _ Interface 1_Ethernet Congestion_Control_Algo OLD_TAHOE Oo Window_Size MSS 8 1 Select Transport Layer 0 Acknowledgement_Type Undelayed FF UDP Protocol UDP Ce Seagment_Size bytes 1472 4 TL Baill 66 Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties Ma
40. Sim to run The User code which is to be added is given below void fnLBAC User code part start Write you own code for Leaky Bucket algorithm HERE int nBufferValue 0 int ninterval 0 nSeconds Q0 for nInterval 0 nInterval lt 10 nInterval if CCnInputRate nInterval nOutputRate gt 0 the input is more than the output rate if C nBufferValue CnInputRate nIinterval nOutputRate gt nBufferSize All put together the value is more or equal than the buffer size if nBufferValue nInputRate nInterval nOutputRate gt nBufferSize more than case where we have discard nDiscardRate nSeconds CCCnInputRate nIinterval nOutputRate nBufferValue nBufferSize the discard rate is recorded nBufferValue nBufferSize else this equal case is where we have no discard nBufferValue nBufferValue CnInputRate nInterval nOutputRate the exces is stored in the buffer for both case the output and buffer level is recorded nOutputRates nSeconds nOutputRate else if C nInputRate nInterval nOutputRate 0 the output is equal to input rate nBufferValue nBufferValue nOutputRates nSeconds nOutputRate 128 else if C CnInputRate nInterval nOutputRate lt 0 input is less than output rate if CninputRate nInterval gt 0 if CnBufferValue CnInputRate nIinterval nOutputRate gt nBufferSize All put tog
41. _ID Destination_Count Destination_ID Distribution Constant Value Bytes 1460 Start_Time s End_Time s eeoeoeoosce Src_to_Dest rPACKET_SIZE Distribution Distribution Constant Value us 1200 Value Bytes rINTER_ARRIVAL_TIME Distribution CONSTANT Value micro sec 1200 Accept 4 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 1 Click on Run Simulation 22 Steps to save an experiment Step 1 After simulation of the network on the top left corner of Performance metrics screen o Link Metrics H Queue Metrics Metric E L TCP Metrics click on the Save Network and un TP Metrics a a p IP Forwarding Table Simulation Time ms Metric as button ce pola Packets Transmitted i Application Metrics Step 2 Specify the Experiment Name and Save Path and click on OK Experiment Name Exp 1 Save path D Exp 1 5 Configure the Network Sample 2 Follow all the steps as shown in Sample and modify only the wired link properties as shown below OR User can also select the Go back to Network option select the Edit button and modify only the wired link properties as shown below ajon Programming Utilities Help Dynamic Performance Metrics Wired Link Properties Right click on Wired Link gt Properties and set t
42. and Destination_Id as 5 Wired Node E Click on Accept Application 1 Application_Type CBR y Application ID f Source _Count 1 Source_ID 2 v Destination _Count fa 4 Modify required parameters amp select ACCEPT CAAA FFFA Value Bytes Distribution Value micro sec 12 4 Simulate For simulating the network scenario created click on Run Simulation present in the Ribbon Be R 1 Click on Run Simulation Set the Simulation Time to 10 seconds Select OK To see Packet Animation after Simulation To see Packet Animation during Simulation To disable Packet Animation A Simulation Configuration Ip and ARP Configuration 2 Set Simulation Simulation Time time to 10 seconds Simulation Time 0 to 100000 fao o Packet Animation Record animation Simulation will slow down marginally Play amp record animation Simulation will slow down significantly Don t play record animation Simulation will run fast Seed Values Used to generate random numbers in simulation Enter any value between 1 to 99999999 Seed 1 12345678 Seed 2 23456789 13 5 Analysis of Result The different methods of performing analysis of Network performance in NetSim Academic Version are e Performance Metrics e Packet Animation e Analytics For multiple exper
43. and the intermediate router field value have the same value as any one of the neighbors routing entry e Update the source router s routing table entry with the new advertised one if the intermediate router value in the source table 1s not same but the cost value is greater than the its neighbor s entry e Write the next stage of routing table into the file 102 Repeat steps to 5 for all routers Check whether any changes are made in any of the routers If yes then repeat the above steps otherwise quit the process Procedure To begin with the experiment open NetSim Click on Programming from the menu bar and select Distance Vector Routing The scenario will be obtained as shown below Follow the steps Select Mode Connect the Routers gt Router 1 Actio anme Click Run to execute Click here to view Concept Algorithm pseudo Code amp Flowchart When you select the User mode you have to write your own program in C C compile and link to NetSim software for validation Click on the F1 Help for details on how to proceed with your own code 103 Results FZ NetSim Programming Distance Vector Routing Final Stage Router 5 Dest Cost NextHop Ri 2 Output Table User Mode In User Mode the user needs to edit the Interface Source Code at the following location void fnDistVectAlgorithm Write your own code here
44. aoesusedeoussenesses eur 102 Experiment 13 TCP IP Sockets Write Using TCP IP sockets write a client server program to make the client send the file name and to make the server send back the contents of the requested file if DVEOSCWvscseccacesessticsoissaccssussacacoinessieiedelessaiiecsedeadeaviecieweainieieiaumeesadien 108 Experiment 14 RSA Write a program for simple RSA algorithm to encrypt and decrypt Medr AAE E A es etaeeaieeernouiatees 116 Experiment 15 Hamming Code Write a program for Hamming code generation for error detection and correctiO irsoc acters coc ease ances can i a ER en Aaaa aE Ea iaaii reii 120 Experiment 16 Leaky Bucket Algorithm Write a program for congestion control using aky Ducke ac 218 614 0199 nE a E E 125 Appendix 1 Programming exercise How to practice without NetSim cccccccsesesenesenenesens 131 Appendix 2 Creating exe file Using Dev Ctt oo ccc cccccccscssescceenececeeeseseseeessseeueessseeeseseeneseenenes 135 Experiment 1 Introduction to NetSim network simulator and procedure of working in it Part A Introduce students to network simulation through the NetSim simulation package Theory e What is NetSim NetSim is a network simulation tool that enables users to virtually create a network along with its components such as devices links and applications etc to study the behavior and performance of the Network Some examples of its applications are e P
45. ble under Application Metrics in an Excel file Similarly please follow the same steps for all the saved samples note down the throughput values and create graph in Excel as shown below 86 Graph II Throughput of the first application vs Number of transmitting nodes Throughput of a single Node Vs Number of transmitting nodes g Cc O 2 Q Q lt q O gt Q lt Qo gt O Se Number of transmitting nodes NOTE The procedure to create graph is same as provided in Experiment 2 15 Inference If the number of nodes generating data increases then the number of packets collided in the network also increases Hence there is a gradual increase in number of packets collided when the transmitting nodes increases in Graph I If more than one node is accessing the medium at the same time the particular node has to wait until the completion of packet transmission in the medium Hence Node 1 s throughput decreases when number of transmitting nodes increases in Graph II 8 Experiment 10 Cyclic Redundancy Check Write a program for error detecting code using CRC CCITT 16 bits Note CRC 12 CRC 16 and CRC 32 are also available in NetSim Theory Cyclic redundancy check CRC is a type of function that takes a data stream of any length as input and produces an output Bit strings are treated as representation of polynomials with coefficients of 0 and 1 The Sender
46. bles with the default value Compiler ral Resources dh Compile Log VY Debug A Find Results File Edit Search View Project Execute Debug Tools CVS Window Help BE L E S BG58 8 aa5 l o o YP 39 New Insert Toogle I Goto Project Classes Debug LinkState c void fnDijkstra code part start own code for Link State Algorithm HERE Temporary loop variables char szString _MEM BUFFER2 char szToken int iNo total number of nodes used in the graph pszFile char malloc sizeof char MEM BUFFER2 szInput_path char malloc _ MEM BUFFER2 sizeof char strcepy szInput_path szTempPath strcat szInput path Input txt strcpy pszFile szInput_path fp fopen pszFile r szToken char malloc sizeof _ MEM BUFFER2 fgets szString MEM BUFFER2 fp skip fgets szString MEM BUFFER2 fp szToken strtok szString n o Fe de code ow Io SP ETETE T ww o Compiler ray Resources dh Compile Log ZY Debug A Find Results Insert 526 Lines in file After writing the code for the function void fnDijkstra create exe file The procedure to create exe file is explained in Section 9 2 of NetSim User Manual In this example the exe file created is LinkState exe Step 4 Run in command prompt Open command prompt and go to the folder where the exe file is saved There type lt EXE Name gt lt blank gt
47. ck on the environment at the desired location 1 Click on Switch 1 Click on Router 2 Select Internal Router a hae be 2 Select Switch Step 2 Connecting devices on the environment Sim Simulation Internetworks In order to connect devices present in the environment ition Programming Realtime Basics Utili 1 we i click on Link and select Wired Link Click and select the devices successively where link is required For example select wired link and select Switch and Router successively to connect them In this manner f 1 Select Wired Link continue to link all devices 4 a 3 Click on router 2 Click on Switch _ ey ow RouterD 3 gl 4 Link will be created between Switch amp Router Wired Node A Wired Node B Wired Node E 2 Configure the Network Step 1 Configure Devices Right click on the device and select properties Wired Node A Wired Ne gt Wired Node E a Icon 2 Select Properties 10 TA WIREDNODE Properties Ji Wired Node 2 H GLOBAL_PROPERTIES 4 APPLICATION_LAYER L TRANSPORT_LAYER H NETWORK_LAYER eres eee Interface 1_Ethernet rNETWORK_LAYER r DATALINK_LAYER ETHERNET rPHYSICAL_LAYER Network Protocol IP_Address Subnet_Mask Default_Gateway Protocol ARP_Retry_Interval s 10 ARP_Retry_Limit IPV4 ILLLS 255 255 0 0 1
48. cro sec 39 6 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 7 Model Traffic in the Network Sample 3 Follow all the steps as shown in Sample and modify only the Application properties as shown below Application Properties Custom for Custom for icati FTP _ re TELNET TELNET 4 Wired Node D Wired Node A 2 Wired Node B 5 Wired Node E 6 Wired Node F 7 Wired Node G Dhidi CnC Cat Size Size Bytes 10000000 1460 1460 gt Inter Arrival Time pobota Inter Arrival Time 15000 us 15000 us 8 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 9 Model Traffic in the Network Sample 4 Follow all the steps as shown in Sample and modify only the Application properties as shown below 40 Application Properties Application Type Custom for Custom for Custom for Sae P NED TINED TENED Source ID 4 Wired Node D 1 Wired 2 Wired 3 Wired Destination ID 5 Wired Node E 6 Wired 7 Wired 8 Wired poe a Size Bytes 10000000 1460 1460 1460 Inter Arrival Time 15000 us 15000 us 15000 us 10 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 11 Analysis of Result Go to Simulat
49. del Traffic in the Network Sample 4 Application Properties Destination ID 4 Wireless Node D 7 Wireless Node G 5 Wireless Node E 6 Wireless Node F 7 Wireless Node G 8 Wireless 9 Wireless 6 Wireless Node H Node I Node F cet Size OA 1460 1460 1460 1460 Value us 2336 2336 2336 2336 13 Simulate Sample 4 Simulation Time 10 Sec After completion of the simulation Save the experiment for future analysis of results 14 Analysis of Result Go to NetSim Analytics Simulation gt Analytics 1 Click Browse button gt experiment folder select the Metrics txt File inside the first saved 2 Add the remaining 5 sample experiments by repeating the above step 3 Select the Metrics Select the coordinates for Y axis by clicking on the dropdown menu User should select Packets Collided 85 Comparison Chart Graph I Number of nodes generating traffic vs Packets collided gr D 2 T LA r E Ll T mi Experiment Mame Go to Simulation gt Open gt Metrics menu to open the results of saved experiments Simulation Programming Utilities Help Delete MIE Legacy Network Legacy Metrics to open Look in F Experiment a eg L ay RecentItems SpanningTree Desktop File name Metrics txt j i RAES My Documents sinner bet Open the Metrics txt file of the first sample and note down the Throughput value availa
50. e analysis of results 27 Analysis of Result Go to Simulation gt Open gt Metrics menu to open the results of saved experiments ee New gt Open Network Delete e Legacy Network Legacy Metrics to open L tn Ys Recent Items __ SpanningTree Desktop File name Metrics txt Files of type txt My Documents 56 Open the Metrics txt file of the first sample and note down the total number of Dropped Packets available under Queue metrics and number of ping messages Packets Received received available under Application metrics in an Excel file Similarly please follow the same steps for all the saved samples and note down the dropped packets values It will be as shown below LO di DD lo L See B44 52 2 a I z Number applications pd 8 8 a ae 28 Inference From the table we can observe that number of ping messages received when scheduling type is Priority is less than number of ping messages received when scheduling type is FIFO In NetSim Voice messages have higher priority compared to ping messages Hence when scheduling type is Priority higher preference is given to voice messages As a result the number of ping messages received is lower when priority based scheduling is considered From the table we can observe that packets are dropped when there are five voice applications The number of packets that arrive at the router increas
51. e larger the data blocks more the efficiency of the algorithm This is a key part of external sorting 3 If possible retain all the data in main memory In this case random access into an array can be effectively used This is a key part in internal sorting There are three important considerations that will affect a programmer s decision to choose from a variety of sorting methods 1 Time to write the program 2 Execution time of the program 3 Memory or auxiliary space needed for the program s environment In this exercise we will look at the Bubble sort algorithm By selecting Sample option user can visualize the sorting for the given input data and understand the concept of Sorting Algorithm Bubble sort derives its name from the fact that the smallest data item bubbles up to the top of the sorted array 97 The algorithm begins by comparing the top item of the array with the next and swapping them if necessary After n comparisons the largest among a total of n items descends to the bottom of the array to the nth location The process is then reapplied to the remaining n 1 items of the array For n data items the method requires n n 1 2 comparisons and on the average almost one half as many swaps The bubble sort therefore is inefficient in large sorting jobs Procedure To begin with the experiment open NetSim Click on Programming in the menu bar select Sorting Tech
52. e with the name Input txt The contents of the file will vary for each programming exercises and are specified in NetSim User Manual under programming topic For Example Copy the input file contents from NetSim user manual and save it in a file called Input txt 131 Sample Algorithm Link_State No_of_Router 3 Distance 999 gt 6 gt 5 gt 6 gt 999 gt 7 gt 5 gt 7 gt 999 gt Source_Router 1 Destination _Router 2 Save it in some other location In this example it is saved at D New Step 3 Create exe file Open C editor Turbo C Dev C etc and write the Interface source code which was saved in the first text file Also add the code to be written by the user in the specific sections and compile it Keep the exe file For Example Now in C editor Dev C IDE 1s used here copy the interface source code In the interface source code void fnDijkstra is not implemented File Edit Search View Project Execute Debug Tools CVS Window Help LLC COCALCA I iek E B New g inset Toge M Goto Project Classes Debug LinkState c endif fnDijkstra return 0 void fnDijkstra Write your own code h void fniInitialize int iNo variables declaration int source 0 destination 0 to store the source node and destination node int i j temporary loop variables char szString MEM BUFFER2 char szToken ff gt gt e r h7 om J ers f f initializing varia
53. eds to edit the Interface Source Code at the following location int fnTcpServer Write your own code here return O J So the user needs to add the user code create exe and attach it with NetSim to run The User code which is to be added for TCP is given below int fnTcpServer User code part start nSocketfd Cint socket AF_INET SOCK_STREAM 0 serv_addr sin_family AF_INET serv_addr sin_port htonsCSERVER_PORTNUMBER serv_addr sin_addr s_addr hton CINADDR_ANY nBindfd bind nSocketfd struct sockaddr amp serv_addr sizeof serv_addr 1fndef NETSIM_SAMPLE nListenfd listen nSocketfd 5 else nListenfd listen nSocketfd 1 endi f nServerLen sizeof serv_addr if CfnWriteOutput Qd 1 if socket creation bind and listen failed function will terminate closesocket nSocketfd return 0 ifndef _NETSIM_SAMPLE nNewsocketfd int accept nSocketfd struct sockaddr amp cli_addr amp nServerLen nLoopCount memset szData 0 sizeof szData Clear the array nReceivedbytes int recv nNewsocketfd szData sizeof szData 0 fnWriteOutputQ nSendbytes Cint send nNewsocketfd pszBuffer strlen pszBuffer 0 else while 1 nNewsocketfd Cint accept nSocketfd struct sockaddr amp cli_addr amp nServerLen 113 nLoopCount memset szData 0 sizeof szData Clear the array nReceivedbytes int recv nNewsocke
54. ee P A A Qa A amp Q i M ap SY race Trace Metrics Simulation Metrics In l E ormance dati Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to Priority wa ROUTER Properties Interface1_Ethernet NETWORK_LAYER Network Protocol IPV4 J Router 1 GLOBAL PROPERTIES APPLICATION_LAYER TRANSPORT_LAYER NETWORK_LAYER am interface1_Ethernet gt Interface2_Ethernet gt Interface3_Ethernet IP_Address 11 14 11 Subnet_Mask 255 255 0 0 Default_Gateway 1 Check which Interface is Buffer size MB connected to Wired Node G Scheckiing type 3 Set neie Type Priority 6 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 7 Configure the Network Sample 3 Follow all the steps as shown in Sample 1 and modify only the Router properties and Wired Link properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to FIFO 48 wa ROUTER Properties di Router 1 GLOBAL_PROPERTIES Interface 1_Ethernet NETWORK_LAYER _ APPLICATION_LAYER OOPTE Pretncsl IPV4 ri TRANSPORT_LAYER p f i
55. eeds to edit the Interface Source Code at the following location void fnBubblesortCint iNoElement Write your own code here J So the user needs to add the user code create exe and attach it with NetSim to run The User code which is to be added is given below void fnBubblesort int iNoElement User code part start int iNoOfExch 0 szOutput_path_BS char malloc 200 sizeof Cchar strcpy szOutput_path_BS szTempPath_BS ifndef NETSIMDLL strcatCszOutput_path_BS Output txt 99 else strcatCszOutput_path_BS Temp txt endif fp_BS fopen szOutput_path_BS w for CnLoop1_BS 0 nLoop1_BS lt iNoElement 1 nLoop1_BS Outer Loop Inner Loop Comparing Swapping Swapping 1NoOfFExch 0 for CnLoop2_BS 0 nLoop2_BS lt iNoElement CnLoop1_BS 1 nLoop2_BS forintf Cfp_BS 1 gt d gt d gt n nLoop2_BS nLoop2_BS 1 Ji Ascending Order if nOrder_BS 1 Ascending Order if CnArray_BS nLoop2_BS gt nArray_BS nLoop2_BS 1 ForintfCfp_BS 2 gt d gt d gt n nLoop2_BS nLoop2_BS 1 nTemp_BS nArray_BS nLoop2_BS nArray_BS nLoop2_BS nArray_BS nLoop2_BS 1 nArray_BS nLoop2_BS 1 nTemp_BS 1NoOfExch Descending Order if nOrder_BS 2 Descending Order if CnArray_BS nLoop2_BS lt nArray_BS nLoop2_BS 1 Forintf Cfp_BS 2 gt d gt d gt n nLoop2_BS nLoop2_BS 1 nTemp_BS nArray_BS nLoop2_BS nA
56. ent selection the Collision will consist of 73 So B Z U Aw ESEE r PD Paste p ee Styles FY E JTZ A7 E E Y oo 20 Gael Fe Clipboard Font Alignment Number Ci H1148 v fe A B q 4 Scroll down F G 1142 1 1141 98 1143 1 1142 98 1144 1 1143 988 gt su0z0 1145 1 1144 9921147 1146 1 1145 9960061 2 2 1150 2 2 2 5 Inference As expected we see a large number of collisions in each node Further we notice that the number of collided packets in each node is approximately the same showing the inherent fairness of CSMA CD Performance studies indicate that CSMA CD performs better at light network loads With the increase in the number of stations sending data it is expected that heavier traffic have to be carried on CSMA CD LANs IEEE 802 3 Different studies have shown that CSMA CD performance tends to degrade rapidly as the load exceeds about 40 of the bus capacity Above this load value the number of packet collision raise rapidly due to the interaction among repeated transmissions and new packet arrivals Collided packets will back off based on the truncated binary back off algorithm as defined in IEEE 802 3 standards These retransmitted packets also collided with the newly arriving packets 74 Experiment 8 To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot contention window for different source destination Theory Carrie
57. ep 2 Specify the Experiment Name and Comments and click on OK Enter the Experiment Name Exp 1 This is a Legacy network experiment 18 Opening an Experiment Open Network All Networks except Legacy Networks Go to Simulation gt Open gt Network menu to open saved experiments The following steps need to be followed TE Recent Items Desktop d File name Configuration xml My Documents Files of type xml Open Network Legacy Networks Go to Simulation gt Open gt Legacy Network a Programming Utilities Help menu to open saved experiments The following New J Oper i Network steps need to be followed __ ii Delete Metrics Analytics Legacy Network Legacy Metrics Open Network Delete Metrics Analytics Legacy Network Legacy Metrics e Click on Browse e Open the Saved experiment folder NetSim creates a folder with the experiment name during saving e Select the configuration xml file inside the folder a Select the User Note This option is available in Admin login only Select the Network Only Legacy Networks option will be present Select the Protocol Note Protocols present under Legacy Network will be displayed Select the Experiment Click on Ok button to open the specified
58. eriment Save the experiment for future analysis of results 68 9 Configure the Network Sample 4 Follow all the steps as shown in Sample and modify only the Wired Link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties Uplink Speed Mbps La ie Downlink Speed Mbps 8000 8000 No Error No Error Uplink BER No Error No Error 10 Simulate Simulation Time 10 Sec After completion of the experiment Save the experiment for future analysis of results 11 Analysis of Result Go to Simulation gt Open gt Metrics menu to open the results of saved experiments Programming Utilities Help New Open i Network Delete Analytics Legacy Network Legacy Metrics Click on Browse and select the Metrics txt file present with the saved experiment you want to open Lookin Experiment a egan hn by Metrics Recent Items SpanningTree Desktop File name Metrics txt Files of type txt My Documents 69 Open the Metrics txt file of the first sample and note down the Throughput value available under Application Metrics in an Excel file Similarly please follow the same steps for all the saved samples note down the throughput values and create Graph in Excel as shown below Graph I Data Rate Vs Throughput Data Rate Vs Throughput O O
59. es when there are more number of voice applications As a result the buffer gets filled All the packets that arrive after the buffer is filled will be dropped 57 Experiment 6 Simulate an Ethernet LAN using n nodes 6 10 change error rate and data rate and compare throughput Part A To simulate an Ethernet LAN using n nodes 6 10 change error rate and compare throughput Theory Bit error rate BER The bit error rate or bit error ratio is the number of bit errors divided by the total number of transferred bits during a studied time interval 1 e BER Bit errors Total number of bits For example a transmission might have a BER of 10 meaning that on average out of every of 100 000 bits transmitted exhibits an error The BER is an indication of how often a packet or other data unit has to be retransmitted because of an error Unlike many other forms of assessment bit error rate BER assesses the full end to end performance of a system including the transmitter receiver and the medium between the two In this way bit error rate BER enables the actual performance of a system in operation to be tested Packet Error Rate PER The PER is the number of incorrectly received data packets divided by the total number of received packets A packet is declared incorrect if at least one bit is erroneous Procedure In NetSim Select Simulation gt New gt Internetworks 58 1 Create Design the Network D
60. ether the value is more or equal than the buffer size if CCnBufferValue niInputRate nInterval nOutputRate gt nBufferSize more than case where we have discard nDiscardRate nSeconds CCCnInputRate nInterval nOutputRate nBufferValue nBufferSize the discard rate is recorded nBufferValue nBufferSize nOutputRates nSeconds nOutputRate else if nBufferValue nInputRate nInterval nOutputRate lt 0 nOutputRates nSeconds nBufferValue nInputRate nIinterval nBufferValue 0 else nOutputRates nSeconds nOutputRate nBufferValue nBufferValue CnInputRate nIinterval nOutputRate else if C nBufferValue nOutputRate gt 0 nBufferValue nBufferValue nOutputRate nOutputRates nSeconds nOutputRate else nOutputRates nSeconds nBufferValue nBufferValue 0 nBufferLevel nSeconds nBufferValue nSeconds J while nBufferValue 0 this sends the remaining data in the buffer 129 if CnBufferValue gt nOutputRate buffer is more than the output nBufferValue nBufferValue nOutputRate nOutputRates nSeconds nOutputRate else nOutputRates nSeconds nBufferValue nBufferValue 0 nBufferLevel nSeconds nBufferValue nSeconds Write you own code for Leaky Bucket algorithm HERE User code part end Note How to practice this experiment without using NetSim
61. etwork Devices Required Hub 5 Wired Nodes Network Diagram Note While creating network first place the Hub Then select Wired Node and click on Hub Automatically Wired Nodes will be placed and linked with Hub 71 2 Configure the Network Right click on each Wired Node gt Properties and set the values Wired Node Properties meee NODE 2 IDE 3 NC NODE 5 Point to o to Point to Point to Point to Transmission Point Point Point Point Point e Distribution Constant Constant Constant Application Data Size 4 Fess 2 bamali 2 1472 1472 Bytes Distribution Constant Constant Constant Constant Constant Inter Arrival Time us 1000 1000 1000 1000 1000 Hub Properties Right click on Hub gt Properties and set the values C Error Rate bit error rate 3 Simulate Simulation Time 10 Sec 1 Click on Run Simulation After completion of the experiment Save the experiment for future analysis of results 4 Analysis of Result Collision Determination e Once the simulation is completed CollisionCount txt file will be written in the temp path of the operating system To reach the temp folder Click Start gt Run and then type temp NetSim 72 Type the name of a program folder document or Internet resource and Windows will open it for you Open the file in Excel sA abc AppData Local Temp NetSim Organize v Include in library v Share
62. evices Required 2 Switches 6 Wired Nodes Network Diagram _ ation CUSTOM Wired Node B Switch H 3 Wired Node C Wired Node F Note While creating network place the devices according to the Node ID given in diagram above in order to easily understand the settings to be configured as provided in this manual For example Figure shows Wired Node A has Node ID 1 and Wired Node B has Node ID 2 So first place a Wired Node at the location of Wired Node A and then at Wired Node B and so on 2 Configure the Network Sample 1 Wired Node Properties za WIREDNODE Properties 2S di Wired Node 2 TRANSPORT_LAYER Disable TCP in Wired Node A L GLOBAL PROPERTIES TCP om 2 Deselect TCP ER rotocol y Checkbox TRANSPORT LAYER O TEENE MSS bytes 1980 l Interface1_ Ethernet Congestion _Control_Algo OLD_TAHOE Oo Window_Size MSS 8 1 Select Transport Layer 0 Acknowledgement_Type Undelayed J UDP Protocol 7 UDP Seagment_Size bytes 1472 gt 59 Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties amine ee ea Downlink Speed Mbps 10 10 10 fio fo fwo 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties Applicatio
63. explanations of networking principles protocol working and packet formats Displays all the Help related to NetSim Part B Creating a Simple network collecting and analyzing statistics on network performance through the use of NetSim This section will demonstrate how to create a basic network scenario and analyze in NetSim Analyzing a Network in NetSim mainly involves 5 steps 1 Create Design the Network 2 Configure the Network 3 Model Traffic in the Network 4 Simulate 5 Analysis of Result Let us consider Internetworks To create a new scenario go to Simulation gt New gt Internetworks Legacy Networks Advanced Wireless Networks F EGP Networks Cellular Networks Wireless Sensor Networks Personal Area Networks Cognitive Radio Networks LTE Networks Perform the following steps to create a sample network scenario which looks like this 1 Create Design the Network Step 1 Drop the devices Click on Node icon and select gt Wired Node Click on the environment the grid in the center where you want the Wired Node to be placed In this way place two more wired nodes orks ve Basics Utilities Help e i be k Station Sink 100 150 200 250 300 350 400 3 Click on Grid and device will be placed there 4 Router D Switch C WirediNode A Wired Node B Wired Node E 5 Similarly to place a Switch and a Router click on the respective device and cli
64. ferent encryption and decryption techniques are used to provide security to the data that is to be transmitted Among these is the public key cryptography Public key cryptography requires each user to have two keys a public key used by the entire world for encrypting messages to be sent to the user and a private key which the user needs for decrypting messages RSA algorithm was discovered at the Massachusetts Institute of Technology MIT RSA stands for the initials of the three who discovered the algorithm Rivest Shamir and Adleman Algorithm The technique followed 1s 1 Choose two large primes p and g typically greater than 101 2 Computen p qandz p 1 q 1 3 Choose a number relatively prime to z and call it Kp 4 Find Ks such that Ks Kp mod z 1 To encrypt a message P compute C P mod n To decrypt C compute P C mod n It can be proven that for all P in the specified range the encryption and decryption functions are inversed To perform the encryption we need Ks and n To perform the decryption we need Kp and n Therefore the public key consist of the pair Ks n and the private key consist of Kp n 116 Procedure To begin with the experiment open NetSim Click on Programming from the menu bar and select Cryptography and then select Advanced RSA When you select the User mode you have to write your own program in C C compile and link to NetSim software for validation Click
65. file ner Desktop setup txt sa Text file txt Max 5000 bytes ie Concept Algorithm Pseudo Code amp Flow Chart tg Interface Source Code 93 User Mode In User Mode the user needs to edit the Interface Source Code at the following location int fnCrc12 char pszString Write your own code here J So the user needs to add the user code create exe and attach it with NetSim to run The User code which is to be added is given below int fnCrc12 char pszString User code part start char pszParse NULL Parsing Variable char pszFileName NULL To Store the File name that has been Parsed from the string int nErrorOrNoError 0 To Store whether the Error is Required or Not char pszStorePassString NULL To the Passed String Crc12 myCrc Crc12 Class Variable char szOrginalCrc 10 ji A variable to Store the Orginal Crc Value char szFileContent 5500 A variable to Get the File Content char szReceivedCrc 10 A variable to Get CRC in the Receiving Side FILE fp NULL fz A variable to get the File Pointer JJ Allot the memory location and store the passed variable value pszStorePassString char mallocCCCint strlen pszString 2 strcpy pszStorePassString pszString Parse the Passed String pszParse strtok pszStorePassString gt pszFileName char mallocCCCint strlen pszParse 2 strcpy pszFileName pszParse pszPa
66. g type IPV4 11 111 255 255 0 0 3 Set Scheduling Type Priority A Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 17 Configure the Network Sample 7 Follow all the steps as shown in Sample 1 and modify only the Router properties and Wired Link properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to FIFO w ROUTER Properties Interface1_Ethernet rNETWORK_LAYER Network Protocol dJi Router 1 GLOBAL_PROPERTIES APPLICATION_LAYER TRANSPORT_LAYER u NETWORK_LAYER om interface 1_Ethernet gt Interface2_Ethernet gt Interface3_Ethernet IPV4 IP_Address 11 41 11 Subnet_Mask 255 255 0 0 Default_Gateway Buffer size MB 1 Check which Interface is connected to Wired Scheduling type Node G Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties Wired Lin Wired Link 6 Uplink Speed Mbps 0 064 Downlink Speed Mbps 0 064 18 Model Traffic in the Network Sample 7 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Proper
67. gn the Network Devices Required 3 Routers 8 Wired Nodes 36 Network Diagram i a Wired Node A s Wired Node G Wired Node B q Applications 5 EE Wired Node H Wired Node D Wired Node E Note While creating network place the devices according to the Node ID given in diagram above in order to easily understand the settings to be configured as provided in this manual For example Figure shows Wired Node A has Node ID 1 and Wired Node B has Node ID 2 So first place a Wired Node at the location of Wired Node A and then at Wired Node B and so on 2 Configure the Network Sample 1 Wired Node Properties TCP should be enabled in all Wired Nodes Wired Link Properties Right click on Wired Link gt Properties and set the values 37 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties noe _ Properties D 00 250 350 400 Remove Change Icon Event Dynamic fireless WSN Packet k Trace Trace Metrics 300 Sensor Sin 3 Right Click on Application 2 Click anywhere above grid and select Properties 350 200 Application Properties Destination ID 5 Wired Node E Size Bytes 10000000 File Inter Arrival Time Inter Arrival Time 4 Simulate Simulation Time 100 Sec m s e 2 ami
68. ha idi 6 3 Model Traffic in the Network Sample 1 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties Application Properties 1 Wired Node A 4 Wired Node D 1000 4 Simulate Simulation Time 10 Sec After completion of the experiment Save the experiment for future analysis of results 5 Configure the Network Sample 2 Follow all the steps as shown in Sample 1 and modify only the Wired Link properties as shown below OR 67 User can also select the Go back to Network option select the Edit button and modify only the wired link properties as shown below Sjaan Programming Utilities Help OON l FETT Event Dynamic Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties 6 Simulate Simulation Time 10 Sec After completion of the experiment Save the experiment for future analysis of results 7 Configure the Network Sample 3 Follow all the steps as shown in Sample and modify only the Wired Link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties Link 1 Uplink Speed Mbps 60 ic I VV 1 Link 6 o 0 Downlink Speed Mbps 8 Simulate Simulation Time 10 Sec After completion of the exp
69. he principle explained above Calculation and Placement of Check Bits in Hamming Code for the Input data and for the Error data 4 Compare the Check Bits values of the Original Input Data and the Error Data values Keep a note of the Check Bit Position where the value differs 5 Add all the position of the Check Bits where the values differ The resultant value gives the position of the error bit in the Error Data of length m r i e the total length which includes the length of the Input Data Bits and the Check Bits Procedure To begin with the experiment open NetSim Click on Programming from the menu bar and select Error Correcting Code and then select Hamming Code When you select the User mode you have to write your own program in C C compile and link to NetSim software for validation Click on the F1 Help for details on how to proceed with your own code The scenario will be obtained as shown below Follow the steps Step 1 FZ NetSim Programming s Hamming Code Mode oO a Select the Mode Parity Select Oout iii the Parity Input Data Maximum 8 Alphabets Error Position v Data Bits Original w Concept Algorithm Pseudo Code amp Flow Chart amp Interface Source Code 121 Step 2 After that you can type the input in the Textbox and Select the error position which is shown below FZ NetSim Programming Help Hamming Code Mode o Sample
70. he remainder is made to 16 bits 5 If there are successive bits in the data make the previous remainder bit to 17 bits by bringing down the next bit in the data e Convert the final remainder into HEXA equivalent character 1 Divide the final remainder at the end of step 5 4 into blocks of 4 bits 2 Convert each block into equivalent HEXA character 3 Thus the output of this whole process will be a 4 nibble checksum that is attached to the transmitting frame Receiver side e Repeat the Steps 1 to 4 of the Sender side CRC coding and get the szere value for the data e Make some errors in the string szcrc by changing certain characters The error string is stored in the variable szere e Write the Error string szere into the file Input txt The file path for the file Input txt is the path where you have installed the NetSim application Compulsory e Convert the HEXA equivalent string szSender to its binary format This is the Hexadecimal to binary conversion process e Append the binary format of the above step to the szcrc variable Then append 16 Os to the szere variable e Repeat the Steps 5 and 6 of the Sender Side CRC coding to calculate the CRC value for the receiver side 91 Procedure To begin with the experiment open NetSim Click on Programming in the menu bar select Error Detecting Codes and then select Cyclic Redundancy Check The scenario
71. he values 6 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 23 7 Configure the Network Sample 3 Follow all the steps as shown in Sample and modify only the wired link properties as shown below 8 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 9 Configure the Network Sample 4 Follow all the steps as shown in Sample and modify only the wired link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties ired Link 1 Wired Link 2 Uplink Speed Mbps 2 048 10 Downlink Speed Mbps 10 2 048 10 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 11 Configure the Network Sample 5 Follow all the steps as shown in Sample and modify only the wired link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values 24 Link Properties Uplink Speed Mbps 10 10 Downlink Speed Mbps J10 fisa Uplink BER No Error 12 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 13 Configure the Network Sample 6 Follow all the steps as
72. hich 1s to be added is given below int fnHamming QC User code part start 1iMessageLength strlenCszOriginalString Get the Input Length 1CheckCount fnGetCheckbitscount iMessageLength Allocate the Required Memory for Original Hamming String szHammingOriginal malloc iMessageLength i1CheckCount 1 Position the Check Bits into the Original Hamming String szHammingOriginal fnPositionCheckBits iMessageLength iCheckCount 1Paritytype szOriginalString O Allocate the Required Memory for Error Hamming String szHammingError malloc CiMessageLength 1CheckCount 1 Position the Check Bits into the Error Hamming String szHammingError fnPositionCheckBits CiMessageLength iCheckCount 123 1Paritytype szErrorString E Get the error position 1ErrorPosition fnErrorPosition CszHammingOriginal szHammingError strlen szHammingOriginal 1CheckCount User code part end return 1ErrorPosition End of Function fnhammingErrorPosition Note How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC s can practice as explained below First run the exercise in sample mode The user would see that an Input txt file is created in Win OS temp folder this can be reached by typing temp NetSim in Windows run window This input file should be read by the user code and it should generate an Output txt This Output
73. iment 2 5 Inference As explained above in the theory part whenever a collision occurs the contention window size is calculated and a random number is generated With more number of transmitting nodes the contention for the medium increases causing more collisions and more retransmission attempts Hence the average contention window increases From the above graph it can be observed that for each collision the contention window size increases and at any time the maximum contention window size is 1023 2 1 The maximum retry limit for a packet is 16 after which the packet is dropped 79 Experiment 9 To simulate simple ESS and with transmitting nodes in wireless LAN by simulation and determine the performance with respect to transmission of packets Theory Wireless LAN is basically a LAN that transmits data over air without any physical connection between devices The transmission medium is a form of electromagnetic radiation Wireless LAN is ratified by IEEE in the IEEE 802 11 standard In most of the WLAN products on the market based on the IEEE 802 11b technology the transmitter is designed as a Direct Sequence Spread Spectrum Phase Shift Keying DSSS PSK modulator which is capable of handling data rates of up to 11 Mbps The underlying algorithm used in Wireless LAN is known as the CSMA CA Carrier Sense Multiple Access Collision Avoidance algorithm Procedure In NetSim Select Simulation gt New gt
74. iments 5 1 Performance Metrics NetSim provides distinct quantitative metrics at various abstraction levels such as Network Metrics Link Metrics TCP Metrics Application Metrics etc at the end of simulation With the help of metrics users can analyze the behavior of the modeled network and can compare the impact of different algorithms on end to end behavior After simulation of a scenario is performed the NetSim Performance Metrics are shown on the screen as shown below fe _ Performance Metrics Network Metrics Link Metrics Queue Metrics J TCP Metrics Metric Value IP Metrics mult i IP Forwarding Table Simulation Time ms 10000 0C OSPF Metrics ket tted 4 ARP Metrics Packets Transmitte 2026 ARP TABLE ket d Application Metrics Packets Errore 11 Packets Collided 0 Bytes Transmitted Bytes 1608172 Payload Transmitted Bytes 1464380 Overhead Transmitted Bytes 143792 The Performance metrics can be further subdivided into sections Network metrics Here users can view the values of the metrics obtained based on the overall network Link Metrics Displays the values of the metrics pertaining to each link like Link_Id Packets_ Transmitted Error_Packets Collided_ Packets Bytes_Transmitted Payload_Transmitted Overhead_Transmitted 14 Queue Metrics Displays the values of the queue metrics for the devices containing buffer queue like routers access points etc Protocol metrics D
75. in correct order since there is a chance of out of order reception Therefore in TCP no transmission errors will affect the correct delivery of data UDP UDP uses a simple transmission model with a minimum of protocol mechanism It has no handshaking dialogues and thus exposes any unreliability of the underlying network protocol to the user s program As this is normally IP over unreliable media there is no guarantee of delivery ordering or duplicate protection Procedure In NetSim Select Simulation gt New gt Internetworks 28 1 Create Design the Network Devices Required Router 3 Wired Nodes Network Diagram Wired Node C Wired Node D Note While creating network first place the Router Then place Wired Node B C and D as shown here Connect Wired Node B with Router first Then connect Wired Node C and Wired Node D with Router 2 Configure the Network Sample 1 Wired Node Properties Disable TCP in Wired Node B Right Click Wired Node B Properties zA WIREDNODE Properties dL Wired Node 2 GLOBAL_PROPERTIES ER RANSPORT_LAYER 5 i J VUL JR z TEL i Interface 1_Ethernet 1 Select Transport Layer Disable UDP in Wired Node C Right Click Wired Node C Properties 2S TRANSPORT_LAYER re 2 Deselect Protocol Checkbox MSS bytes 1460 Congestion_Control_Algo OLD_TAHOE Oo Window _Size
76. ing on the dropdown menu User should select Packets Errored 63 Comparison Chart Graph I Error Rate Vs Packets Errored Select the Metric Packets Errored E a p pus o pret lu wi 9 wu 0 ao Metri Metri Metri Metri Metri cs tet cs tet cs tet cs tet cs tet Experiment Name Go to Simulation gt Open gt Metrics menu to open the results of saved experiments a Simulation Programming Utilities Help New gt Open Network Delete Analytics Legacy Network Legacy Metrics Click on Browse and select the Metrics txt file present with the saved experiment you want to open Lookin J Experiment M ea Recent Items L SpanningTree File name Metrics txt j i i My D ts Files of type Ft Open the Metrics txt file of the first saved sample and note down the Throughput value available under Application Metrics in an Excel file Similarly please follow the same steps for all the saved samples and note down the throughput values and create graph in Excel as shown below 64 Graph II Error Rate Vs Throughput Error Rate vs Throughput O gt U 5 or S 2 4 55 O Yd lt lt H No Error 10 8 Error Rate NOTE The procedure to create graph is same as provided in Experiment 2 Part B To simulate an Ethernet LAN using n nodes 6 10 change data rate and compare throughput Theory Data
77. io will be obtained as shown below Follow the steps 126 FZ NetSim Programming Leaky Bucket Algorithm Mode oO Sampte Select Mode Input Input Rate Enter Output Capacity Packets Seconds 100 Enter Size of Buffer Number of Packets 100 Enter Input Capacity Packets Seconds Seconds Input Capacity 100 to 1000 100 Time Seconds 7 8 9 10 Give Output capacity Give Buffer capacity Give Input capacity Click run to execute ae Click here to Concept Algorithm and Pseudo Code amp Flow Chart W Concept Algorithm Pseudo Code amp Flow Cha 7 Interface Source Code Click here to Interface Source Code Results KZ NetSim Programming gt Help Leaky Bucket Algorithm Input Input Rate Enter Output Capacity Packets Seconds Enter Size of Buffer Number of Packets Enter Input Capacity Packets Seconds Seconds Input Capacity 100 to 1000 Time Seconds Output and Discard Rate 2 Concept Algorithm Pseudo Code amp Flow Chart Output Q Interface Source Code Input packet rate E Output packet rate E Discard packet rate 127 User Mode In User Mode the user needs to edit the Interface Source Code at the following location void fnLBAC Write your own code here J So the user needs to add the user code create exe and attach it with Net
78. ion gt Open gt Metrics menu to open the results of saved experiments a Simulation Programming Utilities Help New Open 1 Network Delete Analytics Legacy Network Legacy Metrics to open L Select the path to open Metrics fil Look in reo el cg Recent Items Desktop File name Metrics txt Files of type txt j My Documents 41 Open the Metrics txt file of the first saved sample and note down the Throughput values available under Application metrics in the metrics screen of NetSim in an Excel file Similarly please follow the same steps for all the saved samples and note down the Throughput values It will be as shown below i Pan T Yat 4 mxperment bDurce Vestination A pplication Throughpt 0 824842 0 672768 Number Wired Node D Wired Node E Wired Node D Wired Node E Wired Node A Wired Node F TELNET 0 255091 Wired Node D Wired Node E 0 562158 Wired Node A Wired Node F TELNET 0 187814 Wired Node B Wired Node G TELNET 0 193654 Wired Node D Wired Node E 0 487990 Wired Node A Wired Node F TELNET 0 149154 Wired Node B Wired Node G TELNET 0 146467 Wired Node C Wired Node H TELNET 0 156862 Graph I FTP Throughput ON 5 U 03 o A 0 2 a 0 1 O 1FTP 1Telnet 1FTP 2Telnet 1FTP 3Telnet Experiments Graph IT TELNET Throughput of Wired Node 1 oO oO p
79. is deleted from the queue If the acknowledgment is not received before the timer runs out the segment is retransmitted So even though a packet gets errored or dropped that packet will be retransmitted in TCP but UDP will not retransmit such packets As per the theory given and the explanation provided in the above paragraph we see in Graph 2 that there is no packet loss in TCP but UDP has packet loss 35 Experiment 4 Simulate the different types of internet traffic such as FTP TELNET over a network and analyze the throughput Theory FTP is File Transfer Protocol that transfers the files from source to destination It is an application layer protocol The file transfer takes place over TCP TELNET is Terminal Network Protocol that is used to access the data in the remote machine It is also an Application layer protocol It establishes connection to the remote machine over TCP FTP Database Voice HTTP Email Peer to Peer and Video are the traffic types available as options in NetSim To model other applications the Custom option is available TELNET application has been modeled in NetSim by using custom traffic type Packet Size and Packet Inter Arrival Time for TELNET application is shown below Distribution Constant Packet Size Bytes 1460 Distribution Constant Packet Inter Arrival Time us 15000 Procedure In NetSim Select Simulation gt New gt Internetworks 1 Create Desi
80. isesasuninbeseueann 36 Experiment 5 Simulate the transmission of ping messages over a network topology consisting of 6 nodes and find the number of packets dropped due to CONBESTION ccceeeeeeee wees 44 Experiment 6 Simulate an Ethernet LAN using n nodes 6 10 change error rate and data rate and compare throughput eessssssessssresesrrressrrresrresssrerossrrsssreressreessreresererssreresererssrereserersseere 58 Experiment 7 To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and determine collision across different nodes ssessesesssseserressrrserrrsrressrresrteserensrrrerteserresrresrerserreens 71 Experiment 8 To Simulate an Ethernet LAN using n nodes and set multiple traffic nodes and plot contention window for different source destination ssssssssssssssrsrrrseesssrrrrreeessrrrerrseessse 75 Experiment 9 To simulate simple ESS and with transmitting nodes in wireless LAN by simulation and determine the performance with respect to transmission of packets csccceeeeee 80 Experiment 10 Cyclic Redundancy Check Write a program for error detecting code using CRC CCITT 16 bits Note CRC 12 CRC 16 and CRC 32 are also available in NetSim 008 88 Experiment 11 Sorting Bubble Sort Write a program for frame sorting technique used Dae E A E 97 Experiment 12 Distance Vector Routing Implementation of distance vector routing EONA r A T ssuseues doouunearens
81. isplays the protocol based metrics which are implemented in Network scenario Metrics will vary depending upon the type of network simulated Device metrics Displays device related metrics like ARP table IP forwarding tables This is also dependent upon the type of network Application Metrics Displays the various metrics based on the Application running in the network scenario 5 2 Packet Animation NetSim provides the feature to play and record animations to the user Packet animation enables users to watch traffic flow through the network for in depth visualization and analysis User has the following options before running simulation e Record the animation e Play and record animation while running simulation e No animation Simulation Configuration IP and ARP Configuration Simulation Time To see Packet Animation after Simulation Simulation Time 0 to 100000 s 10 Packet Animation To see Pa cket An i m atio n d u ri ng Si mu latio n Record animation Simulation will slow down marginally Play amp record animation Simulation will slow down significantly C Don t play record animation Simulation will run fast To disable Packet Animation ee Used to generate random numbers in simulation Enter any value between 1 to 99999999 Seed 1 12345678 Seed 2 23456789 Cancel The packet animation would then be recorded and the user can view the animation from the metrics screen as shown below 15 A
82. lained below First run the exercise in sample mode The user would see that an Input txt file 1s created in Win OS temp folder this can be reached by typing temp NetSim in Windows run window This input file should be read by the user code and it should generate an Output txt This Output txt file 1s read by NetSim and shown graphically to the user User can follow the steps provided in Appendix 1 Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code The Output txt file will vary based on the Data_file In this case the size of Data_File file is 11 264 bytes For TCP For UDP Input txt file contents at Server system Input txt file contents at Server system Protocol TCP Protocol UDP Operation Server Operation Server Input txt file contents at Client system Input txt file contents at Client system Protocol TCP Protocol UDP Operation Client Operation Client Destination IP Address 192 168 0 130 Destination IP Address 192 168 0 130 192 168 0 147 Hello World 192 168 0 147 Hello World Output txt file contents at Server system Output txt file contents at Server system Socket Created Socket Created Bind Succeed Bind Succeed Listen Succeed 115 Experiment 14 RSA Write a program for simple RSA algorithm to encrypt and decrypt the data Theory The Application Layer takes care of network security Dif
83. logos people places and events depicted herein are fictitious and no association with any real company organization product domain name email address logo person place or event is intended or should be inferred Rev 8 3 10 V July 2015 VTU_Karnataka TETCOS All rights reserved All trademarks are property of their respective owner Contact us at TETCOS 214 39th A Cross 7th Main 5th Block Jayanagar T Bangalore 560 041 Karnataka INDIA Phone 91 80 26630624 ETC i S E Mail sales tetcos com Visit www tetcos com Contents Experiment 1 Introduction to NetSim network simulator amp procedure of working in it 066 5 Experiment 2 Simulate a three nodes point to point network with duplex links between them Set the queue size and vary the bandwidth and find the number of packets OPP E E E onencaecemienseneecate 20 Experiment 3 Simulate a three node point to point network with the links connected as follows n0 gt n2 n1 gt n2 and n2 gt n3 Apply TCP agent between n0 n3 and UDP between n1 n3 Apply relevant applications over TCP and UDP agents changing the parameter and determine the number of packets sent by TCP UDP nO n1 and n3 are nodes and TN WS OU OI Jesis E E T i 28 Experiment 4 Simulate the different types of internet traffic such as FTP TELNET over a networkand analyze the throughput cessssissesacuitaneaanracosacntecesacuzecnasttocsnaasuasnnecteaunanceteannesatu
84. n Properties 2500 4 Simulate Sample 1 Go to IP and ARP configuration and disable static ARP 1 Click on Run Simulation 60 Z NetSim L Static ARP Static ARP File Path Static IP forwarding Static IP Forwarding File Path Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 5 Configure the Network Sample 2 Follow all the steps as shown in Sample 1 and modify only the Wired Link properties as shown below OR User can also select the Go back to Network option select the Edit button and modify only the wired link properties as shown below jon Programming Utilities Help r Sugg pe farrmanrce l a Faas a Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties hap Uplink Speed Mbps Downlink Speed Mbps w o Uplink BER 61 6 Simulate Go to IP and ARP configuration and disable static ARP Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 7 Configure the Network Sample 3 Follow all the steps as shown in Sample and modify only the Wired Link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values j l Link Properties EEE ile i LHIK 4 LIK 2 pee i lI K 4 10 Downlink Speed Mbp
85. nalytics Go to NetSim Analytics Click here to view packet animation Edit and Re run Metrics Help On clicking packet animation a screen with the following toolbar appears 20821 60 Micro sec Animation Speed ee While viewing packet animation user can see the flow of packets as well as the type of packet Blue color packet denotes control packet green color is used for data packet and red color is error collided packet Example showing packet animation In first figure Custom data packet is flowing from Switch F to Node G green color and TCP_ACK is sent from Node G to Switch F in second figure blue color Switch B Switch F Switch F Wired Node A Wired Nede G 16 5 3 Analytics Menu for multiple experiments Go to Simulation gt Analytics to view the Analytics screen This module is designed to enable comparison of performance metrics of multiple experiments The metrics that can be compared are Simulation Time Packets Transmitted Packets Errored Packets Collided Bytes Transmitted Payload Transmitted and Overhead Transmitted Please note that other metrics cannot be directly compared in the analytics menu and an tool like Excel is recommended In Tool Bar Click on the particular Network tab Ex Internetworks LTE Networks etc for comparing the performance of protocols under that Network gt For Internetworks Advanced Wireless Networks MANET BGP Networks Wireless Sensor Net
86. nce Vector Routing is one of the routing algorithms used in a Wide Area Network for computing shortest path between source and destination The router is one of the main devices used in a wide area network The main task of the router is routing It forms the routing table and delivers the packets depending upon the routes in the table either directly or via an intermediate device perhaps another router Each router initially has information about its all neighbors 1 e it is directly connected After a period of time each router exchanges its routing table among its neighbors After certain number of exchanges all routers will have the full routing information about the area of the network After each table exchange router re computes the shortest path between the routers The algorithm used for this routing is called Distance Vector Routing Algorithm Repeat the following steps until there is no change in the routing table for all routers e Take the Next Router routing table and its neighbor routing table e Add the router entry that is not in your own routing table but exists in any one of the other routing tables If the new router entry exists in more than one neighbor then find the minimum cost among them The minimum cost value details are taken as a new entry such as source router intermediate router destination router and cost value etc e Update the source router routing table cost value if both the destination router
87. niques and then select Bubble The scenario will be obtained as shown below Follow the steps Step 1 Select the User mode to write your own program in C C compile and link to NetSim software for validation Click on the F1 Help for details on how to proceed with your own code The scenario will be obtained as shown below Follow the steps FZ NetSim Programming Help KA Sorting Techniques Select Mode Sorting Type SS h_h Select Type Insertion Quick Sorting Order Select Or der rr Select the value for how many Data Inputs numbers to be sort Total Number to be Sorted 3 Number lt 1 gt Value 1 to 9999 lh ee ee Give the value gt qt __ After give the value click Add Click run to execute Action Click here to view concept Help algorithm pseudo Code amp flow 1 Concept Algorithm Pseudo Code amp ar chart rs Click here to interface source code 98 Results FZ NetSim Programming Help KA Sorting Techniques Bubble Sort with Ascending Order 500 1000 2000 Sorting Order Ascending Data Inputs Number of Comparison Total Number to be Sorted Number of Swapping Number lt 4 gt Value 1 to 9999 Bubble Sort Sequence Value 1 Value 2 Value 3 Value 4 Concept Algorithm Pseudo Code amp Flow Chart 2 Interface Source Code User Mode In User Mode the user n
88. odel Traffic in the Network Sample 3 Follow all the steps as shown in Sample and modify only the Application properties as shown below 32 Application Properties Create 2 Application and set the values as shown below Application Type Custom 2 Wired Node B 3 Wired Node C A Wired Node D 4 Wired Node D Distribution Constant Value Bytes 1460 1460 inter i Value us 2500 2500 8 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 9 Analysis of Result Go to Simulation gt Open gt Metrics menu to open the results of saved experiments Click on Browse and select the Metrics txt file present with the saved experiment you want to open Look in jy Experiment a B gt a File name Metrics txt if My Documents Files of type txt 33 Open the Metrics txt file and note the Number of Simulation Programming Utilit Segments Sent Segments Received available in the Connection Metrics under TCP Metrics and J Performance Metrics gt Network Metrics i ink Metrics Datagram Sent Datagram Received available in the pennies Eb J TCP Meig UDP Metrics of Performance Metrics screen of os NetSim in an Excel file Do the same procedure for cae Ce UDP Metrics the rest 5 samples ce I OSPF Metrics H ARP Metrics NOTE To create Graph in E
89. ponse In the process it measures the time from transmission to reception round trip time and records any packet loss Congestion occurs when the amount of incoming traffic is more than what the network can handle In such cases routers store these packets in the buffer All the packets that arrive after the buffer is filled are dropped Several traffic types available as options in NetSim are database voice video FTP E mail HTTP and peer to peer To model other applications the Custom option is available Ping application has been modeled in NetSim by using custom traffic type Packet Size and Packet Inter Arrival Time for Ping application is shown below Distribution Packet Size Bytes Packet Inter Arrival Time ji Distribution Constant Packet Inter Arrival Time us 100000 Procedure In NetSim Select Simulation gt New gt Internetworks 44 1 Create Design the Network Devices Required Router 6 Wired Nodes Network Diagram Note While creating network place the devices according to the Node ID given in diagram below in order to easily understand the settings to be configured as provided in this manual For example Figure shows Wired Node A has Node ID and Wired Node B has Node ID 2 So first place a Wired Node at the location of Wired Node A and then at Wired Node B and so on Wired Node D Application3 VOICE Application VORTEM pplication4 VOICE Dc
90. r Sense Multiple Access Collision Detection CSMA CD Working of the truncated binary back off algorithm In Ethernet networks the CSMA CD is commonly used to schedule retransmissions after collisions The retransmission is delayed by an amount of time derived from the slot time and the number of attempts to retransmit After c collisions a random number of slot times between 0 and 2 1 is chosen For the first collision each sender will wait O or 1 slot times After the second collision the senders will wait anywhere from O to 3 slot times inclusive After the third collision the senders will wait anywhere from O to 7 slot times inclusive and so forth As the number of retransmission attempts increases the number of possibilities for delay increases exponentially The truncated simply means that after a certain number of increases the exponentiation stops 1 e the retransmission timeout reaches a ceiling and thereafter does not increase any further For example if the ceiling is set atz 10 as it is in the IEEE 802 3 CSMA CD standard then the maximum delay is 1023 slot times Because these delays cause other stations that are sending to collide as well there is a possibility that on a busy network hundreds of people may be caught in a single collision set Because of this possibility after 16 attempts at transmission the process is aborted Procedure In NetSim Select Simulation gt New gt Legac
91. riment for future analysis of results 22 Configure the Network Sample 9 Follow all the steps as shown in Sample and modify only the Router properties and Wired Link properties as shown below Router Properties Right click on Router Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to FIFO s ian ya ROUTER Properties e e xo Ji Router 1 Interface 1_Ethernet a ve GLOBAL_PROPERTIES r NETWORK_LAYER ell p APPLICATION_LAYER Network Protocol IPV4 ri H TRANSPORT_LAYER 3 NETWORK _LAYER IP_Address TEELLA oO gt Interface 1_Ethernet Subnet Mask 355 755 0 0 A gt Interface2 Ethernet Interface3_Ethernet Default_Gateway 2 Set Buffer Size 8 Buffer size MB 8 1 Check which 2e Yi Scheduling type FIFO SAT ij Interface is connected 3 Set Scheduling Type FIFO to Wired Node G 54 Wired Link Properties Right click on Wired Link gt Properties and set the values Wired Lin Link Properties Wired Link 6 Uplink Speed Mbps Downlink Speed Mbps Uplink BER Downlink BER 23 Model Traffic in the Network Sample 9 Select the Application Button and click on the gap between the Grid Environment and the ribbon Now right click on Application and select Properties Application Properties Voice Voice Voice Application Type Voice Voice Custom Source ID Destination ID 6 Wired Node F
92. rite a program for congestion control using leaky bucket algorithm Theory l This is a type of traffic shaping algorithm Traffic shaping allows control of the traffic in the network to improve performance of the network An application before transmitting agrees upon a peak cell rate This algorithm will not allow packets more than the agreed peak cell rate This algorithm will also avoid burst of data arrival which could lead to congestion One of the major reasons for congestion is the burst kind of data arrival in the network This algorithm is used to avoid the burst traffic Burst input data is stored in a buffer and output at a constant rate If the input rate is larger than the output rate and the buffer is full the extra data is discarded and not transmitted Algorithm l 2 Read data Input txt file which has the required data Parse the content of the file from which you get the input rate for each second buffer size output rate per second and store in separate variables Follow the steps outlined below for time starting from 0 to 10 If input rate is larger than the output rate less the output rate store the rate of packet output for the corresponding second and for the remaining input packets check for buffer availability If the buffer value is larger than or equal to the remaining input packets store the remaining packets in the buffer Else if the buffer capacity is lesser then
93. rotocol performance analysis e Application modelling and analysis e Network design and planning e Research and development of new networking technologies e Test and verification e What is simulation A simulation is the imitation of the operation of a real world process or system over time Network simulation is a technique where a program models the behavior of a network either by calculating the interaction between the different network entities hosts routers data links packets etc using mathematical formulae or actually capturing and playing back observations from a production network The key features essential to any network simulation are e Building the model Create a network scenario with devices links applications etc e Running the simulation Run the discrete event simulation DES and log different performance metrics e Visualizing the simulation Use a packet animator to view the flow of packets e Analyzing the results Examine output performance metrics such as throughput delay loss etc at multiple levels network sub network link queue application etc e Developing your own protocol algorithm Extend existing algorithms by modifying the simulators source C code What does NetSim provide Simulation NetSim provides simulation of various protocols working in various networks as follows Internetworks Legacy Networks BGP Networks MPLS Networks Advanced Wireless Networks Cellular Networks
94. rray_BS nLoop2_BS nArray_BS nLoop2_BS 1 nArray_BS nLoop2_BS 1 nTemp_BS 1NoOfExch end of inner FOR LOOP if CiNoOFExch 0 break end of outer FOR LOOP Ffclose fp_BS User code part end end of bubble function Note How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC s can practice as explained below First run the exercise in sample mode The user would see that an Input txt file 1s created in Win OS temp folder this can be reached by typing temp NetSim in Windows run 100 window This input file should be read by the user code and it should generate an Output txt This Output txt file 1s read by NetSim and shown graphically to the user User can follow the steps provided in Appendix Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code The Output txt file will vary based on the Data_file In this case the size of Data_File file is 11 264 bytes Input txt file contents Sorting _Type Bubble Sorting _Order Ascending Total_ Number 3 Number_to_Sort 258 996 12 Output txt file contents 1 gt 0 gt 1 gt 1 gt 1 gt 2 gt 2 gt 1 gt 2 gt 1 gt 0 gt 1 gt 2 gt 0 gt 1 gt 101 Experiment 12 Distance Vector Routing Implementation of distance vector routing algorithm Theory Dista
95. rse strtok NULL gt nErrorOrNoError atoi pszParse ae Read the Content of the file strcpy szFileContent fnReadFile_Crcl2 pszFi leName fi Get the Origianal Crc for the data read from the file strcpy szOrginalCrc getCrcl2 szFileContent if CnErrorOrNoError 1 No Error case for the Coding else ei Error case for the Coding Strcpy szFileContent fnMakeError_Crc12 szFileContent J 94 Fi Get the Received Crc for the string strcpy szReceivedCrc getCrc12 szF1ileContent szOrginalCrc Make the Output to the Output file strcpyCszPath_Crcl12 szPathl1_Crcl2 ifndef NETSIMDLL strcatCszPath_Crcl12 Output txt else strcatCszPath_Crcl12 Temp txt endi f yy Open the File for Writing szOutput_path_Crcl2 char malloc 200 sizeof char strcpy szOutput_path_Crc12 szTempPath_Crcl12 1fndef _NETSIMDLL strcatCszOutput_path_Crecl2 Output txt else strcatCszOutput_path_Crcl12 Temp txt endi f fo fopen szOutput_path_Crcl12 w forintf fp s n s n szOrginalCrc szReceivedCrc fclose fp delete pszStorePassString delete pszFileName free pszStorePassString free pszFi leName User code part end return 1 Note How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC s can practice as explained below First run the exercise in sample mode
96. s 10 i0 fio fo 0 0 Uplink BER 8 Simulate Go to IP and ARP configuration and disable static ARP Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 9 Configure the Network Sample 4 Follow all the steps as shown in Sample 1 and modify only the Wired Link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values 10 Simulate Go to IP and ARP configuration and disable static ARP Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 11 Configure the Network Sample 5 Follow all the steps as shown in Sample 1 and modify only the Wired Link properties as Shown below Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties tig ee A w wo fo fo Downlink Speed Mbps 12 Simulate Go to IP and ARP configuration and disable static ARP Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 13 Analysis of Result Go to NetSim Analytics Simulation gt Analytics 1 Click Browse button gt select the Metrics txt File inside the first saved experiment folder 2 Add the remaining 5 sample experiments by repeating the above step 3 Select the Metrics Select the coordinates for Y axis by click
97. saP 1 nKp 7 nKS W N Il cChr szStr 0 To get the Integer Equivalent Position of the Alphabets Jf Ael al Bets Da2 Ces Get win ccic nChr cChr if CCnChr gt 65 amp amp CnChr lt 90 nChr nChr 64 else if CCnChr gt 97 amp amp CnChr lt 122 nChr nChr 96 1CypTxt fmodCClong double pow CnChr nKs Clong double nNVal 1PInTxt fmodCClong double pow CICypTxt nKp Clong double nNVal User code part end Note How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC s can practice as explained below First run the exercise in sample mode The user would see that an Input txt file is created in Win OS temp folder this can be reached by typing temp NetSim in Windows run window This input file should be read by the user code and it should generate an Output txt This Output txt file 1s read by NetSim and shown graphically to the user User can follow the steps provided in Appendix 1 Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code The Output txt file will vary based on the Data_file In this case the size of Data_File file is 11 264 bytes Input txt file contents Plain _Text N Output txt file contents 11 gt 3 gt 33 gt 20 gt 7 gt 3 gt 5 gt 14 gt 119 Experiment 15 Hamming
98. shown in Sample 1 and modify only the wired link properties as shown below Wired Link Properties Right click on Wired Link gt Properties and set the values Link Properties Wired Link 1 Wired Link 2 Uplink Speed Mbps 0 064 Downlink Speed Mbps 0 064 14 Simulate Simulation Time 100 Sec After completion of the simulation Save the experiment for future analysis of results 15 Analysis of Result Go to Simulation gt Open gt Metrics menu to open the results of saved experiments Legacy Network Legacy Metrics Click on Browse and select the Metrics txt file present with the saved experiment you want to open Lookin Experiment vy P E Ge File name Metrics txt Files of type txt My Documents Open the Metrics txt file of the first saved sample and note down the Dropped Packet values of Port Id 2 available under Queue Metrics in an Excel file Simulation Programming Utilities Help ef Performance Metrics Q 2 Performance Metrics Qu eue Metrics Port Id Queued Packet Dequeued Packet Dropped Packet cp IP Forwarding Table UDP Metrics J OSPF Metrics be ARP Metrics Similarly please follow the same steps for all the saved experiments and note down the Dropped Packets values and Wired Link 2 speed of that sample It will be as shown below q Ws AEA M D gt ci f ple 26 NOTE To create Graph in Excel 2010
99. store up to the capacity of the buffer and discard the rest of the packets Increment timer 125 6 If the input rate is equal to the output rate no packet is stored in the buffer Store the output rate discard packet as zero for the corresponding second Increment timer 7 If the input rate is less than the output rate no packet is stored in the buffer Store the input rate as output rate discard packet as zero for the corresponding second Increment timer 8 Follow the steps outlined below until buffer capacity is zero 9 If the buffer value is non zero reduce the buffer capacity by the output rate if the buffer value is more than the output rate Store the output rate discard packet as zero for the corresponding second Increment timer 10 If the buffer value is non zero reduce the buffer capacity to O if the buffer value is less than or equal to the output rate Store the buffer capacity discard the packet as zero for the corresponding second Increment timer 11 Store the total time value 12 Write the required values to the output file Output txt Procedure To begin with the experiment open NetSim Click on Programming from the menu bar and select Leaky Bucket Algorithm When you select the User mode you have to write your own program in C C compile and link to NetSim software for validation Click on the F1 Help for details on how to proceed with your own code The scenar
100. t 6 2 gt 2 gt 5 gt 1 gt 0 2 gt 2 gt 6 gt 1 gt 0 2 gt 3 gt 1 gt 2 gt 2 2 gt 3 gt 2 gt 1 gt 0 2 gt 3 gt 4 gt 1 gt 0 2 gt 3 gt 5 gt 2 gt 2 2 gt 3 gt 6 gt 2 gt 4 2 gt 4 gt 1 gt 3 gt 6 2 gt 4 gt 2 gt 2 gt 6 2 gt 4 gt 3 gt 1 gt 0 2 gt 4 gt 5 gt 3 gt 6 2 gt 4 gt 6 gt 1 gt 0 2 gt 5 gt 1 gt 2 gt 2 2 gt 5 gt 2 gt 1 gt 0 2 gt 5 gt 3 gt 2 gt 2 2 gt 5 gt 4 gt 3 gt 2 2 gt 5 gt 6 gt 2 gt 2 2 gt 6 gt 1 gt 2 gt 2 2 gt 6 gt 2 gt 1 gt 0 2 gt 6 gt 3 gt 2 gt 4 2 gt 6 gt 4 gt 1 gt 0 2 gt 6 gt 5 gt 2 gt 2 107 Experiment 13 TCP IP Sockets Write Using TCP IP sockets write a client server program to make the client send the file name and to make the server send back the contents of the requested file if present Theory The socket is a fundamental concept to the operation of TCP IP application software It is also an interface between the application and the network The exchange of data between a pair of devices consists of a series of messages sent from a socket on one device to a socket on other Once the socket is configured the application can send the data using sockets for network transmission and receive the data using sockets from the other host A socket communication can be connection oriented TCP sockets or connectionless UDP sockets There is a receiver TCP server which listens to the sender TCP client communications There can be two way communication Algorithm e Create a socket using address family AF_INET
101. ta to the Server e The Client should click on the Close button to terminate the Connection with Server e If the Data is successfully transmitted then the Sent Data would be Received in the Server System KZ NetSim Programming Help Enter Destination Destination IP Address pese aj IP Address oes Enter data to Enter Data to be transmitted Hi How Are You j be transmitted Click send button to send the message 111 Results FZ NetSim Programming Programming Basics Utilities Help Sample Operation Server Client Local IP Address Received CED data Received Data Help 192 168 0 10 Hi How Are You B Concept Algorithm Pseudo Code amp Flow Chart ka Interface Source Code Note If using Dev C IDE go to Tools gt compiler options and add lws2_32 as follows before executing Compiler Options ma Compiler Settings Directories Programs Defaut compiler a A F Add the following commands when calling compiler pS I Add these commands to the linker command line C lws2_32 gt Dama set to configure a Enables a delay in milliseconds if make complains Compile Delay 0 X about the makefiles time stamp Makefile generation MV Use fast but imperfect dependency generation f Default X Cancel Help 112 User Mode In User Mode the user ne
102. tfd szData sizeof szData 0 fnWriteOutputQ nSendbytes Cint send nNewsocketfd pszBuffer strlen pszBuffer 0 1F nTCPServerCloseFlag 1 break the loop when user send close the connection break endif closesocket nSocketfd User code part end return 0 J The User code which is to be added for UDP is given below int fnUdpServer User code part start nSocketfd int socket AF_INET SOCK_DGRAM 0 Server side socket creation serv_addr sin_family AF_INET serv_addr sin_addr s_addr hton CINADDR_ANY serv_addr sin_port htonsCSERVER_PORTNUMBER Server port number 6000 nServerLen sizeof serv_addr nBindfd bind nSocketfd struct sockaddr amp serv_addr sizeof serv_addr FnWriteOutputQ 1fndef NETSIM_SAMPLE memset szData 0 sizeof szData Clear the array nReceivedbytes recvfrom nSocketfd szData sizeof szData 0O Cstruct sockaddr amp serv_addr amp nServerLen fnWriteOutputQ else whi le 1 memset szData 0 sizeof szData Clear the array nReceivedbytes recvfrom nSocketfd szData sizeof szData 0O Cstruct sockaddr amp serv_addr amp nServerLen fnWriteOutputQ endif closesocket nSocketfd 114 User code part end return 0 J Note How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC s can practice as exp
103. the cost ID is 1 or not 1f Table nRouterTable nCostID nDestID gt Table nNeighbour nCostID nDestID IV if This loop is to find the least cost path Table nRouterTable nDestID nDestID nDestID Table nRouterTable nNextHop nDestID nNeighbour Table nRouterTable nCostID nDestID Table nNeighbour nCostID nDestID 1 end IV if end else if end II if end IV for end I if end III for end II for nStage fnDisplay CnStage whi le nStage lt 2 User code part end J Note How to practice this experiment without using NetSim Users who do not have a licensed version of NetSim in their PC s can practice as explained below First run the exercise in sample mode The user would see that an Input txt file is created in Win OS temp folder this can be reached by typing temp NetSim in Windows run 105 window This input file should be read by the user code and it should generate an Output txt This Output txt file 1s read by NetSim and shown graphically to the user User can follow the steps provided in Appendix 1 Programming exercise How to practice without NetSim Given below are sample Input txt and Output txt files for this experiment for users to verify amp validate their code Input txt file contents Router_ID 1 gt Router_Name Router_1 gt No_Of_Neighbour 1 gt Neighbours_ID 2 Router_ID 2 gt Router_Name Router_2 gt No_Of_Neighbour 4 gt Neighbours_ID 1 gt
104. ties Application Properties Source ID 5 Wired 4 Wired 3 Wired 2 Wired 2 Wired Node E Node D Node C Node B Node B Destination ID 7 Wired 7 Wired 7 Wired 7 Wired 7 Wired Node G Node G Node G Node G Node G Coie wem son Cason Coxon Packet Size Pacl Arrival Tim Packet Inter 10000 10000 10000 10000 100000 Arrival Time ps 19 Simulate Simulation Time 100 Sec After completion of the experiment Save the experiment for future analysis of results 53 20 Configure the Network Sample 8 Follow all the steps as shown in Sample 7 and modify only the Router properties as shown below Router Properties Right click on Router gt Properties Set buffer size to 8 MB Set scheduling type of interface connected to Wired Node G to Priority 3 a ROUTER Properties eo oe z X Ji Router 1 Interface1_Ethernet FA H GLOBAL_PROPERTIES r NETWORK_LAYER ve APPLICATION_LAYER Network Protocol IPV4 Oo H TRANSPORT_LAYER 3 NETWORK LAYER IP_Address 11 1 1 1 J E gt Interface 1_Ethernet Subnet_Mask 355 255 0 0 A EE gt Interface2_Ethernet J Interface3_Ethernet Default_Gateway 2 Set Buffer Size 8 Buffer size MB 8 a a ii Check which SS i Scheduling type FIFO f Interface is connected l a to Wired Node G 3 Set Scheduling Type Priority 21 Simulate Simulation Time 100 Sec After completion of the experiment Save the expe
105. type SOCK_STREM and protocol TCP e Initialize the address family port no and IP address to communicate using sockets e Bind a local address and port number with a socket e Listen for an incoming socket connection e Accept an incoming connection attempt on a socket e Receive an incoming message e Write that incoming message to Output txt e Send ACK to received socket 108 e Call step 5 to receive the message once again e Close file e Close socket Procedure To begin with the experiment open NetSim Click on Programming from the menu bar and select PC to PC Communication and then select Socket Programming When you select the User mode you have to write your own program in C C compile and link to NetSim software for validation Click on the F1 Help for details on how to proceed with your own code The scenario will be obtained as shown below Follow the steps FZ NetSim Programming Help KA Pc to Pc Communication Socket Programming Mode o m al Select Mode Protocol asa Select Protocol Operation Select Operation Server Waiting for the connection Click Run to start Click here to view Concept Algorithm and Pseudo Code amp Flowchart Click here to interface source e Under Input there are two things 1 When Operation is Client then the Server s IP Address Ex 192 168 1 2 should be given in the Server IP Address field 109 2 When Operation is Ser
106. ver then the Server s IP Address Ex 192 168 1 2 would be automatically filled in the Local IP Address field If the Operation is Server the scenario will be obtained as shown below FZ NetSim Programming Help A Pc to Pc Communication Socket Programming Protocol Server Side TCP Operation Server Server Waiting for the connection Local IP Address If the Operation is Client the scenario will be obtained as shown below FZ NetSim Programming gt Help Pc to Pc Communication Socket Programming Operation Server Client Destination IP Address hoz 168 0 118 Enter Data to be transmitted Requesting for the connection v Press Connect button to make connection with the server 110 TCP e First the Server should click on the Run button after which the Client should click on the Run button to Create the socket e Client should click on the Connect button to establish the connection with server e The Client should click on the Send button to transmit the data to the Server e The Client should click on the Close button to terminate the Connection with Server e If the Data is successfully transmitted then the Sent Data would be Received in the Server System UDP First the Server should click on the Run button after which the Client should click on the Run button to Create the socket e The Client should click on the Send button to transmit the da
107. will be obtained as shown below Follow the steps Step 1 Select the User mode to write your own program in C C compile and link to NetSim software for validation Click on the F1 Help for details on how to proceed with your own code The scenario will be obtained as shown below Follow the steps i NetSim Programming KA Error Detecting Codes Cyclic Redundancy Check Mode gpl ice Algorithm O CRC 12 O CRC 16 O crc 32 0 OS aK AA _ _ mm Condition lt P Input Select the file Text file txt Max 5000 bytes Click Run to execute Interfac Select Mode Select any of the algorithms Select Error condition Click here to add the input text file Click here to view concept algorithm pseudo Code amp flow chart Click here to interface source code 92 Results Error condition No Error FZ NetSim Programming lation Project Work Programming Basics Utilities Help Data Frame is Flowing from Node1 to Node2 with no error Node1 Error Input Select the File ner Desktop setup txt E Text file txt Max 5000 bytes ed Concept Algorithm Pseudo Code amp Flow Chart i Interface Source Code Error condition Error FZ NetSim Programming Project tt Proorar asics i Help Data Frame is Flowing from Node1 to Node2 with error Node1 Node2 a Input Ty Select the
108. works Personal Area Networks LTE networks and Cognitive Radio Networks 1 Click Browse button gt select the Metrics txt File inside the saved experiment folder 2 To add more experiments repeat the above step for other experiments 3 Select the Metrics Select the coordinates for Y axis by clicking on the dropdown menu User can select 4 Graph Based on the X axis 1 e Metrics File Experiment selected and Y axis e Metrics selected by using the dropdown menu above the graph a Bar graph will be Simulation Programming Utilities Help Analytics reso Analytics User Admin v Advanced Wireless Networks WiMAX Cellular Networks Wireless Sensor Networks Personal Area Networks Cognitive Radio Networks Internetworks LTE Networks Legacy Networks BGP Networks Advanced Wireless Networks MANET praia gestae Browse ears ips jas upto a Max of 25 files 6 Exp 9 Sample4 Metrics txt Browse a anne Bytes Transmitted f 2s ee ene eeeeeeeeeee 14000 SRS Gccee sceterecescee Payload Transmitted _ _ 2 ee eee 3 12000 o Overhead Transmitted oo O Ss S BESE m i 4 2 a m ee nn Se pm a 6000 i Pee SOTLE A Poo 4000 Ea a ao ooo o 2000 Sa a a ooo ee coon Metri Metri Metri cbt cbt csitt Experiment Name Experiment 3 Packets Payload Overhead TS Simulation Time Teid Packets Errored Packets Collided
109. xcel 2010 follow the steps 1 Copy the data in an Excel sheet 2 Select the data Go to Insert gt Column under Charts gt Clustered Column Ki EEA BAE Booki Microsoft Excel Oo ee File Home nsert Data Review Views Foutt Reader POF Team a Q ogr Ss ik Line Bp Area A une gt Equation Pie fr Scatter bi Column creenshot ba other Charts gt FE Win loss aE ty ome evens 2 D Column dal af ele 3 D Column ia a3 aa J Graph I Note The Packets transmitted successfully for TCP is Segments Received and for UDP is Datagram Received of the destination node 1 e Wired Node 3 TCP vs UDP Packets transmitted successfully 10000 5000 2500 Inter arrival time Micro Sec Number of packets transmitted successfully in TCP and UDP 34 Graph II Number of lost packets in TCP and UDP Note To get the No of packet lost For TCP get the difference between Segments Sent and Segments Received and for UDP get the difference between Datagram Sent and Datagram Received TCP vs UDP N O Ag QO ae or Q O Z Exp2 Experiment list 10 Inference Graph I shows that the number of successful packets transmitted in TCP is greater than or equal to UDP Because when TCP transmits a packet containing data it puts a copy on a retransmission queue and starts a timer when the acknowledgment for that data is received the segment
110. y Networks gt Traditional Ethernet 75 1 Create Design the Network Devices Required Hub 4 Wired Nodes Network Diagram Note While creating network first place the Hub Then select Wired Node and click on Hub Automatically Wired Nodes will be placed and linked with Hub 2 Configure the Network Right click on Wired Node or Hub and select Properties to open the property window Wired Node Properties Wired Node Properties IODE 1 NODE 4 Transmission Type Point to Point Distribution Constant Application Data Size Bytes 1472 1472 Inter Arrival Time ps 2000 2000 Hub Properties Hub Properties Values to Data Rat Mbps ye Selected Error Rate bit error rate No error 76 3 Simulate Simulation Time 10 Sec 4 Analysis of Result T i AP Ad L3 its sll ad a Event Dynamic Env View Zoom Traca Metrics fai i 1 Click on Run Simulation e Once the simulation is completed ContentionWindow txt file will be written in the temp path of the operating system To reach the temp folder Click Start gt Run or press Windows Key R and then type temp NetSim e Open the file in Excel sea gt abc gt AppData Local Temp NetSim Organize v Include in library Type the name of a program folder document or Internet resource and Windows will open it for you Share with w Burn Search NetSim p Fr Favorites E
111. z Q O nD oF 0 z 5 oF t gt oN 5 O ao z aa m 1FTP 1Telnet 1FTP 2Telnet 1FTP 3Telnet Experiments NOTE The procedure to create graph is same as provided in Experiment 2 12 Inference From Graph I it can be inferred that FTP throughput decreases as the number of transmitting nodes of TELNET application increases Wired link 5 is used for FTP traffic All TELNET applications in this experiment also used Wired Link 5 Hence as the TELNET traffic over wired link 5 increases the FTP throughput decreases From Graph II it can be inferred that TELNET throughput of Wired Node 1 decreases as the number of transmitting nodes of TELNET application increases TELNET traffic of wired node 1 flows through wired link 5 Other TELNET applications also used the wired link 5 Hence as the overall TELNET traffic over wired link 5 increases the TELNET throughput of Wired Node 1 decreases 43 Experiment 5 Simulate the transmission of ping messages over a network topology consisting of 6 nodes and find the number of packets dropped due to congestion Theory Ping is a computer network administration utility used to test the reachability of a host on an Internet Protocol IP network and to measure the round trip time for messages sent from the originating host to a destination computer Ping operates by sending Internet Control Message Protocol ICMP echo request packets to the target host and waiting for an ICMP res
Download Pdf Manuals
Related Search
Related Contents
Paper - Asee peer logo これからは生ごみをその場で処理する時代です。 水を使ってニオイを抑え FSM User Guide for V1.1 PCB Delfield 6076XL-SH Refrigerator Voyager® 835 de Plantronics + アルサッ ト ALー 。 (\4~743) Troy-Bilt TB55B User's Manual ASSMANN Electronic DN-19 MONI rack accessory Copyright © All rights reserved.
Failed to retrieve file